@motion.page/sdk 1.0.8 → 1.1.0

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/index.js CHANGED
@@ -1,34 +1,36 @@
1
- function S(J,$){switch(J){case"play":case"resume":$.play();break;case"pause":$.pause();break;case"reverse":$.reverse();break;case"restart":$.restart();break;case"reset":$.pause(),$.progress(0);break;case"complete":$.progress(1),$.pause();break;case"none":break;default:console.warn(`[Motion] Unknown timeline action: "${J}". Valid actions: play, pause, resume, reverse, restart, reset, complete, none`)}}var U={color:null,filter:null,drawSVG:null,stagger:null,textSplitter:null,triggerManager:null,styleReset:null,fit:null};class A{static _instance;static _triggerRegistry=new Map;static _pageLoadTriggerFactory=null;static _RESIZE_DEBOUNCE_MS=200;static _BODY_RESIZE_DEBOUNCE_MS=250;_pageLoadTrigger=null;_scrollTriggers=new Map;_eventTriggers=new Map;_mouseMoveTriggers=new Map;_gestureTriggers=new Map;_cursorTriggers=new Map;_pageExitTriggers=new Map;_resizeHandler=null;_resizeTimer=null;_bodyResizeObserver=null;_lastBodyHeight=0;_bodyResizeTimer=null;get _allTriggerMaps(){return[this._scrollTriggers,this._eventTriggers,this._mouseMoveTriggers,this._gestureTriggers,this._cursorTriggers,this._pageExitTriggers]}constructor(){}static getInstance(){if(!A._instance)A._instance=new A;return A._instance}static registerTrigger(J,$){A._triggerRegistry.set(J,$)}static registerPageLoadTrigger(J){A._pageLoadTriggerFactory=J}_getPageLoadTrigger(){if(!this._pageLoadTrigger&&A._pageLoadTriggerFactory)this._pageLoadTrigger=new A._pageLoadTriggerFactory;return this._pageLoadTrigger}_createTrigger(J,...$){let Q=A._triggerRegistry.get(J);if(!Q){let Z=Array.from(A._triggerRegistry.keys());return console.warn(`[Motion SDK] Trigger type '${J}' is not available in this bundle. Available triggers: ${Z.join(", ")||"none"}. Animations using .on${J.charAt(0).toUpperCase()+J.slice(1)}() will be skipped.`),null}return new Q(...$)}registerPageLoad(J,$){this.unregister(J);let Q=this._getPageLoadTrigger();if(Q)Q.register(J,$)}_attachResizeListener(){if(this._resizeHandler||typeof window>"u")return;this._resizeHandler=()=>{if(this._resizeTimer!==null)clearTimeout(this._resizeTimer);this._resizeTimer=setTimeout(()=>{this._resizeTimer=null,this.refreshScrollTriggers()},A._RESIZE_DEBOUNCE_MS)},window.addEventListener("resize",this._resizeHandler,{passive:!0})}_detachResizeListener(){if(!this._resizeHandler||typeof window>"u")return;if(window.removeEventListener("resize",this._resizeHandler),this._resizeTimer!==null)clearTimeout(this._resizeTimer),this._resizeTimer=null;this._resizeHandler=null}_attachBodyResizeObserver(){if(this._bodyResizeObserver)return;if(typeof window>"u"||typeof document>"u")return;if(typeof ResizeObserver>"u")return;this._lastBodyHeight=document.body.offsetHeight,this._bodyResizeObserver=new ResizeObserver((J)=>{for(let $ of J){let Q=$.borderBoxSize?.[0]?$.borderBoxSize[0].blockSize:$.contentRect.height;if(Math.abs(Q-this._lastBodyHeight)<1)continue;if(this._lastBodyHeight=Q,this._bodyResizeTimer!==null)clearTimeout(this._bodyResizeTimer);this._bodyResizeTimer=setTimeout(()=>{this._bodyResizeTimer=null,this.refreshScrollTriggers()},A._BODY_RESIZE_DEBOUNCE_MS)}}),this._bodyResizeObserver.observe(document.body)}_detachBodyResizeObserver(){if(!this._bodyResizeObserver)return;if(this._bodyResizeObserver.disconnect(),this._bodyResizeObserver=null,this._bodyResizeTimer!==null)clearTimeout(this._bodyResizeTimer),this._bodyResizeTimer=null;this._lastBodyHeight=0}registerScroll(J,$){this.unregister(J);let Q=this._createTrigger("scroll",J,$);if(!Q)return;this._scrollTriggers.set(J,Q),J._trigger=Q,Q.enable(),this._attachResizeListener(),this._attachBodyResizeObserver()}registerHover(J,$){this.unregister(J);let Q=this._createTrigger("event",J,{type:"hover",target:$.target,onLeave:$.onLeave,leaveDelay:$.leaveDelay});if(!Q)return;this._eventTriggers.set(J,Q),J._trigger=Q,Q.enable()}registerClick(J,$){this.unregister(J);let Q=this._createTrigger("event",J,{type:"click",target:$.target,secondTarget:$.secondTarget,toggle:$.toggle,preventDefault:$.preventDefault});if(!Q)return;this._eventTriggers.set(J,Q),J._trigger=Q,Q.enable()}registerMouseMove(J,$){this.unregister(J);let Q=this._createTrigger("mouseMove",J,$);if(!Q)return;this._mouseMoveTriggers.set(J,Q),J._trigger=Q,Q.enable()}registerGesture(J,$){this.unregister(J);let Q=this._createTrigger("gesture",J,$);if(!Q)return;this._gestureTriggers.set(J,Q),J._trigger=Q,Q.enable()}registerCursor(J,$){this.unregister(J);let Q=this._createTrigger("cursor",J,$);if(!Q)return;this._cursorTriggers.set(J,Q),J._trigger=Q,Q.enable()}registerPageExit(J,$){this.unregister(J);let Q=this._createTrigger("pageExit",J,$);if(!Q)return;this._pageExitTriggers.set(J,Q),J._trigger=Q,Q.enable()}unregister(J){let $=this._getPageLoadTrigger();if($)$.unregister(J);for(let Q of this._allTriggerMaps){let Z=Q.get(J);if(Z)Z.disable(),Q.delete(J)}if(J._trigger=void 0,this._scrollTriggers.size===0)this._detachResizeListener(),this._detachBodyResizeObserver()}refreshScrollTriggers(){let J=Array.from(this._scrollTriggers.values()),$=typeof window<"u"?window.scrollY:0;J.sort((Q,Z)=>{let j=Q._pinManager?.getLayoutRect?.(),q=Z._pinManager?.getLayoutRect?.();if(!j&&!q)return 0;if(!j)return 1;if(!q)return-1;return j.top+$-(q.top+$)}),J.forEach((Q)=>Q.refresh?.()),this._eventTriggers.forEach((Q)=>Q.refresh?.()),this._gestureTriggers.forEach((Q)=>Q.refresh?.()),this._mouseMoveTriggers.forEach((Q)=>Q.refresh?.())}killAll(){let J=this._getPageLoadTrigger();if(J)J.clear();for(let $ of this._allTriggerMaps)$.forEach((Q)=>Q.disable()),$.clear();this._detachResizeListener(),this._detachBodyResizeObserver()}static _reset(){if(A._instance){if(A._instance._pageLoadTrigger)A._instance._pageLoadTrigger._reset();A._instance.killAll(),A._instance=void 0}}}U.triggerManager={getInstance:A.getInstance};function AJ(J){if(typeof document>"u"){J();return}if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",J,{once:!0});else J()}function OJ(J){if(J===null||typeof J!=="object")return!1;if(J instanceof Element)return!1;if("nodeType"in J)return!1;if("style"in J)return!1;let $=J;if("x"in $&&typeof $.x==="number")return!0;if("length"in J)return!1;return!0}function U0(J){return J instanceof Element||typeof J==="object"&&J!==null&&(("nodeType"in J)||("style"in J))}function D0(J){if(OJ(J))return[J];if(typeof J==="string"){if(typeof document<"u")try{return Array.from(document.querySelectorAll(J))}catch($){return console.warn(`[Motion] Invalid selector "${J}":`,$),[]}return[]}if(J instanceof Element)return[J];if(J&&typeof J==="object"&&"style"in J&&!Array.isArray(J))return[J];if(J instanceof NodeList)return Array.from(J);if(Array.isArray(J)){if(J.length===0)return[];if(typeof J[0]==="string"){if(typeof document>"u")return[];let $=[];for(let Q of J)try{$.push(...Array.from(document.querySelectorAll(Q)))}catch(Z){console.warn(`[Motion] Invalid selector "${Q}":`,Z)}return $}if(OJ(J[0]))return J;return J}if(J&&typeof J==="object"&&"length"in J)return Array.from(J);return[]}class d{_timeline;_config;_enabled=!1;constructor(J,$){this._timeline=J,this._config=$}enable(){if(this._enabled)return;this._enabled=!0,AJ(()=>{if(!this._enabled)return;this._onEnable()})}disable(){if(!this._enabled)return;this._enabled=!1,this._onDisable()}_resolveElement(J,$){if(J===void 0||J===null)return $??null;if(typeof J!=="string")return J;if(typeof document<"u")try{let Q=document.querySelector(J);if(Q!==null)return Q}catch(Q){console.warn(`[Motion] Invalid selector "${J}":`,Q)}return $??null}_resolveElements(J){if(J===void 0||J===null)return[];if(typeof J!=="string")return[J];if(typeof document<"u")try{let $=document.querySelectorAll(J);return Array.from($)}catch($){return console.warn(`[Motion] Invalid selector "${J}":`,$),[]}return[]}_cleanupListenerMap(J){J.forEach(($,Q)=>{$.forEach((Z,j)=>{Q.removeEventListener(j,Z)})}),J.clear()}}function c(J){let $=J,Q=$.style.transform,Z=$.style.transition;$.style.transition="none",$.style.transform="none";let j=!1,q=$.style.position,G=$.style.top,z=$.style.left,W=$.style.width;if(q==="fixed")j=!0;else if(q===""||q===void 0){if(typeof window<"u"&&typeof window.getComputedStyle==="function"&&window.getComputedStyle($).position==="fixed")j=!0}if(j)$.style.position="",$.style.top="",$.style.left="",$.style.width="";let N=$.getBoundingClientRect();if($.style.transform=Q,$.style.transition=Z,j)$.style.position=q,$.style.top=G,$.style.left=z,$.style.width=W;return N}class LJ extends d{_targets=[];_secondTargets=[];_listeners=new Map;_isForward=!0;_frozenRects=new Map;_snapshotScrollX=0;_snapshotScrollY=0;_wasHovering=!1;_hoverLeaveTimeout=null;_boundMouseMoveHandler=null;constructor(J,$){super(J,$)}_onEnable(){if(this._resolveTargets(),this._config.type==="hover")this._addHoverListeners();else if(this._config.type==="click")this._addClickListeners()}_onDisable(){if(this._boundMouseMoveHandler)window.removeEventListener("mousemove",this._boundMouseMoveHandler),this._boundMouseMoveHandler=null;if(this._hoverLeaveTimeout!==null)clearTimeout(this._hoverLeaveTimeout),this._hoverLeaveTimeout=null;this._frozenRects.clear(),this._wasHovering=!1,this._cleanupListenerMap(this._listeners)}refresh(){if(this._config.type!=="hover")return;this._snapshotRects()}_snapshotRects(){this._snapshotScrollX=window.scrollX||0,this._snapshotScrollY=window.scrollY||0;for(let J of this._targets)this._frozenRects.set(J,c(J))}_resolveTargets(){if(this._targets=this._resolveElements(this._config.target),this._config.secondTarget)this._secondTargets=this._resolveElements(this._config.secondTarget);else this._secondTargets=this._targets}_addHoverListeners(){let J=this._config.onLeave||"reverse",$=this._config.leaveDelay||0;this._snapshotRects(),this._boundMouseMoveHandler=(Q)=>{let Z=(window.scrollX||0)-this._snapshotScrollX,j=(window.scrollY||0)-this._snapshotScrollY,q=Q.clientX+Z,G=Q.clientY+j,z=!1;for(let W of this._frozenRects.values())if(q>=W.left&&q<=W.right&&G>=W.top&&G<=W.bottom){z=!0;break}if(z&&!this._wasHovering){if(this._wasHovering=!0,this._hoverLeaveTimeout!==null)clearTimeout(this._hoverLeaveTimeout),this._hoverLeaveTimeout=null;this._timeline.play()}else if(!z&&this._wasHovering){if(this._wasHovering=!1,J==="none")return;let W=()=>{this._handleLeaveAction(J),this._hoverLeaveTimeout=null};if($>0)this._hoverLeaveTimeout=window.setTimeout(W,$*1000);else W()}},window.addEventListener("mousemove",this._boundMouseMoveHandler)}_handleLeaveAction(J){S(J==="stop"?"reset":J,this._timeline)}_addClickListeners(){let J=this._config.toggle||"play",$=this._config.preventDefault||!1,Q=this._config.secondTarget&&this._config.secondTarget!==this._config.target;if(this._targets.forEach((Z)=>{let j=this._listeners.get(Z)||new Map,q=(G)=>{if($)G.preventDefault();if(!Q)if(this._isForward){if(this._timeline.restart(),J!=="play")this._isForward=!1}else this._handleSecondClick(J),this._isForward=!0;else this._timeline.restart()};Z.addEventListener("click",q),j.set("click",q),this._listeners.set(Z,j)}),Q)this._secondTargets.forEach((Z)=>{if(this._listeners.has(Z))return;let j=new Map,q=(G)=>{if($)G.preventDefault();this._handleSecondClick(J)};Z.addEventListener("click",q),j.set("click",q),this._listeners.set(Z,j)})}_handleSecondClick(J){S(J,this._timeline)}}A.registerTrigger("event",LJ);var t0={perspective:0,x:1,y:2,z:3,rotate:4,rotateX:5,rotateY:6,rotateZ:7,scale:8,scaleX:9,scaleY:10,scaleZ:11,skewX:12,skewY:13},kJ=["px","px","px","px","deg","deg","deg","deg","","","","","deg","deg"],z0=new WeakMap,R0=new WeakMap,D=[];function o(J){let $=J.trim().match(/([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z%]*)/i);if(!$)return{value:0,unit:""};return{value:parseFloat($[1]),unit:$[2]||""}}function G0(J,$){switch($){case"rad":return J*180/Math.PI;case"turn":return J*360;case"grad":return J*0.9;default:return J}}function e(J){let $=o(J);return G0($.value,$.unit||"deg")}function F(J,$,Q,Z){let j=t0[$];if(j===void 0)return;J.values[j]=Q;let q=Z&&Z.length>0?Z:kJ[j]||"";J.units[j]=q,J.used|=1<<j}function X6(J,$){let Q=/([a-zA-Z0-9]+)\(([^)]+)\)/g,Z;while((Z=Q.exec(J))!==null){let j=Z[1],q=Z[2].match(/[-+]?\d*\.?\d+(?:e[-+]?\d+)?[a-z%]*/gi)||[];switch(j){case"translate":{let G=q[0]?o(q[0]):{value:0,unit:""},z=q[1]?o(q[1]):{value:0,unit:""};F($,"x",G.value,G.unit),F($,"y",z.value,z.unit);break}case"translate3d":{let G=q[0]?o(q[0]):{value:0,unit:""},z=q[1]?o(q[1]):{value:0,unit:""},W=q[2]?o(q[2]):{value:0,unit:""};F($,"x",G.value,G.unit),F($,"y",z.value,z.unit),F($,"z",W.value,W.unit);break}case"translateX":{let G=q[0]?o(q[0]):{value:0,unit:""};F($,"x",G.value,G.unit);break}case"translateY":{let G=q[0]?o(q[0]):{value:0,unit:""};F($,"y",G.value,G.unit);break}case"translateZ":{let G=q[0]?o(q[0]):{value:0,unit:""};F($,"z",G.value,G.unit);break}case"scale":{let G=q[0]?parseFloat(q[0]):1,z=q[1]?parseFloat(q[1]):G;F($,"scaleX",G),F($,"scaleY",z);break}case"scale3d":{let G=q[0]?parseFloat(q[0]):1,z=q[1]?parseFloat(q[1]):1,W=q[2]?parseFloat(q[2]):1;F($,"scaleX",G),F($,"scaleY",z),F($,"scaleZ",W);break}case"scaleX":{let G=q[0]?parseFloat(q[0]):1;F($,"scaleX",G);break}case"scaleY":{let G=q[0]?parseFloat(q[0]):1;F($,"scaleY",G);break}case"scaleZ":{let G=q[0]?parseFloat(q[0]):1;F($,"scaleZ",G);break}case"rotate":F($,"rotate",q[0]?e(q[0]):0,"deg");break;case"rotateX":F($,"rotateX",q[0]?e(q[0]):0,"deg");break;case"rotateY":F($,"rotateY",q[0]?e(q[0]):0,"deg");break;case"rotateZ":F($,"rotateZ",q[0]?e(q[0]):0,"deg");break;case"skew":{let G=q[0]?e(q[0]):0,z=q[1]?e(q[1]):0;F($,"skewX",G,"deg"),F($,"skewY",z,"deg");break}case"skewX":F($,"skewX",q[0]?e(q[0]):0,"deg");break;case"skewY":F($,"skewY",q[0]?e(q[0]):0,"deg");break;case"perspective":{let G=q[0]?o(q[0]):{value:0,unit:""};F($,"perspective",G.value,G.unit);break}default:break}}}function a0(J,$,Q,Z,j,q,G,z,W,N,_,Y,X,B){if(X){let Z0=Math.hypot(J,$),Y6=J*j-$*Z,B6=Z0!==0?Y6/Z0:0,H6=Z0!==0?Math.atan2($,J):0,FJ=Z0!==0?Math.atan2(J*Z+$*j,Z0*Z0):0;if(F(B,"x",N,"px"),F(B,"y",_,"px"),F(B,"scaleX",Z0||1),F(B,"scaleY",B6||1),F(B,"rotate",G0(H6,"rad"),"deg"),Math.abs(FJ)>0.000001)F(B,"skewX",G0(FJ,"rad"),"deg");return}let H=Math.hypot(J,$,Q)||1,I=Math.hypot(Z,j,q)||1,K=Math.hypot(G,z,W)||1,O=J/H,M=$/H,k=Q/H,L=Z/I,P=j/I,l0=q/I,IJ=G/K,W6=z/K,N6=W/K,o0=Math.sqrt(O*O+L*L),_6=o0<0.000001,s0=0,i0=0,n0=0;if(!_6)s0=Math.atan2(W6,N6),i0=Math.atan2(-IJ,o0),n0=Math.atan2(L,O);else s0=Math.atan2(-l0,P),i0=Math.atan2(-IJ,o0),n0=0;F(B,"x",N,"px"),F(B,"y",_,"px"),F(B,"z",Y,"px"),F(B,"scaleX",H),F(B,"scaleY",I),F(B,"scaleZ",K),F(B,"rotateX",G0(s0,"rad"),"deg"),F(B,"rotateY",G0(i0,"rad"),"deg"),F(B,"rotateZ",G0(n0,"rad"),"deg")}function K6(J,$){if(!J||J==="none")return;if(typeof DOMMatrixReadOnly<"u"){let Z=new DOMMatrixReadOnly(J);a0(Z.m11,Z.m12,Z.m13,Z.m21,Z.m22,Z.m23,Z.m31,Z.m32,Z.m33,Z.m41,Z.m42,Z.m43,Z.is2D,$);return}let Q=J.match(/[-+]?\d*\.?\d+(?:e[-+]?\d+)?/gi)||[];if(J.startsWith("matrix3d")&&Q.length>=16){let Z=Q.map(Number);a0(Z[0],Z[1],Z[2],Z[4],Z[5],Z[6],Z[8],Z[9],Z[10],Z[12],Z[13],Z[14],!1,$);return}if(J.startsWith("matrix")&&Q.length>=6){let Z=Q.map(Number);a0(Z[0],Z[1],0,Z[2],Z[3],0,0,0,1,Z[4],Z[5],0,!0,$)}}function U6(J,$){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let Z=J.style.transform;if(Z&&Z!=="none"){X6(Z,$),$.cachedString=Z;return}try{if(typeof window<"u"&&window.getComputedStyle){let j=window.getComputedStyle(J),q=j.transform||j.getPropertyValue("transform");if(q&&q!=="none")K6(q,$),$.cachedString=q}}catch{}}function DJ(J){let $=z0.get(J);if(!$){let Q=new Float32Array(14);Q[8]=1,Q[9]=1,Q[10]=1,Q[11]=1,$={values:Q,units:[...kJ],dirty:0,used:0,cachedString:"",pinDirty:!1},U6(J,$),z0.set(J,$)}return $}function y(J,$,Q,Z){let j=DJ(J),q=t0[$];if(q!==void 0){if(j.values[q]=Q,Z!==void 0)j.units[q]=Z;if(j.used|=1<<q,$==="scale")j.values[9]=Q,j.values[10]=Q,j.dirty|=1536;else if($==="scaleX"||$==="scaleY")j.values[8]=1,j.dirty|=256;if($==="rotate")j.values[7]=0,j.dirty|=128;else if($==="rotateZ")j.values[4]=0,j.dirty|=16;j.dirty|=1<<q}}function e0(J,$){let Q=DJ(J),Z=t0[$];if(Z===void 0)return $.startsWith("scale")?1:0;if($==="scale"){if(Q.values[Z]!==1)return Q.values[Z];let j=Q.values[9],q=Q.values[10];if(Math.abs(j-q)<0.000001&&j!==1)return j;return Q.values[Z]}if($==="rotate"){if(Q.values[Z]!==0)return Q.values[Z];let j=Q.values[7];if(j!==0&&Q.values[5]===0&&Q.values[6]===0)return j;return Q.values[Z]}return Q.values[Z]}function r0(J){return J===0?"0":`${Math.round(J)}px`}function MJ(J,$,Q){return`translate3d(${r0(J)}, ${r0($)}, ${r0(Q)})`}function E0(J,$,Q,Z){R0.set(J,{x:$,y:Q,z:Z});let j=z0.get(J);if(j)j.pinDirty=!0}function W0(J){let $=R0.has(J);if(R0.delete(J),$){let Q=z0.get(J);if(Q)Q.pinDirty=!0}}function R(J){let $=z0.get(J),Q=R0.get(J);if(!$){if(Q&&(Q.x!==0||Q.y!==0||Q.z!==0))return MJ(Q.x,Q.y,Q.z);return""}if($.dirty===0&&!$.pinDirty&&$.cachedString)return $.cachedString;let{values:Z,units:j}=$;D.length=0;let q=$.used,G=Z[0];if(G!==0){let L=j[0];D.push(`perspective(${G}${L})`)}let z=Z[1],W=Z[2],N=Z[3],_=j[1],Y=j[2],X=j[3],B=q&2,H=q&4,I=q&8;if(z!==0||W!==0||N!==0||B||H||I){let L=_===Y&&(N===0&&!I||Y===X);if(N!==0||I)if(L)D.push(`translate3d(${z}${_}, ${W}${Y}, ${N}${X})`);else{if(z!==0||B)D.push(`translateX(${z}${_})`);if(W!==0||H)D.push(`translateY(${W}${Y})`);D.push(`translateZ(${N}${X})`)}else if(L&&(z!==0||B)&&(W!==0||H))D.push(`translate(${z}${_}, ${W}${Y})`);else{if(z!==0||B)D.push(`translateX(${z}${_})`);if(W!==0||H)D.push(`translateY(${W}${Y})`)}}if(Z[4]!==0||q&16)D.push(`rotate(${Z[4]}deg)`);if(Z[5]!==0||q&32)D.push(`rotateX(${Z[5]}deg)`);if(Z[6]!==0||q&64)D.push(`rotateY(${Z[6]}deg)`);if(Z[7]!==0||q&128)D.push(`rotateZ(${Z[7]}deg)`);let K=q&256,O=q&512,M=q&1024;if(Z[8]!==1||K)D.push(`scale(${Z[8]})`);else if(Z[9]!==1||Z[10]!==1||O||M)D.push(`scaleX(${Z[9]})`),D.push(`scaleY(${Z[10]})`);if(Z[11]!==1||q&2048)D.push(`scaleZ(${Z[11]})`);if(Z[12]!==0||q&4096)D.push(`skewX(${Z[12]}deg)`);if(Z[13]!==0||q&8192)D.push(`skewY(${Z[13]}deg)`);let k=D.join(" ");if(Q&&(Q.x!==0||Q.y!==0||Q.z!==0)){let L=MJ(Q.x,Q.y,Q.z);$.cachedString=k?`${L} ${k}`:L}else $.cachedString=k;return $.dirty=0,$.pinDirty=!1,$.cachedString}function v(J,$=!1){if(z0.delete(J),$&&J instanceof HTMLElement)J.style.transform=""}var JJ=new Set,b0=new Map,C0=!1;function V0(J){JJ.add(J),C0=!0}function x0(J,$,Q){let Z=b0.get(J);if(!Z)Z=new Map,b0.set(J,Z);Z.set($,Q),C0=!0}function $J(){if(!C0)return;for(let J of JJ){let $=J;if($.style){let Q=R(J);$.style.transform=Q}}JJ.clear();for(let[J,$]of b0){let Q=J;if(Q.style)for(let[Z,j]of $)try{if(Z.startsWith("--"))Q.style.setProperty(Z,j);else Q.style[Z]=j}catch{}}b0.clear(),C0=!1}var j0=!1;function N0(){return j0}function QJ(J){if(j0){J();return}j0=!0;try{J(),$J()}finally{j0=!1}}class V{static instance;listeners=[];_listenersDirty=!0;_listenersSnapshot=[];_isRunning=!1;rafId=null;lastTime=0;elapsedTime=0;lagThreshold=500;maxDelta=33;fpsFrames=0;fpsTime=0;currentFPS=60;lastFrameTime=0;constructor(){}static getInstance(){if(!V.instance)V.instance=new V;return V.instance}add(J,$=0){let Q=this.listeners.findIndex((Z)=>Z.callback===J);if(Q!==-1)this.listeners[Q].priority=$;else this.listeners.push({callback:J,priority:$});if(this.listeners.sort((Z,j)=>j.priority-Z.priority),this._listenersDirty=!0,!this._isRunning&&this.listeners.length>0)this.start()}remove(J){let $=this.listeners.findIndex((Q)=>Q.callback===J);if($!==-1)this.listeners.splice($,1),this._listenersDirty=!0;if(this.listeners.length===0&&this._isRunning)this.stop()}start(){if(this._isRunning)return;if(typeof requestAnimationFrame>"u"){this._isRunning=!1;return}this._isRunning=!0,this.lastTime=performance.now(),this.rafId=requestAnimationFrame(this.tick)}stop(){if(!this._isRunning)return;if(this._isRunning=!1,this.rafId!==null&&typeof cancelAnimationFrame<"u")cancelAnimationFrame(this.rafId),this.rafId=null}pause(){this.stop()}resume(){if(this.listeners.length>0)this.start()}tick=()=>{if(!this._isRunning)return;let J=performance.now(),$=J-this.lastTime;if($>this.lagThreshold)$=this.maxDelta,this.lastTime=J-$;else this.lastTime=J;let Q=$/1000;if(this.elapsedTime+=Q,this.lastFrameTime=$,this.updateFPS($),j0=!0,this._listenersDirty)this._listenersSnapshot=[...this.listeners],this._listenersDirty=!1;for(let Z of this._listenersSnapshot)try{Z.callback(Q,this.elapsedTime)}catch(j){console.error("[Motion] Uncaught error in animation callback:",j)}try{$J()}catch(Z){console.error("[Motion] Uncaught error in render batch flush:",Z)}if(j0=!1,typeof requestAnimationFrame<"u")this.rafId=requestAnimationFrame(this.tick)};updateFPS(J){if(this.fpsFrames++,this.fpsTime+=J,this.fpsTime>=1000)this.currentFPS=Math.round(this.fpsFrames*1000/this.fpsTime),this.fpsFrames=0,this.fpsTime=0}getFPS(){return this.currentFPS}getLastDelta(){return this.lastFrameTime}isRunning(){return this._isRunning}isInTick(){return j0}getListenerCount(){return this.listeners.length}removeAll(){this.listeners=[],this.stop()}}var i=null,_0=null,I6=100,s=new Map;function F6(J){let $=s.get(J);if($!==void 0)s.delete(J),s.set(J,$);return $}function O6(J,$){if(s.has(J))s.delete(J);while(s.size>=I6){let Q=s.keys().next().value;if(Q!==void 0)s.delete(Q);else break}s.set(J,$)}function A6(J){return/^\s*[Mm]/.test(J)}function RJ(){if(_0)return _0;if(typeof document>"u")throw Error("PathParser requires a browser environment");return i=document.createElementNS("http://www.w3.org/2000/svg","svg"),i.style.cssText="position:absolute;width:0;height:0;overflow:hidden;visibility:hidden;",i.setAttribute("aria-hidden","true"),_0=document.createElementNS("http://www.w3.org/2000/svg","path"),i.appendChild(_0),document.body.appendChild(i),_0}function EJ(J){if(J instanceof Element)return J.getAttribute("d");if(typeof J==="string"){if(A6(J))return J;if(typeof document<"u"){let $=document.querySelector(J);if($)return $.getAttribute("d")}}return null}function bJ(J){let $=F6(J);if($!==void 0)return $;try{let Q=RJ();Q.setAttribute("d",J);let Z=Q.getTotalLength();return O6(J,Z),Z}catch{return 0}}function ZJ(J,$,Q=!1){try{let Z=RJ();Z.setAttribute("d",J);let j=Z.getTotalLength(),q=Math.max(0,Math.min(1,$)),G=j*q,z=Z.getPointAtLength(G),W=0;if(Q)W=L6(Z,G,j);return{x:z.x,y:z.y,angle:W}}catch{return{x:0,y:0,angle:0}}}function L6(J,$,Q){let Z=Math.min(0.1,Q*0.001),j=Math.max(0,$-Z),q=Math.min(Q,$+Z),G=J.getPointAtLength(j),z=J.getPointAtLength(q),W=z.x-G.x,N=z.y-G.y;return Math.atan2(N,W)*(180/Math.PI)}function CJ(J,$=[50,50]){if(!J)return{x:0,y:0};let Q=null;if(J instanceof Element)Q=J;else if(typeof J==="string"&&typeof document<"u")Q=document.querySelector(J);if(!Q||typeof Q.getBoundingClientRect!=="function")return{x:0,y:0};let Z=Q.getBoundingClientRect(),j=Z.width*$[0]/100,q=Z.height*$[1]/100;return{x:j,y:q}}function VJ(J,$,Q){if(!J)return{x:0,y:0};let Z=null;if(J instanceof Element)Z=J;else if(typeof J==="string"&&typeof document<"u")Z=document.querySelector(J);if(!Z)return{x:0,y:0};let j=ZJ($,0,!1);if(Q&&Q instanceof HTMLElement){let q=Q.style.transform,G=q&&q!=="none"&&q!=="";if(G)Q.style.transform="none";let z=Q.getBoundingClientRect(),W=Z.getBoundingClientRect();if(G)Q.style.transform=q;let N=W.left+W.width/2-(z.left+z.width/2),_=W.top+W.height/2-(z.top+z.height/2);return{x:N-j.x,y:_-j.y}}return{x:-j.x,y:-j.y}}function xJ(){if(i&&i.parentNode)i.parentNode.removeChild(i);i=null,_0=null,s.clear()}var M6=new Set(["perspective","x","y","z","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skewX","skewY"]),k6=new Set(["perspective","x","y","z","width","height","top","left","right","bottom","margin","marginTop","marginRight","marginBottom","marginLeft","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","borderRadius","fontSize","lineHeight"]),D6=new Set(["rotate","rotateX","rotateY","rotateZ","skewX","skewY"]),R6=new Set(["opacity","scale","scaleX","scaleY","scaleZ","z-index","zIndex"]),E6=new Set(["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor","textDecorationColor","caretColor","fill","stroke"]),b6=new Set(["red","green","blue","yellow","orange","purple","pink","cyan","magenta","white","black","gray","grey","transparent","crimson","gold","silver","navy","teal","maroon","olive","lime","aqua","fuchsia","coral","salmon","tomato","indigo"]);function T(J){return M6.has(J)}function q0(J){return E6.has(J)}function r(J){return J==="filter"}function jJ(J){return J==="drawSVG"}function qJ(J){return J==="path"}function t(J){return J.startsWith("--")}function wJ(J){if(typeof J!=="string")return!1;let $=J.trim().toLowerCase();if($.startsWith("#"))return!0;if(/^(rgb|rgba|hsl|hsla)\s*\(/.test($))return!0;let Q=U.color;if(Q)return Q.parseColor($)!==null;return b6.has($)}function x(J){if(typeof J==="number"){if(isNaN(J)||!isFinite(J))return console.warn(`[Motion] Property value is ${J}. This property will not animate correctly.`),{value:0,unit:""};return{value:J,unit:""}}if(typeof J==="string"){let $=J.match(/^([+\-*/])=(.+)/);if($){let Z=$[2].match(/([-+]?[\d.]+(?:e[-+]?\d+)?)([a-z%]*)/i);if(Z)return{value:parseFloat(Z[1]),unit:Z[2]||""}}let Q=J.match(/([-+]?[\d.]+(?:e[-+]?\d+)?)([a-z%]*)/i);if(Q)return{value:parseFloat(Q[1]),unit:Q[2]||""}}return{value:0,unit:""}}function g(J){if(R6.has(J))return"";if(D6.has(J))return"deg";if(k6.has(J))return"px";return""}function SJ(J){if(J==="opacity")return 1;if(J.startsWith("scale"))return 1;return 0}function p(J,$){if(!(J instanceof Element)){let Q=J;if($ in Q)return Q[$];return C6($)}if(T($))return e0(J,$);try{if(typeof window<"u"&&window.getComputedStyle){let Z=window.getComputedStyle(J).getPropertyValue(n($));if(Z)return x(Z).value}}catch(Q){}return SJ($)}function yJ(J,$){let Q=J,Z=n($);if(T($)){let j=Q.style.transform;v(J),Q.style.transform="";let q=e0(J,$);return Q.style.transform=j,v(J),{value:q,unit:g($)}}try{if(typeof window<"u"&&window.getComputedStyle){let j=Q.style.getPropertyValue(Z);Q.style.removeProperty(Z);let G=window.getComputedStyle(J).getPropertyValue(Z);if(j)Q.style.setProperty(Z,j);if(G){let z=x(G);return{value:z.value,unit:z.unit}}}}catch(j){}return{value:SJ($),unit:g($)}}function C6(J){if(J.startsWith("scale"))return 1;return 0}function n(J){return J.replace(/[A-Z]/g,($)=>`-${$.toLowerCase()}`)}function V6(J){if(typeof J==="string")return/^[+\-*/]=/.test(J);return!1}function x6(J){let $=J.match(/^([+\-*/])=/);return $?$[0]:null}function w6(J,$,Q){switch(Q){case"+=":return J+$;case"-=":return J-$;case"*=":return J*$;case"/=":return $!==0?J/$:J;default:return $}}function P6(J,$,Q,Z){let j=U.color;if(!j)return null;let q=String(Q),G=q===""?j.getCurrentColor(J,$):j.parseColor(q,J),z=Z!==void 0?j.parseColor(String(Z),J):j.getCurrentColor(J,$);return{type:"color",property:$,isTransform:!1,startColor:z||new Float32Array([0,0,0,1]),endColor:G||new Float32Array([0,0,0,1])}}function S6(J,$,Q,Z){let j=U.filter;if(!j)return null;let q=String(Q),G=q===""?j.getCurrentFilter(J):j.parseFilter(q),z=Z!==void 0?j.parseFilter(String(Z)):j.getCurrentFilter(J);z=z||[],G=G||[];let W=j.mergeFilterArrays(z,G);return{type:"filter",property:$,isTransform:!1,startFilters:W.start,endFilters:W.end}}function y6(J,$,Q,Z){if(wJ(Q)||Z!==void 0&&wJ(Z)){let W=U.color;if(W){let N=String(Q),_=W.parseColor(N,J),Y=Z!==void 0?W.parseColor(String(Z),J):v6(J,$);return{type:"color",property:$,isTransform:!1,startColor:Y||new Float32Array([0,0,0,1]),endColor:_||new Float32Array([0,0,0,1])}}}let q,G,z;if(Z!==void 0&&Q!==void 0){let W=x(Z),N=x(Q);q=W.value,G=N.value,z=N.unit||W.unit}else if(Z!==void 0){let W=x(Z);q=W.value,G=PJ(J,$),z=W.unit}else{let W=x(Q);q=PJ(J,$),G=W.value,z=W.unit}return{type:"scalar",property:$,isTransform:!1,startValue:q,endValue:G,unit:z}}function v6(J,$){let Q=U.color;if(!Q)return null;try{if(typeof window<"u"&&window.getComputedStyle){let j=window.getComputedStyle(J).getPropertyValue($).trim();if(j)return Q.parseColor(j,J)}}catch{}return null}function PJ(J,$){try{if(typeof window<"u"&&window.getComputedStyle){let Z=window.getComputedStyle(J).getPropertyValue($).trim();if(Z)return x(Z).value}}catch{}return 0}function T6(J,$,Q,Z){let j=U.drawSVG;if(!j)return null;let q=j.getPathLength(J),G=j.parseDrawSVG(Q,J)||{start:0,end:1},z=Z!==void 0?j.parseDrawSVG(Z,J)||{start:0,end:1}:j.getCurrentDrawSVG(J);return{type:"drawSVG",property:$,isTransform:!1,startDraw:z,endDraw:G,length:q}}function h6(J,$,Q,Z){let j=Q,q=Z,G=j?.target?j:q;if(!G?.target)return null;let z=EJ(G.target);if(!z)return null;let W=bJ(z);if(W===0)return null;let N,_;if(j?.target&&q?.target)N=q.start??0,_=j.end??1;else if(j?.target)N=j.start??0,_=j.end??1;else N=q.start??0,_=q.end??1;let Y=j?.rotate??q?.rotate??!1,X=j?.alignAt??q?.alignAt??[50,50],B=CJ(J,X),H=j?.align??q?.align,I=VJ(H,z,J);return{type:"path",property:$,isTransform:!1,pathData:z,pathLength:W,startProgress:N,endProgress:_,rotate:Y,alignOffset:B,pathOffset:I}}function vJ(J,$,Q,Z){let j=J instanceof Element;if(j&&t($))return y6(J,$,Q,Z);if(j&&q0($)){let _=P6(J,$,Q,Z);if(_)return _}if(j&&r($)){let _=S6(J,$,Q,Z);if(_)return _}if(j&&jJ($)){let _=T6(J,$,Q,Z);if(_)return _}if(j&&qJ($)){let _=h6(J,$,Q,Z);if(_)return _}let q=T($),G=Z===void 0&&V6(Q),z,W,N;if(Z!==void 0){let _=x(Z);if(Q!==void 0){let Y=x(Q);z=_.value,W=Y.value,N=Y.unit||_.unit||g($)}else z=_.value,W=p(J,$),N=_.unit||g($)}else if(G){let _=x6(Q),Y=p(J,$),X=x(Q);z=Y,W=w6(Y,X.value,_),N=X.unit||g($)}else{let _=p(J,$),Y=x(Q);z=_,W=Y.value,N=Y.unit||g($)}return{type:"scalar",property:$,isTransform:q,startValue:z,endValue:W,unit:N}}function TJ(){let J=new WeakMap;return{register($,Q){let Z=J.get($);if(!Z)Z=new Set,J.set($,Z);Z.add(Q)},registerMany($,Q){for(let Z of Q)this.register($,Z)},get($){return J.get($)},clearRegistry($){J.delete($)}}}var GJ=TJ(),w0=new WeakMap,zJ=TJ();function hJ(J){if(T(J))return["transform"];if(r(J))return["filter"];if(jJ(J))return["strokeDasharray","strokeDashoffset"];return[J]}function f6(J,$){if(T($)&&!w0.has(J)){if(J instanceof HTMLElement||J instanceof SVGElement){let Z=J.style.transform;w0.set(J,Z||null)}}let Q=hJ($);for(let Z of Q)GJ.register(J,Z)}function u6(J,$){for(let Q of $)f6(J,Q)}function d6(J){GJ.clearRegistry(J),w0.delete(J)}function c6(J,$){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let Q=new Set;for(let Z of $)for(let j of hJ(Z))Q.add(j);for(let Z of Q)if(t(Z))J.style.removeProperty(Z);else J.style[Z]=""}function p6(J){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let $=GJ.get(J);if(!$||$.size===0)return;for(let Q of $){if(Q==="transform"){let Z=w0.get(J);if(Z!==void 0){if(Z)J.style.transform=Z;else J.style.removeProperty("transform");continue}}if(t(Q))J.style.removeProperty(Q);else J.style[Q]=""}}function m6(J){p6(J),d6(J)}function I0(J,$){zJ.registerMany(J,$)}function WJ(J){zJ.clearRegistry(J)}function g6(J){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let $=zJ.get(J);if(!$||$.size===0)return;for(let Q of $)J.style[Q]=""}function l6(J){g6(J),WJ(J)}U.styleReset={registerAnimatedProps:u6,clearAnimationStylesForProps:c6,clearAnimationStylesAndUnregister:m6,clearPinStylesAndUnregister:l6};class w{static _registry=new Map;static _users=new Map;static getOrCreate(J,$){let Q=w._registry.get($);if(!Q)Q=new w(J),w._registry.set($,Q);let Z=w._users.get($);if(!Z)Z=new Set,w._users.set($,Z);return Z.add(J),Q}static release(J,$){let Q=w._users.get($);if(!Q)return;if(Q.delete(J),Q.size===0){let Z=w._registry.get($);w._registry.delete($),w._users.delete($),Z?.cleanup()}}_id;_element=null;_originalStyles=null;_spacer=null;_currentState="before";_pinStart=0;_pinEnd=0;_pinDistance=0;_useFixedPin=!1;_pinSpacing;_elementHeight=0;_fixedTop=0;_fixedLeft=0;_width=0;_fixedBreakingAncestors=[];_isBodyPin=!1;_originalHtmlHeight="";_originalHtmlOverflow="";constructor(J){this._id=J}setup(J,$,Q,Z,j,q){if(typeof document>"u")return;this._isBodyPin=J===document.body,this._element=J,this._pinStart=$,this._pinEnd=Q;let G=this._pinDistance;this._pinDistance=Q-$,this._useFixedPin=j,this._pinSpacing=q;let z=this._isBodyPin?this._originalStyles!==null:this._spacer!==null;if(z&&this._currentState==="pinned"&&j)this._updateFixed("before");if(z&&this._spacer)this._spacer.style.width="";let W=z&&this._isBodyPin?document.documentElement.style.height:null;if(W!==null)document.documentElement.style.height=this._originalHtmlHeight;let N=J.getBoundingClientRect();if(W!==null)document.documentElement.style.height=W;let _=z&&this._spacer?window.getComputedStyle(this._spacer):window.getComputedStyle(J);if(this._elementHeight=N.height,!z)this._originalStyles={position:J.style.position,top:J.style.top,left:J.style.left,width:J.style.width,marginTop:J.style.marginTop,marginBottom:J.style.marginBottom,marginLeft:J.style.marginLeft,marginRight:J.style.marginRight,zIndex:J.style.zIndex};if(j)if(this._fixedTop=Z,this._isBodyPin){if(this._fixedLeft=N.left,this._width=N.width,!z)this._originalHtmlHeight=document.documentElement.style.height,this._originalHtmlOverflow=document.documentElement.style.overflow,this._detectFixedBreakingAncestors(J);document.documentElement.style.height=`${this._elementHeight+this._pinDistance}px`}else{let Y=this._resolvePinSpacing(),X=window.getComputedStyle(J),B=X.display,H=X.flexDirection,I=z&&this._spacer?.parentElement?this._spacer.parentElement:J.parentElement,K=I?/^(inline-)?flex$/.test(getComputedStyle(I).display):!1,O=/^(inline-)?flex$/.test(B),M=`
2
- display: ${B};
3
- ${O?`flex-direction: ${H};`:""}
1
+ function u(J,$){switch(J){case"play":case"resume":$.play();break;case"pause":$.pause();break;case"reverse":$.reverse();break;case"restart":$.restart();break;case"reset":$.pause(),$.progress(0);break;case"complete":$.progress(1),$.pause();break;case"none":break;default:console.warn(`[Motion] Unknown timeline action: "${J}". Valid actions: play, pause, resume, reverse, restart, reset, complete, none`)}}var I={color:null,filter:null,drawSVG:null,clipPath:null,stagger:null,textSplitter:null,textFlapper:null,triggerManager:null,styleReset:null,fit:null};class D{static _instance;static _triggerRegistry=new Map;static _pageLoadTriggerFactory=null;static _RESIZE_DEBOUNCE_MS=200;static _BODY_RESIZE_DEBOUNCE_MS=250;_pageLoadTrigger=null;_scrollTriggers=new Map;_eventTriggers=new Map;_mouseMoveTriggers=new Map;_gestureTriggers=new Map;_cursorTriggers=new Map;_pageExitTriggers=new Map;_resizeHandler=null;_resizeTimer=null;_bodyResizeObserver=null;_lastBodyHeight=0;_bodyResizeTimer=null;get _allTriggerMaps(){return[this._scrollTriggers,this._eventTriggers,this._mouseMoveTriggers,this._gestureTriggers,this._cursorTriggers,this._pageExitTriggers]}constructor(){}static getInstance(){if(!D._instance)D._instance=new D;return D._instance}static registerTrigger(J,$){D._triggerRegistry.set(J,$)}static registerPageLoadTrigger(J){D._pageLoadTriggerFactory=J}_getPageLoadTrigger(){if(!this._pageLoadTrigger&&D._pageLoadTriggerFactory)this._pageLoadTrigger=new D._pageLoadTriggerFactory;return this._pageLoadTrigger}_createTrigger(J,...$){let Q=D._triggerRegistry.get(J);if(!Q){let Z=Array.from(D._triggerRegistry.keys());return console.warn(`[Motion SDK] Trigger type '${J}' is not available in this bundle. Available triggers: ${Z.join(", ")||"none"}. Animations using .on${J.charAt(0).toUpperCase()+J.slice(1)}() will be skipped.`),null}return new Q(...$)}registerPageLoad(J,$){this.unregister(J);let Q=this._getPageLoadTrigger();if(Q)Q.register(J,$)}_attachResizeListener(){if(this._resizeHandler||typeof window>"u")return;this._resizeHandler=()=>{if(this._resizeTimer!==null)clearTimeout(this._resizeTimer);this._resizeTimer=setTimeout(()=>{this._resizeTimer=null,this.refreshScrollTriggers()},D._RESIZE_DEBOUNCE_MS)},window.addEventListener("resize",this._resizeHandler,{passive:!0})}_detachResizeListener(){if(!this._resizeHandler||typeof window>"u")return;if(window.removeEventListener("resize",this._resizeHandler),this._resizeTimer!==null)clearTimeout(this._resizeTimer),this._resizeTimer=null;this._resizeHandler=null}_attachBodyResizeObserver(){if(this._bodyResizeObserver)return;if(typeof window>"u"||typeof document>"u")return;if(typeof ResizeObserver>"u")return;this._lastBodyHeight=document.body.offsetHeight,this._bodyResizeObserver=new ResizeObserver((J)=>{for(let $ of J){let Q=$.borderBoxSize?.[0]?$.borderBoxSize[0].blockSize:$.contentRect.height;if(Math.abs(Q-this._lastBodyHeight)<1)continue;if(this._lastBodyHeight=Q,this._bodyResizeTimer!==null)clearTimeout(this._bodyResizeTimer);this._bodyResizeTimer=setTimeout(()=>{this._bodyResizeTimer=null,this.refreshScrollTriggers()},D._BODY_RESIZE_DEBOUNCE_MS)}}),this._bodyResizeObserver.observe(document.body)}_detachBodyResizeObserver(){if(!this._bodyResizeObserver)return;if(this._bodyResizeObserver.disconnect(),this._bodyResizeObserver=null,this._bodyResizeTimer!==null)clearTimeout(this._bodyResizeTimer),this._bodyResizeTimer=null;this._lastBodyHeight=0}registerScroll(J,$){this.unregister(J);let Q=this._createTrigger("scroll",J,$);if(!Q)return;this._scrollTriggers.set(J,Q),J._trigger=Q,Q.enable(),this._attachResizeListener(),this._attachBodyResizeObserver()}registerHover(J,$){this.unregister(J);let Q=this._createTrigger("event",J,{type:"hover",target:$.target,onEnter:$.onEnter,onLeave:$.onLeave,leaveDelay:$.leaveDelay});if(!Q)return;this._eventTriggers.set(J,Q),J._trigger=Q,Q.enable()}registerClick(J,$){this.unregister(J);let Q=this._createTrigger("event",J,{type:"click",target:$.target,secondTarget:$.secondTarget,toggle:$.toggle,preventDefault:$.preventDefault});if(!Q)return;this._eventTriggers.set(J,Q),J._trigger=Q,Q.enable()}registerMouseMove(J,$){this.unregister(J);let Q=this._createTrigger("mouseMove",J,$);if(!Q)return;this._mouseMoveTriggers.set(J,Q),J._trigger=Q,Q.enable()}registerGesture(J,$){this.unregister(J);let Q=this._createTrigger("gesture",J,$);if(!Q)return;this._gestureTriggers.set(J,Q),J._trigger=Q,Q.enable()}registerCursor(J,$){this.unregister(J);let Q=this._createTrigger("cursor",J,$);if(!Q)return;this._cursorTriggers.set(J,Q),J._trigger=Q,Q.enable()}registerPageExit(J,$){this.unregister(J);let Q=this._createTrigger("pageExit",J,$);if(!Q)return;this._pageExitTriggers.set(J,Q),J._trigger=Q,Q.enable()}unregister(J){let $=this._getPageLoadTrigger();if($)$.unregister(J);for(let Q of this._allTriggerMaps){let Z=Q.get(J);if(Z)Z.disable(),Q.delete(J)}if(J._trigger=void 0,this._scrollTriggers.size===0)this._detachResizeListener(),this._detachBodyResizeObserver()}refreshScrollTriggers(){let J=Array.from(this._scrollTriggers.values()),$=typeof window<"u"?window.scrollY:0;J.sort((Q,Z)=>{let j=Q._pinManager?.getLayoutRect?.(),q=Z._pinManager?.getLayoutRect?.();if(!j&&!q)return 0;if(!j)return 1;if(!q)return-1;return j.top+$-(q.top+$)}),J.forEach((Q)=>Q.refresh?.()),this._eventTriggers.forEach((Q)=>Q.refresh?.()),this._gestureTriggers.forEach((Q)=>Q.refresh?.()),this._mouseMoveTriggers.forEach((Q)=>Q.refresh?.())}killAll(){let J=this._getPageLoadTrigger();if(J)J.clear();for(let $ of this._allTriggerMaps)$.forEach((Q)=>Q.disable()),$.clear();this._detachResizeListener(),this._detachBodyResizeObserver()}static _reset(){if(D._instance){if(D._instance._pageLoadTrigger)D._instance._pageLoadTrigger._reset();D._instance.killAll(),D._instance=void 0}}}I.triggerManager={getInstance:D.getInstance};function nJ(J){if(typeof document>"u"){J();return}if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",J,{once:!0});else J()}function iJ(J){if(J===null||typeof J!=="object")return!1;if(J instanceof Element)return!1;if("nodeType"in J)return!1;if("style"in J)return!1;let $=J;if("x"in $&&typeof $.x==="number")return!0;if("length"in J)return!1;return!0}function d0(J){return J instanceof Element||typeof J==="object"&&J!==null&&(("nodeType"in J)||("style"in J))}function a0(J){if(iJ(J))return[J];if(typeof J==="string"){if(typeof document<"u")try{return Array.from(document.querySelectorAll(J))}catch($){return console.warn(`[Motion] Invalid selector "${J}":`,$),[]}return[]}if(J instanceof Element)return[J];if(J&&typeof J==="object"&&"style"in J&&!Array.isArray(J))return[J];if(J instanceof NodeList)return Array.from(J);if(Array.isArray(J)){if(J.length===0)return[];if(typeof J[0]==="string"){if(typeof document>"u")return[];let $=[];for(let Q of J)try{$.push(...Array.from(document.querySelectorAll(Q)))}catch(Z){console.warn(`[Motion] Invalid selector "${Q}":`,Z)}return $}if(iJ(J[0]))return J;return J}if(J&&typeof J==="object"&&"length"in J)return Array.from(J);return[]}class m{_timeline;_config;_enabled=!1;constructor(J,$){this._timeline=J,this._config=$}enable(){if(this._enabled)return;this._enabled=!0,nJ(()=>{if(!this._enabled)return;this._onEnable()})}disable(){if(!this._enabled)return;this._enabled=!1,this._onDisable()}_resolveElement(J,$){if(J===void 0||J===null)return $??null;if(typeof J!=="string")return J;if(typeof document<"u")try{let Q=document.querySelector(J);if(Q!==null)return Q}catch(Q){console.warn(`[Motion] Invalid selector "${J}":`,Q)}return $??null}_resolveElements(J){if(J===void 0||J===null)return[];if(typeof J!=="string")return[J];if(typeof document<"u")try{let $=document.querySelectorAll(J);return Array.from($)}catch($){return console.warn(`[Motion] Invalid selector "${J}":`,$),[]}return[]}_cleanupListenerMap(J){J.forEach(($,Q)=>{$.forEach((Z,j)=>{Q.removeEventListener(j,Z)})}),J.clear()}}function o(J){let $=J,Q=$.style.transform,Z=$.style.transition;$.style.transition="none",$.style.transform="none";let j=!1,q=$.style.position,z=$.style.top,G=$.style.left,Y=$.style.width;if(q==="fixed")j=!0;else if(q===""||q===void 0){if(typeof window<"u"&&typeof window.getComputedStyle==="function"&&window.getComputedStyle($).position==="fixed")j=!0}if(j)$.style.position="",$.style.top="",$.style.left="",$.style.width="";let N=$.getBoundingClientRect();if($.style.transform=Q,$.style.transition=Z,j)$.style.position=q,$.style.top=z,$.style.left=G,$.style.width=Y;return N}class aJ extends m{_targets=[];_secondTargets=[];_listeners=new Map;_isForward=!0;_frozenRects=new Map;_snapshotScrollX=0;_snapshotScrollY=0;_wasHovering=!1;_hoverLeaveTimeout=null;_boundMouseMoveHandler=null;constructor(J,$){super(J,$)}_onEnable(){if(this._resolveTargets(),this._config.type==="hover")this._addHoverListeners();else if(this._config.type==="click")this._addClickListeners()}_onDisable(){if(this._boundMouseMoveHandler)window.removeEventListener("mousemove",this._boundMouseMoveHandler),this._boundMouseMoveHandler=null;if(this._hoverLeaveTimeout!==null)clearTimeout(this._hoverLeaveTimeout),this._hoverLeaveTimeout=null;this._frozenRects.clear(),this._wasHovering=!1,this._cleanupListenerMap(this._listeners)}refresh(){if(this._config.type!=="hover")return;this._snapshotRects()}_snapshotRects(){this._snapshotScrollX=window.scrollX||0,this._snapshotScrollY=window.scrollY||0;for(let J of this._targets)this._frozenRects.set(J,o(J))}_resolveTargets(){if(this._targets=this._resolveElements(this._config.target),this._config.secondTarget)this._secondTargets=this._resolveElements(this._config.secondTarget);else this._secondTargets=this._targets}_addHoverListeners(){let J=this._config.onEnter||"play",$=this._config.onLeave||"reverse",Q=this._config.leaveDelay||0;this._snapshotRects(),this._boundMouseMoveHandler=(Z)=>{if(!this._wasHovering)this._snapshotRects();let j=(window.scrollX||0)-this._snapshotScrollX,q=(window.scrollY||0)-this._snapshotScrollY,z=Z.clientX+j,G=Z.clientY+q,Y=!1;for(let N of this._frozenRects.values())if(z>=N.left&&z<=N.right&&G>=N.top&&G<=N.bottom){Y=!0;break}if(Y&&!this._wasHovering){if(this._wasHovering=!0,this._hoverLeaveTimeout!==null)clearTimeout(this._hoverLeaveTimeout),this._hoverLeaveTimeout=null;if(J==="restart"){let N=this._timeline.progress();if(N>=1||N===0)this._timeline.restart()}else this._timeline.play()}else if(!Y&&this._wasHovering){if(this._wasHovering=!1,$==="none")return;let N=()=>{this._handleLeaveAction($),this._hoverLeaveTimeout=null};if(Q>0)this._hoverLeaveTimeout=window.setTimeout(N,Q*1000);else N()}},window.addEventListener("mousemove",this._boundMouseMoveHandler)}_handleLeaveAction(J){u(J==="stop"?"reset":J,this._timeline)}_addClickListeners(){let J=this._config.toggle||"play",$=this._config.preventDefault||!1,Q=this._config.secondTarget&&this._config.secondTarget!==this._config.target;if(this._targets.forEach((Z)=>{let j=this._listeners.get(Z)||new Map,q=(z)=>{if($)z.preventDefault();if(!Q)if(this._isForward){if(this._timeline.restart(),J!=="play")this._isForward=!1}else this._handleSecondClick(J),this._isForward=!0;else this._timeline.restart()};Z.addEventListener("click",q),j.set("click",q),this._listeners.set(Z,j)}),Q)this._secondTargets.forEach((Z)=>{if(this._listeners.has(Z))return;let j=new Map,q=(z)=>{if($)z.preventDefault();this._handleSecondClick(J)};Z.addEventListener("click",q),j.set("click",q),this._listeners.set(Z,j)})}_handleSecondClick(J){u(J,this._timeline)}}D.registerTrigger("event",aJ);var t0={perspective:0,x:1,y:2,z:3,rotate:4,rotateX:5,rotateY:6,rotateZ:7,scale:8,scaleX:9,scaleY:10,scaleZ:11,skewX:12,skewY:13},kJ=["px","px","px","px","deg","deg","deg","deg","","","","","deg","deg"],b0=new WeakMap,r0=new WeakMap,V=[];function J0(J){let $=J.trim().match(/([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z%]*)/i);if(!$)return{value:0,unit:""};return{value:parseFloat($[1]),unit:$[2]||""}}function R0(J,$){switch($){case"rad":return J*180/Math.PI;case"turn":return J*360;case"grad":return J*0.9;default:return J}}function X0(J){let $=J0(J);return R0($.value,$.unit||"deg")}function M(J,$,Q,Z){let j=t0[$];if(j===void 0)return;J.values[j]=Q;let q=Z&&Z.length>0?Z:kJ[j]||"";J.units[j]=q,J.used|=1<<j}function s6(J,$){let Q=/([a-zA-Z0-9]+)\(([^)]+)\)/g,Z;while((Z=Q.exec(J))!==null){let j=Z[1],q=Z[2].match(/[-+]?\d*\.?\d+(?:e[-+]?\d+)?[a-z%]*/gi)||[];switch(j){case"translate":{let z=q[0]?J0(q[0]):{value:0,unit:""},G=q[1]?J0(q[1]):{value:0,unit:""};M($,"x",z.value,z.unit),M($,"y",G.value,G.unit);break}case"translate3d":{let z=q[0]?J0(q[0]):{value:0,unit:""},G=q[1]?J0(q[1]):{value:0,unit:""},Y=q[2]?J0(q[2]):{value:0,unit:""};M($,"x",z.value,z.unit),M($,"y",G.value,G.unit),M($,"z",Y.value,Y.unit);break}case"translateX":{let z=q[0]?J0(q[0]):{value:0,unit:""};M($,"x",z.value,z.unit);break}case"translateY":{let z=q[0]?J0(q[0]):{value:0,unit:""};M($,"y",z.value,z.unit);break}case"translateZ":{let z=q[0]?J0(q[0]):{value:0,unit:""};M($,"z",z.value,z.unit);break}case"scale":{let z=q[0]?parseFloat(q[0]):1,G=q[1]?parseFloat(q[1]):z;M($,"scaleX",z),M($,"scaleY",G);break}case"scale3d":{let z=q[0]?parseFloat(q[0]):1,G=q[1]?parseFloat(q[1]):1,Y=q[2]?parseFloat(q[2]):1;M($,"scaleX",z),M($,"scaleY",G),M($,"scaleZ",Y);break}case"scaleX":{let z=q[0]?parseFloat(q[0]):1;M($,"scaleX",z);break}case"scaleY":{let z=q[0]?parseFloat(q[0]):1;M($,"scaleY",z);break}case"scaleZ":{let z=q[0]?parseFloat(q[0]):1;M($,"scaleZ",z);break}case"rotate":M($,"rotate",q[0]?X0(q[0]):0,"deg");break;case"rotateX":M($,"rotateX",q[0]?X0(q[0]):0,"deg");break;case"rotateY":M($,"rotateY",q[0]?X0(q[0]):0,"deg");break;case"rotateZ":M($,"rotateZ",q[0]?X0(q[0]):0,"deg");break;case"skew":{let z=q[0]?X0(q[0]):0,G=q[1]?X0(q[1]):0;M($,"skewX",z,"deg"),M($,"skewY",G,"deg");break}case"skewX":M($,"skewX",q[0]?X0(q[0]):0,"deg");break;case"skewY":M($,"skewY",q[0]?X0(q[0]):0,"deg");break;case"perspective":{let z=q[0]?J0(q[0]):{value:0,unit:""};M($,"perspective",z.value,z.unit);break}default:break}}}function MJ(J,$,Q,Z,j,q,z,G,Y,N,H,X,K,_){if(K){let g=Math.hypot(J,$),z0=J*j-$*Z,u0=g!==0?z0/g:0,a=g!==0?Math.atan2($,J):0,e=g!==0?Math.atan2(J*Z+$*j,g*g):0;if(M(_,"x",N,"px"),M(_,"y",H,"px"),M(_,"scaleX",g||1),M(_,"scaleY",u0||1),M(_,"rotate",R0(a,"rad"),"deg"),Math.abs(e)>0.000001)M(_,"skewX",R0(e,"rad"),"deg");return}let B=Math.hypot(J,$,Q)||1,U=Math.hypot(Z,j,q)||1,W=Math.hypot(z,G,Y)||1,O=J/B,F=$/B,A=Q/B,L=Z/U,R=j/U,O0=q/U,I0=z/W,f0=G/W,F0=Y/W,p=Math.sqrt(O*O+L*L),k0=p<0.000001,L0=0,G0=0,A0=0;if(!k0)L0=Math.atan2(f0,F0),G0=Math.atan2(-I0,p),A0=Math.atan2(L,O);else L0=Math.atan2(-O0,R),G0=Math.atan2(-I0,p),A0=0;M(_,"x",N,"px"),M(_,"y",H,"px"),M(_,"z",X,"px"),M(_,"scaleX",B),M(_,"scaleY",U),M(_,"scaleZ",W),M(_,"rotateX",R0(L0,"rad"),"deg"),M(_,"rotateY",R0(G0,"rad"),"deg"),M(_,"rotateZ",R0(A0,"rad"),"deg")}function i6(J,$){if(!J||J==="none")return;if(typeof DOMMatrixReadOnly<"u"){let Z=new DOMMatrixReadOnly(J);MJ(Z.m11,Z.m12,Z.m13,Z.m21,Z.m22,Z.m23,Z.m31,Z.m32,Z.m33,Z.m41,Z.m42,Z.m43,Z.is2D,$);return}let Q=J.match(/[-+]?\d*\.?\d+(?:e[-+]?\d+)?/gi)||[];if(J.startsWith("matrix3d")&&Q.length>=16){let Z=Q.map(Number);MJ(Z[0],Z[1],Z[2],Z[4],Z[5],Z[6],Z[8],Z[9],Z[10],Z[12],Z[13],Z[14],!1,$);return}if(J.startsWith("matrix")&&Q.length>=6){let Z=Q.map(Number);MJ(Z[0],Z[1],0,Z[2],Z[3],0,0,0,1,Z[4],Z[5],0,!0,$)}}function n6(J,$){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let Z=J.style.transform;if(Z&&Z!=="none"){s6(Z,$),$.cachedString=Z;return}try{if(typeof window<"u"&&window.getComputedStyle){let j=window.getComputedStyle(J),q=j.transform||j.getPropertyValue("transform");if(q&&q!=="none")i6(q,$),$.cachedString=q}}catch{}}function RJ(J){let $=b0.get(J);if(!$){let Q=new Float32Array(14);Q[8]=1,Q[9]=1,Q[10]=1,Q[11]=1,$={values:Q,units:[...kJ],dirty:0,used:0,cachedString:"",pinDirty:!1},n6(J,$),b0.set(J,$)}return $}function E(J,$,Q,Z){let j=RJ(J),q=t0[$];if(q!==void 0){if(j.values[q]=Q,Z!==void 0)j.units[q]=Z;if(j.used|=1<<q,$==="scale")j.values[9]=Q,j.values[10]=Q,j.dirty|=1536;else if($==="scaleX"||$==="scaleY")j.values[8]=1,j.dirty|=256;if($==="rotate")j.values[7]=0,j.dirty|=128;else if($==="rotateZ")j.values[4]=0,j.dirty|=16;j.dirty|=1<<q}}function bJ(J,$){let Q=RJ(J),Z=t0[$];if(Z===void 0)return $.startsWith("scale")?1:0;if($==="scale"){if(Q.values[Z]!==1)return Q.values[Z];let j=Q.values[9],q=Q.values[10];if(Math.abs(j-q)<0.000001&&j!==1)return j;return Q.values[Z]}if($==="rotate"){if(Q.values[Z]!==0)return Q.values[Z];let j=Q.values[7];if(j!==0&&Q.values[5]===0&&Q.values[6]===0)return j;return Q.values[Z]}return Q.values[Z]}function EJ(J,$){let Q=RJ(J),Z=t0[$];if(Z===void 0)return"";return Q.units[Z]||kJ[Z]||""}function DJ(J){return J===0?"0":`${Math.round(J)}px`}function rJ(J,$,Q){return`translate3d(${DJ(J)}, ${DJ($)}, ${DJ(Q)})`}function e0(J,$,Q,Z){r0.set(J,{x:$,y:Q,z:Z});let j=b0.get(J);if(j)j.pinDirty=!0}function E0(J){let $=r0.has(J);if(r0.delete(J),$){let Q=b0.get(J);if(Q)Q.pinDirty=!0}}function w(J){let $=b0.get(J),Q=r0.get(J);if(!$){if(Q&&(Q.x!==0||Q.y!==0||Q.z!==0))return rJ(Q.x,Q.y,Q.z);return""}if($.dirty===0&&!$.pinDirty&&$.cachedString)return $.cachedString;let{values:Z,units:j}=$;V.length=0;let q=$.used,z=Z[0];if(z!==0){let L=j[0];V.push(`perspective(${z}${L})`)}let G=Z[1],Y=Z[2],N=Z[3],H=j[1],X=j[2],K=j[3],_=q&2,B=q&4,U=q&8;if(G!==0||Y!==0||N!==0||_||B||U){let L=H===X&&(N===0&&!U||X===K);if(N!==0||U)if(L)V.push(`translate3d(${G}${H}, ${Y}${X}, ${N}${K})`);else{if(G!==0||_)V.push(`translateX(${G}${H})`);if(Y!==0||B)V.push(`translateY(${Y}${X})`);V.push(`translateZ(${N}${K})`)}else if(L&&(G!==0||_)&&(Y!==0||B))V.push(`translate(${G}${H}, ${Y}${X})`);else{if(G!==0||_)V.push(`translateX(${G}${H})`);if(Y!==0||B)V.push(`translateY(${Y}${X})`)}}if(Z[4]!==0||q&16)V.push(`rotate(${Z[4]}deg)`);if(Z[5]!==0||q&32)V.push(`rotateX(${Z[5]}deg)`);if(Z[6]!==0||q&64)V.push(`rotateY(${Z[6]}deg)`);if(Z[7]!==0||q&128)V.push(`rotateZ(${Z[7]}deg)`);let W=q&256,O=q&512,F=q&1024;if(Z[8]!==1||W)V.push(`scale(${Z[8]})`);else if(Z[9]!==1||Z[10]!==1||O||F)V.push(`scaleX(${Z[9]})`),V.push(`scaleY(${Z[10]})`);if(Z[11]!==1||q&2048)V.push(`scaleZ(${Z[11]})`);if(Z[12]!==0||q&4096)V.push(`skewX(${Z[12]}deg)`);if(Z[13]!==0||q&8192)V.push(`skewY(${Z[13]}deg)`);let A=V.join(" ");if(Q&&(Q.x!==0||Q.y!==0||Q.z!==0)){let L=rJ(Q.x,Q.y,Q.z);$.cachedString=A?`${L} ${A}`:L}else $.cachedString=A;return $.dirty=0,$.pinDirty=!1,$.cachedString}function x(J,$=!1){if(b0.delete(J),$&&J instanceof HTMLElement)J.style.transform=""}var VJ=new Set,JJ=new Map,$J=!1;function $0(J){VJ.add(J),$J=!0}function V0(J,$,Q){let Z=JJ.get(J);if(!Z)Z=new Map,JJ.set(J,Z);Z.set($,Q),$J=!0}function wJ(){if(!$J)return;for(let J of VJ){let $=J;if($.style){let Q=w(J);$.style.transform=Q}}VJ.clear();for(let[J,$]of JJ){let Q=J;if(Q.style)for(let[Z,j]of $)try{if(Z.startsWith("--"))Q.style.setProperty(Z,j);else Q.style[Z]=j}catch{}}JJ.clear(),$J=!1}var M0=!1;function D0(){return M0}function CJ(J){if(M0){J();return}M0=!0;try{J(),wJ()}finally{M0=!1}}class T{static instance;listeners=[];_listenersDirty=!0;_listenersSnapshot=[];_isRunning=!1;rafId=null;lastTime=0;elapsedTime=0;lagThreshold=500;maxDelta=33;fpsFrames=0;fpsTime=0;currentFPS=60;lastFrameTime=0;constructor(){}static getInstance(){if(!T.instance)T.instance=new T;return T.instance}add(J,$=0){let Q=this.listeners.findIndex((Z)=>Z.callback===J);if(Q!==-1)this.listeners[Q].priority=$;else this.listeners.push({callback:J,priority:$});if(this.listeners.sort((Z,j)=>j.priority-Z.priority),this._listenersDirty=!0,!this._isRunning&&this.listeners.length>0)this.start()}remove(J){let $=this.listeners.findIndex((Q)=>Q.callback===J);if($!==-1)this.listeners.splice($,1),this._listenersDirty=!0;if(this.listeners.length===0&&this._isRunning)this.stop()}start(){if(this._isRunning)return;if(typeof requestAnimationFrame>"u"){this._isRunning=!1;return}this._isRunning=!0,this.lastTime=performance.now(),this.rafId=requestAnimationFrame(this.tick)}stop(){if(!this._isRunning)return;if(this._isRunning=!1,this.rafId!==null&&typeof cancelAnimationFrame<"u")cancelAnimationFrame(this.rafId),this.rafId=null}pause(){this.stop()}resume(){if(this.listeners.length>0)this.start()}tick=()=>{if(!this._isRunning)return;let J=performance.now(),$=J-this.lastTime;if($>this.lagThreshold)$=this.maxDelta,this.lastTime=J-$;else this.lastTime=J;let Q=$/1000;if(this.elapsedTime+=Q,this.lastFrameTime=$,this.updateFPS($),M0=!0,this._listenersDirty)this._listenersSnapshot=[...this.listeners],this._listenersDirty=!1;for(let Z of this._listenersSnapshot)try{Z.callback(Q,this.elapsedTime)}catch(j){console.error("[Motion] Uncaught error in animation callback:",j)}try{wJ()}catch(Z){console.error("[Motion] Uncaught error in render batch flush:",Z)}if(M0=!1,typeof requestAnimationFrame<"u")this.rafId=requestAnimationFrame(this.tick)};updateFPS(J){if(this.fpsFrames++,this.fpsTime+=J,this.fpsTime>=1000)this.currentFPS=Math.round(this.fpsFrames*1000/this.fpsTime),this.fpsFrames=0,this.fpsTime=0}getFPS(){return this.currentFPS}getLastDelta(){return this.lastFrameTime}isRunning(){return this._isRunning}isInTick(){return M0}getListenerCount(){return this.listeners.length}removeAll(){this.listeners=[],this.stop()}}var Z0=null,w0=null,a6=100,Q0=new Map;function r6(J){let $=Q0.get(J);if($!==void 0)Q0.delete(J),Q0.set(J,$);return $}function t6(J,$){if(Q0.has(J))Q0.delete(J);while(Q0.size>=a6){let Q=Q0.keys().next().value;if(Q!==void 0)Q0.delete(Q);else break}Q0.set(J,$)}function e6(J){return/^\s*[Mm]/.test(J)}function tJ(){if(w0)return w0;if(typeof document>"u")throw Error("PathParser requires a browser environment");return Z0=document.createElementNS("http://www.w3.org/2000/svg","svg"),Z0.style.cssText="position:absolute;width:0;height:0;overflow:hidden;visibility:hidden;",Z0.setAttribute("aria-hidden","true"),w0=document.createElementNS("http://www.w3.org/2000/svg","path"),Z0.appendChild(w0),document.body.appendChild(Z0),w0}function eJ(J){if(J instanceof Element)return J.getAttribute("d");if(typeof J==="string"){if(e6(J))return J;if(typeof document<"u"){let $=document.querySelector(J);if($)return $.getAttribute("d")}}return null}function J6(J){let $=r6(J);if($!==void 0)return $;try{let Q=tJ();Q.setAttribute("d",J);let Z=Q.getTotalLength();return t6(J,Z),Z}catch{return 0}}function xJ(J,$,Q=!1){try{let Z=tJ();Z.setAttribute("d",J);let j=Z.getTotalLength(),q=Math.max(0,Math.min(1,$)),z=j*q,G=Z.getPointAtLength(z),Y=0;if(Q)Y=J7(Z,z,j);return{x:G.x,y:G.y,angle:Y}}catch{return{x:0,y:0,angle:0}}}function J7(J,$,Q){let Z=Math.min(0.1,Q*0.001),j=Math.max(0,$-Z),q=Math.min(Q,$+Z),z=J.getPointAtLength(j),G=J.getPointAtLength(q),Y=G.x-z.x,N=G.y-z.y;return Math.atan2(N,Y)*(180/Math.PI)}function $6(J,$=[50,50]){if(!J)return{x:0,y:0};let Q=null;if(J instanceof Element)Q=J;else if(typeof J==="string"&&typeof document<"u")Q=document.querySelector(J);if(!Q||typeof Q.getBoundingClientRect!=="function")return{x:0,y:0};let Z=Q.getBoundingClientRect(),j=Z.width*$[0]/100,q=Z.height*$[1]/100;return{x:j,y:q}}function Q6(J,$,Q){if(!J)return{x:0,y:0};let Z=null;if(J instanceof Element)Z=J;else if(typeof J==="string"&&typeof document<"u")Z=document.querySelector(J);if(!Z)return{x:0,y:0};let j=xJ($,0,!1);if(Q&&Q instanceof HTMLElement){let q=Q.style.transform,z=q&&q!=="none"&&q!=="";if(z)Q.style.transform="none";let G=Q.getBoundingClientRect(),Y=Z.getBoundingClientRect();if(z)Q.style.transform=q;let N=Y.left+Y.width/2-(G.left+G.width/2),H=Y.top+Y.height/2-(G.top+G.height/2);return{x:N-j.x,y:H-j.y}}return{x:-j.x,y:-j.y}}function Z6(){if(Z0&&Z0.parentNode)Z0.parentNode.removeChild(Z0);Z0=null,w0=null,Q0.clear()}var $7=new Set(["perspective","x","y","z","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skewX","skewY"]),Q7=new Set(["perspective","x","y","z","width","height","top","left","right","bottom","margin","marginTop","marginRight","marginBottom","marginLeft","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","borderRadius","fontSize","lineHeight"]),Z7=new Set(["rotate","rotateX","rotateY","rotateZ","skewX","skewY"]),j7=new Set(["opacity","scale","scaleX","scaleY","scaleZ","z-index","zIndex"]),q7=new Set(["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor","textDecorationColor","caretColor","fill","stroke"]),G7=new Set(["red","green","blue","yellow","orange","purple","pink","cyan","magenta","white","black","gray","grey","transparent","crimson","gold","silver","navy","teal","maroon","olive","lime","aqua","fuchsia","coral","salmon","tomato","indigo"]);function y(J){return $7.has(J)}function _0(J){return q7.has(J)}function t(J){return J==="filter"}function C0(J){return J==="drawSVG"}function SJ(J){return J==="path"}function PJ(J){return J==="clip-path"||J==="clipPath"}function j0(J){return J.startsWith("--")}function j6(J){if(typeof J!=="string")return!1;let $=J.trim().toLowerCase();if($.startsWith("#"))return!0;if(/^(rgb|rgba|hsl|hsla)\s*\(/.test($))return!0;let Q=I.color;if(Q)return Q.parseColor($)!==null;return G7.has($)}function S(J){if(typeof J==="number"){if(isNaN(J)||!isFinite(J))return console.warn(`[Motion] Property value is ${J}. This property will not animate correctly.`),{value:0,unit:""};return{value:J,unit:""}}if(typeof J==="string"){let $=J.match(/^([+\-*/])=(.+)/);if($){let Z=$[2].match(/([-+]?[\d.]+(?:e[-+]?\d+)?)([a-z%]*)/i);if(Z)return{value:parseFloat(Z[1]),unit:Z[2]||""}}let Q=J.match(/([-+]?[\d.]+(?:e[-+]?\d+)?)([a-z%]*)/i);if(Q)return{value:parseFloat(Q[1]),unit:Q[2]||""}}return{value:0,unit:""}}function l(J){if(j7.has(J))return"";if(Z7.has(J))return"deg";if(Q7.has(J))return"px";return""}function z6(J){if(J==="opacity")return 1;if(J.startsWith("scale"))return 1;return 0}function Y0(J,$){if(!(J instanceof Element)){let Q=J;if($ in Q)return Q[$];return Y7($)}if(y($))return bJ(J,$);try{if(typeof window<"u"&&window.getComputedStyle){let Z=window.getComputedStyle(J).getPropertyValue(s($));if(Z)return S(Z).value}}catch(Q){}return z6($)}function z7(J,$,Q,Z){if(!Z||Z==="px")return Q;if(typeof window>"u"||!window.getComputedStyle)return Q;let j=J,q=s($);try{let z=j.style.getPropertyValue(q);j.style.setProperty(q,`100${Z}`);let G=window.getComputedStyle(J),Y=parseFloat(G.getPropertyValue(q));if(z)j.style.setProperty(q,z);else j.style.removeProperty(q);if(Y&&isFinite(Y)&&Y!==0)return Q/Y*100}catch{}return Q}function QJ(J,$,Q){let Z=Y0(J,$);if(J instanceof Element&&Q&&Q!=="px")return z7(J,$,Z,Q);return Z}function Y6(J,$){let Q=J,Z=s($);if(y($)){let j=Q.style.transform;x(J),Q.style.transform="";let q=bJ(J,$);return Q.style.transform=j,x(J),{value:q,unit:l($)}}try{if(typeof window<"u"&&window.getComputedStyle){let j=Q.style.getPropertyValue(Z);Q.style.removeProperty(Z);let z=window.getComputedStyle(J).getPropertyValue(Z);if(j)Q.style.setProperty(Z,j);if(z){let G=S(z);return{value:G.value,unit:G.unit}}}}catch(j){}return{value:z6($),unit:l($)}}function Y7(J){if(J.startsWith("scale"))return 1;return 0}function s(J){return J.replace(/[A-Z]/g,($)=>`-${$.toLowerCase()}`)}function q6(J){return typeof J==="string"&&J.trim().toLowerCase()==="auto"}var N6=new Set(["width","height"]);function N7(J,$){if(!N6.has($))return 0;let Q=J,Z=s($);try{let j=Q.style.getPropertyValue(Z);Q.style.setProperty(Z,"auto");let q=$==="width"?Q.offsetWidth:Q.offsetHeight;if(j)Q.style.setProperty(Z,j);else Q.style.removeProperty(Z);return q}catch{return 0}}function H7(J){if(typeof J==="string")return/^[+\-*/]=/.test(J);return!1}function X7(J){let $=J.match(/^([+\-*/])=/);return $?$[0]:null}function _7(J,$,Q){switch(Q){case"+=":return J+$;case"-=":return J-$;case"*=":return J*$;case"/=":return $!==0?J/$:J;default:return $}}function K7(J,$,Q,Z){let j=I.color;if(!j)return null;let q=String(Q),z=q===""?j.getCurrentColor(J,$):j.parseColor(q,J),G=Z!==void 0?j.parseColor(String(Z),J):j.getCurrentColor(J,$);return{type:"color",property:$,isTransform:!1,startColor:G||new Float32Array([0,0,0,1]),endColor:z||new Float32Array([0,0,0,1])}}function B7(J,$,Q,Z){let j=I.filter;if(!j)return null;let q=String(Q),z=q===""?j.getCurrentFilter(J):j.parseFilter(q),G=Z!==void 0?j.parseFilter(String(Z)):j.getCurrentFilter(J);G=G||[],z=z||[];let Y=j.mergeFilterArrays(G,z);return{type:"filter",property:$,isTransform:!1,startFilters:Y.start,endFilters:Y.end}}function W7(J,$,Q,Z){if(j6(Q)||Z!==void 0&&j6(Z)){let Y=I.color;if(Y){let N=String(Q),H=Y.parseColor(N,J),X=Z!==void 0?Y.parseColor(String(Z),J):U7(J,$);return{type:"color",property:$,isTransform:!1,startColor:X||new Float32Array([0,0,0,1]),endColor:H||new Float32Array([0,0,0,1])}}}let q,z,G;if(Z!==void 0&&Q!==void 0){let Y=S(Z),N=S(Q);q=Y.value,z=N.value,G=N.unit||Y.unit}else if(Z!==void 0){let Y=S(Z);q=Y.value,z=G6(J,$),G=Y.unit}else{let Y=S(Q);q=G6(J,$),z=Y.value,G=Y.unit}return{type:"scalar",property:$,isTransform:!1,startValue:q,endValue:z,unit:G}}function U7(J,$){let Q=I.color;if(!Q)return null;try{if(typeof window<"u"&&window.getComputedStyle){let j=window.getComputedStyle(J).getPropertyValue($).trim();if(j)return Q.parseColor(j,J)}}catch{}return null}function G6(J,$){try{if(typeof window<"u"&&window.getComputedStyle){let Z=window.getComputedStyle(J).getPropertyValue($).trim();if(Z)return S(Z).value}}catch{}return 0}function O7(J,$,Q,Z){let j=I.drawSVG;if(!j)return null;let q=j.getPathLength(J),z=j.parseDrawSVG(Q,J)||{start:0,end:1},G=Z!==void 0?j.parseDrawSVG(Z,J)||{start:0,end:1}:j.getCurrentDrawSVG(J);return{type:"drawSVG",property:$,isTransform:!1,startDraw:G,endDraw:z,length:q}}function I7(J,$,Q,Z){let j=I.clipPath;if(!j)return null;let q;if(Q===void 0||Q==="")q=j.getCurrentClipPath(J);else q=j.parseClipPath(String(Q));let z;if(Z!==void 0)z=j.parseClipPath(String(Z));else z=j.getCurrentClipPath(J);if(!q)return null;if(!z)z=q;return{type:"clipPath",property:$,isTransform:!1,startClipPath:z,endClipPath:q}}function F7(J,$,Q,Z){let j=Q,q=Z,z=j?.target?j:q;if(!z?.target)return null;let G=eJ(z.target);if(!G)return null;let Y=J6(G);if(Y===0)return null;let N,H;if(j?.target&&q?.target)N=q.start??0,H=j.end??1;else if(j?.target)N=j.start??0,H=j.end??1;else N=q.start??0,H=q.end??1;let X=j?.rotate??q?.rotate??!1,K=j?.alignAt??q?.alignAt??[50,50],_=$6(J,K),B=j?.align??q?.align,U=Q6(B,G,J);return{type:"path",property:$,isTransform:!1,pathData:G,pathLength:Y,startProgress:N,endProgress:H,rotate:X,alignOffset:_,pathOffset:U}}function yJ(J,$,Q,Z){let j=J instanceof Element;if(j&&j0($))return W7(J,$,Q,Z);if(j&&_0($)){let K=K7(J,$,Q,Z);if(K)return K}if(j&&t($)){let K=B7(J,$,Q,Z);if(K)return K}if(j&&C0($)){let K=O7(J,$,Q,Z);if(K)return K}if(j&&PJ($)){let K=I7(J,$,Q,Z);if(K)return K}if(j&&SJ($)){let K=F7(J,$,Q,Z);if(K)return K}let q=q6(Q),z=Z!==void 0&&q6(Z);if(j&&(q||z)&&N6.has($)){let K=N7(J,$);return yJ(J,$,q?K:Q,z?K:Z)}let G=y($),Y=Z===void 0&&H7(Q),N,H,X;if(Z!==void 0){let K=S(Z);if(Q!==void 0){let _=S(Q);N=K.value,H=_.value,X=_.unit||K.unit||l($)}else N=K.value,X=K.unit||l($),H=QJ(J,$,X)}else if(Y){let K=X7(Q),_=Y0(J,$),B=S(Q);N=_,H=_7(_,B.value,K),X=B.unit||l($)}else{let K=S(Q);X=K.unit||l($),N=QJ(J,$,X),H=K.value}return{type:"scalar",property:$,isTransform:G,startValue:N,endValue:H,unit:X}}function H6(){let J=new WeakMap;return{register($,Q){let Z=J.get($);if(!Z)Z=new Set,J.set($,Z);Z.add(Q)},registerMany($,Q){for(let Z of Q)this.register($,Z)},get($){return J.get($)},clearRegistry($){J.delete($)}}}var vJ=H6(),ZJ=new WeakMap,TJ=H6();function X6(J){if(y(J))return["transform"];if(t(J))return["filter"];if(C0(J))return["strokeDasharray","strokeDashoffset"];return[J]}function L7(J,$){if(y($)&&!ZJ.has(J)){if(J instanceof HTMLElement||J instanceof SVGElement){let Z=J.style.transform;ZJ.set(J,Z||null)}}let Q=X6($);for(let Z of Q)vJ.register(J,Z)}function A7(J,$){for(let Q of $)L7(J,Q)}function M7(J){vJ.clearRegistry(J),ZJ.delete(J)}function D7(J,$){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let Q=new Set;for(let Z of $)for(let j of X6(Z))Q.add(j);for(let Z of Q)if(j0(Z))J.style.removeProperty(Z);else J.style[Z]=""}function k7(J){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let $=vJ.get(J);if(!$||$.size===0)return;for(let Q of $){if(Q==="transform"){let Z=ZJ.get(J);if(Z!==void 0){if(Z)J.style.transform=Z;else J.style.removeProperty("transform");continue}}if(j0(Q))J.style.removeProperty(Q);else J.style[Q]=""}}function R7(J){k7(J),M7(J)}function c0(J,$){TJ.registerMany(J,$)}function hJ(J){TJ.clearRegistry(J)}function b7(J){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let $=TJ.get(J);if(!$||$.size===0)return;for(let Q of $)J.style[Q]=""}function E7(J){b7(J),hJ(J)}I.styleReset={registerAnimatedProps:A7,clearAnimationStylesForProps:D7,clearAnimationStylesAndUnregister:R7,clearPinStylesAndUnregister:E7};class h{static _registry=new Map;static _users=new Map;static getOrCreate(J,$){let Q=h._registry.get($);if(!Q)Q=new h(J),h._registry.set($,Q);let Z=h._users.get($);if(!Z)Z=new Set,h._users.set($,Z);return Z.add(J),Q}static release(J,$){let Q=h._users.get($);if(!Q)return;if(Q.delete(J),Q.size===0){let Z=h._registry.get($);h._registry.delete($),h._users.delete($),Z?.cleanup()}}_id;_element=null;_originalStyles=null;_spacer=null;_currentState="before";_pinStart=0;_pinEnd=0;_pinDistance=0;_useFixedPin=!1;_pinSpacing;_elementHeight=0;_fixedTop=0;_fixedLeft=0;_width=0;_fixedBreakingAncestors=[];_isBodyPin=!1;_originalHtmlHeight="";_originalHtmlOverflow="";constructor(J){this._id=J}setup(J,$,Q,Z,j,q){if(typeof document>"u")return;this._isBodyPin=J===document.body,this._element=J,this._pinStart=$,this._pinEnd=Q;let z=this._pinDistance;this._pinDistance=Q-$,this._useFixedPin=j,this._pinSpacing=q;let G=this._isBodyPin?this._originalStyles!==null:this._spacer!==null;if(G&&this._currentState==="pinned"&&j)this._updateFixed("before");if(G&&this._spacer)this._spacer.style.width="";let Y=G&&this._isBodyPin?document.documentElement.style.height:null;if(Y!==null)document.documentElement.style.height=this._originalHtmlHeight;let N=J.getBoundingClientRect();if(Y!==null)document.documentElement.style.height=Y;let H=G&&this._spacer?window.getComputedStyle(this._spacer):window.getComputedStyle(J);if(this._elementHeight=N.height,!G)this._originalStyles={position:J.style.position,top:J.style.top,left:J.style.left,width:J.style.width,marginTop:J.style.marginTop,marginBottom:J.style.marginBottom,marginLeft:J.style.marginLeft,marginRight:J.style.marginRight,zIndex:J.style.zIndex};if(j)if(this._fixedTop=Z,this._isBodyPin){if(this._fixedLeft=N.left,this._width=N.width,!G)this._originalHtmlHeight=document.documentElement.style.height,this._originalHtmlOverflow=document.documentElement.style.overflow,this._detectFixedBreakingAncestors(J);document.documentElement.style.height=`${this._elementHeight+this._pinDistance}px`}else{let X=this._resolvePinSpacing(),K=window.getComputedStyle(J),_=K.display,B=K.flexDirection,U=G&&this._spacer?.parentElement?this._spacer.parentElement:J.parentElement,W=U?/^(inline-)?flex$/.test(getComputedStyle(U).display):!1,O=/^(inline-)?flex$/.test(_),F=`
2
+ display: ${_};
3
+ ${O?`flex-direction: ${B};`:""}
4
4
  box-sizing: content-box;
5
5
  width: ${N.width}px;
6
6
  height: ${N.height}px;
7
- margin-top: ${_.marginTop};
8
- margin-left: ${_.marginLeft};
9
- margin-right: ${_.marginRight};
7
+ margin-top: ${H.marginTop};
8
+ margin-left: ${H.marginLeft};
9
+ margin-right: ${H.marginRight};
10
10
  overflow: visible;
11
- ${K?"flex-shrink: 0;":""}
12
- `;if(Y==="padding")M+=`padding-bottom: ${this._pinDistance}px;`,M+=`margin-bottom: ${_.marginBottom};`;else if(Y==="margin"){let L=parseFloat(_.marginBottom)||0,P=z?L-G:L;M+=`margin-bottom: ${P+this._pinDistance}px;`}else M+=`margin-bottom: ${_.marginBottom};`;if(!this._spacer)this._detectFixedBreakingAncestors(J),this._spacer=document.createElement("div"),J.parentNode?.insertBefore(this._spacer,J),this._spacer.appendChild(J),J.style.marginTop="0",J.style.marginBottom="0",J.style.marginLeft="0",J.style.marginRight="0";this._spacer.style.cssText=M,this._spacer.setAttribute("data-scrolltrigger-spacer",String(this._id));let k=this._spacer.getBoundingClientRect();this._fixedLeft=k.left,this._width=k.width}this._currentState="before"}update(J){if(!this._element)return;let $=J<this._pinStart?"before":J<this._pinEnd?"pinned":"after";if(this._useFixedPin){if($!==this._currentState)this._updateFixed($),this._currentState=$}else if($!==this._currentState||$==="pinned")this._updateTransform($,J),this._currentState=$}cleanup(){if(this._element&&w._registry.get(this._element)===this)w._registry.delete(this._element),w._users.delete(this._element);if(this._element&&this._originalStyles){let J=this._element;W0(J),J.style.position=this._originalStyles.position,J.style.top=this._originalStyles.top,J.style.left=this._originalStyles.left,J.style.width=this._originalStyles.width,J.style.marginTop=this._originalStyles.marginTop,J.style.marginBottom=this._originalStyles.marginBottom,J.style.marginLeft=this._originalStyles.marginLeft,J.style.marginRight=this._originalStyles.marginRight,J.style.zIndex=this._originalStyles.zIndex,J.style.transform="",WJ(J)}if(this._isBodyPin){if(typeof document<"u")document.documentElement.style.height=this._originalHtmlHeight,document.documentElement.style.overflow=this._originalHtmlOverflow}else if(this._spacer?.parentNode&&this._element)this._spacer.parentNode.insertBefore(this._element,this._spacer),this._spacer.parentNode.removeChild(this._spacer);this._restoreFixedBreakingAncestors(),this._fixedBreakingAncestors=[],this._element=null,this._originalStyles=null,this._spacer=null,this._currentState="before",this._pinSpacing=void 0,this._isBodyPin=!1,this._originalHtmlHeight="",this._originalHtmlOverflow=""}getElement(){return this._element}getPinDistance(){return this._pinDistance}getState(){return this._currentState}getLayoutRect(){if(this._spacer?.parentNode){let J=this._spacer.getBoundingClientRect();return{top:J.top,left:J.left,width:J.width,height:this._elementHeight,bottom:J.top+this._elementHeight,right:J.left+J.width}}return null}isBodyPin(){return this._isBodyPin}suspendHtmlHeight(){if(!this._isBodyPin)return null;let J=document.documentElement.style.height;return document.documentElement.style.height=this._originalHtmlHeight,()=>{document.documentElement.style.height=J}}isFixedPin(){return this._useFixedPin}_detectFixedBreakingAncestors(J){this._fixedBreakingAncestors=[];let $=J.parentElement;while($&&$!==document.documentElement){let Q=window.getComputedStyle($),Z=[];if(Q.filter&&Q.filter!=="none")Z.push({property:"filter",originalValue:""});if(Q.transform&&Q.transform!=="none")Z.push({property:"transform",originalValue:""});if(Q.perspective&&Q.perspective!=="none")Z.push({property:"perspective",originalValue:""});if(Q.willChange&&Q.willChange!=="auto"){if(Q.willChange.split(",").map((q)=>q.trim()).some((q)=>q==="transform"||q==="filter"||q==="perspective"))Z.push({property:"willChange",originalValue:""})}if(Q.contain&&Q.contain!=="none"){if(["paint","layout","strict","content"].some((q)=>Q.contain.includes(q)))Z.push({property:"contain",originalValue:""})}if(Q.backdropFilter&&Q.backdropFilter!=="none")Z.push({property:"backdropFilter",originalValue:""});if(Q.overflow==="clip"||Q.overflowX==="clip"||Q.overflowY==="clip"){if(Q.overflowY==="clip")Z.push({property:"overflowY",originalValue:""});if(Q.overflowX==="clip")Z.push({property:"overflowX",originalValue:""})}if(Z.length>0)this._fixedBreakingAncestors.push({element:$,overrides:Z});$=$.parentElement}}_overrideFixedBreakingAncestors(){for(let{element:J,overrides:$}of this._fixedBreakingAncestors)for(let Q of $)switch(Q.originalValue=J.style[Q.property]||"",Q.property){case"filter":case"backdropFilter":case"transform":case"perspective":J.style[Q.property]="none";break;case"willChange":J.style.willChange="auto";break;case"contain":J.style.contain="none";break;case"overflowY":J.style.overflowY="visible";break;case"overflowX":J.style.overflowX="hidden";break}}_restoreFixedBreakingAncestors(){for(let{element:J,overrides:$}of this._fixedBreakingAncestors)for(let{property:Q,originalValue:Z}of $)J.style[Q]=Z}_resolvePinSpacing(){if(this._pinSpacing===!1)return!1;if(this._pinSpacing==="margin")return"margin";if(this._pinSpacing===void 0||this._pinSpacing===!0){if(this._isBodyPin)return!1}return"padding"}_updateFixed(J){let $=this._element;if(J==="before"){if($.style.position=this._originalStyles?.position||"",$.style.top=this._originalStyles?.top||"",$.style.left=this._originalStyles?.left||"",$.style.width=this._originalStyles?.width||"",this._isBodyPin)$.style.marginTop=this._originalStyles?.marginTop||"";else $.style.marginTop="0",$.style.marginLeft="0";$.style.zIndex=this._originalStyles?.zIndex||"",W0($),$.style.transform=R($),this._restoreFixedBreakingAncestors()}else if(J==="pinned"){if(this._overrideFixedBreakingAncestors(),$.style.position="fixed",$.style.top=`${this._fixedTop}px`,$.style.left=`${this._fixedLeft}px`,$.style.width=`${this._width}px`,this._isBodyPin)$.style.marginTop=this._originalStyles?.marginTop||"";else $.style.marginTop="0",$.style.marginLeft="0";if($.style.zIndex="100",W0($),$.style.transform=R($),this._isBodyPin)I0($,["position","top","left","width","zIndex","transform","marginTop"]);else I0($,["position","top","left","width","marginTop","marginLeft","zIndex","transform"])}else{if($.style.position=this._originalStyles?.position||"",$.style.top=this._originalStyles?.top||"",$.style.left=this._originalStyles?.left||"",$.style.width=this._originalStyles?.width||"",this._isBodyPin)W0($),$.style.transform=R($),$.style.marginTop=`${this._pinDistance}px`;else $.style.marginTop="0",$.style.marginLeft="0",E0($,0,this._pinDistance,0),$.style.transform=R($);$.style.zIndex=this._originalStyles?.zIndex||"",this._restoreFixedBreakingAncestors()}}_updateTransform(J,$){let Q=this._element;if(J==="before")Q.style.zIndex=this._originalStyles?.zIndex||"",W0(Q),Q.style.transform=R(Q);else if(J==="pinned"){let Z=Math.round($-this._pinStart);Q.style.zIndex="100",E0(Q,0,Z,0),Q.style.transform=R(Q),I0(Q,["transform","zIndex"])}else Q.style.zIndex=this._originalStyles?.zIndex||"",E0(Q,0,this._pinDistance,0),Q.style.transform=R(Q),I0(Q,["transform","zIndex"])}}function h(J,$,Q,Z){if(!J)return 0;let j=J.trim().toLowerCase(),q=j.match(/^(top|center|bottom)([+-])(-?\d+(?:\.\d+)?)(px|%|vh|vw)?$/);if(q){let z=q[1],W=q[2]==="-"?-1:1,N=parseFloat(q[3]),_=q[4]||"px",Y=0;switch(z){case"top":Y=0;break;case"center":Y=$/2;break;case"bottom":Y=$;break}let X=fJ(N,_,$,Q,Z);return Y+W*X}switch(j){case"top":return 0;case"center":return $/2;case"bottom":return $}let G=j.match(/^(-?\d+(?:\.\d+)?)(px|%|vh|vw)?$/);if(G){let z=parseFloat(G[1]),W=G[2]||"px";return fJ(z,W,$,Q,Z)}return 0}function fJ(J,$,Q,Z,j){switch($){case"px":return J;case"%":return J/100*Q;case"vh":return J/100*Z;case"vw":return J/100*(j??(typeof window<"u"?window.innerWidth:0));default:return J}}class NJ{_id;_markers;_markerContainer;_triggerElement;_scrollerStartOffset=0;_scrollerEndOffset=0;_scroller=window;_startConfig="top top";_endConfig="bottom top";_cachedElStartDocTop=0;_cachedElEndDocTop=0;_cachedElPositionValid=!1;constructor(J){this._id=J}setup(J){if(typeof document>"u")return;this._scroller=J.scroller,this._triggerElement=J.triggerElement||void 0,this._startConfig=J.startConfig,this._endConfig=J.endConfig;let $=J.markerConfig,Q=(typeof $==="object"?$.startColor:null)||"lime",Z=(typeof $==="object"?$.endColor:null)||"red",j=(typeof $==="object"?$.fontSize:null)||"10px",q=this._scroller!==window,G=J.viewportHeight,z=this._startConfig.split(" "),W=h(z[1]||"top",G,G),N=this._endConfig.startsWith("+=")?W:h(this._endConfig.split(" ")[1]||"top",G,G);this._markerContainer=document.createElement("div"),this._markerContainer.setAttribute("data-scrolltrigger-markers",String(this._id)),this._markerContainer.style.cssText="position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 9999;";let _=(I,K,O)=>{let M=document.createElement("div");M.setAttribute("data-marker",I),M.style.cssText=`
11
+ ${W?"flex-shrink: 0;":""}
12
+ `;if(X==="padding")F+=`padding-bottom: ${this._pinDistance}px;`,F+=`margin-bottom: ${H.marginBottom};`;else if(X==="margin"){let L=parseFloat(H.marginBottom)||0,R=G?L-z:L;F+=`margin-bottom: ${R+this._pinDistance}px;`}else F+=`margin-bottom: ${H.marginBottom};`;if(!this._spacer)this._detectFixedBreakingAncestors(J),this._spacer=document.createElement("div"),J.parentNode?.insertBefore(this._spacer,J),this._spacer.appendChild(J),J.style.marginTop="0",J.style.marginBottom="0",J.style.marginLeft="0",J.style.marginRight="0";this._spacer.style.cssText=F,this._spacer.setAttribute("data-scrolltrigger-spacer",String(this._id));let A=this._spacer.getBoundingClientRect();this._fixedLeft=A.left,this._width=A.width}this._currentState="before"}update(J){if(!this._element)return;let $=J<this._pinStart?"before":J<this._pinEnd?"pinned":"after";if(this._useFixedPin){if($!==this._currentState)this._updateFixed($),this._currentState=$}else if($!==this._currentState||$==="pinned")this._updateTransform($,J),this._currentState=$}cleanup(){if(this._element&&h._registry.get(this._element)===this)h._registry.delete(this._element),h._users.delete(this._element);if(this._element&&this._originalStyles){let J=this._element;E0(J),J.style.position=this._originalStyles.position,J.style.top=this._originalStyles.top,J.style.left=this._originalStyles.left,J.style.width=this._originalStyles.width,J.style.marginTop=this._originalStyles.marginTop,J.style.marginBottom=this._originalStyles.marginBottom,J.style.marginLeft=this._originalStyles.marginLeft,J.style.marginRight=this._originalStyles.marginRight,J.style.zIndex=this._originalStyles.zIndex,J.style.transform="",hJ(J)}if(this._isBodyPin){if(typeof document<"u")document.documentElement.style.height=this._originalHtmlHeight,document.documentElement.style.overflow=this._originalHtmlOverflow}else if(this._spacer?.parentNode&&this._element)this._spacer.parentNode.insertBefore(this._element,this._spacer),this._spacer.parentNode.removeChild(this._spacer);this._restoreFixedBreakingAncestors(),this._fixedBreakingAncestors=[],this._element=null,this._originalStyles=null,this._spacer=null,this._currentState="before",this._pinSpacing=void 0,this._isBodyPin=!1,this._originalHtmlHeight="",this._originalHtmlOverflow=""}getElement(){return this._element}getPinDistance(){return this._pinDistance}getState(){return this._currentState}getLayoutRect(){if(this._spacer?.parentNode){let J=this._spacer.getBoundingClientRect();return{top:J.top,left:J.left,width:J.width,height:this._elementHeight,bottom:J.top+this._elementHeight,right:J.left+J.width}}return null}isBodyPin(){return this._isBodyPin}suspendHtmlHeight(){if(!this._isBodyPin)return null;let J=document.documentElement.style.height;return document.documentElement.style.height=this._originalHtmlHeight,()=>{document.documentElement.style.height=J}}isFixedPin(){return this._useFixedPin}_detectFixedBreakingAncestors(J){this._fixedBreakingAncestors=[];let $=J.parentElement;while($&&$!==document.documentElement){let Q=window.getComputedStyle($),Z=[];if(Q.filter&&Q.filter!=="none")Z.push({property:"filter",originalValue:""});if(Q.transform&&Q.transform!=="none")Z.push({property:"transform",originalValue:""});if(Q.perspective&&Q.perspective!=="none")Z.push({property:"perspective",originalValue:""});if(Q.willChange&&Q.willChange!=="auto"){if(Q.willChange.split(",").map((q)=>q.trim()).some((q)=>q==="transform"||q==="filter"||q==="perspective"))Z.push({property:"willChange",originalValue:""})}if(Q.contain&&Q.contain!=="none"){if(["paint","layout","strict","content"].some((q)=>Q.contain.includes(q)))Z.push({property:"contain",originalValue:""})}if(Q.backdropFilter&&Q.backdropFilter!=="none")Z.push({property:"backdropFilter",originalValue:""});if(Q.overflow==="clip"||Q.overflowX==="clip"||Q.overflowY==="clip"){if(Q.overflowY==="clip")Z.push({property:"overflowY",originalValue:""});if(Q.overflowX==="clip")Z.push({property:"overflowX",originalValue:""})}if(Z.length>0)this._fixedBreakingAncestors.push({element:$,overrides:Z});$=$.parentElement}}_overrideFixedBreakingAncestors(){for(let{element:J,overrides:$}of this._fixedBreakingAncestors)for(let Q of $)switch(Q.originalValue=J.style[Q.property]||"",Q.property){case"filter":case"backdropFilter":case"transform":case"perspective":J.style[Q.property]="none";break;case"willChange":J.style.willChange="auto";break;case"contain":J.style.contain="none";break;case"overflowY":J.style.overflowY="visible";break;case"overflowX":J.style.overflowX="hidden";break}}_restoreFixedBreakingAncestors(){for(let{element:J,overrides:$}of this._fixedBreakingAncestors)for(let{property:Q,originalValue:Z}of $)J.style[Q]=Z}_resolvePinSpacing(){if(this._pinSpacing===!1)return!1;if(this._pinSpacing==="margin")return"margin";if(this._pinSpacing===void 0||this._pinSpacing===!0){if(this._isBodyPin)return!1}return"padding"}_updateFixed(J){let $=this._element;if(J==="before"){if($.style.position=this._originalStyles?.position||"",$.style.top=this._originalStyles?.top||"",$.style.left=this._originalStyles?.left||"",$.style.width=this._originalStyles?.width||"",this._isBodyPin)$.style.marginTop=this._originalStyles?.marginTop||"";else $.style.marginTop="0",$.style.marginLeft="0";$.style.zIndex=this._originalStyles?.zIndex||"",E0($),$.style.transform=w($),this._restoreFixedBreakingAncestors()}else if(J==="pinned"){if(this._overrideFixedBreakingAncestors(),$.style.position="fixed",$.style.top=`${this._fixedTop}px`,$.style.left=`${this._fixedLeft}px`,$.style.width=`${this._width}px`,this._isBodyPin)$.style.marginTop=this._originalStyles?.marginTop||"";else $.style.marginTop="0",$.style.marginLeft="0";if($.style.zIndex="100",E0($),$.style.transform=w($),this._isBodyPin)c0($,["position","top","left","width","zIndex","transform","marginTop"]);else c0($,["position","top","left","width","marginTop","marginLeft","zIndex","transform"])}else{if($.style.position=this._originalStyles?.position||"",$.style.top=this._originalStyles?.top||"",$.style.left=this._originalStyles?.left||"",$.style.width=this._originalStyles?.width||"",this._isBodyPin)E0($),$.style.transform=w($),$.style.marginTop=`${this._pinDistance}px`;else $.style.marginTop="0",$.style.marginLeft="0",e0($,0,this._pinDistance,0),$.style.transform=w($);$.style.zIndex=this._originalStyles?.zIndex||"",this._restoreFixedBreakingAncestors()}}_updateTransform(J,$){let Q=this._element;if(J==="before")Q.style.zIndex=this._originalStyles?.zIndex||"",E0(Q),Q.style.transform=w(Q);else if(J==="pinned"){let Z=Math.round($-this._pinStart);Q.style.zIndex="100",e0(Q,0,Z,0),Q.style.transform=w(Q),c0(Q,["transform","zIndex"])}else Q.style.zIndex=this._originalStyles?.zIndex||"",e0(Q,0,this._pinDistance,0),Q.style.transform=w(Q),c0(Q,["transform","zIndex"])}}function d(J,$,Q,Z){if(!J)return 0;let j=J.trim().toLowerCase(),q=j.match(/^(top|center|bottom)([+-])(-?\d+(?:\.\d+)?)(px|%|vh|vw)?$/);if(q){let G=q[1],Y=q[2]==="-"?-1:1,N=parseFloat(q[3]),H=q[4]||"px",X=0;switch(G){case"top":X=0;break;case"center":X=$/2;break;case"bottom":X=$;break}let K=_6(N,H,$,Q,Z);return X+Y*K}switch(j){case"top":return 0;case"center":return $/2;case"bottom":return $}let z=j.match(/^(-?\d+(?:\.\d+)?)(px|%|vh|vw)?$/);if(z){let G=parseFloat(z[1]),Y=z[2]||"px";return _6(G,Y,$,Q,Z)}return 0}function _6(J,$,Q,Z,j){switch($){case"px":return J;case"%":return J/100*Q;case"vh":return J/100*Z;case"vw":return J/100*(j??(typeof window<"u"?window.innerWidth:0));default:return J}}class fJ{_id;_markers;_markerContainer;_triggerElement;_scrollerStartOffset=0;_scrollerEndOffset=0;_scroller=window;_startConfig="top top";_endConfig="bottom top";_cachedElStartDocTop=0;_cachedElEndDocTop=0;_cachedElPositionValid=!1;constructor(J){this._id=J}setup(J){if(typeof document>"u")return;this._scroller=J.scroller,this._triggerElement=J.triggerElement||void 0,this._startConfig=J.startConfig,this._endConfig=J.endConfig;let $=J.markerConfig,Q=(typeof $==="object"?$.startColor:null)||"lime",Z=(typeof $==="object"?$.endColor:null)||"red",j=(typeof $==="object"?$.fontSize:null)||"10px",q=this._scroller!==window,z=J.viewportHeight,G=this._startConfig.split(" "),Y=d(G[1]||"top",z,z),N=this._endConfig.startsWith("+=")?Y:d(this._endConfig.split(" ")[1]||"top",z,z);this._markerContainer=document.createElement("div"),this._markerContainer.setAttribute("data-scrolltrigger-markers",String(this._id)),this._markerContainer.style.cssText="position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 9999;";let H=(U,W,O)=>{let F=document.createElement("div");F.setAttribute("data-marker",U),F.style.cssText=`
13
13
  position: absolute;
14
14
  ${O}: 0;
15
15
  height: 1px;
16
16
  width: 50px;
17
- background: ${K};
17
+ background: ${W};
18
18
  pointer-events: none;
19
- `;let k=document.createElement("span");return k.textContent=I,k.style.cssText=`
19
+ `;let A=document.createElement("span");return A.textContent=U,A.style.cssText=`
20
20
  position: absolute;
21
21
  ${O}: 0;
22
22
  top: 2px;
23
- background: ${K};
24
- color: ${K==="lime"?"#000":"#fff"};
23
+ background: ${W};
24
+ color: ${W==="lime"?"#000":"#fff"};
25
25
  padding: 1px 3px;
26
26
  font-size: ${j};
27
27
  font-family: monospace;
28
28
  white-space: nowrap;
29
29
  border-radius: 2px;
30
30
  line-height: 1.2;
31
- `,M.appendChild(k),M},Y=_("scroller-start",Q,"right"),X=_("scroller-end",Z,"right"),B=_("start",Q,"left"),H=_("end",Z,"left");if(!this._triggerElement)B.style.display="none",H.style.display="none";if(this._markerContainer.appendChild(Y),this._markerContainer.appendChild(X),this._markerContainer.appendChild(B),this._markerContainer.appendChild(H),this._markers={scrollerStart:Y,scrollerEnd:X,elementStart:B,elementEnd:H},q){let I=this._scroller;if(window.getComputedStyle(I).position==="static")I.style.position="relative";I.appendChild(this._markerContainer)}else document.body.appendChild(this._markerContainer),this._markerContainer.style.position="fixed";this._scrollerStartOffset=W,this._scrollerEndOffset=N,this._cacheElementPositions(G)}_cacheElementPositions(J){if(!this._triggerElement){this._cachedElPositionValid=!1;return}let $=c(this._triggerElement),Q=h(this._startConfig.split(" ")[0]||"top",$.height,J),Z=this._endConfig.startsWith("+=")?Q:h(this._endConfig.split(" ")[0]||"bottom",$.height,J);if(this._scroller!==window){let q=this._scroller.getBoundingClientRect(),G=this._scroller.scrollTop,z=$.top-q.top+G;this._cachedElStartDocTop=z+Q,this._cachedElEndDocTop=z+Z}else{let q=window.scrollY||window.pageYOffset||0,G=$.top+q;this._cachedElStartDocTop=G+Q,this._cachedElEndDocTop=G+Z}this._cachedElPositionValid=!0}update(J,$,Q){if(!this._markers||!this._markerContainer)return;let Z=this._triggerElement;if(this._triggerElement=$||void 0,this._triggerElement!==Z)this._cacheElementPositions(Q);let j=this._scroller!==window;if(j)this._markers.scrollerStart.style.top=`${J+this._scrollerStartOffset}px`,this._markers.scrollerEnd.style.top=`${J+this._scrollerEndOffset}px`;else this._markers.scrollerStart.style.top=`${this._scrollerStartOffset}px`,this._markers.scrollerEnd.style.top=`${this._scrollerEndOffset}px`;if(this._triggerElement&&this._cachedElPositionValid)if(this._markers.elementStart.style.display="",this._markers.elementEnd.style.display="",j)this._markers.elementStart.style.top=`${this._cachedElStartDocTop}px`,this._markers.elementEnd.style.top=`${this._cachedElEndDocTop}px`;else this._markers.elementStart.style.top=`${this._cachedElStartDocTop-J}px`,this._markers.elementEnd.style.top=`${this._cachedElEndDocTop-J}px`;else this._markers.elementStart.style.display="none",this._markers.elementEnd.style.display="none"}recachePositions(J){this._cacheElementPositions(J)}cleanup(){if(this._markerContainer&&this._markerContainer.parentNode)this._markerContainer.parentNode.removeChild(this._markerContainer);this._markerContainer=void 0,this._markers=void 0,this._triggerElement=void 0}}class a extends d{static _nextId=0;_id;static _SCRUB_TICKER_PRIORITY=1;static _activeInstances=new Set;static _loadListenerAdded=!1;_scrollListener;_scrubTickListener=null;_currentProgress=0;_targetProgress=0;_scrubLag=0;_scroller;_triggerStart=0;_triggerEnd=0;_pinManager=null;_markerManager=null;_triggerState="before";_toggleActions=["play","none","none","none"];_initializing=!1;constructor(J,$){super(J,$);this._id=a._nextId++,this._scrubLag=typeof $.scrub==="number"?$.scrub:0}static _ensureLoadListener(){if(a._loadListenerAdded||typeof window>"u")return;if(a._loadListenerAdded=!0,document.readyState==="complete")return;window.addEventListener("load",()=>{setTimeout(()=>{for(let J of a._activeInstances)J.refresh()},100)},{once:!0})}_resolveScroller(){if(this._config.scroller)if(typeof this._config.scroller==="string"){if(typeof document>"u"){this._scroller=window;return}try{let J=document.querySelector(this._config.scroller);this._scroller=J??window}catch(J){console.warn(`[Motion] Invalid scroller selector "${this._config.scroller}":`,J),this._scroller=window}}else this._scroller=this._config.scroller;else this._scroller=window}_resolvePinElement(){if(!this._config.pin||typeof document>"u")return null;let J=null;if(typeof this._config.pin==="string")J=document.querySelector(this._config.pin);else if(this._config.pin===!0)J=this._getFirstAnimatedElement();return J}_defaultStart(){return this._config.start||(this._config.pin?"top top":"top bottom")}_defaultEnd(){return this._config.end||"bottom top"}_getFirstAnimatedElement(){let J=this._timeline.getFirstChildBuilder();if(J){let Q=J.hasSplit()?J.getOriginalTargets():J.getTargets();for(let Z of Q)if(Z instanceof HTMLElement)return Z}let $=this._timeline.getFirstChildAnimation();if($){let Q=$.getTargets();if(Q.length>0&&Q[0]instanceof HTMLElement)return Q[0]}return null}_resolveTriggerElement(){if(this._config.target instanceof HTMLElement)return this._config.target;if(typeof this._config.target==="string"&&typeof document<"u"){let J=document.querySelector(this._config.target);if(J instanceof HTMLElement)return J}return this._getFirstAnimatedElement()}_calculateTriggerPositions(J){let $=J||this._resolveTriggerElement(),Q=this._getViewportHeight(),Z=this._getScrollTop();if(!$){this._triggerStart=0,this._triggerEnd=this._getScrollHeight();return}let j=this._pinManager?.getLayoutRect()??c($),q;if(this._scroller instanceof Element){let B=this._scroller.getBoundingClientRect();q=j.top-B.top+Z}else q=j.top+Z;let z=this._defaultStart().split(" "),W=z[0]||"top",N=z[1]||"top",_=h(W,j.height,Q),Y=h(N,Q,Q);this._triggerStart=q+_-Y;let X=this._defaultEnd();if(X.startsWith("+=")){let B=h(X.slice(2),Q,Q);this._triggerEnd=this._triggerStart+B}else{let B=X.split(" "),H=B[0]||"bottom",I=B[1]||"top",K=h(H,j.height,Q),O=h(I,Q,Q);this._triggerEnd=q+K-O}if(this._triggerEnd<=this._triggerStart)this._triggerEnd=this._triggerStart+Math.max(Q,100)}_onEnable(){this._resolveScroller();let J=this._resolvePinElement();this._calculateTriggerPositions(J),a._activeInstances.add(this),a._ensureLoadListener();let Q=(this._config.toggleActions||"play none none none").trim().split(/\s+/);if(this._toggleActions=[Q[0],Q[1],Q[2],Q[3]],J){let j=this._defaultStart().split(" "),q=this._getViewportHeight(),G=h(j[0]||"top",J.getBoundingClientRect().height,q),W=h(j[1]||"top",q,q)-G;this._pinManager=w.getOrCreate(this._id,J),this._pinManager.setup(J,this._triggerStart,this._triggerEnd,W,this._scroller===window,this._config.pinSpacing)}if(this._config.markers&&typeof document<"u"){let Z=this._pinManager?.getElement()||this._resolveTriggerElement();this._markerManager=new NJ(this._id),this._markerManager.setup({scroller:this._scroller,triggerElement:Z,startConfig:this._defaultStart(),endConfig:this._defaultEnd(),markerConfig:this._config.markers,viewportHeight:this._getViewportHeight()})}if(this._scrollListener=()=>this._onScroll(),this._scroller){if(this._scroller.addEventListener("scroll",this._scrollListener,{passive:!0}),this._initializing=!0,this._onScroll(),this._initializing=!1,this._config.scrub===!1||this._config.scrub===void 0){if(this._triggerState==="active")S(this._toggleActions[0],this._timeline);else if(this._triggerState==="after")this._timeline.progress(1),this._timeline.pause()}}}_onDisable(){if(this._scrollListener&&this._scroller)this._scroller.removeEventListener("scroll",this._scrollListener);if(this._markerManager?.cleanup(),this._markerManager=null,this._pinManager){let J=this._pinManager.getElement();if(J)w.release(this._id,J);else this._pinManager.cleanup();this._pinManager=null}this._stopSmoothScrollLoop(),a._activeInstances.delete(this)}refresh(){if(!this._enabled)return;let J=this._pinManager?.getElement()||null,$=this._pinManager?.suspendHtmlHeight?.()??null;if(this._calculateTriggerPositions(J),$?.(),this._pinManager&&J){let Z=this._defaultStart().split(" "),j=this._getViewportHeight(),q=this._pinManager.getLayoutRect()?.height??J.getBoundingClientRect().height,G=h(Z[0]||"top",q,j),W=h(Z[1]||"top",j,j)-G;this._pinManager.setup(J,this._triggerStart,this._triggerEnd,W,this._scroller===window,this._config.pinSpacing)}if(this._markerManager)this._markerManager.recachePositions(this._getViewportHeight());this._onScroll()}_getViewportHeight(){if(this._scroller===window)return typeof window<"u"?window.innerHeight:0;else if(this._scroller instanceof Element)return this._scroller.clientHeight;return 0}_getScrollTop(){if(this._scroller===window)return typeof window<"u"?window.scrollY||window.pageYOffset:0;else if(this._scroller instanceof Element)return this._scroller.scrollTop;return 0}_getScrollHeight(){if(this._scroller===window){if(typeof document<"u"&&document.documentElement)return document.documentElement.scrollHeight-window.innerHeight;return 0}else if(this._scroller instanceof Element)return this._scroller.scrollHeight-this._scroller.clientHeight;return 0}_onScroll(){if(!this._enabled)return;let J=this._getScrollTop(),$=this._triggerEnd-this._triggerStart,Q=$>0?(J-this._triggerStart)/$:0;if(Q=Math.max(0,Math.min(1,Q)),Q=this._applySnap(Q),this._targetProgress=Q,this._pinManager?.update(J),this._markerManager){let Z=this._pinManager?.getElement()||this._resolveTriggerElement();this._markerManager.update(J,Z,this._getViewportHeight())}if(this._config.scrub!==!1&&this._config.scrub!==void 0)if(this._scrubLag===0)this._currentProgress=this._targetProgress,QJ(()=>this._timeline.progress(this._currentProgress));else this._startSmoothScrollLoop();else{let Z;if(Q<=0)Z="before";else if(Q>=1)Z="after";else Z="active";if(Z!==this._triggerState){let j=this._triggerState;if(this._triggerState=Z,this._initializing)return;QJ(()=>{if(Z==="active"&&j==="before")S(this._toggleActions[0],this._timeline);else if(Z==="after"&&j==="active")S(this._toggleActions[1],this._timeline);else if(Z==="active"&&j==="after")S(this._toggleActions[2],this._timeline);else if(Z==="before"&&j==="active")S(this._toggleActions[3],this._timeline);else if(Z==="after"&&j==="before")S(this._toggleActions[0],this._timeline),this._timeline.progress(1),S(this._toggleActions[1],this._timeline);else if(Z==="before"&&j==="after")S(this._toggleActions[2],this._timeline),this._timeline.progress(0),S(this._toggleActions[3],this._timeline)})}}}_applySnap(J){let $=this._config.snap;if($==null)return J;if(typeof $==="function")return $(J);if(Array.isArray($)){let Q=$[0]??J,Z=Math.abs(J-Q);for(let j=1;j<$.length;j++){let q=Math.abs(J-$[j]);if(q<Z)Z=q,Q=$[j]}return Q}if(typeof $==="number"&&$>0)return Math.round(J/$)*$;return J}_startSmoothScrollLoop(){if(this._scrubTickListener)return;this._scrubTickListener=(J,$)=>{if(!this._enabled){this._stopSmoothScrollLoop();return}let Q=this._targetProgress-this._currentProgress,Z=1-Math.exp(-J*3/this._scrubLag);if(this._currentProgress+=Q*Z,Math.abs(this._targetProgress-this._currentProgress)<0.0001){this._currentProgress=this._targetProgress,this._timeline.progress(this._currentProgress),this._stopSmoothScrollLoop();return}this._timeline.progress(this._currentProgress)},V.getInstance().add(this._scrubTickListener,a._SCRUB_TICKER_PRIORITY)}_stopSmoothScrollLoop(){if(this._scrubTickListener)V.getInstance().remove(this._scrubTickListener),this._scrubTickListener=null}}A.registerTrigger("scroll",a);class uJ{_registrations=[];_domContentLoaded=!1;_windowLoaded=!1;_initialized=!1;constructor(){this._initialize()}_initialize(){if(this._initialized)return;if(this._initialized=!0,typeof document<"u"){if(document.addEventListener("DOMContentLoaded",()=>{this._domContentLoaded=!0,this._triggerDuring()}),typeof window<"u")window.addEventListener("load",()=>{this._windowLoaded=!0,this._triggerAfter()});if(document.readyState==="interactive"||document.readyState==="complete")this._domContentLoaded=!0;if(document.readyState==="complete")this._windowLoaded=!0}}register(J,$){let Q=$.timing||"during",Z=$.paused===!0;if(this._registrations.push({timeline:J,timing:Q,paused:Z}),Z)return;if(Q==="before")J.play();else if(Q==="during"&&this._domContentLoaded)J.play();else if(Q==="after"&&this._windowLoaded)J.play()}unregister(J){this._registrations=this._registrations.filter(($)=>$.timeline!==J)}clear(){this._registrations=[]}_triggerDuring(){this._registrations.filter((J)=>J.timing==="during"&&!J.paused).forEach((J)=>J.timeline.play())}_triggerAfter(){this._registrations.filter((J)=>J.timing==="after"&&!J.paused).forEach((J)=>J.timeline.play())}_reset(){this._registrations=[],this._domContentLoaded=!1,this._windowLoaded=!1,this._initialized=!1,this._initialize()}}A.registerPageLoadTrigger(uJ);class dJ extends d{_targets=[];_listeners=new Map;_frozenRects=new Map;_state={x:0.5,y:0.5,distance:0.5,isInside:!1};_targetState={targetX:0.5,targetY:0.5,targetDistance:0.5};_tickerCallback;_defaultStartProgress=0.5;_defaultLeaveProgress=0.5;constructor(J,$){super(J,$);this._config={type:"distance",startProgress:this._defaultStartProgress,leaveProgress:this._defaultLeaveProgress,...$};let Q=this._config.startProgress??this._defaultStartProgress;this._state.x=Q,this._state.y=Q,this._state.distance=Q,this._targetState.targetX=Q,this._targetState.targetY=Q,this._targetState.targetDistance=Q}_onEnable(){if(this._targets=this._resolveElements(this._config.target),this._targets.length===0)this._addViewportListeners();else this._addTargetListeners();if(this._config.smooth!==void 0&&this._config.smooth>0)this._startSmoothingTicker();this._updateTimelineProgress()}_onDisable(){if(this._tickerCallback)V.getInstance().remove(this._tickerCallback),this._tickerCallback=void 0;this._frozenRects.clear(),this._cleanupListenerMap(this._listeners)}_addViewportListeners(){if(typeof window>"u")return;let J=new Map,$=(Q)=>{let Z=Q;this._handleViewportMouseMove(Z.clientX,Z.clientY)};window.addEventListener("mousemove",$),J.set("mousemove",$),this._state.isInside=!0,this._listeners.set(window,J)}refresh(){for(let J of this._targets)this._frozenRects.set(J,c(J))}_addTargetListeners(){this._targets.forEach((J)=>{this._frozenRects.set(J,c(J));let $=new Map,Q=(q)=>{let G=q;this._handleTargetMouseMove(J,G.clientX,G.clientY)};J.addEventListener("mousemove",Q),$.set("mousemove",Q);let Z=()=>{this._state.isInside=!0};J.addEventListener("mouseenter",Z),$.set("mouseenter",Z);let j=()=>{this._state.isInside=!1,this._handleMouseLeave()};J.addEventListener("mouseleave",j),$.set("mouseleave",j),this._listeners.set(J,$)})}_handleViewportMouseMove(J,$){if(typeof window>"u")return;let{innerWidth:Q,innerHeight:Z}=window,j=Q/2,q=Z/2;if(this._config.type==="axis")this._targetState.targetX=J/Q,this._targetState.targetY=$/Z;else{let G=J-j,z=$-q,W=Math.sqrt(G*G+z*z),N=Math.sqrt(j*j+q*q);this._targetState.targetDistance=1-Math.min(W/N,1)}this._applyProgress()}_handleTargetMouseMove(J,$,Q){let Z=this._frozenRects.get(J)??J.getBoundingClientRect(),j=Z.left+Z.width/2,q=Z.top+Z.height/2;if(this._config.type==="axis"){let G=$-Z.left,z=Q-Z.top;this._targetState.targetX=Math.max(0,Math.min(1,G/Z.width)),this._targetState.targetY=Math.max(0,Math.min(1,z/Z.height))}else{let G=$-j,z=Q-q,W=Math.sqrt(G*G+z*z),N=Math.sqrt(Math.pow(Z.width/2,2)+Math.pow(Z.height/2,2));this._targetState.targetDistance=1-Math.min(W/N,1)}this._applyProgress()}_handleMouseLeave(){let J=this._config.leaveProgress??this._defaultLeaveProgress;if(this._targetState.targetX=J,this._targetState.targetY=J,this._targetState.targetDistance=J,!this._config.smooth)this._state.x=J,this._state.y=J,this._state.distance=J,this._updateTimelineProgress()}_applyProgress(){if(this._config.smooth)return;this._state.x=this._targetState.targetX,this._state.y=this._targetState.targetY,this._state.distance=this._targetState.targetDistance,this._updateTimelineProgress()}_startSmoothingTicker(){let J=Math.max(0,Math.min(1,this._config.smooth??0.1));this._tickerCallback=($)=>{let Q=this._lerp(this._state.x,this._targetState.targetX,J,$),Z=this._lerp(this._state.y,this._targetState.targetY,J,$),j=this._lerp(this._state.distance,this._targetState.targetDistance,J,$),q=0.0001,G=Math.abs(Q-this._state.x)<0.0001&&Math.abs(Q-this._targetState.targetX)<0.0001,z=Math.abs(Z-this._state.y)<0.0001&&Math.abs(Z-this._targetState.targetY)<0.0001,W=Math.abs(j-this._state.distance)<0.0001&&Math.abs(j-this._targetState.targetDistance)<0.0001;if(this._state.x=Q,this._state.y=Z,this._state.distance=j,!G||!z||!W)this._updateTimelineProgress()},V.getInstance().add(this._tickerCallback)}_lerp(J,$,Q,Z){let j=$-J;if(Math.abs(j)<0.0001)return $;let q=0.5*Math.pow(1-Q,2)+0.005,G=1-Math.pow(1-q,Z*60);return J+j*G}_updateTimelineProgress(){if(this._config.type==="axis")this._timeline.setAxisProgress("x",this._state.x),this._timeline.setAxisProgress("y",this._state.y);else this._timeline.progress(this._state.distance)}}A.registerTrigger("mouseMove",dJ);class F0 extends d{_target=window;_tolerance;_dragMinimum;_dragMinimumSquared;_wheelSpeed;_scrollSpeed;_stopDelay;_preventDefault;_lockAxis;_animationStep;_smooth;_startX=0;_startY=0;_deltaX=0;_deltaY=0;_lockedAxis=null;_isPressed=!1;_isDragging=!1;_lastDirectionX=null;_lastDirectionY=null;_lastScrollX=0;_lastScrollY=0;_stopTimeout=null;_isMoving=!1;_lastActivityTime=0;_pendingActions=new Map;_rafScheduled=!1;_rafId=null;_wheelAccumulatorX=0;_wheelAccumulatorY=0;_wheelRafId=null;_scrollRafId=null;_lastPointerX=0;_lastPointerY=0;_activatedDirections=new Set;_targetProgress=0;_currentProgress=0;_interpolationRafId=null;_siblings=null;_index=0;static _sequenceStates=new WeakMap;_boundHandlers={};_frozenHoverRect=null;_gestureHoverActive=!1;_boundHoverMoveHandler=null;constructor(J,$){super(J,$);this._tolerance=$.tolerance??1,this._dragMinimum=$.dragMinimum??10,this._dragMinimumSquared=this._dragMinimum*this._dragMinimum,this._wheelSpeed=$.wheelSpeed??1,this._scrollSpeed=$.scrollSpeed??1,this._stopDelay=$.stopDelay??150,this._preventDefault=$.preventDefault??!1,this._lockAxis=$.lockAxis??!1,this._animationStep=$.animationStep??0.1,this._smooth=Math.max(0,Math.min(1,$.smooth??0));let Q=$;if(Q._siblings&&Q._index!==void 0){if(this._siblings=Q._siblings,this._index=Q._index,!F0._sequenceStates.has(this._siblings))F0._sequenceStates.set(this._siblings,{lastIndex:0})}}_onEnable(){let J=this._resolveElement(this._config.target,window);this._target=J??window;let $=this._config.types;if($.includes("pointer"))this._addPointerListeners();if($.includes("touch"))this._addTouchListeners();if($.includes("wheel"))this._addWheelListener();if($.includes("scroll"))this._addScrollListener();if(this._config.events.Hover||this._config.events.HoverEnd)this._addHoverListeners()}_onDisable(){if(this._stopTimeout)clearTimeout(this._stopTimeout),this._stopTimeout=null;if(this._rafId!==null)cancelAnimationFrame(this._rafId),this._rafId=null;if(this._wheelRafId!==null)cancelAnimationFrame(this._wheelRafId),this._wheelRafId=null;if(this._scrollRafId!==null)cancelAnimationFrame(this._scrollRafId),this._scrollRafId=null;if(this._interpolationRafId!==null)cancelAnimationFrame(this._interpolationRafId),this._interpolationRafId=null;this._rafScheduled=!1,this._pendingActions.clear();let J=this._target;if(this._boundHandlers.pointerDown)J.removeEventListener("pointerdown",this._boundHandlers.pointerDown),window.removeEventListener("pointermove",this._boundHandlers.pointerMove),window.removeEventListener("pointerup",this._boundHandlers.pointerUp);if(this._boundHandlers.touchStart)J.removeEventListener("touchstart",this._boundHandlers.touchStart),window.removeEventListener("touchmove",this._boundHandlers.touchMove),window.removeEventListener("touchend",this._boundHandlers.touchEnd);if(this._boundHandlers.wheel)J.removeEventListener("wheel",this._boundHandlers.wheel);if(this._boundHandlers.scroll)(this._target===window?window:this._target).removeEventListener("scroll",this._boundHandlers.scroll);if(this._boundHoverMoveHandler)window.removeEventListener("mousemove",this._boundHoverMoveHandler),this._boundHoverMoveHandler=null;this._frozenHoverRect=null,this._gestureHoverActive=!1,this._boundHandlers={}}_addPointerListeners(){this._boundHandlers.pointerDown=this._handlePointerDown.bind(this),this._boundHandlers.pointerMove=this._handlePointerMove.bind(this),this._boundHandlers.pointerUp=this._handlePointerUp.bind(this);let J={passive:!this._preventDefault};this._target.addEventListener("pointerdown",this._boundHandlers.pointerDown,J),window.addEventListener("pointermove",this._boundHandlers.pointerMove,J),window.addEventListener("pointerup",this._boundHandlers.pointerUp)}_handlePointerDown(J){if(J.pointerType==="touch"&&this._config.types.includes("touch"))return;if(this._preventDefault)J.preventDefault();this._handleInputStart(J.clientX,J.clientY)}_handlePointerMove(J){if(J.pointerType==="touch"&&this._config.types.includes("touch"))return;if(this._handleInputMove(J.clientX,J.clientY)){if(this._preventDefault)J.preventDefault()}}_handlePointerUp(J){if(J.pointerType==="touch"&&this._config.types.includes("touch"))return;this._handleInputEnd()}_addTouchListeners(){this._boundHandlers.touchStart=this._handleTouchStart.bind(this),this._boundHandlers.touchMove=this._handleTouchMove.bind(this),this._boundHandlers.touchEnd=this._handleTouchEnd.bind(this);let J={passive:!this._preventDefault};this._target.addEventListener("touchstart",this._boundHandlers.touchStart,J),window.addEventListener("touchmove",this._boundHandlers.touchMove,J),window.addEventListener("touchend",this._boundHandlers.touchEnd)}_handleTouchStart(J){if(this._preventDefault)J.preventDefault();let $=J.touches[0];if(!$)return;this._handleInputStart($.clientX,$.clientY)}_handleTouchMove(J){let $=J.touches[0];if(!$)return;if(this._handleInputMove($.clientX,$.clientY)){if(this._preventDefault)J.preventDefault()}}_handleTouchEnd(J){this._handleInputEnd()}_handleInputStart(J,$){this._fireEvent("PressInit"),this._startX=J,this._startY=$,this._lastPointerX=J,this._lastPointerY=$,this._deltaX=0,this._deltaY=0,this._isPressed=!0,this._isDragging=!1,this._lockedAxis=null,this._fireEvent("Press")}_handleInputMove(J,$){if(!this._isPressed)return!1;let Q=J-this._lastPointerX,Z=$-this._lastPointerY;if(Math.abs(Q)<1&&Math.abs(Z)<1)return!1;this._lastPointerX=J,this._lastPointerY=$;let j=J-this._startX,q=$-this._startY;if(this._updateDeltas(j,q),this._checkDragStart(),this._checkDirectionAndFire(!1),this._checkToggle(j,q),this._scheduleStopCheck(),this._isDragging)this._fireEvent("Drag");return!0}_handleInputEnd(){if(!this._isPressed)return;if(this._isDragging)this._fireEvent("DragEnd");this._fireEvent("Release"),this._fireCompleteCallbacks(),this._fireEvent("Stop"),this._resetGestureState()}_addWheelListener(){this._boundHandlers.wheel=this._handleWheel.bind(this),this._target.addEventListener("wheel",this._boundHandlers.wheel,{passive:!this._preventDefault})}_handleWheel(J){if(this._preventDefault)J.preventDefault();if(this._wheelAccumulatorX+=J.deltaX*this._wheelSpeed,this._wheelAccumulatorY+=J.deltaY*this._wheelSpeed,this._wheelRafId!==null)return;this._wheelRafId=requestAnimationFrame(()=>{this._wheelRafId=null,this._deltaX=this._wheelAccumulatorX,this._deltaY=this._wheelAccumulatorY,this._wheelAccumulatorX=0,this._wheelAccumulatorY=0,this._checkDirectionAndFire(!0),this._checkToggle(this._deltaX,this._deltaY),this._scheduleStopCheck(),this._deltaX=0,this._deltaY=0})}_addScrollListener(){if(this._boundHandlers.scroll=this._handleScroll.bind(this),this._target===window)this._lastScrollX=window.scrollX,this._lastScrollY=window.scrollY;else{let J=this._target;this._lastScrollX=J.scrollLeft,this._lastScrollY=J.scrollTop}this._target.addEventListener("scroll",this._boundHandlers.scroll,{passive:!0})}_handleScroll(){if(this._scrollRafId!==null)return;this._scrollRafId=requestAnimationFrame(()=>{this._scrollRafId=null,this._processScroll()})}_processScroll(){let J,$;if(this._target===window)J=window.scrollX,$=window.scrollY;else{let j=this._target;J=j.scrollLeft,$=j.scrollTop}let Q=(J-this._lastScrollX)*this._scrollSpeed,Z=($-this._lastScrollY)*this._scrollSpeed;this._lastScrollX=J,this._lastScrollY=$,this._deltaX=Q,this._deltaY=Z,this._checkDirectionAndFire(!0),this._checkToggle(Q,Z),this._scheduleStopCheck(),this._deltaX=0,this._deltaY=0}_addHoverListeners(){if(this._target===window)return;let J=this._target;this._frozenHoverRect=c(J),this._boundHoverMoveHandler=($)=>{if(!this._frozenHoverRect)return;let Q=this._frozenHoverRect,Z=$.clientX>=Q.left&&$.clientX<=Q.right&&$.clientY>=Q.top&&$.clientY<=Q.bottom;if(Z&&!this._gestureHoverActive)this._gestureHoverActive=!0,this._fireEvent("Hover");else if(!Z&&this._gestureHoverActive)this._gestureHoverActive=!1,this._fireEvent("HoverEnd")},window.addEventListener("mousemove",this._boundHoverMoveHandler)}refresh(){if(this._target===window||!this._frozenHoverRect)return;this._frozenHoverRect=c(this._target)}_updateDeltas(J,$){if(this._lockAxis&&this._lockedAxis)if(this._lockedAxis==="x")this._deltaX=J,this._deltaY=0;else this._deltaX=0,this._deltaY=$;else this._deltaX=J,this._deltaY=$;if(this._lockAxis&&!this._lockedAxis){let Q=this._tolerance;if(Math.abs(this._deltaX)>Q||Math.abs(this._deltaY)>Q)this._lockedAxis=Math.abs(this._deltaX)>Math.abs(this._deltaY)?"x":"y"}}_checkDirectionAndFire(J){let $=this._tolerance;if(J||!this._lockedAxis||this._lockedAxis==="y"){if(this._deltaY<-$){if(this._fireEvent("Up"),!J)this._activatedDirections.add("Up")}if(this._deltaY>$){if(this._fireEvent("Down"),!J)this._activatedDirections.add("Down")}}if(J||!this._lockedAxis||this._lockedAxis==="x"){if(this._deltaX<-$){if(this._fireEvent("Left"),!J)this._activatedDirections.add("Left")}if(this._deltaX>$){if(this._fireEvent("Right"),!J)this._activatedDirections.add("Right")}}if(Math.abs(this._deltaX)>$||Math.abs(this._deltaY)>$){if(this._fireEvent("Change"),Math.abs(this._deltaX)>$)this._fireEvent("ChangeX");if(Math.abs(this._deltaY)>$)this._fireEvent("ChangeY")}}_checkToggle(J,$){let Q=this._tolerance;if(Math.abs(J)>=Q){let Z=J>0?1:-1;if(this._lastDirectionX!==null&&Z!==this._lastDirectionX)this._fireEvent("ToggleX");this._lastDirectionX=Z}if(Math.abs($)>=Q){let Z=$>0?1:-1;if(this._lastDirectionY!==null&&Z!==this._lastDirectionY)this._fireEvent("ToggleY");this._lastDirectionY=Z}}_checkDragStart(){if(this._isDragging)return;if(this._deltaX*this._deltaX+this._deltaY*this._deltaY>this._dragMinimumSquared)this._isDragging=!0}_scheduleStopCheck(){if(this._isMoving=!0,this._lastActivityTime=performance.now(),this._stopTimeout)return;let J=()=>{let $=performance.now()-this._lastActivityTime;if($>=this._stopDelay){if(this._stopTimeout=null,this._isMoving){if(this._isMoving=!1,this._lastDirectionX=null,this._lastDirectionY=null,!this._isPressed)this._fireEvent("Stop")}}else this._stopTimeout=setTimeout(J,this._stopDelay-$)};this._stopTimeout=setTimeout(J,this._stopDelay)}_fireEvent(J){let $=this._config.events[J];if($)this._pendingActions.set($,J),this._scheduleRAF()}_scheduleRAF(){if(this._rafScheduled)return;this._rafScheduled=!0,this._rafId=requestAnimationFrame(()=>{this._rafScheduled=!1,this._rafId=null;for(let[J,$]of this._pendingActions)this._executeAction(J,$);this._pendingActions.clear()})}_getStepForEvent(J){if(typeof this._animationStep==="number")return this._animationStep;if(J&&this._animationStep[J]!==void 0)return this._animationStep[J];let $=Object.values(this._animationStep);return $.length>0?$[0]:0.1}_executeAction(J,$){switch(J){case"play":case"pause":case"reverse":case"restart":case"reset":case"complete":S(J,this._timeline);break;case"toggle":if(this._timeline.isActive())this._timeline.pause();else this._timeline.play();break;case"kill":this._timeline.kill();break;case"playReverse":{let Q=this._timeline.progress();if(Q>=1)this._timeline.reverse();else if(Q<=0)this._timeline.play();else if(!this._timeline.isActive())if(this._timeline.reversed())this._timeline.play();else this._timeline.reverse();break}case"progressUp":this._interpolateProgress(this._getStepForEvent($));break;case"progressDown":this._interpolateProgress(-this._getStepForEvent($));break;case"playNext":this._playSequenceItem(1);break;case"playPrevious":this._playSequenceItem(-1);break}}_playSequenceItem(J){if(!this._siblings||this._siblings.length===0)return;let $=F0._sequenceStates.get(this._siblings);if(!$)return;let Q=this._siblings.length,Z=$.lastIndex,j=(Z+J+Q)%Q,q=this._siblings[Z];if(q&&q.progress()>0)q.reverse();let G=this._siblings[j];if(G)G.restart();$.lastIndex=j}_interpolateProgress(J){let $=this._timeline.progress();if(Math.abs($-this._currentProgress)>0.01)this._currentProgress=$,this._targetProgress=$;if(this._interpolationRafId===null)this._currentProgress=$,this._targetProgress=$;if(this._targetProgress=Math.max(0,Math.min(1,this._targetProgress+J)),this._smooth===0){this._currentProgress=this._targetProgress,this._timeline.progress(this._currentProgress);return}if(this._interpolationRafId===null)this._startInterpolationLoop()}_startInterpolationLoop(){if(this._interpolationRafId!==null)return;let J=0.08+(1-this._smooth)*0.12,$=()=>{let Q=this._targetProgress-this._currentProgress;if(Math.abs(Q)<0.0001){this._currentProgress=this._targetProgress,this._timeline.progress(this._currentProgress),this._interpolationRafId=null;return}this._currentProgress+=Q*J,this._timeline.progress(this._currentProgress),this._interpolationRafId=requestAnimationFrame($)};this._interpolationRafId=requestAnimationFrame($)}_fireCompleteCallbacks(){if(this._activatedDirections.has("Up"))this._fireEvent("UpComplete");if(this._activatedDirections.has("Down"))this._fireEvent("DownComplete");if(this._activatedDirections.has("Left"))this._fireEvent("LeftComplete");if(this._activatedDirections.has("Right"))this._fireEvent("RightComplete");this._activatedDirections.clear()}_resetGestureState(){this._isPressed=!1,this._isDragging=!1,this._deltaX=0,this._deltaY=0,this._lockedAxis=null,this._lastDirectionX=null,this._lastDirectionY=null,this._activatedDirections.clear()}}A.registerTrigger("gesture",F0);var P0=null;function cJ(J,$,Q,Z){let j=J;if(!j.style)return;let q=N0();if(T($))if(y(J,$,Q,Z),q)V0(J);else j.style.transform=R(J);else{let G=Z?`${Q}${Z}`:`${Q}`;if(q)x0(J,$,G);else try{if(t($))j.style.setProperty($,G);else if($ in j.style)j.style[$]=G;else j.style.setProperty(n($),G)}catch{}}}function pJ(J,$,Q,Z,j,q){let G=J;if(!G.style)return;let z=q===1?`rgb(${Math.round(Q)}, ${Math.round(Z)}, ${Math.round(j)})`:`rgba(${Math.round(Q)}, ${Math.round(Z)}, ${Math.round(j)}, ${q})`;if(N0())x0(J,$,z);else try{if(t($))G.style.setProperty($,z);else if($ in G.style)G.style[$]=z;else G.style.setProperty(n($),z)}catch{}}function mJ(J,$,Q,Z){let j=J;if(!j.style)return;if(P0||(P0=U.filter)){let q=P0.interpolateFilters($,Q,Z),G=P0.filterToString(q);if(N0())x0(J,"filter",G);else j.style.filter=G}}function gJ(J,$,Q){let{pathLUT:Z,alignOffset:j,pathOffset:q,pathRotate:G}=Q;if(!Z||Z.length===0)return;let z=$*(Z.length-1),W=Math.floor(z),N=Math.min(W+1,Z.length-1),_=z-W,Y=Z[W],X=Z[N],B=Y.x+(X.x-Y.x)*_,H=Y.y+(X.y-Y.y)*_,I=(q?.x??0)+B-(j?.x??0),K=(q?.y??0)+H-(j?.y??0);if(y(J,"x",I,"px"),y(J,"y",K,"px"),G){let O=o6(Y.angle,X.angle,_);y(J,"rotate",O,"deg")}if(N0())V0(J);else J.style.transform=R(J)}function o6(J,$,Q){let Z=$-J;if(Z>180)Z-=360;if(Z<-180)Z+=360;return J+Z*Q}var _J=null,s6=100,i6=500,n6=0.5,O0=[],a6=50;function r6(J){for(let $=0;$<O0.length;$++)if(O0[$].length>=J){let Q=O0.splice($,1)[0];return Q.length=J,Q}return Array(J)}function t6(J){if(O0.length<a6)O0.push(J)}class YJ{target=null;property="";startValue=0;endValue=0;change=0;unit="";next=null;valueType="scalar";startColor=null;endColor=null;changeColor=new Float32Array(4);startFilters=null;endFilters=null;startDraw=null;endDraw=null;pathLength=0;pathData=null;motionPathLength=0;startProgress=0;endProgress=0;pathRotate=!1;alignOffset=null;pathOffset=null;pathLUT=null;_isElement=!1;init(J,$,Q,Z,j=""){return this.target=J,this.property=$,this.startValue=Q,this.endValue=Z,this.change=Z-Q,this.unit=j,this.valueType="scalar",this._isElement=J instanceof Element,this}initColor(J,$,Q,Z){return this.target=J,this.property=$,this.valueType="color",this.startColor=Q,this.endColor=Z,this.changeColor[0]=Z[0]-Q[0],this.changeColor[1]=Z[1]-Q[1],this.changeColor[2]=Z[2]-Q[2],this.changeColor[3]=Z[3]-Q[3],this._isElement=J instanceof Element,this}initFilter(J,$,Q,Z){return this.target=J,this.property=$,this.valueType="filter",this.startFilters=Q,this.endFilters=Z,this._isElement=J instanceof Element,this}initDrawSVG(J,$,Q,Z,j){return this.target=J,this.property=$,this.valueType="drawSVG",this.startDraw=Q,this.endDraw=Z,this.pathLength=j,this._isElement=J instanceof Element,this}initPath(J,$,Q,Z,j,q,G,z,W){if(J instanceof Element)v(J,!0);this.target=J,this.property=$,this.valueType="path",this.pathData=Q,this.motionPathLength=Z,this.startProgress=j,this.endProgress=q,this.pathRotate=G,this.alignOffset=z,this.pathOffset=W,this._isElement=J instanceof Element;let N=Math.abs(q-j),_=Z*N,Y=Math.min(i6,Math.max(s6,Math.ceil(_*n6)));this.pathLUT=r6(Y+1);for(let X=0;X<=Y;X++){let B=X/Y,H=j+(q-j)*B;this.pathLUT[X]=ZJ(Q,H,G)}return this}render(J){if(!this.target)return;if(this.valueType==="color"&&this.startColor){let $=this.startColor[0]+this.changeColor[0]*J,Q=this.startColor[1]+this.changeColor[1]*J,Z=this.startColor[2]+this.changeColor[2]*J,j=this.startColor[3]+this.changeColor[3]*J;if(this._isElement)pJ(this.target,this.property,$,Q,Z,j)}else if(this.valueType==="filter"&&this.startFilters&&this.endFilters){if(this._isElement)mJ(this.target,this.startFilters,this.endFilters,J)}else if(this.valueType==="drawSVG"&&this.startDraw&&this.endDraw){if(this._isElement&&this.pathLength>0){let $=this.startDraw.start+(this.endDraw.start-this.startDraw.start)*J,Q=this.startDraw.end+(this.endDraw.end-this.startDraw.end)*J;if(_J||(_J=U.drawSVG))_J.applyDrawSVG(this.target,$,Q,this.pathLength)}}else if(this.valueType==="path"&&this.pathLUT&&this.pathLUT.length>0){if(this._isElement)gJ(this.target,J,{pathLUT:this.pathLUT,alignOffset:this.alignOffset??{x:0,y:0},pathOffset:this.pathOffset??{x:0,y:0},pathRotate:this.pathRotate})}else{let $=this.startValue+this.change*J;if(this._isElement)cJ(this.target,this.property,$,this.unit);else this.target[this.property]=$}}reset(){if(this.target=null,this.property="",this.startValue=0,this.endValue=0,this.change=0,this.unit="",this.next=null,this.valueType="scalar",this.startColor=null,this.endColor=null,this.startFilters=null,this.endFilters=null,this.startDraw=null,this.endDraw=null,this.pathLength=0,this.pathData=null,this.motionPathLength=0,this.startProgress=0,this.endProgress=0,this.pathRotate=!1,this.alignOffset=null,this.pathOffset=null,this.pathLUT)t6(this.pathLUT);this.pathLUT=null,this._isElement=!1}}class A0{pool=[];totalCreated=0;factory;maxSize;constructor(J,$){this.factory=J,this.maxSize=$}acquire(){if(this.pool.length>0)return this.pool.pop();return this.totalCreated++,this.factory()}release(J){if(J.reset(),this.maxSize===void 0||this.pool.length<this.maxSize)this.pool.push(J)}getPoolSize(){return this.pool.length}getTotalCreated(){return this.totalCreated}clear(){this.pool=[]}}var L0=new A0(()=>new YJ,500),J0={acquire:()=>L0.acquire(),release:(J)=>L0.release(J),getPoolSize:()=>L0.getPoolSize(),getTotalCreated:()=>L0.getTotalCreated(),clear:()=>L0.clear()};var lJ={x:0,y:0,z:0,rotate:0,rotateX:0,rotateY:0,rotateZ:0,scale:1,scaleX:1,scaleY:1,scaleZ:1,skewX:0,skewY:0,opacity:1};class f{static _createAnimationCallback=null;static setCreateAnimationCallback(J){f._createAnimationCallback=J}_targets;_originalTargets;_fromVars;_toVars;_setVars;_duration=0.5;_delay=0;_ease="power1.out";_animation=null;_animations=[];_built=!1;_splitType;_mask;_repeat;_repeatDelay;_yoyo;_stagger;_axis;_fitConfig;_onStart;_onUpdate;_onComplete;_onRepeat;_onReverseComplete;_skipInitialFromRender=!1;_plainObjectInitialValues=new Map;_expectedAnimationIds=[];_propsToAnimate=[];constructor(J,$){if(this._targets=D0(J),this._originalTargets=this._targets,$)this._applyAnimationConfig($)}_applyAnimationConfig(J){if(J.from)this._fromVars=J.from;if(J.to)this._toVars=J.to;if(J.set)this._setVars=J.set;if(J.duration!==void 0)if(typeof J.duration!=="number"||!isFinite(J.duration)||J.duration<0)console.warn(`[Motion] Invalid duration: ${J.duration}. Must be a finite number >= 0. Using default.`);else this._duration=J.duration;if(J.delay!==void 0)if(typeof J.delay!=="number"||isNaN(J.delay))console.warn(`[Motion] Invalid delay: ${J.delay}. Must be a number. Using default 0.`);else if(!isFinite(J.delay))console.warn(`[Motion] Invalid delay: ${J.delay}. Infinity is not a valid delay. Using default 0.`);else this._delay=J.delay;if(J.ease)this._ease=J.ease;if(J.split)this._splitType=J.split;if(J.mask)this._mask=J.mask;if(J.stagger!==void 0)this._stagger=J.stagger;if(J.axis)this._axis=J.axis;if(J.fit)this._fitConfig=J.fit;if(J.repeat)if(typeof J.repeat==="number")this._repeat=J.repeat;else this._repeat=J.repeat.times,this._repeatDelay=J.repeat.delay,this._yoyo=J.repeat.yoyo;if(J.onStart)this._onStart=J.onStart;if(J.onUpdate)this._onUpdate=J.onUpdate;if(J.onComplete)this._onComplete=J.onComplete;if(J.onRepeat)this._onRepeat=J.onRepeat;if(J.onReverseComplete)this._onReverseComplete=J.onReverseComplete}_capturePlainObjectValues(J){for(let $ of this._targets){if($ instanceof Element)continue;let Q=$,Z={};for(let j of J)if(j in Q&&typeof Q[j]==="number")Z[j]=Q[j];if(Object.keys(Z).length>0)this._plainObjectInitialValues.set($,Z)}}_restorePlainObjectValues(){for(let[J,$]of this._plainObjectInitialValues){let Q=J;for(let[Z,j]of Object.entries($))Q[Z]=j}}_ensureBuilt(){if(!this._built)this._build()}_isInvalidated(){if(this._animations.length===0)return!1;return this._animations.some((J,$)=>{let Q=J.getId(),Z=this._expectedAnimationIds[$];return Q===0||Q!==Z})}rebuildIfPooled(){if(this._isInvalidated()){this._restorePlainObjectValues();for(let J of this._targets)if(J instanceof Element)v(J),U.styleReset?.clearAnimationStylesForProps?.(J,this._propsToAnimate);this._resetBuildState(),this._ensureBuilt()}}_build(){if(this._built)return;if(this._targets.length===0)return;if(!this._fromVars&&!this._toVars&&!this._setVars&&!this._fitConfig&&this._duration<=0)return;if(this._fitConfig){if(!U.fit){console.warn("[Motion] FitResolver not loaded. Did you import the SDK?");return}if(this._built=!0,!f._createAnimationCallback)throw Error("AnimationBuilder: Engine not initialized. Call Engine.init() first.");let q={};if(this._repeat!==void 0)q.repeat=this._repeat;if(this._repeatDelay!==void 0)q.repeatDelay=this._repeatDelay;if(this._yoyo)q.yoyo=this._yoyo;if(this._onStart)q.onStart=this._onStart;if(this._onUpdate)q.onUpdate=this._onUpdate;if(this._onComplete)q.onComplete=this._onComplete;if(this._onRepeat)q.onRepeat=this._onRepeat;if(this._onReverseComplete)q.onReverseComplete=this._onReverseComplete;if(this._stagger!==void 0)q.stagger=this._stagger;let G=[];for(let W of this._targets){if(!(W instanceof Element))continue;let N=f._createAnimationCallback([W],{},this._duration,this._delay,this._ease,!1,void 0,q);if(Array.isArray(N))G.push(...N);else G.push(N)}let z=this._fitConfig;for(let W of G)for(let N of W.getTargets())if(N instanceof Element)U.fit.registerPendingSetup(W,N,z,J0);this._animation=G[0]??null,this._animations=G,this._expectedAnimationIds=G.map((W)=>W.getId());return}if(this._built=!0,this._setVars&&Object.keys(this._setVars).length>0&&this._toVars&&!this._fromVars)this._fromVars={...this._setVars},this._setVars=void 0;let J={},$=!1,Q;if(this._fromVars&&this._toVars){J={...this._toVars},Q={...this._fromVars},$=!0;for(let q of Object.keys(Q))if(!(q in J))if(q in lJ)J[q]=lJ[q];else if(q0(q))J[q]="";else if(r(q))J[q]="";else{let G=Q[q];if(G===void 0||G===null)continue;let W=x(G).unit||g(q),N;for(let Y of this._targets)if(Y instanceof Element){if(t(q))try{let B=window.getComputedStyle(Y).getPropertyValue(q).trim();if(B)N=x(B).value}catch{}else N=p(Y,q);break}let _=N??0;J[q]=W?`${_}${W}`:`${_}`}}else if(this._fromVars)J={...this._fromVars},$=!0;else if(this._toVars)J={...this._toVars};if(this._splitType&&U.textSplitter?.split){let q={mask:!!this._mask,consumer:this},G=[];for(let z of this._originalTargets)if(z instanceof Element){let W=U.textSplitter?.split(z,this._splitType,q);G.push(...W)}if(G.length>0)this._targets=G}if(this._propsToAnimate=Object.keys(J),Q){for(let q of Object.keys(Q))if(!this._propsToAnimate.includes(q))this._propsToAnimate.push(q)}if(this._plainObjectInitialValues.size===0)this._capturePlainObjectValues(this._propsToAnimate);if($){for(let q of this._targets)if(q instanceof Element)v(q),U.styleReset?.clearAnimationStylesForProps?.(q,this._propsToAnimate)}if(U.styleReset?.registerAnimatedProps){for(let q of this._targets)if(q instanceof Element)U.styleReset?.registerAnimatedProps(q,this._propsToAnimate)}let Z={repeat:this._repeat,repeatDelay:this._repeatDelay,yoyo:this._yoyo,stagger:this._stagger,onStart:this._onStart,onUpdate:this._onUpdate,onComplete:this._onComplete,onRepeat:this._onRepeat,onReverseComplete:this._onReverseComplete,_skipInitialRender:this._skipInitialFromRender||void 0};if(!f._createAnimationCallback)throw Error("AnimationBuilder: Engine not initialized. Call AnimationBuilder.setCreateAnimationCallback first.");let j=f._createAnimationCallback(this._targets,J,this._duration,this._delay,this._ease,$,Q,Z);if(Array.isArray(j))this._animations=j,this._animation=j[0]||null;else this._animation=j,this._animations=[j];if(this._expectedAnimationIds=this._animations.map((q)=>q.getId()),this._setVars&&Object.keys(this._setVars).length>0&&f._createAnimationCallback){let q=f._createAnimationCallback(this._targets,{...this._setVars},0,0,"none",!1,void 0,{_skipInitialRender:this._skipInitialFromRender||void 0}),G=Array.isArray(q)?q:[q];this._animations=[...G,...this._animations],this._expectedAnimationIds=this._animations.map((z)=>z.getId())}}getAnimation(){return this._ensureBuilt(),this._animation}getAnimations(){return this._ensureBuilt(),this._animations}getTargets(){return this._targets}getOriginalTargets(){return this._originalTargets}hasSplit(){return!!this._splitType}_resetBuildState(){this._built=!1,this._animations=[],this._animation=null,this._expectedAnimationIds=[]}getConfig(){return{fromVars:this._fromVars?{...this._fromVars}:void 0,toVars:this._toVars?{...this._toVars}:void 0,setVars:this._setVars?{...this._setVars}:void 0,duration:this._duration,delay:this._delay,ease:this._ease,axis:this._axis,fit:this._fitConfig?{...this._fitConfig}:void 0,split:this._splitType,mask:this._mask,stagger:this._stagger,repeat:this._repeat,repeatDelay:this._repeatDelay,yoyo:this._yoyo,onStart:this._onStart,onUpdate:this._onUpdate,onComplete:this._onComplete,onRepeat:this._onRepeat,onReverseComplete:this._onReverseComplete}}setAxis(J){this._axis=J}getAxis(){return this._axis}setSkipInitialFromRender(J){this._skipInitialFromRender=J}}class S0{static parse(J,$,Q,Z){if(J===void 0)return $;if(typeof J==="number")return J;let j=J.trim();if(j==="<")return Q;if(j===">")return Z;if(j.startsWith("<")){let q=parseFloat(j.substring(1));if(!isNaN(q))return Q+q}if(j.startsWith(">")){let q=parseFloat(j.substring(1));if(!isNaN(q))return Z+q}if(j.startsWith("+=")){let q=parseFloat(j.substring(2));return $+q}if(j.startsWith("-=")){let q=parseFloat(j.substring(2));return $-q}return console.warn(`Invalid position parameter: "${j}", using current end`),$}}class b{static _eachCounter=0;static _registerWithEngine=null;static setEngineRegisterCallback(J){b._registerWithEngine=J}_name;_children=[];_duration=0;_time=0;_progress=0;_timeScale=1;_isActive=!1;_isReversed=!1;_killed=!1;_atZeroState=!1;_repeat=0;_repeatDelay=0;_yoyo=!1;_currentRepeat=0;_completeFired=!1;_inRepeatDelay=!1;_repeatDelayCounter=0;_onStart;_onUpdate;_onComplete;_onRepeat;_startFired=!1;_trigger;_unregisterCallback;setUnregisterCallback(J){this._unregisterCallback=J}_previousStart=0;_previousEnd=0;_eachInstances;_eachDuration;_initialValues=new Map;_initialTransforms=new Map;_transformElements=new Set;_savedTransitions=new Map;_transitionsDisabled=!1;_splitParentOverrides=new Map;constructor(J,$){if(this._name=J,$?.repeat!==void 0)if(typeof $.repeat==="number")this._repeat=$.repeat;else this._repeat=$.repeat.times,this._repeatDelay=$.repeat.delay??0,this._yoyo=$.repeat.yoyo??!1;if($?.onStart)this._onStart=$.onStart;if($?.onUpdate)this._onUpdate=$.onUpdate;if($?.onComplete)this._onComplete=$.onComplete;if($?.onRepeat)this._onRepeat=$.onRepeat;if(J&&b._registerWithEngine)b._registerWithEngine(J,this)}duration(){if(this._eachDuration!==void 0)return this._eachDuration;return this._duration}totalDuration(){if(this._repeat===-1)return 1/0;return this._duration*(this._repeat+1)+this._repeatDelay*this._repeat}clear(){for(let J of this._children)if(J.type==="animation")J.child.kill();else if(J.type==="timeline")J.child.kill();return this._children=[],this._duration=0,this._time=0,this._progress=0,this._isActive=!1,this._isReversed=!1,this._startFired=!1,this._previousStart=0,this._previousEnd=0,this._initialValues.clear(),this._initialTransforms.clear(),this._transformElements.clear(),this._splitParentOverrides.clear(),this._clearTransitionData(),this._currentRepeat=0,this._completeFired=!1,this._inRepeatDelay=!1,this._repeatDelayCounter=0,this}_captureInitialValues(J){let $=J.getTargets(),Q=J.getFirstPropTween();while(Q){let Z=Q.property;for(let j of $){if(!(j instanceof Element))continue;let q=this._initialValues.get(j);if(!q)q=new Map,this._initialValues.set(j,q);if(!q.has(Z)){let G=j;if(T(Z)||qJ(Z)){if(this._transformElements.add(j),!this._initialTransforms.has(j)){let z=G.style.transform;this._initialTransforms.set(j,z||null)}q.set(Z,{removeInline:!0})}else if(q0(Z)||r(Z))q.set(Z,{removeInline:!0});else{let z=Z.replace(/([A-Z])/g,"-$1").toLowerCase();if(G.style.getPropertyValue(z)!==""){let N=yJ(j,Z);q.set(Z,{removeInline:!1,value:N.value,unit:N.unit})}else q.set(Z,{removeInline:!0})}}}Q=Q.next}}_restoreInitialValues(){for(let J of this._transformElements){let $=J;v(J);let Q=this._initialTransforms.get(J);if(Q)$.style.transform=Q;else $.style.removeProperty("transform")}for(let[J,$]of this._initialValues){let Q=J;for(let[Z,j]of $){if(T(Z))continue;let q=Z.replace(/([A-Z])/g,"-$1").toLowerCase();if(j.removeInline)Q.style.removeProperty(q);else{let G=`${j.value}${j.unit}`;Q.style.setProperty(q,G)}}}}_disableTransitions(){if(this._transitionsDisabled)return;for(let J of this._savedTransitions.keys())J.style.transition="none";this._transitionsDisabled=!0}_restoreTransitions(){if(!this._transitionsDisabled)return;for(let[J,$]of this._savedTransitions)J.style.transition=$;this._transitionsDisabled=!1}_clearTransitionData(){this._restoreTransitions(),this._savedTransitions.clear(),this._transitionsDisabled=!1}_addEntry(J,$,Q){let Z=S0.parse(Q,this._duration,this._previousStart,this._previousEnd),j=new f(J,$);return this._addBuilder(j,Z)}_addBuilder(J,$){J.setSkipInitialFromRender(!0);let Q=J.getAnimations();if(Q.length===0)return this;let Z=$;for(let j of Q){let q=j.getDelay(),G=$+q;j.clearDelay();let z=j.totalDuration(),W={type:"animation",child:j,builder:J,startTime:G,duration:z};this._children.push(W),j.setTimelineChild(!0),j.pause(),this._captureInitialValues(j);for(let Y of j.getTargets())if(Y instanceof HTMLElement&&!this._savedTransitions.has(Y))this._savedTransitions.set(Y,Y.style.transition);let N=!!J.getConfig().fromVars;if(G>0&&!N)j.setLazyStartCapture(!0);if(N)j.renderAtTime(0);if(J.hasSplit()){for(let Y of J.getOriginalTargets())if(Y instanceof Element){let X=Y;if(!this._splitParentOverrides.has(X))this._splitParentOverrides.set(X,X.style.opacity);X.style.opacity="1"}}let _=G+z;if(_>Z)Z=_}if(this._previousStart=$,this._previousEnd=Z,Z>this._duration)this._duration=Z;return this}call(J,$,Q){let Z=S0.parse(Q,this._duration,this._previousStart,this._previousEnd),j={type:"callback",child:J,startTime:Z,duration:0,params:$};if(this._children.push(j),this._previousStart=Z,this._previousEnd=Z,Z>this._duration)this._duration=Z;return this}_getFirstAnimationTarget(){let J=this._children[0];if(J?.type==="animation"&&J.builder){let Q=J.builder,Z=Q.hasSplit()?Q.getOriginalTargets():Q.getTargets();for(let j of Z)if(U0(j))return j}let $=this.getFirstChildAnimation();if($){let Q=$.getTargets();for(let Z of Q)if(U0(Z))return Z}return}_getAllAnimationTargets(){let J=[],$=new Set,Q=new Set;for(let Z of this._children)if(Z.type==="animation"&&Z.builder){if(Q.has(Z.builder))continue;Q.add(Z.builder);let j=Z.builder.hasSplit()?Z.builder.getOriginalTargets():Z.builder.getTargets();for(let q of j)if(U0(q)&&!$.has(q))$.add(q),J.push(q)}return J}_createInstanceForElement(J,$){let Z=`${this._name||"__each"}__each_${$}_${b._eachCounter++}`,j=new b(Z),q=new Set;for(let G of this._children)if(G.type==="animation"&&G.builder){if(q.has(G.builder))continue;if(q.add(G.builder),!(G.builder.hasSplit()?G.builder.getOriginalTargets():G.builder.getTargets()).filter((X)=>U0(X)).includes(J))continue;let W=G.builder.getConfig(),N=W.repeat!=null?{times:W.repeat,delay:W.repeatDelay,yoyo:W.yoyo}:void 0,_=G.builder.hasSplit(),Y=new f(J,{from:W.fromVars,to:W.toVars,set:W.setVars,duration:W.duration,delay:W.delay,ease:W.ease,repeat:N,..._&&W.split?{split:W.split}:{},..._&&W.mask?{mask:W.mask}:{},..._&&W.stagger!==void 0?{stagger:W.stagger}:{},onStart:W.onStart,onUpdate:W.onUpdate,onComplete:W.onComplete,onRepeat:W.onRepeat,onReverseComplete:W.onReverseComplete});if(W.axis)Y.setAxis(W.axis);j._addBuilder(Y,G.startTime)}else if(G.type==="callback")j.call(G.child,G.params,G.startTime);return j}_createInstanceForElements(J,$){let Z=`${this._name||"__each"}__each_${$}_${b._eachCounter++}`,j=new b(Z),q=new Set;for(let G of this._children)if(G.type==="animation"&&G.builder){if(q.has(G.builder))continue;q.add(G.builder);let z=G.builder.getConfig(),W=z.repeat!=null?{times:z.repeat,delay:z.repeatDelay,yoyo:z.yoyo}:void 0,N=G.builder.hasSplit(),_=new f(J,{from:z.fromVars,to:z.toVars,set:z.setVars,duration:z.duration,delay:z.delay,ease:z.ease,repeat:W,...N&&z.split?{split:z.split}:{},...N&&z.mask?{mask:z.mask}:{},...N&&z.stagger!==void 0?{stagger:z.stagger}:{},onStart:z.onStart,onUpdate:z.onUpdate,onComplete:z.onComplete,onRepeat:z.onRepeat,onReverseComplete:z.onReverseComplete});if(z.axis)_.setAxis(z.axis);j._addBuilder(_,G.startTime)}else if(G.type==="callback")j.call(G.child,G.params,G.startTime);return j}_resolveTargetElements(J){if(typeof J!=="string")return[J];if(typeof document<"u")try{return Array.from(document.querySelectorAll(J))}catch($){console.warn(`[Motion] Invalid selector "${J}":`,$)}return[]}_setupEachModeGeneric(J,$){if(J.length===0)return;this._eachInstances=[];let Q=this._children.filter((Z)=>Z.type==="animation"&&Z.builder?.hasSplit()).map((Z)=>Z.builder);if(Q.length>0)for(let Z of J)for(let j of Q)U.textSplitter?.revert?.(Z,j);this._clearTransitionData();for(let Z=0;Z<J.length;Z++){let j=J[Z],q=this._createInstanceForElement(j,Z);$(q,j),this._eachInstances.push(q)}{let Z=null,j=this._onUpdate,q=this._onStart,G=this._onComplete;for(let z of this._eachInstances){if(j)z.onUpdate((W,N)=>{let _=W>0&&W<1;if(_)Z=z;if(Z===z){if(j(W,N),!_)Z=null}});if(q)z.onStart(()=>{Z=z,q()});if(G)z.onComplete(()=>{if(Z===z)Z=null,G()})}}this._eachDuration=this._duration;for(let Z of this._children)if(Z.type==="animation"){let j=Z.child;j.setTimelineChild(!1),j.kill()}else if(Z.type==="timeline")Z.child.kill();this._children=[],this._duration=0,this._initialValues.clear(),this._initialTransforms.clear(),this._transformElements.clear(),this._splitParentOverrides.clear(),this._isActive=!1,this._time=0,this._progress=0,this._isReversed=!1,this._startFired=!1}_setupEachMode(J,$){let Q=U.triggerManager?.getInstance?.();if(!Q)return;let{each:Z,...j}=$;if($.target){let G=this._resolveTargetElements($.target);if(G.length===0)return;let z=this._getAllAnimationTargets();if(!z.every((_)=>G.some((Y)=>Y!==_&&Y.contains(_)))){let _=this._children.filter((Y)=>Y.type==="animation"&&Y.builder?.hasSplit()).map((Y)=>Y.builder);if(_.length>0)for(let Y of z)for(let X of _)U.textSplitter?.revert?.(Y,X);this._setupEachModeGeneric(z,(Y,X)=>{if(J==="scroll")Q.registerScroll(Y,{...j,target:X});else if(J==="hover")Q.registerHover(Y,{...j,target:X});else Q.registerClick(Y,{...j,target:X})});return}let N=this._children.filter((_)=>_.type==="animation"&&_.builder?.hasSplit()).map((_)=>_.builder);if(N.length>0)for(let _ of z)for(let Y of N)U.textSplitter?.revert?.(_,Y);this._clearTransitionData(),this._eachInstances=[];for(let _=0;_<G.length;_++){let Y=G[_],X=z.filter((H)=>Y.contains(H));if(X.length===0)continue;let B=this._createInstanceForElements(X,_);if(J==="scroll")Q.registerScroll(B,{...j,target:Y});else if(J==="hover")Q.registerHover(B,{...j,target:Y});else Q.registerClick(B,{...j,target:Y});this._eachInstances.push(B)}{let _=null,Y=this._onUpdate,X=this._onStart,B=this._onComplete;for(let H of this._eachInstances){if(Y)H.onUpdate((I,K)=>{let O=I>0&&I<1;if(O)_=H;if(_===H){if(Y(I,K),!O)_=null}});if(X)H.onStart(()=>{_=H,X()});if(B)H.onComplete(()=>{if(_===H)_=null,B()})}}this._eachDuration=this._duration;for(let _ of this._children)if(_.type==="animation"){let Y=_.child;Y.setTimelineChild(!1),Y.kill()}else if(_.type==="timeline")_.child.kill();this._children=[],this._duration=0,this._initialValues.clear(),this._initialTransforms.clear(),this._transformElements.clear(),this._splitParentOverrides.clear(),this._isActive=!1,this._time=0,this._progress=0,this._isReversed=!1,this._startFired=!1;return}let q=this._getAllAnimationTargets();this._setupEachModeGeneric(q,(G,z)=>{if(J==="scroll")Q.registerScroll(G,{...j,target:z});else if(J==="hover")Q.registerHover(G,{...j,target:z});else Q.registerClick(G,{...j,target:z})})}onHover(J){if(J?.each)return this._setupEachMode("hover",J),this;let $=J?.target??this._getFirstAnimationTarget();return U.triggerManager?.getInstance?.().registerHover(this,{target:$,onLeave:J?.onLeave,leaveDelay:J?.leaveDelay}),this}onClick(J){if(J?.each)return this._setupEachMode("click",J),this;let $=J?.target??this._getFirstAnimationTarget();return U.triggerManager?.getInstance?.().registerClick(this,{target:$,secondTarget:J?.secondTarget,toggle:J?.toggle,preventDefault:J?.preventDefault}),this}onScroll(J){if(J?.each)return this._setupEachMode("scroll",J),this;let $=J?.target??this._getFirstAnimationTarget();return U.triggerManager?.getInstance?.().registerScroll(this,{...J,target:$}),this}onMouseMove(J){if(J?.each&&J.target)return this._setupMouseMoveEachMode(J),this;return U.triggerManager?.getInstance?.().registerMouseMove(this,{type:J?.type??"distance",target:J?.target,smooth:J?.smooth,startProgress:J?.startProgress,leaveProgress:J?.leaveProgress}),this}_setupMouseMoveEachMode(J){if(!J.target)return;let $=[];if(typeof J.target==="string"){if(typeof document<"u")$=Array.from(document.querySelectorAll(J.target))}else $=[J.target];let Q=U.triggerManager?.getInstance?.();if(!Q)return;this._setupEachModeGeneric($,(Z,j)=>{Q.registerMouseMove(Z,{type:J.type??"distance",target:j,smooth:J.smooth,startProgress:J.startProgress,leaveProgress:J.leaveProgress})})}onPageLoad(J){return U.triggerManager?.getInstance?.().registerPageLoad(this,J||{}),this}onPageExit(J){return U.triggerManager?.getInstance?.().registerPageExit(this,J||{}),this}onGesture(J){if(J.each)return this._setupGestureEachMode(J),this;return U.triggerManager?.getInstance?.().registerGesture(this,J),this}_setupGestureEachMode(J){let $=[];if(J.target)if(typeof J.target==="string"){if(typeof document<"u")$=Array.from(document.querySelectorAll(J.target))}else $=[J.target];else $=this._getAllAnimationTargets();if(this._setupEachModeGeneric($,()=>{}),!this._eachInstances||this._eachInstances.length===0)return;let Q=U.triggerManager?.getInstance?.();if(!Q)return;for(let Z=0;Z<$.length;Z++){let j=$[Z],q=this._eachInstances[Z];Q.registerGesture(q,{...J,target:j,each:!1,_siblings:this._eachInstances,_index:Z})}}onCursor(J){return U.triggerManager?.getInstance?.().registerCursor(this,J),this}_updateCallbackChild(J,$,Q){let Z=J.startTime,j=$<Z&&this._time>=Z,q=$>Z&&this._time<=Z,G=Math.abs(this._time-Z)<0.001;if(j||q||G&&Q===0){let z=J.child,W=J.params||[];z(...W)}}_updateAnimationChild(J,$){let Q=J.child,Z=Math.abs(Q.getTimeScale())||1,j=Q.totalDuration()/Z,q=this._time-J.startTime,G=q*Z;if(q>=0&&q<=j){if(!Q.isActive())Q.captureStartValues(),Q.play();Q.renderAtTime(G)}else if(q<0){if(!Q.isLazyCapture())Q.renderAtTime(0);if(Q.isActive())Q.pause(),Q.fireReverseComplete()}else if(Q.isActive())Q.renderAtTime(Q.totalDuration()),Q.pause();else if($===0)Q.renderAtTime(Q.totalDuration())}_updateTimelineChild(J,$){let Q=J.child,Z=Q.duration(),j=this._time-J.startTime;if(j>=0&&j<=Z){if(!Q.isActive())Q.play();Q.time(j)}else if(Q.isActive())if(j<0)Q.time(0),Q.pause();else Q.time(Z),Q.pause();else if($===0)if(j<0);else Q.time(Z)}update(J){if(this._eachInstances){for(let Z of this._eachInstances)Z.update(J);return}let $=this._time;if(!this._isActive&&J===0);else if(!this._isActive)return;let Q=J*this._timeScale;if(this._inRepeatDelay&&J>0){if(this._repeatDelayCounter-=Q,this._repeatDelayCounter>0)return;if(this._inRepeatDelay=!1,this._repeatDelayCounter=0,this._isReversed){this._time=this._duration;for(let Z of this._children)if(Z.type==="animation")Z.child.resetForReplay()}else this._time=0,this._startFired=!1,this._resetChildrenForCycle()}else if(!this._inRepeatDelay){if(this._time+=this._isReversed?-Q:Q,J>0){if(!this._isReversed&&this._time>=this._duration&&this._repeat!==0){if(this._repeat===-1||this._currentRepeat<this._repeat){this._time=this._duration,this._currentRepeat++;try{this._onRepeat?.(this._currentRepeat)}catch(j){console.error("[Motion] onRepeat callback error:",j)}if(this._yoyo){this._isReversed=!0;for(let j of this._children)if(j.type==="animation")j.child.resetForReplay()}else this._time=0,this._startFired=!1,this._resetChildrenForCycle();if(this._repeatDelay>0)this._inRepeatDelay=!0,this._repeatDelayCounter=this._repeatDelay}}else if(this._isReversed&&this._time<=0&&this._yoyo&&this._repeat!==0){if(this._repeat===-1||this._currentRepeat<this._repeat){this._time=0,this._currentRepeat++;try{this._onRepeat?.(this._currentRepeat)}catch(j){console.error("[Motion] onRepeat callback error:",j)}if(this._isReversed=!1,this._startFired=!1,this._resetChildrenForCycle(),this._repeatDelay>0)this._inRepeatDelay=!0,this._repeatDelayCounter=this._repeatDelay}}}}if(this._time<0)this._time=0;else if(this._time>this._duration)this._time=this._duration;if(this._progress=this._duration>0?this._time/this._duration:0,!this._startFired&&this._isActive&&this._time>0)this._startFired=!0,this._disableTransitions(),this._onStart?.();if(this._isActive)this._onUpdate?.(this._progress,this._time);for(let Z of this._children)if(Z.type==="callback")this._updateCallbackChild(Z,$,J);else if(Z.type==="animation")this._updateAnimationChild(Z,J);else if(Z.type==="timeline")this._updateTimelineChild(Z,J);if(!this._completeFired){let Z=!this._isReversed&&this._time>=this._duration,j=this._isReversed&&this._time<=0,q=this._repeat!==-1&&this._currentRepeat>=this._repeat;if(Z&&(this._repeat===0||q))this._completeFired=!0,this._isActive=!1,this._startFired=!1,this._restoreTransitions(),this._onComplete?.();else if(j&&(this._repeat===0||this._yoyo&&q))this._completeFired=!0,this._isActive=!1,this._startFired=!1,this._restoreTransitions(),this._onComplete?.()}}play(J){if(this._killed)return console.warn("[Motion] Cannot play a killed timeline. Create a new one with Motion(name)."),this;if(this._eachInstances){for(let $ of this._eachInstances)$.play(J);return this}if(J!==void 0){if(this._time=J,this._progress=this._duration>0?this._time/this._duration:0,J===0)this._currentRepeat=0,this._inRepeatDelay=!1,this._repeatDelayCounter=0}else if(this._time>=this._duration&&!this._isReversed)return this;return this._completeFired=!1,this._isReversed=!1,this._isActive=!0,this._atZeroState=!1,this}pause(J){if(this._killed)return console.warn("[Motion] Cannot pause a killed timeline. Create a new one with Motion(name)."),this;if(this._eachInstances){for(let $ of this._eachInstances)$.pause(J);return this}if(J!==void 0)this._time=J,this._progress=this._duration>0?this._time/this._duration:0;this._isActive=!1;for(let $ of this._children)if($.type!=="callback"){let Q=$.child;if("pause"in Q)Q.pause()}return this}reverse(J){if(this._killed)return console.warn("[Motion] Cannot reverse a killed timeline. Create a new one with Motion(name)."),this;if(this._eachInstances){for(let $ of this._eachInstances)$.reverse(J);return this}if(J!==void 0)this._time=J,this._progress=this._duration>0?this._time/this._duration:0;else if(this._time<=0&&this._isReversed)return this;return this._completeFired=!1,this._inRepeatDelay=!1,this._repeatDelayCounter=0,this._isReversed=!0,this._isActive=!0,this._atZeroState=!1,this}restart(){if(this._killed)return console.warn("[Motion] Cannot restart a killed timeline. Create a new one with Motion(name)."),this;if(this._eachInstances){for(let J of this._eachInstances)J.restart();return this}this._time=0,this._progress=0,this._isActive=!0,this._isReversed=!1,this._startFired=!1,this._atZeroState=!1,this._currentRepeat=0,this._completeFired=!1,this._inRepeatDelay=!1,this._repeatDelayCounter=0;for(let J of this._children)if(J.type==="animation")J.child.resetForReplay();return this._restoreInitialValues(),this._renderPositionZeroAnimations(),this}_resetChildrenForCycle(){for(let J of this._children)if(J.type==="animation")J.child.resetForReplay();this._restoreInitialValues(),this._renderPositionZeroAnimations()}_renderPositionZeroAnimations(){for(let J of this._children)if(J.type==="animation"){let $=J.child;if(!$.isLazyCapture())$.renderAtTime(0);if($.isActive())$.pause()}else if(J.type==="timeline")J.child.progress(0)}seek(J){if(this._killed)return console.warn("[Motion] Cannot seek a killed timeline. Create a new one with Motion(name)."),this;if(this._eachInstances){for(let $ of this._eachInstances)$.seek(J);return this}return this._time=Math.max(0,Math.min(J,this._duration)),this._progress=this._duration>0?this._time/this._duration:0,this._atZeroState=!1,this.update(0),this}setAxisProgress(J,$){let Q=Math.max(0,Math.min(1,$));for(let Z of this._children)if(Z.type==="animation"&&Z.builder){if(Z.builder.getConfig().axis===J){let q=Z.child,G=q.totalDuration();if(!q.isActive())q.captureStartValues(),q.play();q.renderAtTime(Q*G)}}return this}onStart(J){return this._onStart=J,this}onUpdate(J){return this._onUpdate=J,this}onComplete(J){return this._onComplete=J,this}onRepeat(J){return this._onRepeat=J,this}withRepeat(J){if(typeof J==="number")this._repeat=J,this._repeatDelay=0,this._yoyo=!1;else this._repeat=J.times,this._repeatDelay=J.delay??0,this._yoyo=J.yoyo??!1;return this}progress(J){if(J===void 0){if(this._eachInstances&&this._eachInstances.length>0){let Q=0;for(let Z of this._eachInstances){let j=Z.progress();if(j>Q)Q=j}return Q}return this._progress}if(this._eachInstances){for(let Q of this._eachInstances)Q.progress(J);return this}let $=Math.max(0,Math.min(1,J));if(!this._transitionsDisabled&&this._savedTransitions.size>0)this._disableTransitions();if($===0){for(let Q of this._children)if(Q.type==="animation")Q.child.resetForReplay()}if(this._time=$*this._duration,this._progress=$,$===0)if(this._atZeroState);else this._restoreInitialValues(),this._renderPositionZeroAnimations(),this._atZeroState=!0;else this._atZeroState=!1,this.update(0);return this._onUpdate?.(this._progress,this._time),this}time(J){if(J===void 0){if(this._eachInstances&&this._eachInstances.length>0){let $=0;for(let Q of this._eachInstances){let Z=Q.time();if(Z>$)$=Z}return $}return this._time}if(this._eachInstances){for(let $ of this._eachInstances)$.time(J);return this}return this._time=Math.max(0,Math.min(J,this._duration)),this._progress=this._duration>0?this._time/this._duration:0,this.update(0),this}timeScale(J){if(J===void 0)return this._timeScale;return this._timeScale=J,this}kill(J=!0){if(this._killed=!0,this._isActive=!1,this._atZeroState=!1,U.triggerManager?.getInstance?.().unregister(this),this._eachInstances){for(let $ of this._eachInstances)$.kill(J);this._eachInstances=void 0}if(this._clearTransitionData(),J&&(this._initialValues.size>0||this._transformElements.size>0))this._restoreInitialValues();if(J&&this._splitParentOverrides.size>0){for(let[$,Q]of this._splitParentOverrides)if(Q)$.style.opacity=Q;else $.style.removeProperty("opacity");this._splitParentOverrides.clear()}for(let $ of this._children)if($.type==="animation"){let Q=$.child;Q.setTimelineChild(!1),Q.kill()}else if($.type==="timeline")$.child.kill(J);if(this._unregisterCallback)this._unregisterCallback(),this._unregisterCallback=void 0;this._children=[],this._initialValues.clear(),this._initialTransforms.clear(),this._transformElements.clear(),this._savedTransitions.clear(),this._splitParentOverrides.clear(),this._transitionsDisabled=!1,this._duration=0,this._time=0,this._progress=0,this._previousStart=0,this._previousEnd=0,this._isReversed=!1,this._startFired=!1,this._currentRepeat=0,this._completeFired=!1,this._inRepeatDelay=!1,this._repeatDelayCounter=0}isActive(){if(this._eachInstances)return this._eachInstances.some((J)=>J.isActive());return this._isActive}reversed(){if(this._eachInstances)return this._eachInstances.some((J)=>J.reversed());return this._isReversed}getName(){return this._name}getFirstChildAnimation(){let J=this._children[0];if(J?.type==="animation")return J.child;return null}getFirstChildBuilder(){let J=this._children[0];if(J?.type==="animation"&&J.builder)return J.builder;return null}}function y0(J,$,Q){let Z=J;if(T($)){let G=Q??($.startsWith("scale")?"":"px");return(z)=>{y(J,$,z,G),Z.style.transform=R(J)}}if($.startsWith("--")){let G=Q??"";return(z)=>{Z.style.setProperty($,`${z}${G}`)}}let j=$.replace(/([A-Z])/g,"-$1").toLowerCase(),q=Q??"";return(G)=>{Z.style.setProperty(j,`${G}${q}`)}}var e6=new Set(["opacity","z-index","font-weight","line-height","flex","flex-grow","flex-shrink","order","scale","column-count","columns","tab-size","orphans","widows","zoom"]);function J7(J){if(typeof location>"u")return!J.includes(":");try{let $=new URL(J,location.href);return $.protocol==="https:"||$.protocol==="http:"}catch{return!J.includes(":")}}class Y0 extends d{_element=null;_innerElement=null;_mousePos={x:-100,y:-100};_cursorPos={x:-100,y:-100};_xSetter=null;_ySetter=null;_squeezeSetter=null;_squeezeConfig={min:0.55,max:1.2,multiplier:150};_state="default";_stateTimelines=new Map;_parsedStates=new Map;_textElement=null;_mediaElement=null;_tickerCallback;_boundMouseMove;_boundMouseDown;_boundMouseUp;_hoverSelectors=null;_isHoveringCursorTarget=!1;_boundHoverTargetMoveHandler=null;_cursorStyleTag=null;_attributeListeners=new Map;constructor(J,$){super(J,$);if(this._config={type:"basic",smooth:0.25,hideNative:!1,...$},$.squeeze===!0)this._squeezeConfig={min:0.55,max:1.2,multiplier:150};else if(typeof $.squeeze==="object")this._squeezeConfig={min:$.squeeze.min??0.55,max:$.squeeze.max??1.2,multiplier:$.squeeze.multiplier??150};if(this._parsedStates.set("default",this._parseStateConfig($.default)),$.hover)this._parsedStates.set("hover",this._parseStateConfig($.hover));if($.click)this._parsedStates.set("click",this._parseStateConfig($.click))}_parseStateConfig(J){let{targets:$,duration:Q,ease:Z,enabled:j,...q}=J;return{properties:q,duration:Q??0.15,ease:Z??"power3.inOut",targets:$,enabled:j??!0}}_onEnable(){if(this._element=this._createContainer(),this._innerElement=document.createElement("div"),this._innerElement.setAttribute("data-cursor-inner",""),this._innerElement.style.cssText="pointer-events:none;position:absolute;top:0;left:0;",this._element.appendChild(this._innerElement),y(this._innerElement,"x",-50,"%"),y(this._innerElement,"y",-50,"%"),this._xSetter=y0(this._element,"x","px"),this._ySetter=y0(this._element,"y","px"),this._config.squeeze)this._squeezeSetter=y0(this._element,"scale");if(this._cursorPos={x:-100,y:-100},this._mousePos={x:-100,y:-100},this._xSetter(-100),this._ySetter(-100),this._applyProperties(this._parsedStates.get("default").properties),this._innerElement.style.transform=R(this._innerElement),this._config.hideNative)this._cursorStyleTag=document.createElement("style"),this._cursorStyleTag.setAttribute("data-cursor-hide",""),this._cursorStyleTag.textContent="* { cursor: none !important; }",document.head.appendChild(this._cursorStyleTag);if(this._config.type==="text")this._setupTextCursor();else if(this._config.type==="media")this._setupMediaCursor();this._createStateTimelines(),this._setupEventListeners(),this._tickerCallback=(J)=>this._tick(J),V.getInstance().add(this._tickerCallback)}_onDisable(){if(this._tickerCallback)V.getInstance().remove(this._tickerCallback),this._tickerCallback=void 0;if(this._cursorStyleTag)this._cursorStyleTag.remove(),this._cursorStyleTag=null;if(this._removeEventListeners(),this._stateTimelines.forEach((J)=>J.kill()),this._stateTimelines.clear(),this._innerElement?.parentNode)this._innerElement.remove();if(this._innerElement=null,this._element?.parentNode)this._element.remove();this._element=null}_createContainer(){let J=document.createElement("div");return J.setAttribute("data-cursor-container",""),J.style.cssText="position:fixed;top:0;left:0;pointer-events:none;z-index:999999;width:0;height:0;",document.body.appendChild(J),J}_applyProperties(J){if(!this._innerElement)return;for(let[$,Q]of Object.entries(J))if($==="transform"){let Z=Y0._expandTransformShorthand(String(Q));for(let[j,q]of Object.entries(Z))y(this._innerElement,j,q)}else if(T($)){let Z=typeof Q==="number"?{value:Q,unit:g($)}:x(Q);y(this._innerElement,$,Z.value,Z.unit||g($)||void 0)}else{let Z=n($),j=typeof Q==="number"&&!e6.has(Z)?`${Q}px`:String(Q);this._innerElement.style.setProperty(Z,j)}}_createStateTimelines(){if(!this._innerElement)return;let J=this._parsedStates.get("hover");if(J&&J.enabled){let Q=new b;Q._addEntry(this._innerElement,{to:Y0._expandStateProperties(J.properties),duration:J.duration,ease:J.ease}),this._stateTimelines.set("hover",Q)}let $=this._parsedStates.get("click");if($&&$.enabled){let Q=new b;Q._addEntry(this._innerElement,{to:Y0._expandStateProperties($.properties),duration:$.duration,ease:$.ease}),this._stateTimelines.set("click",Q)}}static _expandStateProperties(J){let $={};for(let[Q,Z]of Object.entries(J))if(Q==="transform"){let j=Y0._expandTransformShorthand(String(Z));Object.assign($,j)}else $[Q]=Z;return $}static _expandTransformShorthand(J){let $={},Q=/([a-zA-Z0-9]+)\(([^)]+)\)/g,Z;while((Z=Q.exec(J))!==null){let j=Z[1],q=Z[2].split(",").map((G)=>parseFloat(G.trim()));switch(j){case"scale":{let G=q[0]??1,z=q.length>1?q[1]:G;if(G===z)$.scale=G;else $.scaleX=G,$.scaleY=z;break}case"scaleX":$.scaleX=q[0]??1;break;case"scaleY":$.scaleY=q[0]??1;break;case"scaleZ":$.scaleZ=q[0]??1;break;case"rotate":$.rotate=q[0]??0;break;case"rotateX":$.rotateX=q[0]??0;break;case"rotateY":$.rotateY=q[0]??0;break;case"rotateZ":$.rotateZ=q[0]??0;break;case"skewX":$.skewX=q[0]??0;break;case"skewY":$.skewY=q[0]??0;break}}return $}_setupEventListeners(){if(this._boundMouseMove=(Q)=>{this._mousePos.x=Q.clientX,this._mousePos.y=Q.clientY},document.addEventListener("mousemove",this._boundMouseMove),this._parsedStates.get("click")?.enabled)this._boundMouseDown=()=>this._setState("click"),this._boundMouseUp=()=>this._setState(this._state==="click"?"default":this._state),document.addEventListener("mousedown",this._boundMouseDown),document.addEventListener("mouseup",this._boundMouseUp);let $=this._parsedStates.get("hover");if($?.enabled&&$.targets&&$.targets.length>0)this._setupHoverTargets($.targets)}_setupHoverTargets(J){this._hoverSelectors=J,this._boundHoverTargetMoveHandler=($)=>{let Z=document.elementsFromPoint($.clientX,$.clientY).some((j)=>this._hoverSelectors.some((q)=>{try{return j.matches(q)}catch{return!1}}));if(Z&&!this._isHoveringCursorTarget)this._isHoveringCursorTarget=!0,this._setState("hover");else if(!Z&&this._isHoveringCursorTarget){if(this._isHoveringCursorTarget=!1,this._state==="hover")this._setState("default")}},window.addEventListener("mousemove",this._boundHoverTargetMoveHandler)}_setupTextCursor(){if(!this._innerElement)return;this._innerElement.style.display="grid",this._innerElement.style.placeItems="center",this._innerElement.style.overflow="visible",this._textElement=document.createElement("div"),this._textElement.setAttribute("data-cursor-text",""),this._textElement.style.whiteSpace="nowrap",this._textElement.style.opacity="0",this._innerElement.appendChild(this._textElement);let $=this._parsedStates.get("hover")?.duration??0.15;if(this._textElement.style.transition=`opacity ${$}s ease-in-out`,this._config.text)for(let[Z,j]of Object.entries(this._config.text))this._textElement.style.setProperty(n(Z),String(j));let Q=document.querySelectorAll("[mp-cursor-text], [mp-cursor-tooltip]");for(let Z of Q){let j=(G)=>{let z=G.target,W=z.getAttribute("mp-cursor-text")??z.getAttribute("mp-cursor-tooltip")??"";if(this._textElement)this._textElement.textContent=W,this._textElement.style.opacity="1";this._setState("hover")},q=()=>{if(this._textElement)this._textElement.style.opacity="0";if(this._state==="hover")this._setState("default")};Z.addEventListener("mouseenter",j),Z.addEventListener("mouseleave",q),this._attributeListeners.set(Z,{enter:j,leave:q})}}_setupMediaCursor(){if(!this._innerElement)return;let J=document.createElement("img");J.setAttribute("data-cursor-media",""),J.style.display="none",this._innerElement.appendChild(J);let $=document.createElement("video");if($.setAttribute("data-cursor-media",""),$.autoplay=!0,$.muted=!0,$.loop=!0,$.style.display="none",this._innerElement.appendChild($),this._config.media)for(let[Z,j]of Object.entries(this._config.media))J.style.setProperty(n(Z),String(j)),$.style.setProperty(n(Z),String(j));let Q=document.querySelectorAll("[mp-cursor-media]");for(let Z of Q){let j=(G)=>{let z=G.target.getAttribute("mp-cursor-media")||"";if(!z||!J7(z)){if(z)console.warn(`[Motion] Blocked unsafe media URL: "${z}". Only http/https URLs and relative paths are allowed.`);return}if(z.endsWith(".mp4")||z.endsWith(".webm"))$.src=z,$.style.display="block",J.style.display="none",$.play().catch(()=>{}),this._mediaElement=$;else J.src=z,J.style.display="block",$.style.display="none",this._mediaElement=J;this._setState("hover")},q=()=>{if(J.style.display="none",$.style.display="none",$.pause(),this._state==="hover")this._setState("default")};Z.addEventListener("mouseenter",j),Z.addEventListener("mouseleave",q),this._attributeListeners.set(Z,{enter:j,leave:q})}}_removeEventListeners(){if(this._boundMouseMove)document.removeEventListener("mousemove",this._boundMouseMove);if(this._boundMouseDown)document.removeEventListener("mousedown",this._boundMouseDown);if(this._boundMouseUp)document.removeEventListener("mouseup",this._boundMouseUp);if(this._boundHoverTargetMoveHandler)window.removeEventListener("mousemove",this._boundHoverTargetMoveHandler),this._boundHoverTargetMoveHandler=null;this._hoverSelectors=null,this._isHoveringCursorTarget=!1,this._attributeListeners.forEach((J,$)=>{$.removeEventListener("mouseenter",J.enter),$.removeEventListener("mouseleave",J.leave)}),this._attributeListeners.clear()}_setState(J){if(this._state===J)return;let $=this._state;this._state=J;let Q=this._stateTimelines.get(J),Z=this._stateTimelines.get($);if(J==="default"){if(Z)Z.reverse()}else{if($!=="default"&&Z)Z.reverse();if(Q)Q.play()}}_tick(J){if(!this._xSetter||!this._ySetter)return;let $=this._config.smooth??0.25,Q=Math.pow($,2.5)||0.000001,Z=1-Math.pow(1-Q,J*60);if(this._cursorPos.x+=(this._mousePos.x-this._cursorPos.x)*Z,this._cursorPos.y+=(this._mousePos.y-this._cursorPos.y)*Z,this._xSetter(this._cursorPos.x),this._ySetter(this._cursorPos.y),this._squeezeSetter&&this._config.squeeze){let j=this._calculateSqueeze();this._squeezeSetter(j)}for(let j of this._stateTimelines.values())if(j.isActive())j.update(J)}_calculateSqueeze(){let J=this._cursorPos.x-this._mousePos.x,$=this._cursorPos.y-this._mousePos.y,Q=Math.sqrt(J*J+$*$),{min:Z,max:j,multiplier:q}=this._squeezeConfig,G=1-(Math.exp(Q/q)-1)/10;if(Number.isNaN(G))return 1;return Math.max(Z,Math.min(j,G))}getElement(){return this._element}getState(){return this._state}}A.registerTrigger("cursor",Y0);class oJ extends d{_links=[];_listeners=new Map;_isNavigating=!1;_pendingUrl=null;_onCompleteHandler=null;_pollTimerId=null;constructor(J,$){super(J,$)}_onEnable(){if(this._isInsideBuilder())return;this._resolveLinks(),this._addClickListeners()}_onDisable(){if(this._cleanupListenerMap(this._listeners),this._links=[],this._isNavigating=!1,this._pendingUrl=null,this._pollTimerId!==null)clearTimeout(this._pollTimerId),this._pollTimerId=null;if(this._onCompleteHandler)this._onCompleteHandler=null}_isInsideBuilder(){try{if(typeof window<"u"&&window.top?.mp_iframe)return!0}catch{}return!1}_resolveLinks(){if(typeof document>"u")return;let J=this._config.mode||"all",$;if(J==="include"&&this._config.selectors&&this._config.selectors.trim()!=="")try{$=Array.from(document.querySelectorAll(this._config.selectors)).filter((Z)=>Z.tagName==="A"),document.querySelectorAll(this._config.selectors).forEach((Z)=>{if(Z.tagName!=="A"){let j=Z.querySelectorAll("a");$.push(...Array.from(j))}})}catch(Q){console.warn(`[Motion] Invalid selector "${this._config.selectors}":`,Q),$=[]}else if(J==="include")$=[];else if(J==="exclude"&&this._config.selectors&&this._config.selectors.trim()!==""){let Q=Array.from(document.querySelectorAll("a")),Z;try{Z=new Set(document.querySelectorAll(this._config.selectors))}catch(j){console.warn(`[Motion] Invalid selector "${this._config.selectors}":`,j),Z=new Set}$=Q.filter((j)=>!Z.has(j))}else $=Array.from(document.querySelectorAll("a"));this._links=[...new Set($)],this._links=this._links.filter((Q)=>this._shouldIntercept(Q))}_shouldIntercept(J){let $=J.getAttribute("href");if(!$||$==="")return!1;let Q=this._config.skipHref||[];if($.startsWith("#"))return!Q.includes("anchor");if($.toLowerCase().startsWith("javascript:"))return!Q.includes("javascript");if($.toLowerCase().startsWith("mailto:")||$.toLowerCase().startsWith("tel:"))return!Q.includes("mailto");return!0}_addClickListeners(){this._links.forEach((J)=>{let $=new Map,Q=(Z)=>{if(this._isNavigating)return;let j=Z;if(j.ctrlKey||j.metaKey||j.shiftKey||j.altKey)return;let q=J.getAttribute("target");if(q&&q!=="_self")return;let G=J.href;if(!G)return;Z.preventDefault(),Z.stopPropagation(),this._isNavigating=!0,this._pendingUrl=G,this._onCompleteHandler=()=>{this._navigate()},this._timeline.restart(),this._waitForCompletion()};J.addEventListener("click",Q),$.set("click",Q),this._listeners.set(J,$)})}_waitForCompletion(){let J=this._timeline,$=16,Q=()=>{if(this._pollTimerId=null,!this._enabled||!this._isNavigating||!this._pendingUrl)return;let Z=J.progress(),j=J.isActive();if(Z>=1||!j&&Z>0)this._navigate();else this._pollTimerId=setTimeout(Q,16)};this._pollTimerId=setTimeout(Q,16)}_navigate(){if(!this._pendingUrl)return;let J=this._pendingUrl;if(this._pendingUrl=null,this._isNavigating=!1,typeof window<"u")window.location.href=J}}A.registerTrigger("pageExit",oJ);var BJ=null;function $7(){if(!BJ&&typeof document<"u"){let J=document.createElement("canvas");J.width=1,J.height=1,BJ=J.getContext("2d")}return BJ}function sJ(J){let $=J.replace("#",""),Q,Z,j,q=1;if($.length===3)Q=parseInt($[0]+$[0],16),Z=parseInt($[1]+$[1],16),j=parseInt($[2]+$[2],16);else if($.length===4)Q=parseInt($[0]+$[0],16),Z=parseInt($[1]+$[1],16),j=parseInt($[2]+$[2],16),q=parseInt($[3]+$[3],16)/255;else if($.length===6)Q=parseInt($.slice(0,2),16),Z=parseInt($.slice(2,4),16),j=parseInt($.slice(4,6),16);else if($.length===8)Q=parseInt($.slice(0,2),16),Z=parseInt($.slice(2,4),16),j=parseInt($.slice(4,6),16),q=parseInt($.slice(6,8),16)/255;else return null;if(isNaN(Q)||isNaN(Z)||isNaN(j)||isNaN(q))return null;return new Float32Array([Q,Z,j,q])}function Q7(J){let $=J.match(/rgba?\s*\(\s*([\d.]+)\s*[,\s]\s*([\d.]+)\s*[,\s]\s*([\d.]+)\s*(?:[,\/]\s*([\d.]+))?\s*\)/i);if(!$)return null;let Q=parseFloat($[1]),Z=parseFloat($[2]),j=parseFloat($[3]),q=$[4]!==void 0?parseFloat($[4]):1;if(isNaN(Q)||isNaN(Z)||isNaN(j)||isNaN(q))return null;return new Float32Array([Q,Z,j,q])}function Z7(J,$,Q){J=J/360,$=$/100,Q=Q/100;let Z,j,q;if($===0)Z=j=q=Q;else{let G=(N,_,Y)=>{if(Y<0)Y+=1;if(Y>1)Y-=1;if(Y<0.16666666666666666)return N+(_-N)*6*Y;if(Y<0.5)return _;if(Y<0.6666666666666666)return N+(_-N)*(0.6666666666666666-Y)*6;return N},z=Q<0.5?Q*(1+$):Q+$-Q*$,W=2*Q-z;Z=G(W,z,J+0.3333333333333333),j=G(W,z,J),q=G(W,z,J-0.3333333333333333)}return[Math.round(Z*255),Math.round(j*255),Math.round(q*255)]}function j7(J){let $=J.match(/hsla?\s*\(\s*([\d.]+)\s*[,\s]\s*([\d.]+)%\s*[,\s]\s*([\d.]+)%\s*(?:[,\/]\s*([\d.]+))?\s*\)/i);if(!$)return null;let Q=parseFloat($[1]),Z=parseFloat($[2]),j=parseFloat($[3]),q=$[4]!==void 0?parseFloat($[4]):1;if(isNaN(Q)||isNaN(Z)||isNaN(j)||isNaN(q))return null;let[G,z,W]=Z7(Q,Z,j);return new Float32Array([G,z,W,q])}function q7(J,$){if(!$||typeof window>"u")return null;let Q=J.match(/var\s*\(\s*(--[\w-]+)\s*\)/i);if(!Q)return null;let Z=Q[1],j=window.getComputedStyle($).getPropertyValue(Z).trim();if(!j)return null;return HJ(j,$)}function G7(J){let $=$7();if(!$)return null;$.fillStyle="#000000",$.fillStyle=J;let Q=$.fillStyle;if(Q==="#000000"&&J.toLowerCase()!=="black"&&J!=="#000000"&&J!=="#000")return null;return sJ(Q)}function HJ(J,$){if(!J||typeof J!=="string")return null;let Q=J.trim().toLowerCase();if(Q==="transparent")return new Float32Array([0,0,0,0]);if(Q.startsWith("#"))return sJ(Q);if(Q.startsWith("rgb"))return Q7(Q);if(Q.startsWith("hsl"))return j7(Q);if(Q.startsWith("var("))return q7(Q,$);return G7(Q)}function z7(J,$){if(typeof window>"u")return new Float32Array([0,0,0,1]);let Q=window.getComputedStyle(J),Z=$.replace(/[A-Z]/g,(G)=>`-${G.toLowerCase()}`),j=Q.getPropertyValue(Z).trim();if(!j||j==="none")J.offsetHeight,j=window.getComputedStyle(J).getPropertyValue(Z).trim();if(!j||j==="none")return new Float32Array([0,0,0,0]);return HJ(j,J)||new Float32Array([0,0,0,1])}U.color={parseColor:HJ,getCurrentColor:z7};var iJ={blur:{value:0,unit:"px"},brightness:{value:1,unit:""},contrast:{value:1,unit:""},saturate:{value:1,unit:""},grayscale:{value:0,unit:""},sepia:{value:0,unit:""},"hue-rotate":{value:0,unit:"deg"},invert:{value:0,unit:""},opacity:{value:1,unit:""}};function W7(J){let $=J.trim().match(/^([\w-]+)\(\s*([\d.]+)(px|%|deg)?\s*\)$/);if(!$)return null;let Q=$[1].toLowerCase(),Z=parseFloat($[2]),j=$[3]||"";if(j==="%")Z=Z/100,j="";return{name:Q,value:Z,unit:j}}function nJ(J){if(J===null||J===void 0||typeof J!=="string")return null;let $=J.trim().toLowerCase();if($==="none"||$==="")return[];let Q=[],Z=/([\w-]+)\([^)]+\)/g,j;while((j=Z.exec($))!==null){let q=W7(j[0]);if(q)Q.push(q)}return Q.length>0?Q:null}function N7(J){let $=iJ[J.name];if(!$)return!1;return J.value===$.value}function _7(J){if(!J||J.length===0)return"none";if(J.every(N7))return"none";return J.map(($)=>{let Q;if($.name==="blur")Q=`${$.value}${$.unit||"px"}`;else if($.name==="hue-rotate")Q=`${$.value}${$.unit||"deg"}`;else Q=`${$.value}`;return`${$.name}(${Q})`}).join(" ")}function Y7(J){if(typeof window>"u")return[];let $=window.getComputedStyle(J),Q=$.filter||$.getPropertyValue("filter");if(!Q||Q==="none")return[];return nJ(Q)||[]}function B7(J){let $=iJ[J];if($)return{name:J,value:$.value,unit:$.unit};return{name:J,value:0,unit:""}}function H7(J,$){let Q=new Set;for(let q of J)Q.add(q.name);for(let q of $)Q.add(q.name);let Z=[],j=[];for(let q of Q){let G=J.find((N)=>N.name===q),z=$.find((N)=>N.name===q),W=B7(q);Z.push(G||W),j.push(z||W)}return{start:Z,end:j}}var B0=[];function X7(J,$,Q){let Z=J.length;if(B0.length<Z)for(let j=B0.length;j<Z;j++)B0.push({name:"",value:0,unit:""});for(let j=0;j<Z;j++){let q=J[j],G=$[j],z=B0[j];z.name=q.name,z.value=q.value+(G.value-q.value)*Q,z.unit=q.unit||G.unit}return B0.length=Z,B0}U.filter={parseFilter:nJ,getCurrentFilter:Y7,mergeFilterArrays:H7,interpolateFilters:X7,filterToString:_7};var aJ=new WeakMap;function K7(J){return"getTotalLength"in J&&typeof J.getTotalLength==="function"}function v0(J){let $=aJ.get(J);if($!==void 0)return $;if(K7(J)){let Q=J.getTotalLength();return aJ.set(J,Q),Q}return 0}function U7(J,$){if(J===null||J===void 0)return null;if(typeof J==="object"){let Q=J.start??0,Z=J.end??100;return{start:Q/100,end:Z/100}}if(typeof J==="string"){let Q=J.trim();if(Q==="true")return{start:0,end:1};if(Q==="false"||Q===""||Q==="none")return{start:0,end:0};let Z=Q.match(/^([-\d.]+)(px|%)?\s+([-\d.]+)(px|%)?$/);if(Z){let q=parseFloat(Z[1]),G=Z[2]||"%",z=parseFloat(Z[3]),W=Z[4]||"%",N=$?v0($):0,_=XJ(q,G,N),Y=XJ(z,W,N);return{start:_,end:Y}}let j=Q.match(/^([-\d.]+)(px|%)?$/);if(j){let q=parseFloat(j[1]),G=j[2]||"%",z=$?v0($):0;return{start:0,end:XJ(q,G,z)}}}return null}function XJ(J,$,Q){if($==="px"&&Q>0)return J/Q;return J/100}function I7(J){let $=v0(J);if($===0)return{start:0,end:1};try{if(typeof window<"u"&&window.getComputedStyle){let Q=window.getComputedStyle(J),Z=Q.strokeDasharray,j=Q.strokeDashoffset;if(!Z||Z==="none")return{start:0,end:1};let q=Z.split(/[\s,]+/).map(parseFloat).filter((z)=>!isNaN(z)),G=parseFloat(j)||0;if(q.length>=1){let z=q[0],W=-G/$,N=(-G+z)/$;return{start:W,end:N}}}}catch{}return{start:0,end:1}}function F7(J,$,Q,Z){if(!(J instanceof SVGElement)||Z===0)return;let j=J,q=Math.abs(Q-$)*Z,G=Math.min($,Q)*Z;j.style.strokeDasharray=`${q} ${Z}`,j.style.strokeDashoffset=`${-G}`}U.drawSVG={parseDrawSVG:U7,getCurrentDrawSVG:I7,getPathLength:v0,applyDrawSVG:F7};var H0=new WeakMap;class T0{static split(J,$,Q){if(!(J instanceof HTMLElement))return[];let Z=Q?.consumer,j=H0.get(J);if(j){if(Z&&j.consumers.has(Z)){if((J.getAttribute("data-split")??"")===$)return this._getSpansForType(j.result,$);j.consumers.delete(Z)}if(Z)j.consumers.add(Z);if(j.consumers.size>1){let Y=this._tryUpgrade(J,j,$,Q);if(Y!==null)return Y;let X=$.split(",").map((B)=>B.trim());if(X.includes("chars")&&j.result.chars.length>0)return j.result.chars.slice();if(X.includes("words")&&j.result.words.length>0)return j.result.words.slice();return j.result.elements.slice()}if(Z)j.consumers.delete(Z);J.innerHTML=j.originalHTML,J.removeAttribute("data-split"),H0.delete(J)}let q=J.innerHTML,G={chars:[],words:[],lines:[],elements:[]},z=$.split(",").map((Y)=>Y.trim()),W=z.includes("chars"),N=z.includes("words"),_=z.includes("lines");if(_)this._splitWithLinesDom(J,N,W,G);else if(N&&W)this._splitWordsWithCharsDom(J,G);else if(N)this._splitWordsDom(J,G);else if(W)this._splitCharsDom(J,G);if(W)G.elements=G.chars;else if(N)G.elements=G.words;else if(_)G.elements=G.lines;if(Q?.mask&&G.elements.length>0)this._applyMaskWrappers(G);return this._propagateGradientText(J,G),H0.set(J,{originalHTML:q,result:G,consumers:new Set(Z?[Z]:[])}),J.setAttribute("data-split",$),G.elements}static _tryUpgrade(J,$,Q,Z){let q=(J.getAttribute("data-split")??"").split(",").map((B)=>B.trim()),G=Q.split(",").map((B)=>B.trim()),z=G.includes("chars"),W=G.includes("words"),N=G.includes("lines"),_=q.includes("chars"),Y=q.includes("words"),X=q.includes("lines");if((!z||_)&&(!W||Y)&&(!N||X))return this._getSpansForType($.result,Q);if(N||X)return null;if(Y&&!_&&z){let B=[];for(let I of $.result.words)this._nestCharsInElement(I,B);$.result.chars=B,$.result.elements=B;let H=this._buildTypeString(q,G);if(J.setAttribute("data-split",H),Z?.mask)this._applyMaskWrappers($.result);return this._propagateGradientText(J,$.result),z?B:$.result.words.slice()}if(_&&!Y&&W){let B=Array.from(J.querySelectorAll("[data-split-word-wrap]")),H=[];for(let K=0;K<B.length;K++){let O=B[K];O.removeAttribute("data-split-word-wrap"),O.setAttribute("data-split-word",""),O.setAttribute("data-word-index",String(K)),H.push(O)}$.result.words=H;let I=this._buildTypeString(q,G);return J.setAttribute("data-split",I),z?$.result.chars.slice():H}return null}static _getSpansForType(J,$){let Q=$.split(",").map((Z)=>Z.trim());if(Q.includes("chars")&&J.chars.length>0)return J.chars.slice();if(Q.includes("words")&&J.words.length>0)return J.words.slice();if(Q.includes("lines")&&J.lines.length>0)return J.lines.slice();return J.elements.slice()}static _buildTypeString(J,$){let Q=new Set([...J,...$]);return["lines","words","chars"].filter((Z)=>Q.has(Z)).join(",")}static _nestCharsInElement(J,$){let Q=document.createTreeWalker(J,4),Z=[],j=Q.nextNode();while(j!==null)Z.push(j),j=Q.nextNode();for(let q of Z){let G=q.textContent??"";if(!G)continue;let z=document.createDocumentFragment();for(let W of G)if(/\s/.test(W))z.appendChild(document.createTextNode(W));else{let N=document.createElement("span");N.setAttribute("data-split-char",""),N.setAttribute("data-char-index",String($.length)),N.style.display="inline-block",N.textContent=W,$.push(N),z.appendChild(N)}q.parentNode?.replaceChild(z,q)}}static _splitWordsDom(J,$){let Q=Array.from(J.childNodes);for(let Z of Q)if(Z.nodeType===3){let j=Z.textContent||"";if(!j)continue;let q=j.split(/(\s+)/),G=document.createDocumentFragment(),z=!1;for(let W of q)if(/^\s+$/.test(W))G.appendChild(document.createTextNode(W.replace(/\n/g," "))),z=!0;else if(W){let N=document.createElement("span");N.setAttribute("data-split-word",""),N.setAttribute("data-word-index",String($.words.length)),N.style.display="inline-block",N.textContent=W,$.words.push(N),G.appendChild(N),z=!0}if(z)J.replaceChild(G,Z)}else if(Z.nodeType===1){let j=Z;if(j.tagName==="BR")continue;this._splitWordsDom(j,$)}}static _splitCharsDom(J,$){let Q=Array.from(J.childNodes);for(let Z of Q)if(Z.nodeType===3){let j=Z.textContent||"";if(!j)continue;let q=j.split(/(\s+)/),G=document.createDocumentFragment();for(let z of q)if(/^\s+$/.test(z))G.appendChild(document.createTextNode(z.replace(/\n/g," ")));else if(z){let W=document.createElement("span");W.setAttribute("data-split-word-wrap",""),W.style.display="inline-block",W.style.whiteSpace="nowrap";for(let N of z){let _=document.createElement("span");_.setAttribute("data-split-char",""),_.setAttribute("data-char-index",String($.chars.length)),_.style.display="inline-block",_.textContent=N,$.chars.push(_),W.appendChild(_)}G.appendChild(W)}J.replaceChild(G,Z)}else if(Z.nodeType===1){let j=Z;if(j.tagName==="BR")continue;this._splitCharsDom(j,$)}}static _splitWordsWithCharsDom(J,$){let Q=Array.from(J.childNodes);for(let Z of Q)if(Z.nodeType===3){let j=Z.textContent||"";if(!j)continue;let q=j.split(/(\s+)/),G=document.createDocumentFragment();for(let z of q)if(/^\s+$/.test(z))G.appendChild(document.createTextNode(z.replace(/\n/g," ")));else if(z){let W=document.createElement("span");W.setAttribute("data-split-word",""),W.setAttribute("data-word-index",String($.words.length)),W.style.display="inline-block",W.style.whiteSpace="nowrap";for(let N of z){let _=document.createElement("span");_.setAttribute("data-split-char",""),_.setAttribute("data-char-index",String($.chars.length)),_.style.display="inline-block",_.textContent=N,$.chars.push(_),W.appendChild(_)}$.words.push(W),G.appendChild(W)}J.replaceChild(G,Z)}else if(Z.nodeType===1){let j=Z;if(j.tagName==="BR")continue;this._splitWordsWithCharsDom(j,$)}}static _splitWithLinesDom(J,$,Q,Z){let j={chars:[],words:[],lines:[],elements:[]};this._splitWordsDom(J,j);let q=[],G=[],z=-1/0;for(let B of j.words){let H=B.getBoundingClientRect();if(H.top>z+2){if(G.length>0)q.push(G);G=[B],z=H.top}else G.push(B)}if(G.length>0)q.push(G);let W=new Map;for(let B of j.words)W.set(B,this._getWrapperChain(B,J));let N="",_=0,Y=0,X=0;for(let B of q){let H="",I=[];for(let K=0;K<B.length;K++){let O=B[K],M=O.textContent||"",k=W.get(O)||[],L=0;while(L<I.length&&L<k.length&&I[L]===k[L])L++;for(let P=I.length-1;P>=L;P--)H+=`</${I[P].tagName.toLowerCase()}>`;if(K>0)H+=" ";for(let P=L;P<k.length;P++)H+=this._openTag(k[P]);if(Q){let P="";for(let l0 of M)P+=`<span data-split-char data-char-index="${X}" style="display:inline-block">${this._escapeHtml(l0)}</span>`,X++;if($)H+=`<span data-split-word data-word-index="${Y}" style="display:inline-block;white-space:nowrap">${P}</span>`;else H+=P}else if($)H+=`<span data-split-word data-word-index="${Y}" style="display:inline-block">${this._escapeHtml(M)}</span>`;else H+=this._escapeHtml(M);Y++,I=k}for(let K=I.length-1;K>=0;K--)H+=`</${I[K].tagName.toLowerCase()}>`;N+=`<span data-split-line data-line-index="${_}" style="display:block">${H}</span>`,_++}if(J.innerHTML=N,Q)Z.chars=Array.from(J.querySelectorAll("[data-split-char]"));if($)Z.words=Array.from(J.querySelectorAll("[data-split-word]"));Z.lines=Array.from(J.querySelectorAll("[data-split-line]"))}static _applyMaskWrappers(J){let $=J.elements;for(let Q of $){let Z=Q.hasAttribute("data-split-line"),j=Q.hasAttribute("data-split-word"),q=document.createElement("span");if(q.setAttribute("data-split-mask",""),q.style.overflow="hidden",q.style.display=Z?"block":"inline-block",!Z)q.style.verticalAlign=j?"bottom":"bottom";Q.parentNode.insertBefore(q,Q),q.appendChild(Q)}}static _propagateGradientText(J,$){let Q=window.getComputedStyle(J);if((Q.getPropertyValue("background-clip")||Q.getPropertyValue("-webkit-background-clip"))!=="text")return;let j=J.querySelectorAll("[data-split-mask], [data-split-word], [data-split-word-wrap], [data-split-char], [data-split-line]");for(let q of j)q.style.background="inherit",q.style.backgroundClip="text",q.style.setProperty("-webkit-background-clip","text"),q.style.setProperty("-webkit-text-fill-color","transparent")}static revert(J,$){let Q=H0.get(J);if(!Q)return!1;if($){if(Q.consumers.delete($),Q.consumers.size>0)return!1}if(!(J instanceof HTMLElement))return!1;return J.innerHTML=Q.originalHTML,J.removeAttribute("data-split"),H0.delete(J),!0}static isSplit(J){return J.hasAttribute("data-split")}static getResult(J){return H0.get(J)?.result}static _getWrapperChain(J,$){let Q=[],Z=J.parentElement;while(Z&&Z!==$)Q.unshift(Z),Z=Z.parentElement;return Q}static _openTag(J){let $=J.tagName.toLowerCase(),Q="";for(let Z of Array.from(J.attributes))Q+=` ${Z.name}="${this._escapeHtml(Z.value)}"`;return`<${$}${Q}>`}static _escapeHtml(J){return J.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}}U.textSplitter={split:(J,$,Q)=>T0.split(J,$,Q),revert:(J,$)=>T0.revert(J,$),isSplit:T0.isSplit};class rJ{static resolve(J,$){if(J.length===0)return[];if(J.length===1)return[0];if(typeof $==="number")return J.map((Q,Z)=>Z*$);return this.resolveComplexStagger(J,$)}static resolveComplexStagger(J,$){let Q=J.length;if(Q===1)return[0];let Z;if($.each!==void 0)Z=$.each;else if($.amount!==void 0)Z=$.amount/(Q-1);else Z=0.1;let j=this.getOrdering(J,$),q=Array(Q);for(let G=0;G<Q;G++)q[j[G].originalIndex]=j[G].order*Z;return q}static getOrdering(J,$){let Q=J.length,Z=$.from??"start";if($.grid)return this.getGridOrdering(J,$);switch(Z){case"start":return J.map((j,q)=>({originalIndex:q,order:q}));case"end":return J.map((j,q)=>({originalIndex:q,order:Q-1-q}));case"center":{let j=Math.floor(Q/2);return J.map((q,G)=>{let z=Math.abs(G-j);return{originalIndex:G,order:z}})}case"edges":return J.map((j,q)=>{let G=Math.min(q,Q-1-q);return{originalIndex:q,order:G}});case"random":{let j=J.map((q,G)=>({originalIndex:G,order:Math.random()}));return j.sort((q,G)=>q.order-G.order),j.forEach((q,G)=>{q.order=G}),j}default:if(typeof Z==="number"){let j=Math.max(0,Math.min(Q-1,Z));return J.map((q,G)=>{let z=Math.abs(G-j);return{originalIndex:G,order:z}})}return J.map((j,q)=>({originalIndex:q,order:q}))}}static getGridOrdering(J,$){let Q,Z;if($.grid==="auto"){let z=this.detectGrid(J);Q=z.cols,Z=z.rows}else[Q,Z]=$.grid;let j=$.from??"start",q=$.axis??"x",G=J.map((z,W)=>{let N=W%Q,_=Math.floor(W/Q);return{originalIndex:W,col:N,row:_}});if(j==="random"){let z=G.map((W)=>({originalIndex:W.originalIndex,order:Math.random()}));return z.sort((W,N)=>W.order-N.order),z.forEach((W,N)=>{W.order=N}),z}return G.map((z)=>{let W;if(typeof j==="number"){let N=j%Q,_=Math.floor(j/Q);W=q==="x"?Math.abs(z.col-N)+Math.abs(z.row-_)*0.5:Math.abs(z.row-_)+Math.abs(z.col-N)*0.5}else if(j==="center"){let N=(Q-1)/2,_=(Z-1)/2;W=Math.abs(z.col-N)+Math.abs(z.row-_)}else if(j==="edges"){let N=Math.min(z.col,Q-1-z.col),_=Math.min(z.row,Z-1-z.row);W=Math.min(N,_)}else if(j==="end")W=q==="x"?(Z-1-z.row)*Q+(Q-1-z.col):(Q-1-z.col)*Z+(Z-1-z.row);else W=q==="x"?z.row*Q+z.col:z.col*Z+z.row;return{originalIndex:z.originalIndex,order:W}})}static detectGrid(J){if(J.length===0)return{cols:0,rows:0};let $=J.filter((q)=>q instanceof Element);if($.length===0)return{cols:J.length,rows:1};let Q=new Map;$.forEach((q)=>{let G=q.getBoundingClientRect(),z=Math.round(G.top);Q.set(z,(Q.get(z)||0)+1)});let Z=Q.size;return{cols:Math.ceil(J.length/Z),rows:Z}}}U.stagger={resolve:(J,$)=>rJ.resolve(J,$)};function O7(J,$,Q){if(!(J instanceof HTMLElement))return console.warn("[Motion Fit] Fit animations only support HTML elements. SVG elements are not supported."),null;let Z=document.querySelector($);if(!Z)return console.warn(`[Motion Fit] Target element not found: "${$}". Animation skipped.`),null;if(!(Z instanceof HTMLElement))return console.warn("[Motion Fit] Fit animations only support HTML elements. SVG elements are not supported."),null;if(Z===J)return console.warn("[Motion Fit] Target element is the same as source element. Animation skipped."),null;let j=J.getBoundingClientRect(),q=Z.getBoundingClientRect(),G=j.width===0?1:j.width,z=j.height===0?1:j.height,W=j.left+G/2,N=j.top+z/2,_=q.left+q.width/2,Y=q.top+q.height/2,X=_-W,B=Y-N,H=q.width/G,I=q.height/z;if(!Q)return{dx:X,dy:B,sx:H,sy:I,sourceWidth:j.width,sourceHeight:j.height,targetWidth:q.width,targetHeight:q.height};let K=J.offsetParent??document.documentElement,O=K.getBoundingClientRect(),M=K.scrollLeft??0,k=K.scrollTop??0;return{dx:X,dy:B,sx:H,sy:I,sourceWidth:j.width,sourceHeight:j.height,targetWidth:q.width,targetHeight:q.height,sourceLeft:J.offsetLeft,sourceTop:J.offsetTop,targetLeft:q.left-O.left+M,targetTop:q.top-O.top+k}}var u=0.01,X0=0.001;function A7(J,$,Q,Z){let{absolute:j=!1,scale:q=!0,resize:G=!1}=Q;if($ instanceof HTMLElement)v($,!1);let z=O7($,Q.target,j);if(!z)return;if(!j)if(G){let W=z.dx-(z.targetWidth-z.sourceWidth)/2,N=z.dy-(z.targetHeight-z.sourceHeight)/2;if(Math.abs(W)>u){let _=Z.acquire();_.init($,"x",0,W,"px"),J.addPropTween(_)}if(Math.abs(N)>u){let _=Z.acquire();_.init($,"y",0,N,"px"),J.addPropTween(_)}if(Math.abs(z.targetWidth-z.sourceWidth)>u){let _=Z.acquire();_.init($,"width",z.sourceWidth,z.targetWidth,"px"),J.addPropTween(_)}if(Math.abs(z.targetHeight-z.sourceHeight)>u){let _=Z.acquire();_.init($,"height",z.sourceHeight,z.targetHeight,"px"),J.addPropTween(_)}}else{let W=p($,"x"),N=p($,"y"),_=W+z.dx,Y=N+z.dy;if(Math.abs(_-W)>u||Math.abs(W)>u||Math.abs(_)>u){let X=Z.acquire();X.init($,"x",W,_,"px"),J.addPropTween(X)}if(Math.abs(Y-N)>u||Math.abs(N)>u||Math.abs(Y)>u){let X=Z.acquire();X.init($,"y",N,Y,"px"),J.addPropTween(X)}if(q){let X=p($,"scaleX"),B=p($,"scaleY"),H=X*z.sx,I=B*z.sy;if(Math.abs(H-X)>X0||Math.abs(X-1)>X0||Math.abs(H-1)>X0){let K=Z.acquire();K.init($,"scaleX",X,H,""),J.addPropTween(K)}if(Math.abs(I-B)>X0||Math.abs(B-1)>X0||Math.abs(I-1)>X0){let K=Z.acquire();K.init($,"scaleY",B,I,""),J.addPropTween(K)}}}else{let W=$;if(window.getComputedStyle(W).position==="static")W.style.position="absolute";let{sourceLeft:_,sourceTop:Y,targetLeft:X,targetTop:B}=z;if(Math.abs(X-_)>u){let H=Z.acquire();H.init($,"left",_,X,"px"),J.addPropTween(H)}if(Math.abs(B-Y)>u){let H=Z.acquire();H.init($,"top",Y,B,"px"),J.addPropTween(H)}if(q){if(Math.abs(z.targetWidth-z.sourceWidth)>u){let H=Z.acquire();H.init($,"width",z.sourceWidth,z.targetWidth,"px"),J.addPropTween(H)}if(Math.abs(z.targetHeight-z.sourceHeight)>u){let H=Z.acquire();H.init($,"height",z.sourceHeight,z.targetHeight,"px"),J.addPropTween(H)}}}}function L7(J,$,Q,Z){J.setPendingFitSetup((G)=>A7(J,$,Q,G)),J.setLazyStartCapture(!0);let{absolute:j=!1,resize:q=!1}=Q;J.setFitCleanup(()=>{if($ instanceof HTMLElement){if(v($,!0),q)$.style.width="",$.style.height="";if(j)$.style.width="",$.style.height="",$.style.left="",$.style.top=""}})}U.fit={registerPendingSetup:L7};var $6=(J)=>J,M7=$6,E={in:(J)=>J*J,out:(J)=>J*(2-J),inOut:(J)=>J<0.5?2*J*J:-1+(4-2*J)*J},$0={in:(J)=>J*J*J,out:(J)=>--J*J*J+1,inOut:(J)=>J<0.5?4*J*J*J:(J-1)*(2*J-2)*(2*J-2)+1},Q0={in:(J)=>J*J*J*J,out:(J)=>1- --J*J*J*J,inOut:(J)=>J<0.5?8*J*J*J*J:1-8*--J*J*J*J},m={in:(J)=>J*J*J*J*J,out:(J)=>1+--J*J*J*J*J,inOut:(J)=>J<0.5?16*J*J*J*J*J:1+16*--J*J*J*J*J};var h0={in:(J)=>1-Math.cos(J*Math.PI/2),out:(J)=>Math.sin(J*Math.PI/2),inOut:(J)=>-(Math.cos(Math.PI*J)-1)/2},f0={in:(J)=>2**(10*(J-1))*J+J*J*J*J*J*J*(1-J),out:(J)=>1-(2**(10*-J)*(1-J)+(1-J)*(1-J)*(1-J)*(1-J)*(1-J)*(1-J)*J),inOut:(J)=>{if(J<0.5){let Q=J*2;return(2**(10*(Q-1))*Q+Q*Q*Q*Q*Q*Q*(1-Q))/2}let $=(1-J)*2;return 1-(2**(10*($-1))*$+$*$*$*$*$*$*(1-$))/2}},u0={in:(J)=>1-Math.sqrt(1-J*J),out:(J)=>Math.sqrt(1- --J*J),inOut:(J)=>{if((J*=2)<1)return-0.5*(Math.sqrt(1-J*J)-1);return 0.5*(Math.sqrt(1-(J-=2)*J)+1)}};var Q6=(J=1.70158)=>{let $=(Q)=>Q?--Q*Q*((J+1)*Q+J)+1:0;return{in:(Q)=>1-$(1-Q),out:$,inOut:(Q)=>{if(Q<0.5)return(1-$(1-Q*2))/2;return 0.5+$((Q-0.5)*2)/2}}},d0=Q6();var Z6=(J=1,$=0.3)=>{let Q=Math.max(1,J),Z=$/(2*Math.PI)*Math.asin(1/Q),j=$*1.5,q=j/(2*Math.PI)*Math.asin(1/Q);return{in:(G)=>{if(G===0)return 0;if(G===1)return 1;return-(Q*Math.pow(2,10*(G-=1))*Math.sin((G-Z)*(2*Math.PI)/$))},out:(G)=>{if(G===0)return 0;if(G===1)return 1;return Q*Math.pow(2,-10*G)*Math.sin((G-Z)*(2*Math.PI)/$)+1},inOut:(G)=>{if(G===0)return 0;if(G===1)return 1;if((G*=2)<1)return-0.5*(Q*Math.pow(2,10*(G-=1))*Math.sin((G-q)*(2*Math.PI)/j));return Q*Math.pow(2,-10*(G-=1))*Math.sin((G-q)*(2*Math.PI)/j)*0.5+1}}},c0=Z6(),tJ=(J)=>{if(J<0.36363636363636365)return 7.5625*J*J;else if(J<0.7272727272727273)return 7.5625*(J-=0.5454545454545454)*J+0.75;else if(J<0.9090909090909091)return 7.5625*(J-=0.8181818181818182)*J+0.9375;else return 7.5625*(J-=0.9545454545454546)*J+0.984375},K0={in:(J)=>1-tJ(1-J),out:tJ,inOut:(J)=>{if(J<0.5)return K0.in(J*2)*0.5;return K0.out(J*2-1)*0.5+0.5}},M0=(J=0.7,$=0.7,Q=!1)=>{let Z=J!==1?$:0,j=(1-J)/2,q=j+J,G=Q;return(z)=>{let W=z+(0.5-z)*Z;if(z<j){let N=1-z/j;if(G)return 1-N*N;return W-N*N*N*N*W}else if(z>q){let N=(z-q)/j;if(G)return z===1?0:1-N*N;return W+(z-W)*N*N*N*N}return G?1:W}},eJ={in:M0(0.7,0.7,!1),out:M0(0.7,0.7,!1),inOut:M0(0.7,0.7,!1)},m0=(J=1,$=20,Q=!1)=>{let Z=[],j=1/$;for(let q=0;q<$;q++){let G=q*j,W=((q*1327+531)%1000/1000-0.5)*J*0.4,N=G+W;Z.push({x:G,y:Q?Math.max(0,Math.min(1,N)):N})}return Z[0]={x:0,y:0},Z.push({x:1,y:1}),(q)=>{if(q<=0)return 0;if(q>=1)return 1;let G=0,z=Z.length-1;while(G<z-1){let Y=G+z>>1;if(Z[Y].x<=q)G=Y;else z=Y}let W=Z[G],N=Z[z],_=(q-W.x)/(N.x-W.x);return W.y+(N.y-W.y)*_}},k7={in:m0(1,20,!0),out:m0(1,20,!0),inOut:m0(1,20,!0)},g0=(J)=>{return($)=>{if($>=1)return 1;return Math.floor($*J)/J}},p0={in:g0(12),out:g0(12),inOut:g0(12)},J6={linear:$6,none:M7,power1:E.out,"power1.in":E.in,"power1.out":E.out,"power1.inout":E.inOut,power2:$0.out,"power2.in":$0.in,"power2.out":$0.out,"power2.inout":$0.inOut,power3:Q0.out,"power3.in":Q0.in,"power3.out":Q0.out,"power3.inout":Q0.inOut,power4:m.out,"power4.in":m.in,"power4.out":m.out,"power4.inout":m.inOut,quad:E.out,"quad.in":E.in,"quad.out":E.out,"quad.inout":E.inOut,cubic:$0.out,"cubic.in":$0.in,"cubic.out":$0.out,"cubic.inout":$0.inOut,quart:Q0.out,"quart.in":Q0.in,"quart.out":Q0.out,"quart.inout":Q0.inOut,quint:m.out,"quint.in":m.in,"quint.out":m.out,"quint.inout":m.inOut,strong:m.out,"strong.in":m.in,"strong.out":m.out,"strong.inout":m.inOut,sine:h0.out,"sine.in":h0.in,"sine.out":h0.out,"sine.inout":h0.inOut,expo:f0.out,"expo.in":f0.in,"expo.out":f0.out,"expo.inout":f0.inOut,circ:u0.out,"circ.in":u0.in,"circ.out":u0.out,"circ.inout":u0.inOut,back:d0.out,"back.in":d0.in,"back.out":d0.out,"back.inout":d0.inOut,elastic:c0.out,"elastic.in":c0.in,"elastic.out":c0.out,"elastic.inout":c0.inOut,bounce:K0.out,"bounce.in":K0.in,"bounce.out":K0.out,"bounce.inout":K0.inOut,slow:eJ.inOut,"slow.in":E.out,"slow.out":E.out,"slow.inout":E.out,slowmo:eJ.inOut,"slowmo.in":E.out,"slowmo.out":E.out,"slowmo.inout":E.out,rough:k7.inOut,"rough.in":E.out,"rough.out":E.out,"rough.inout":E.out,steps:p0.inOut,"steps.in":p0.in,"steps.out":p0.out,"steps.inout":p0.inOut},D7={back:(J)=>Q6(J),elastic:(J,$)=>Z6(J,$),slow:(J,$,Q)=>{let Z=M0(J,$,Q===1);return{in:Z,out:Z,inOut:Z}},slowmo:(J,$,Q)=>{let Z=M0(J,$,Q===1);return{in:Z,out:Z,inOut:Z}},rough:(J,$,Q)=>{let Z=m0(J,$,Q===1);return{in:Z,out:Z,inOut:Z}},steps:(J)=>{let $=g0(J??12);return{in:$,out:$,inOut:$}}},R7=/^(\w+)(?:\.(\w+))?\(([^)]*)\)$/;function j6(J){let $=J.toLowerCase();if(J6[$])return J6[$];let Q=R7.exec($);if(Q){let[,Z,j,q]=Q,G=D7[Z];if(G){let z=q.split(",").map((W)=>W.trim()).filter((W)=>W.length>0).map(Number);if(z.every((W)=>!isNaN(W))){let W=G(...z),N=j||"out",Y=W[N==="inout"?"inOut":N];if(Y)return Y}}}return console.warn(`[Motion] Unknown easing "${J}". Falling back to "power1.out". Valid easings: linear, power1-4.in/out/inOut, quad, cubic, quart, quint, strong, sine, expo, circ, back, elastic, bounce, slow, rough, steps. Parameterized: back.out(overshoot), elastic.out(amplitude, period), steps(n), slow(ratio, power, yoyo), rough(strength, points, clamp)`),E.out}class KJ{_id=0;_targets=[];_duration=0.5;_delay=0;_time=0;_progress=0;_timeScale=1;_isActive=!1;_isReversed=!1;_propTweens=null;_lastPropTween=null;_easingFn=null;_repeat=0;_repeatDelay=0;_yoyo=!1;_currentRepeat=0;_onStart;_onUpdate;_onComplete;_onRepeat;_onReverseComplete;_startFired=!1;_completeFired=!1;_timelineChild=!1;_needsStartCapture=!1;_startCaptured=!1;_fitSetupFn=null;_pendingFitSetup=null;_fitCleanupFn=null;_unregisterCallback=null;init(J,$,Q,Z,j,q){return this._id=J,this._targets=$,this._duration=Q,this._delay=Z,this._easingFn=j6(j),this._time=0,this._progress=0,this._timeScale=1,this._isActive=!1,this._isReversed=!1,this._startFired=!1,this._completeFired=!1,this._currentRepeat=0,this._repeat=q?.repeat??0,this._repeatDelay=q?.repeatDelay??0,this._yoyo=q?.yoyo??!1,this._onStart=q?.onStart,this._onUpdate=q?.onUpdate,this._onComplete=q?.onComplete,this._onRepeat=q?.onRepeat,this._onReverseComplete=q?.onReverseComplete,this}update(J){if(!this._isActive)return;let $=J*this._timeScale;if(this._time+=this._isReversed?-$:$,!this._isReversed&&this._time<0){this._time=0;return}let Q=Math.max(0,this._time-this._delay);if(this._progress=this._duration>0?Math.min(1,Q/this._duration):1,!this._startFired&&this._progress>0)this._startFired=!0,this._onStart?.();if(this.render(this._progress),this._onUpdate?.(this._progress),this._isReversed){if(this._time<=0)this.handleComplete()}else if(this._progress>=1)this.handleComplete()}render(J){let $=this.applyEasing(J),Q=this._propTweens;while(Q)Q.render($),Q=Q.next}renderAtTime(J){let $=Math.max(0,J),Q=this._duration,Z=this._delay,j=this._currentRepeat;if(Q===0){let q=$>=Z?1:0;this._time=$,this._progress=q,this.render(q)}else{let q=Math.max(0,$-Z);if(this._repeat===0){let G=Math.min(1,q/Q);this._time=Math.min(Q,q),this._progress=G,this.render(G)}else{let G=this._repeatDelay,z=Q+G,W=this._repeat===-1?1/0:Q*(this._repeat+1)+G*this._repeat,N=this._repeat===-1?q:Math.min(q,W),_=z>0?Math.floor(N/z):0,Y=N-_*z,X=Y>Q,B=Q>0?Math.min(1,Y/Q):1,H=this._yoyo&&_%2===1;if(X)B=H?0:1;else if(H)B=1-B;this._currentRepeat=this._repeat===-1?_:Math.min(_,this._repeat),this._isReversed=H,this._progress=B,this._time=Q*B,this.render(B)}}if(this._isActive){if(!this._startFired){this._startFired=!0;try{this._onStart?.()}catch(q){console.error("[Motion] onStart callback error:",q)}}try{this._onUpdate?.(this._progress)}catch(q){console.error("[Motion] onUpdate callback error:",q)}if(this._currentRepeat>j)try{this._onRepeat?.(this._currentRepeat)}catch(q){console.error("[Motion] onRepeat callback error:",q)}if(!this._completeFired&&this._repeat!==-1){if($>=this.totalDuration()){this._completeFired=!0;try{this._onComplete?.()}catch(q){console.error("[Motion] onComplete callback error:",q)}}}}}applyEasing(J){if(!this._easingFn)return J;return this._easingFn(J)}handleComplete(){if(this._repeat===-1||this._currentRepeat<this._repeat){if(this._currentRepeat++,this._onRepeat?.(this._currentRepeat),this._yoyo)this._isReversed=!this._isReversed,this._time=this._isReversed?this._duration+this._delay:0;else this._time=0,this._startFired=!1;this._time-=this._repeatDelay;return}if(this._isReversed)this._onReverseComplete?.();else this._onComplete?.();this._isActive=!1}play(J){if(J!==void 0)return this.seek(J),this._isActive=!0,this._isReversed=!1,this;if(this._isActive&&!this._isReversed)return this;return this._isActive=!0,this._isReversed=!1,this}pause(J){if(J!==void 0){this._time=J;let $=Math.max(0,this._time-this._delay);this._progress=this._duration>0?Math.min(1,$/this._duration):1,this.render(this._progress)}return this._isActive=!1,this}reverse(J){if(J!==void 0)this.seek(J);return this._isActive=!0,this._isReversed=!0,this}restart(J=!0){return this._time=J?0:this._delay,this._progress=0,this._isActive=!0,this._isReversed=!1,this._startFired=!1,this._currentRepeat=0,this.render(0),this}seek(J){this._time=J;let $=Math.max(0,this._time-this._delay);return this._progress=this._duration>0?Math.min(1,$/this._duration):1,this.render(this._progress),this}progress(J){if(J===void 0)return this._progress;if(this._progress=Math.max(0,Math.min(1,J)),this._progress===0)this._time=0;else this._time=this._progress*this._duration+this._delay;return this.render(this._progress),this}time(J){if(J===void 0)return this._time;this._time=J;let $=Math.max(0,this._time-this._delay);return this._progress=this._duration>0?Math.min(1,$/this._duration):1,this.render(this._progress),this}timeScale(J){if(J===void 0)return this._timeScale;return this._timeScale=J,this}getTimeScale(){return this._timeScale}kill(){this._isActive=!1,this._unregisterCallback?.()}isActive(){return this._isActive}isTimelineChild(){return this._timelineChild}setTimelineChild(J){this._timelineChild=J}setLazyStartCapture(J){this._needsStartCapture=J,this._startCaptured=!1}setPendingFitSetup(J){this._fitSetupFn=J,this._pendingFitSetup=J}setFitCleanup(J){this._fitCleanupFn=J}resetForReplay(){if(this._fitSetupFn)this._fitCleanupFn?.(),this._pendingFitSetup=this._fitSetupFn,this._startCaptured=!1;this._startFired=!1,this._completeFired=!1}needsStartCapture(){return this._needsStartCapture&&!this._startCaptured}isLazyCapture(){return this._needsStartCapture}fireReverseComplete(){try{this._onReverseComplete?.()}catch(J){console.error("[Motion] onReverseComplete callback error:",J)}this._startFired=!1,this._completeFired=!1}setUnregisterCallback(J){this._unregisterCallback=J}captureStartValues(){if(!this._needsStartCapture||this._startCaptured)return;if(this._pendingFitSetup){let $=this._propTweens;while($){let Q=$.next;J0.release($),$=Q}this._propTweens=null,this._lastPropTween=null,this._pendingFitSetup(J0),this._pendingFitSetup=null,this._startCaptured=!0;return}let J=this._propTweens;while(J){if(J.target instanceof Element){let{target:$,property:Q}=J;if(J.valueType==="color"&&q0(Q)){let Z=U.color?.getCurrentColor($,Q);if(Z&&J.endColor)J.startColor=Z,J.changeColor=new Float32Array([J.endColor[0]-Z[0],J.endColor[1]-Z[1],J.endColor[2]-Z[2],J.endColor[3]-Z[3]])}else if(J.valueType==="filter"&&r(Q)){let Z=U.filter?.getCurrentFilter($);if(Z&&J.endFilters){let j=U.filter.mergeFilterArrays(Z,J.endFilters);J.startFilters=j.start,J.endFilters=j.end}}else{let Z=p($,Q);J.startValue=Z,J.change=J.endValue-J.startValue}}J=J.next}this._startCaptured=!0}getId(){return this._id}getTargets(){return this._targets}getDuration(){return this._duration}getDelay(){return this._delay}clearDelay(){this._delay=0}getFirstPropTween(){return this._propTweens}addPropTween(J){if(!this._lastPropTween)this._propTweens=J;else this._lastPropTween.next=J;this._lastPropTween=J}totalDuration(){if(this._repeat===-1)return 1/0;let $=this._duration*(this._repeat+1)+this._repeatDelay*this._repeat;return this._delay+$}reset(){this._id=0,this._targets=[],this._duration=0.5,this._delay=0,this._time=0,this._progress=0,this._timeScale=1,this._isActive=!1,this._isReversed=!1,this._easingFn=null,this._repeat=0,this._repeatDelay=0,this._yoyo=!1,this._currentRepeat=0,this._onStart=void 0,this._onUpdate=void 0,this._onComplete=void 0,this._onRepeat=void 0,this._onReverseComplete=void 0,this._startFired=!1,this._completeFired=!1,this._timelineChild=!1,this._needsStartCapture=!1,this._startCaptured=!1,this._fitSetupFn=null,this._pendingFitSetup=null,this._fitCleanupFn=null,this._unregisterCallback=null;let J=J0,$=this._propTweens;while($){let Q=$.next;J.release($),$=Q}this._propTweens=null,this._lastPropTween=null}}var k0=new A0(()=>new KJ,100),q6={acquire:()=>k0.acquire(),release:(J)=>k0.release(J),getPoolSize:()=>k0.getPoolSize(),getTotalCreated:()=>k0.getTotalCreated(),clear:()=>k0.clear()};class C{static instance;animations=[];animationIdToIndex=new Map;nextAnimationId=1;totalCreated=0;_animationSnapshot=[];timelines=new Map;ticker;animationPool;propTweenPool;constructor(){this.ticker=V.getInstance(),this.animationPool=q6,this.propTweenPool=J0,this.ticker.add(this.update,0)}static getInstance(){if(!C.instance)C.instance=new C,b.setEngineRegisterCallback((J,$)=>{let Q=C.instance;if(!Q.hasTimeline(J))Q.registerTimeline(J,$)}),f.setCreateAnimationCallback((J,$,Q,Z,j,q,G,z)=>{return C.instance.createAnimation(J,$,Q,Z,j,q,G,z)});return C.instance}update=(J)=>{let $=this._animationSnapshot,Q=this.animations.length;$.length=Q;for(let j=0;j<Q;j++)$[j]=this.animations[j];let Z=[];for(let j=0,q=$.length;j<q;j++){let G=$[j];if(G.isTimelineChild())continue;if(G.isActive()){if(G.update(J),!G.isActive()&&!G.isTimelineChild())Z.push(G.getId())}}for(let j of Z)this.unregisterAnimation(j);for(let j of this.timelines.values())if(j.isActive())j.update(J)};createAnimation(J,$,Q,Z,j,q,G,z){let W=z?.stagger;if(W&&J.length>1)return this.createStaggeredAnimations(J,$,Q,Z,j,q,G,W,z);let N=this.animationPool.acquire(),_=this.registerAnimation(N);if(N.init(_,J,Q,Z,j,z),this.setupPropertyTweens(N,J,$,q,G),Q===0)N.render(1);else if(q&&!z?._skipInitialRender)N.render(0);return N}createStaggeredAnimations(J,$,Q,Z,j,q,G,z,W){if(!U.stagger){let Y=this.animationPool.acquire(),X=this.registerAnimation(Y);if(Y.init(X,J,Q,Z,j,W),this.setupPropertyTweens(Y,J,$,q,G),Q===0)Y.render(1);else if(q&&!W?._skipInitialRender)Y.render(0);return[Y]}let N=U.stagger.resolve(J,z),_=[];for(let Y=0;Y<J.length;Y++){let X=J[Y],B=N[Y],H=this.animationPool.acquire(),I=this.registerAnimation(H);if(H.init(I,[X],Q,Z+B,j,W),this.setupPropertyTweens(H,[X],$,q,G),Q===0)H.render(1);else if(q&&!W?._skipInitialRender)H.render(0);_.push(H)}return _}setupPropertyTweens(J,$,Q,Z,j){let q=z6(G6(Q)),G=j?z6(G6(j)):void 0,z=Object.keys(q),W=G?Object.keys(G):[],N=[...new Set([...z,...W])],_="perspective"in q,Y=G&&"perspective"in G,X=_&&Y;for(let B of $){if(!X&&(_||Y)&&B instanceof Element){let H=_?q.perspective:G.perspective,I=typeof H==="number"?H:parseFloat(String(H))||0;if(I>0)y(B,"perspective",I,"px"),B.style.transform=R(B)}for(let H of N){if(H==="perspective"&&!X)continue;let I=q[H],K=vJ(B,H,I,G?G[H]:void 0),O=this.propTweenPool.acquire(),M=Z&&!j;switch(K.type){case"color":{let k=M?K.endColor:K.startColor,L=M?K.startColor:K.endColor;O.initColor(B,H,k,L);break}case"filter":{let k=M?K.endFilters:K.startFilters,L=M?K.startFilters:K.endFilters;O.initFilter(B,H,k,L);break}case"scalar":{let k=M?K.endValue:K.startValue,L=M?K.startValue:K.endValue;O.init(B,H,k,L,K.unit);break}case"drawSVG":{let k=M?K.endDraw:K.startDraw,L=M?K.startDraw:K.endDraw;O.initDrawSVG(B,H,k,L,K.length);break}case"path":{let k=M?K.endProgress:K.startProgress,L=M?K.startProgress:K.endProgress;O.initPath(B,H,K.pathData,K.pathLength,k,L,K.rotate,K.alignOffset,K.pathOffset);break}}J.addPropTween(O)}}}registerAnimation(J){let $=this.nextAnimationId++,Q=this.animations.length;return this.animations.push(J),this.animationIdToIndex.set($,Q),this.totalCreated++,J.setUnregisterCallback(()=>this.unregisterAnimation($)),$}unregisterAnimation(J){let $=this.animationIdToIndex.get(J);if($===void 0)return;let Q=this.animations[$],Z=this.animations.length-1;if($!==Z){let j=this.animations[Z];this.animations[$]=j,this.animationIdToIndex.set(j.getId(),$)}this.animations.pop(),this.animationIdToIndex.delete(J),this.animationPool.release(Q)}getAnimation(J){let $=this.animationIdToIndex.get(J);return $!==void 0?this.animations[$]:void 0}killAll(){let J=[...this.animations];for(let $=0,Q=J.length;$<Q;$++)J[$].kill();this.animations.length=0,this.animationIdToIndex.clear()}killAnimationsForTargets(J){if(J.length===0)return;let $=new Set(J),Q=[];for(let Z=0,j=this.animations.length;Z<j;Z++){let q=this.animations[Z],G=q.getTargets();for(let z of G)if(z instanceof Element&&$.has(z)){Q.push(q);break}}for(let Z of Q)Z.kill()}getActiveCount(){let J=0;for(let $=0,Q=this.animations.length;$<Q;$++)if(this.animations[$].isActive())J++;return J}getTotalCreated(){return this.totalCreated}getTimeline(J){let $=this.timelines.get(J);if(!$){if($=new b(J),!this.timelines.has(J))this.timelines.set(J,$),$.setUnregisterCallback(()=>this.removeTimeline(J))}return $}hasTimeline(J){return this.timelines.has(J)}registerTimeline(J,$){this.timelines.set(J,$),$.setUnregisterCallback(()=>this.removeTimeline(J))}getTimelineCount(){return this.timelines.size}getTimelineNames(){return Array.from(this.timelines.keys())}removeTimeline(J){this.timelines.delete(J)}killAllTimelines(){for(let J of this.timelines.values())J.kill();this.timelines.clear()}killEverything(){this.killAllTimelines(),this.killAll(),xJ()}getAnimationPool(){return this.animationPool}getPropTweenPool(){return this.propTweenPool}getPoolStats(){return{animations:this.animationPool.getPoolSize(),propTweens:this.propTweenPool.getPoolSize()}}clearPools(){this.animationPool.clear(),this.propTweenPool.clear()}getMemoryEstimate(){let J=this.animations.length,$=this.animationPool.getPoolSize(),Q=this.propTweenPool.getPoolSize();return(J+$)*500+Q*100}getTicker(){return this.ticker}}function G6(J){if(!("transform"in J))return J;let $=J.transform;if(typeof $!=="string")return J;let Q=/([a-zA-Z0-9]+)\(([^)]+)\)/g,Z,j={},q=!1;while((Z=Q.exec($))!==null){let z=Z[1],N=Z[2].match(/[-+]?\d*\.?\d+(?:e[-+]?\d+)?[a-z%]*/gi)||[];switch(z){case"perspective":{if(!("perspective"in J))j.perspective=N[0]||"0px",q=!0;break}case"translate":{if(N[0]&&!("x"in J))j.x=N[0],q=!0;if(N[1]&&!("y"in J))j.y=N[1],q=!0;break}case"translate3d":{if(N[0]&&!("x"in J))j.x=N[0],q=!0;if(N[1]&&!("y"in J))j.y=N[1],q=!0;if(N[2]&&!("z"in J))j.z=N[2],q=!0;break}case"translateX":{if(N[0]&&!("x"in J))j.x=N[0],q=!0;break}case"translateY":{if(N[0]&&!("y"in J))j.y=N[0],q=!0;break}case"translateZ":{if(N[0]&&!("z"in J))j.z=N[0],q=!0;break}case"rotate":{if(N[0]&&!("rotate"in J))j.rotate=N[0],q=!0;break}case"rotateX":{if(N[0]&&!("rotateX"in J))j.rotateX=N[0],q=!0;break}case"rotateY":{if(N[0]&&!("rotateY"in J))j.rotateY=N[0],q=!0;break}case"rotateZ":{if(N[0]&&!("rotateZ"in J))j.rotateZ=N[0],q=!0;break}case"scale":{if(N[0]&&!("scale"in J))j.scale=parseFloat(N[0]),q=!0;break}case"scaleX":{if(N[0]&&!("scaleX"in J))j.scaleX=parseFloat(N[0]),q=!0;break}case"scaleY":{if(N[0]&&!("scaleY"in J))j.scaleY=parseFloat(N[0]),q=!0;break}case"scaleZ":{if(N[0]&&!("scaleZ"in J))j.scaleZ=parseFloat(N[0]),q=!0;break}case"skew":{if(N[0]&&!("skewX"in J))j.skewX=N[0],q=!0;if(N[1]&&!("skewY"in J))j.skewY=N[1],q=!0;break}case"skewX":{if(N[0]&&!("skewX"in J))j.skewX=N[0],q=!0;break}case"skewY":{if(N[0]&&!("skewY"in J))j.skewY=N[0],q=!0;break}default:break}}if(!q)return J;let G={...j};for(let[z,W]of Object.entries(J)){if(z==="transform")continue;G[z]=W}return G}function z6(J){let $=!1;for(let Z of Object.keys(J))if(Z.includes("-")&&!Z.startsWith("--")){$=!0;break}if(!$)return J;let Q={};for(let[Z,j]of Object.entries(J))if(Z.includes("-")&&!Z.startsWith("--")){let q=Z.replace(/-([a-z])/g,(G,z)=>z.toUpperCase());Q[q]=j}else Q[Z]=j;return Q}function E7(J,$){if(typeof J==="string"){let Q=$||(typeof document<"u"?document:null);if(!Q)return[];try{return Array.from(Q.querySelectorAll(J))}catch{return[]}}if(typeof Element<"u"&&J instanceof Element)return[J];if(typeof NodeList<"u"&&J instanceof NodeList||typeof HTMLCollection<"u"&&J instanceof HTMLCollection)return Array.from(J);if(Array.isArray(J))return J;if(J&&typeof J==="object"&&"length"in J)return Array.from(J);return[]}function b7(J,$,Q){if(Q===void 0)return(Z)=>Math.min($,Math.max(J,Z));return Math.min($,Math.max(J,Q))}function C7(J,$,Q){let Z=J+Math.random()*($-J);if(Q&&Q>0)return Math.round(Z/Q)*Q;return Z}function V7(J,$){let Q=(Z)=>{if(typeof J==="number"){if(J<=0)return Z;return Math.round(Z/J)*J}let j=J,q=j[0],G=Math.abs(Z-q);for(let z=1;z<j.length;z++){let W=Math.abs(Z-j[z]);if(W<G)G=W,q=j[z]}return q};if($===void 0)return Q;return Q($)}function x7(J,$,Q){return J+($-J)*Q}function w7(J,$,Q,Z,j){let q=(G)=>{let z=(G-J)/($-J);return Q+z*(Z-Q)};if(j===void 0)return q;return q(j)}function P7(J,$,Q){let Z=(j)=>(j-J)/($-J);if(Q===void 0)return Z;return Z(Q)}function S7(J,$,Q){let Z=$-J,j=(q)=>{return((q-J)%Z+Z)%Z+J};if(Q===void 0)return j;return j(Q)}var UJ={toArray:E7,clamp:b7,random:C7,snap:V7,interpolate:x7,mapRange:w7,normalize:P7,wrap:S7};function l(J,$,Q){let j=C.getInstance().getTimeline(J);if($!==void 0&&j.duration()>0)console.warn(`[Motion] Timeline "${J}" already has animations. New entries will be appended. Call Motion("${J}").kill() first to rebuild from scratch.`);if(Array.isArray($)&&$.length>0&&typeof $[0]==="object"&&$[0]!==null&&"target"in $[0])for(let q of $)j._addEntry(q.target,q,q.position);else if($!==void 0&&Q!==void 0)j._addEntry($,Q);return j}l.reset=function(J){C.getInstance();let $=D0(J),Q=[];for(let Z of $)if(Z instanceof Element)Q.push(Z);if(Q.length>0)C.getInstance().killAnimationsForTargets(Q);for(let Z of $){if(!(Z instanceof Element))continue;if(U.textSplitter?.isSplit?.(Z))U.textSplitter?.revert?.(Z);v(Z),U.styleReset?.clearAnimationStylesAndUnregister?.(Z),U.styleReset?.clearPinStylesAndUnregister?.(Z)}};l.set=function(J,$){C.getInstance();let Q=new b;Q._addEntry(J,{to:$,duration:0}),Q.kill(!1)};l.get=function(J){let $=C.getInstance();return $.hasTimeline(J)?$.getTimeline(J):void 0};l.has=function(J){return C.getInstance().hasTimeline(J)};l.getNames=function(){return C.getInstance().getTimelineNames()};l.kill=function(J){let $=C.getInstance();if($.hasTimeline(J))$.getTimeline(J).kill()};l.killAll=function(){C.getInstance().killEverything()};l.refreshScrollTriggers=function(){U.triggerManager?.getInstance?.()?.refreshScrollTriggers()};l.cleanup=function(){if(typeof document>"u")return;document.querySelectorAll("[data-scrolltrigger-spacer]").forEach((J)=>J.remove()),document.querySelectorAll("[data-scrolltrigger-markers]").forEach((J)=>J.remove())};l.utils=UJ;var y7=l;var v7={};export{v7 as Types,b as Timeline,UJ as MotionUtils,y7 as Motion};
31
+ `,F.appendChild(A),F},X=H("scroller-start",Q,"right"),K=H("scroller-end",Z,"right"),_=H("start",Q,"left"),B=H("end",Z,"left");if(!this._triggerElement)_.style.display="none",B.style.display="none";if(this._markerContainer.appendChild(X),this._markerContainer.appendChild(K),this._markerContainer.appendChild(_),this._markerContainer.appendChild(B),this._markers={scrollerStart:X,scrollerEnd:K,elementStart:_,elementEnd:B},q){let U=this._scroller;if(window.getComputedStyle(U).position==="static")U.style.position="relative";U.appendChild(this._markerContainer)}else document.body.appendChild(this._markerContainer),this._markerContainer.style.position="fixed";this._scrollerStartOffset=Y,this._scrollerEndOffset=N,this._cacheElementPositions(z)}_cacheElementPositions(J){if(!this._triggerElement){this._cachedElPositionValid=!1;return}let $=o(this._triggerElement),Q=d(this._startConfig.split(" ")[0]||"top",$.height,J),Z=this._endConfig.startsWith("+=")?Q:d(this._endConfig.split(" ")[0]||"bottom",$.height,J);if(this._scroller!==window){let q=this._scroller.getBoundingClientRect(),z=this._scroller.scrollTop,G=$.top-q.top+z;this._cachedElStartDocTop=G+Q,this._cachedElEndDocTop=G+Z}else{let q=window.scrollY||window.pageYOffset||0,z=$.top+q;this._cachedElStartDocTop=z+Q,this._cachedElEndDocTop=z+Z}this._cachedElPositionValid=!0}update(J,$,Q){if(!this._markers||!this._markerContainer)return;let Z=this._triggerElement;if(this._triggerElement=$||void 0,this._triggerElement!==Z)this._cacheElementPositions(Q);let j=this._scroller!==window;if(j)this._markers.scrollerStart.style.top=`${J+this._scrollerStartOffset}px`,this._markers.scrollerEnd.style.top=`${J+this._scrollerEndOffset}px`;else this._markers.scrollerStart.style.top=`${this._scrollerStartOffset}px`,this._markers.scrollerEnd.style.top=`${this._scrollerEndOffset}px`;if(this._triggerElement&&this._cachedElPositionValid)if(this._markers.elementStart.style.display="",this._markers.elementEnd.style.display="",j)this._markers.elementStart.style.top=`${this._cachedElStartDocTop}px`,this._markers.elementEnd.style.top=`${this._cachedElEndDocTop}px`;else this._markers.elementStart.style.top=`${this._cachedElStartDocTop-J}px`,this._markers.elementEnd.style.top=`${this._cachedElEndDocTop-J}px`;else this._markers.elementStart.style.display="none",this._markers.elementEnd.style.display="none"}recachePositions(J){this._cacheElementPositions(J)}cleanup(){if(this._markerContainer&&this._markerContainer.parentNode)this._markerContainer.parentNode.removeChild(this._markerContainer);this._markerContainer=void 0,this._markers=void 0,this._triggerElement=void 0}}class q0 extends m{static _nextId=0;_id;static _SCRUB_TICKER_PRIORITY=1;static _activeInstances=new Set;static _loadListenerAdded=!1;_scrollListener;_scrubTickListener=null;_currentProgress=0;_targetProgress=0;_scrubLag=0;_scroller;_triggerStart=0;_triggerEnd=0;_pinManager=null;_markerManager=null;_triggerState="before";_toggleActions=["play","none","none","none"];_initializing=!1;constructor(J,$){super(J,$);this._id=q0._nextId++,this._scrubLag=typeof $.scrub==="number"?$.scrub:0}static _ensureLoadListener(){if(q0._loadListenerAdded||typeof window>"u")return;if(q0._loadListenerAdded=!0,document.readyState==="complete")return;window.addEventListener("load",()=>{setTimeout(()=>{for(let J of q0._activeInstances)J.refresh()},100)},{once:!0})}_resolveScroller(){if(this._config.scroller)if(typeof this._config.scroller==="string"){if(typeof document>"u"){this._scroller=window;return}try{let J=document.querySelector(this._config.scroller);this._scroller=J??window}catch(J){console.warn(`[Motion] Invalid scroller selector "${this._config.scroller}":`,J),this._scroller=window}}else this._scroller=this._config.scroller;else this._scroller=window}_resolvePinElement(){if(!this._config.pin||typeof document>"u")return null;let J=null;if(typeof this._config.pin==="string")J=document.querySelector(this._config.pin);else if(this._config.pin===!0){let $=this._getFirstAnimatedElement();if($ instanceof HTMLElement)J=$}return J}_defaultStart(){return this._config.start||(this._config.pin?"top top":"top bottom")}_defaultEnd(){return this._config.end||"bottom top"}_getFirstAnimatedElement(){let J=this._timeline.getFirstChildBuilder();if(J){let Q=J.hasSplit()?J.getOriginalTargets():J.getTargets();for(let Z of Q)if(Z instanceof Element)return Z}let $=this._timeline.getFirstChildAnimation();if($){let Q=$.getTargets();if(Q.length>0&&Q[0]instanceof Element)return Q[0]}return null}_resolveTriggerElement(){if(this._config.target instanceof Element)return this._config.target;if(typeof this._config.target==="string"&&typeof document<"u"){let J=document.querySelector(this._config.target);if(J instanceof Element)return J}return this._getFirstAnimatedElement()}_calculateTriggerPositions(J){let $=J||this._resolveTriggerElement(),Q=this._getViewportHeight(),Z=this._getScrollTop();if(!$){this._triggerStart=0,this._triggerEnd=this._getScrollHeight();return}let j=this._pinManager?.getLayoutRect()??o($),q;if(this._scroller instanceof Element){let _=this._scroller.getBoundingClientRect();q=j.top-_.top+Z}else q=j.top+Z;let G=this._defaultStart().split(" "),Y=G[0]||"top",N=G[1]||"top",H=d(Y,j.height,Q),X=d(N,Q,Q);this._triggerStart=q+H-X;let K=this._defaultEnd();if(K.startsWith("+=")){let _=d(K.slice(2),Q,Q);this._triggerEnd=this._triggerStart+_}else{let _=K.split(" "),B=_[0]||"bottom",U=_[1]||"top",W=d(B,j.height,Q),O=d(U,Q,Q);this._triggerEnd=q+W-O}if(this._triggerEnd<=this._triggerStart)this._triggerEnd=this._triggerStart+Math.max(Q,100)}_onEnable(){this._resolveScroller();let J=this._resolvePinElement();this._calculateTriggerPositions(J),q0._activeInstances.add(this),q0._ensureLoadListener();let Q=(this._config.toggleActions||"play none none none").trim().split(/\s+/);if(this._toggleActions=[Q[0],Q[1],Q[2],Q[3]],J){let j=this._defaultStart().split(" "),q=this._getViewportHeight(),z=d(j[0]||"top",J.getBoundingClientRect().height,q),Y=d(j[1]||"top",q,q)-z;this._pinManager=h.getOrCreate(this._id,J),this._pinManager.setup(J,this._triggerStart,this._triggerEnd,Y,this._scroller===window,this._config.pinSpacing)}if(this._config.markers&&typeof document<"u"){let Z=this._pinManager?.getElement()||this._resolveTriggerElement();this._markerManager=new fJ(this._id),this._markerManager.setup({scroller:this._scroller,triggerElement:Z,startConfig:this._defaultStart(),endConfig:this._defaultEnd(),markerConfig:this._config.markers,viewportHeight:this._getViewportHeight()})}if(this._scrollListener=()=>this._onScroll(),this._scroller){if(this._scroller.addEventListener("scroll",this._scrollListener,{passive:!0}),this._initializing=!0,this._onScroll(),this._initializing=!1,this._config.scrub===!1||this._config.scrub===void 0){if(this._triggerState==="active")u(this._toggleActions[0],this._timeline);else if(this._triggerState==="after")this._timeline.progress(1),this._timeline.pause()}}}_onDisable(){if(this._scrollListener&&this._scroller)this._scroller.removeEventListener("scroll",this._scrollListener);if(this._markerManager?.cleanup(),this._markerManager=null,this._pinManager){let J=this._pinManager.getElement();if(J)h.release(this._id,J);else this._pinManager.cleanup();this._pinManager=null}this._stopSmoothScrollLoop(),q0._activeInstances.delete(this)}refresh(){if(!this._enabled)return;let J=this._pinManager?.getElement()||null,$=this._pinManager?.suspendHtmlHeight?.()??null;if(this._calculateTriggerPositions(J),$?.(),this._pinManager&&J){let Z=this._defaultStart().split(" "),j=this._getViewportHeight(),q=this._pinManager.getLayoutRect()?.height??J.getBoundingClientRect().height,z=d(Z[0]||"top",q,j),Y=d(Z[1]||"top",j,j)-z;this._pinManager.setup(J,this._triggerStart,this._triggerEnd,Y,this._scroller===window,this._config.pinSpacing)}if(this._markerManager)this._markerManager.recachePositions(this._getViewportHeight());this._onScroll()}_getViewportHeight(){if(this._scroller===window)return typeof window<"u"?window.innerHeight:0;else if(this._scroller instanceof Element)return this._scroller.clientHeight;return 0}_getScrollTop(){if(this._scroller===window)return typeof window<"u"?window.scrollY||window.pageYOffset:0;else if(this._scroller instanceof Element)return this._scroller.scrollTop;return 0}_getScrollHeight(){if(this._scroller===window){if(typeof document<"u"&&document.documentElement)return document.documentElement.scrollHeight-window.innerHeight;return 0}else if(this._scroller instanceof Element)return this._scroller.scrollHeight-this._scroller.clientHeight;return 0}_onScroll(){if(!this._enabled)return;let J=this._getScrollTop(),$=this._triggerEnd-this._triggerStart,Q=$>0?(J-this._triggerStart)/$:0;if(Q=Math.max(0,Math.min(1,Q)),Q=this._applySnap(Q),this._targetProgress=Q,this._pinManager?.update(J),this._markerManager){let Z=this._pinManager?.getElement()||this._resolveTriggerElement();this._markerManager.update(J,Z,this._getViewportHeight())}if(this._config.scrub!==!1&&this._config.scrub!==void 0)if(this._scrubLag===0)this._currentProgress=this._targetProgress,CJ(()=>this._timeline.progress(this._currentProgress));else this._startSmoothScrollLoop();else{let Z;if(Q<=0)Z="before";else if(Q>=1)Z="after";else Z="active";if(Z!==this._triggerState){let j=this._triggerState;if(this._triggerState=Z,this._initializing)return;CJ(()=>{if(Z==="active"&&j==="before")u(this._toggleActions[0],this._timeline);else if(Z==="after"&&j==="active")u(this._toggleActions[1],this._timeline);else if(Z==="active"&&j==="after")u(this._toggleActions[2],this._timeline);else if(Z==="before"&&j==="active")u(this._toggleActions[3],this._timeline);else if(Z==="after"&&j==="before")u(this._toggleActions[0],this._timeline),this._timeline.progress(1),u(this._toggleActions[1],this._timeline);else if(Z==="before"&&j==="after")u(this._toggleActions[2],this._timeline),this._timeline.progress(0),u(this._toggleActions[3],this._timeline)})}}}_applySnap(J){let $=this._config.snap;if($==null)return J;if(typeof $==="function")return $(J);if(Array.isArray($)){let Q=$[0]??J,Z=Math.abs(J-Q);for(let j=1;j<$.length;j++){let q=Math.abs(J-$[j]);if(q<Z)Z=q,Q=$[j]}return Q}if(typeof $==="number"&&$>0)return Math.round(J/$)*$;return J}_startSmoothScrollLoop(){if(this._scrubTickListener)return;this._scrubTickListener=(J,$)=>{if(!this._enabled){this._stopSmoothScrollLoop();return}let Q=this._targetProgress-this._currentProgress,Z=1-Math.exp(-J*3/this._scrubLag);if(this._currentProgress+=Q*Z,Math.abs(this._targetProgress-this._currentProgress)<0.0001){this._currentProgress=this._targetProgress,this._timeline.progress(this._currentProgress),this._stopSmoothScrollLoop();return}this._timeline.progress(this._currentProgress)},T.getInstance().add(this._scrubTickListener,q0._SCRUB_TICKER_PRIORITY)}_stopSmoothScrollLoop(){if(this._scrubTickListener)T.getInstance().remove(this._scrubTickListener),this._scrubTickListener=null}}D.registerTrigger("scroll",q0);class K6{_registrations=[];_domContentLoaded=!1;_windowLoaded=!1;_initialized=!1;constructor(){this._initialize()}_initialize(){if(this._initialized)return;if(this._initialized=!0,typeof document<"u"){if(document.addEventListener("DOMContentLoaded",()=>{this._domContentLoaded=!0,this._triggerDuring()}),typeof window<"u")window.addEventListener("load",()=>{this._windowLoaded=!0,this._triggerAfter()});if(document.readyState==="interactive"||document.readyState==="complete")this._domContentLoaded=!0;if(document.readyState==="complete")this._windowLoaded=!0}}register(J,$){let Q=$.timing||"during",Z=$.paused===!0;if(this._registrations.push({timeline:J,timing:Q,paused:Z}),Z)return;if(Q==="before")J.play();else if(Q==="during"&&this._domContentLoaded)J.play();else if(Q==="after"&&this._windowLoaded)J.play()}unregister(J){this._registrations=this._registrations.filter(($)=>$.timeline!==J)}clear(){this._registrations=[]}_triggerDuring(){this._registrations.filter((J)=>J.timing==="during"&&!J.paused).forEach((J)=>J.timeline.play())}_triggerAfter(){this._registrations.filter((J)=>J.timing==="after"&&!J.paused).forEach((J)=>J.timeline.play())}_reset(){this._registrations=[],this._domContentLoaded=!1,this._windowLoaded=!1,this._initialized=!1,this._initialize()}}D.registerPageLoadTrigger(K6);class B6 extends m{_targets=[];_listeners=new Map;_frozenRects=new Map;_state={x:0.5,y:0.5,distance:0.5,isInside:!1};_targetState={targetX:0.5,targetY:0.5,targetDistance:0.5};_tickerCallback;_defaultStartProgress=0.5;_defaultLeaveProgress=0.5;constructor(J,$){super(J,$);this._config={type:"distance",startProgress:this._defaultStartProgress,leaveProgress:this._defaultLeaveProgress,...$};let Q=this._config.startProgress??this._defaultStartProgress;this._state.x=Q,this._state.y=Q,this._state.distance=Q,this._targetState.targetX=Q,this._targetState.targetY=Q,this._targetState.targetDistance=Q}_onEnable(){if(this._targets=this._resolveElements(this._config.target),this._targets.length===0)this._addViewportListeners();else this._addTargetListeners();if(this._config.smooth!==void 0&&this._config.smooth>0)this._startSmoothingTicker();this._updateTimelineProgress()}_onDisable(){if(this._tickerCallback)T.getInstance().remove(this._tickerCallback),this._tickerCallback=void 0;this._frozenRects.clear(),this._cleanupListenerMap(this._listeners)}_addViewportListeners(){if(typeof window>"u")return;let J=new Map,$=(Q)=>{let Z=Q;this._handleViewportMouseMove(Z.clientX,Z.clientY)};window.addEventListener("mousemove",$),J.set("mousemove",$),this._state.isInside=!0,this._listeners.set(window,J)}refresh(){for(let J of this._targets)this._frozenRects.set(J,o(J))}_addTargetListeners(){this._targets.forEach((J)=>{this._frozenRects.set(J,o(J));let $=new Map,Q=(q)=>{let z=q;this._handleTargetMouseMove(J,z.clientX,z.clientY)};J.addEventListener("mousemove",Q),$.set("mousemove",Q);let Z=()=>{this._state.isInside=!0};J.addEventListener("mouseenter",Z),$.set("mouseenter",Z);let j=()=>{this._state.isInside=!1,this._handleMouseLeave()};J.addEventListener("mouseleave",j),$.set("mouseleave",j),this._listeners.set(J,$)})}_handleViewportMouseMove(J,$){if(typeof window>"u")return;let{innerWidth:Q,innerHeight:Z}=window,j=Q/2,q=Z/2;if(this._config.type==="axis")this._targetState.targetX=J/Q,this._targetState.targetY=$/Z;else{let z=J-j,G=$-q,Y=Math.sqrt(z*z+G*G),N=Math.sqrt(j*j+q*q);this._targetState.targetDistance=1-Math.min(Y/N,1)}this._applyProgress()}_handleTargetMouseMove(J,$,Q){let Z=this._frozenRects.get(J)??J.getBoundingClientRect(),j=Z.left+Z.width/2,q=Z.top+Z.height/2;if(this._config.type==="axis"){let z=$-Z.left,G=Q-Z.top;this._targetState.targetX=Math.max(0,Math.min(1,z/Z.width)),this._targetState.targetY=Math.max(0,Math.min(1,G/Z.height))}else{let z=$-j,G=Q-q,Y=Math.sqrt(z*z+G*G),N=Math.sqrt(Math.pow(Z.width/2,2)+Math.pow(Z.height/2,2));this._targetState.targetDistance=1-Math.min(Y/N,1)}this._applyProgress()}_handleMouseLeave(){let J=this._config.leaveProgress??this._defaultLeaveProgress;if(this._targetState.targetX=J,this._targetState.targetY=J,this._targetState.targetDistance=J,!this._config.smooth)this._state.x=J,this._state.y=J,this._state.distance=J,this._updateTimelineProgress()}_applyProgress(){if(this._config.smooth)return;this._state.x=this._targetState.targetX,this._state.y=this._targetState.targetY,this._state.distance=this._targetState.targetDistance,this._updateTimelineProgress()}_startSmoothingTicker(){let J=Math.max(0,Math.min(1,this._config.smooth??0.1));this._tickerCallback=($)=>{let Q=this._lerp(this._state.x,this._targetState.targetX,J,$),Z=this._lerp(this._state.y,this._targetState.targetY,J,$),j=this._lerp(this._state.distance,this._targetState.targetDistance,J,$),q=0.0001,z=Math.abs(Q-this._state.x)<0.0001&&Math.abs(Q-this._targetState.targetX)<0.0001,G=Math.abs(Z-this._state.y)<0.0001&&Math.abs(Z-this._targetState.targetY)<0.0001,Y=Math.abs(j-this._state.distance)<0.0001&&Math.abs(j-this._targetState.targetDistance)<0.0001;if(this._state.x=Q,this._state.y=Z,this._state.distance=j,!z||!G||!Y)this._updateTimelineProgress()},T.getInstance().add(this._tickerCallback)}_lerp(J,$,Q,Z){let j=$-J;if(Math.abs(j)<0.0001)return $;let q=0.5*Math.pow(1-Q,2)+0.005,z=1-Math.pow(1-q,Z*60);return J+j*z}_updateTimelineProgress(){if(this._config.type==="axis")this._timeline.setAxisProgress("x",this._state.x),this._timeline.setAxisProgress("y",this._state.y);else this._timeline.progress(this._state.distance)}}D.registerTrigger("mouseMove",B6);class m0 extends m{_target=window;_tolerance;_dragMinimum;_dragMinimumSquared;_wheelSpeed;_scrollSpeed;_stopDelay;_preventDefault;_lockAxis;_animationStep;_smooth;_startX=0;_startY=0;_deltaX=0;_deltaY=0;_lockedAxis=null;_isPressed=!1;_isDragging=!1;_lastDirectionX=null;_lastDirectionY=null;_lastScrollX=0;_lastScrollY=0;_stopTimeout=null;_isMoving=!1;_lastActivityTime=0;_pendingActions=new Map;_rafScheduled=!1;_rafId=null;_wheelAccumulatorX=0;_wheelAccumulatorY=0;_wheelRafId=null;_scrollRafId=null;_lastPointerX=0;_lastPointerY=0;_activatedDirections=new Set;_targetProgress=0;_currentProgress=0;_interpolationRafId=null;_siblings=null;_index=0;static _sequenceStates=new WeakMap;_boundHandlers={};_frozenHoverRect=null;_gestureHoverActive=!1;_boundHoverMoveHandler=null;constructor(J,$){super(J,$);this._tolerance=$.tolerance??1,this._dragMinimum=$.dragMinimum??10,this._dragMinimumSquared=this._dragMinimum*this._dragMinimum,this._wheelSpeed=$.wheelSpeed??1,this._scrollSpeed=$.scrollSpeed??1,this._stopDelay=$.stopDelay??150,this._preventDefault=$.preventDefault??!1,this._lockAxis=$.lockAxis??!1,this._animationStep=$.animationStep??0.1,this._smooth=Math.max(0,Math.min(1,$.smooth??0));let Q=$;if(Q._siblings&&Q._index!==void 0){if(this._siblings=Q._siblings,this._index=Q._index,!m0._sequenceStates.has(this._siblings))m0._sequenceStates.set(this._siblings,{lastIndex:0})}}_onEnable(){let J=this._resolveElement(this._config.target,window);this._target=J??window;let $=this._config.types;if($.includes("pointer"))this._addPointerListeners();if($.includes("touch"))this._addTouchListeners();if($.includes("wheel"))this._addWheelListener();if($.includes("scroll"))this._addScrollListener();if(this._config.events.Hover||this._config.events.HoverEnd)this._addHoverListeners()}_onDisable(){if(this._stopTimeout)clearTimeout(this._stopTimeout),this._stopTimeout=null;if(this._rafId!==null)cancelAnimationFrame(this._rafId),this._rafId=null;if(this._wheelRafId!==null)cancelAnimationFrame(this._wheelRafId),this._wheelRafId=null;if(this._scrollRafId!==null)cancelAnimationFrame(this._scrollRafId),this._scrollRafId=null;if(this._interpolationRafId!==null)cancelAnimationFrame(this._interpolationRafId),this._interpolationRafId=null;this._rafScheduled=!1,this._pendingActions.clear();let J=this._target;if(this._boundHandlers.pointerDown)J.removeEventListener("pointerdown",this._boundHandlers.pointerDown),window.removeEventListener("pointermove",this._boundHandlers.pointerMove),window.removeEventListener("pointerup",this._boundHandlers.pointerUp);if(this._boundHandlers.touchStart)J.removeEventListener("touchstart",this._boundHandlers.touchStart),window.removeEventListener("touchmove",this._boundHandlers.touchMove),window.removeEventListener("touchend",this._boundHandlers.touchEnd);if(this._boundHandlers.wheel)J.removeEventListener("wheel",this._boundHandlers.wheel);if(this._boundHandlers.scroll)(this._target===window?window:this._target).removeEventListener("scroll",this._boundHandlers.scroll);if(this._boundHoverMoveHandler)window.removeEventListener("mousemove",this._boundHoverMoveHandler),this._boundHoverMoveHandler=null;this._frozenHoverRect=null,this._gestureHoverActive=!1,this._boundHandlers={}}_addPointerListeners(){this._boundHandlers.pointerDown=this._handlePointerDown.bind(this),this._boundHandlers.pointerMove=this._handlePointerMove.bind(this),this._boundHandlers.pointerUp=this._handlePointerUp.bind(this);let J={passive:!this._preventDefault};this._target.addEventListener("pointerdown",this._boundHandlers.pointerDown,J),window.addEventListener("pointermove",this._boundHandlers.pointerMove,J),window.addEventListener("pointerup",this._boundHandlers.pointerUp)}_handlePointerDown(J){if(J.pointerType==="touch"&&this._config.types.includes("touch"))return;if(this._preventDefault)J.preventDefault();this._handleInputStart(J.clientX,J.clientY)}_handlePointerMove(J){if(J.pointerType==="touch"&&this._config.types.includes("touch"))return;if(this._handleInputMove(J.clientX,J.clientY)){if(this._preventDefault)J.preventDefault()}}_handlePointerUp(J){if(J.pointerType==="touch"&&this._config.types.includes("touch"))return;this._handleInputEnd()}_addTouchListeners(){this._boundHandlers.touchStart=this._handleTouchStart.bind(this),this._boundHandlers.touchMove=this._handleTouchMove.bind(this),this._boundHandlers.touchEnd=this._handleTouchEnd.bind(this);let J={passive:!this._preventDefault};this._target.addEventListener("touchstart",this._boundHandlers.touchStart,J),window.addEventListener("touchmove",this._boundHandlers.touchMove,J),window.addEventListener("touchend",this._boundHandlers.touchEnd)}_handleTouchStart(J){if(this._preventDefault)J.preventDefault();let $=J.touches[0];if(!$)return;this._handleInputStart($.clientX,$.clientY)}_handleTouchMove(J){let $=J.touches[0];if(!$)return;if(this._handleInputMove($.clientX,$.clientY)){if(this._preventDefault)J.preventDefault()}}_handleTouchEnd(J){this._handleInputEnd()}_handleInputStart(J,$){this._fireEvent("PressInit"),this._startX=J,this._startY=$,this._lastPointerX=J,this._lastPointerY=$,this._deltaX=0,this._deltaY=0,this._isPressed=!0,this._isDragging=!1,this._lockedAxis=null,this._fireEvent("Press")}_handleInputMove(J,$){if(!this._isPressed)return!1;let Q=J-this._lastPointerX,Z=$-this._lastPointerY;if(Math.abs(Q)<1&&Math.abs(Z)<1)return!1;this._lastPointerX=J,this._lastPointerY=$;let j=J-this._startX,q=$-this._startY;if(this._updateDeltas(j,q),this._checkDragStart(),this._checkDirectionAndFire(!1),this._checkToggle(j,q),this._scheduleStopCheck(),this._isDragging)this._fireEvent("Drag");return!0}_handleInputEnd(){if(!this._isPressed)return;if(this._isDragging)this._fireEvent("DragEnd");this._fireEvent("Release"),this._fireCompleteCallbacks(),this._fireEvent("Stop"),this._resetGestureState()}_addWheelListener(){this._boundHandlers.wheel=this._handleWheel.bind(this),this._target.addEventListener("wheel",this._boundHandlers.wheel,{passive:!this._preventDefault})}_handleWheel(J){if(this._preventDefault)J.preventDefault();if(this._wheelAccumulatorX+=J.deltaX*this._wheelSpeed,this._wheelAccumulatorY+=J.deltaY*this._wheelSpeed,this._wheelRafId!==null)return;this._wheelRafId=requestAnimationFrame(()=>{this._wheelRafId=null,this._deltaX=this._wheelAccumulatorX,this._deltaY=this._wheelAccumulatorY,this._wheelAccumulatorX=0,this._wheelAccumulatorY=0,this._checkDirectionAndFire(!0),this._checkToggle(this._deltaX,this._deltaY),this._scheduleStopCheck(),this._deltaX=0,this._deltaY=0})}_addScrollListener(){if(this._boundHandlers.scroll=this._handleScroll.bind(this),this._target===window)this._lastScrollX=window.scrollX,this._lastScrollY=window.scrollY;else{let J=this._target;this._lastScrollX=J.scrollLeft,this._lastScrollY=J.scrollTop}this._target.addEventListener("scroll",this._boundHandlers.scroll,{passive:!0})}_handleScroll(){if(this._scrollRafId!==null)return;this._scrollRafId=requestAnimationFrame(()=>{this._scrollRafId=null,this._processScroll()})}_processScroll(){let J,$;if(this._target===window)J=window.scrollX,$=window.scrollY;else{let j=this._target;J=j.scrollLeft,$=j.scrollTop}let Q=(J-this._lastScrollX)*this._scrollSpeed,Z=($-this._lastScrollY)*this._scrollSpeed;this._lastScrollX=J,this._lastScrollY=$,this._deltaX=Q,this._deltaY=Z,this._checkDirectionAndFire(!0),this._checkToggle(Q,Z),this._scheduleStopCheck(),this._deltaX=0,this._deltaY=0}_addHoverListeners(){if(this._target===window)return;let J=this._target;this._frozenHoverRect=o(J),this._boundHoverMoveHandler=($)=>{if(!this._frozenHoverRect)return;let Q=this._frozenHoverRect,Z=$.clientX>=Q.left&&$.clientX<=Q.right&&$.clientY>=Q.top&&$.clientY<=Q.bottom;if(Z&&!this._gestureHoverActive)this._gestureHoverActive=!0,this._fireEvent("Hover");else if(!Z&&this._gestureHoverActive)this._gestureHoverActive=!1,this._fireEvent("HoverEnd")},window.addEventListener("mousemove",this._boundHoverMoveHandler)}refresh(){if(this._target===window||!this._frozenHoverRect)return;this._frozenHoverRect=o(this._target)}_updateDeltas(J,$){if(this._lockAxis&&this._lockedAxis)if(this._lockedAxis==="x")this._deltaX=J,this._deltaY=0;else this._deltaX=0,this._deltaY=$;else this._deltaX=J,this._deltaY=$;if(this._lockAxis&&!this._lockedAxis){let Q=this._tolerance;if(Math.abs(this._deltaX)>Q||Math.abs(this._deltaY)>Q)this._lockedAxis=Math.abs(this._deltaX)>Math.abs(this._deltaY)?"x":"y"}}_checkDirectionAndFire(J){let $=this._tolerance;if(J||!this._lockedAxis||this._lockedAxis==="y"){if(this._deltaY<-$){if(this._fireEvent("Up"),!J)this._activatedDirections.add("Up")}if(this._deltaY>$){if(this._fireEvent("Down"),!J)this._activatedDirections.add("Down")}}if(J||!this._lockedAxis||this._lockedAxis==="x"){if(this._deltaX<-$){if(this._fireEvent("Left"),!J)this._activatedDirections.add("Left")}if(this._deltaX>$){if(this._fireEvent("Right"),!J)this._activatedDirections.add("Right")}}if(Math.abs(this._deltaX)>$||Math.abs(this._deltaY)>$){if(this._fireEvent("Change"),Math.abs(this._deltaX)>$)this._fireEvent("ChangeX");if(Math.abs(this._deltaY)>$)this._fireEvent("ChangeY")}}_checkToggle(J,$){let Q=this._tolerance;if(Math.abs(J)>=Q){let Z=J>0?1:-1;if(this._lastDirectionX!==null&&Z!==this._lastDirectionX)this._fireEvent("ToggleX");this._lastDirectionX=Z}if(Math.abs($)>=Q){let Z=$>0?1:-1;if(this._lastDirectionY!==null&&Z!==this._lastDirectionY)this._fireEvent("ToggleY");this._lastDirectionY=Z}}_checkDragStart(){if(this._isDragging)return;if(this._deltaX*this._deltaX+this._deltaY*this._deltaY>this._dragMinimumSquared)this._isDragging=!0}_scheduleStopCheck(){if(this._isMoving=!0,this._lastActivityTime=performance.now(),this._stopTimeout)return;let J=()=>{let $=performance.now()-this._lastActivityTime;if($>=this._stopDelay){if(this._stopTimeout=null,this._isMoving){if(this._isMoving=!1,this._lastDirectionX=null,this._lastDirectionY=null,!this._isPressed)this._fireEvent("Stop")}}else this._stopTimeout=setTimeout(J,this._stopDelay-$)};this._stopTimeout=setTimeout(J,this._stopDelay)}_fireEvent(J){let $=this._config.events[J];if($)this._pendingActions.set($,J),this._scheduleRAF()}_scheduleRAF(){if(this._rafScheduled)return;this._rafScheduled=!0,this._rafId=requestAnimationFrame(()=>{this._rafScheduled=!1,this._rafId=null;for(let[J,$]of this._pendingActions)this._executeAction(J,$);this._pendingActions.clear()})}_getStepForEvent(J){if(typeof this._animationStep==="number")return this._animationStep;if(J&&this._animationStep[J]!==void 0)return this._animationStep[J];let $=Object.values(this._animationStep);return $.length>0?$[0]:0.1}_executeAction(J,$){switch(J){case"play":case"pause":case"reverse":case"restart":case"reset":case"complete":u(J,this._timeline);break;case"toggle":if(this._timeline.isActive())this._timeline.pause();else this._timeline.play();break;case"kill":this._timeline.kill();break;case"playReverse":{let Q=this._timeline.progress();if(Q>=1)this._timeline.reverse();else if(Q<=0)this._timeline.play();else if(!this._timeline.isActive())if(this._timeline.reversed())this._timeline.play();else this._timeline.reverse();break}case"progressUp":this._interpolateProgress(this._getStepForEvent($));break;case"progressDown":this._interpolateProgress(-this._getStepForEvent($));break;case"playNext":this._playSequenceItem(1);break;case"playPrevious":this._playSequenceItem(-1);break}}_playSequenceItem(J){if(!this._siblings||this._siblings.length===0)return;let $=m0._sequenceStates.get(this._siblings);if(!$)return;let Q=this._siblings.length,Z=$.lastIndex,j=(Z+J+Q)%Q,q=this._siblings[Z];if(q&&q.progress()>0)q.reverse();let z=this._siblings[j];if(z)z.restart();$.lastIndex=j}_interpolateProgress(J){let $=this._timeline.progress();if(Math.abs($-this._currentProgress)>0.01)this._currentProgress=$,this._targetProgress=$;if(this._interpolationRafId===null)this._currentProgress=$,this._targetProgress=$;if(this._targetProgress=Math.max(0,Math.min(1,this._targetProgress+J)),this._smooth===0){this._currentProgress=this._targetProgress,this._timeline.progress(this._currentProgress);return}if(this._interpolationRafId===null)this._startInterpolationLoop()}_startInterpolationLoop(){if(this._interpolationRafId!==null)return;let J=0.08+(1-this._smooth)*0.12,$=()=>{let Q=this._targetProgress-this._currentProgress;if(Math.abs(Q)<0.0001){this._currentProgress=this._targetProgress,this._timeline.progress(this._currentProgress),this._interpolationRafId=null;return}this._currentProgress+=Q*J,this._timeline.progress(this._currentProgress),this._interpolationRafId=requestAnimationFrame($)};this._interpolationRafId=requestAnimationFrame($)}_fireCompleteCallbacks(){if(this._activatedDirections.has("Up"))this._fireEvent("UpComplete");if(this._activatedDirections.has("Down"))this._fireEvent("DownComplete");if(this._activatedDirections.has("Left"))this._fireEvent("LeftComplete");if(this._activatedDirections.has("Right"))this._fireEvent("RightComplete");this._activatedDirections.clear()}_resetGestureState(){this._isPressed=!1,this._isDragging=!1,this._deltaX=0,this._deltaY=0,this._lockedAxis=null,this._lastDirectionX=null,this._lastDirectionY=null,this._activatedDirections.clear()}}D.registerTrigger("gesture",m0);var jJ=null,qJ=null;function W6(J,$,Q,Z){let j=J;if(!j.style)return;let q=D0();if(y($))if(E(J,$,Q,Z),q)$0(J);else j.style.transform=w(J);else{let z=Z?`${Q}${Z}`:`${Q}`;if(q)V0(J,$,z);else try{if(j0($))j.style.setProperty($,z);else if($ in j.style)j.style[$]=z;else j.style.setProperty(s($),z)}catch{}}}function U6(J,$,Q,Z,j,q){let z=J;if(!z.style)return;let G=q===1?`rgb(${Math.round(Q)}, ${Math.round(Z)}, ${Math.round(j)})`:`rgba(${Math.round(Q)}, ${Math.round(Z)}, ${Math.round(j)}, ${q})`;if(D0())V0(J,$,G);else try{if(j0($))z.style.setProperty($,G);else if($ in z.style)z.style[$]=G;else z.style.setProperty(s($),G)}catch{}}function O6(J,$,Q,Z){let j=J;if(!j.style)return;if(jJ||(jJ=I.filter)){let q=jJ.interpolateFilters($,Q,Z),z=jJ.filterToString(q);if(D0())V0(J,"filter",z);else j.style.filter=z}}function I6(J,$,Q,Z,j){let q=J;if(!q.style)return;if(qJ||(qJ=I.clipPath)){let z=qJ.interpolateClipPaths(Q,Z,j),G=qJ.clipPathToString(z);if(D0())V0(J,"clip-path",G),V0(J,"-webkit-clip-path",G);else q.style.setProperty("clip-path",G),q.style.setProperty("-webkit-clip-path",G)}}function F6(J,$,Q){let{pathLUT:Z,alignOffset:j,pathOffset:q,pathRotate:z}=Q;if(!Z||Z.length===0)return;let G=$*(Z.length-1),Y=Math.floor(G),N=Math.min(Y+1,Z.length-1),H=G-Y,X=Z[Y],K=Z[N],_=X.x+(K.x-X.x)*H,B=X.y+(K.y-X.y)*H,U=(q?.x??0)+_-(j?.x??0),W=(q?.y??0)+B-(j?.y??0);if(E(J,"x",U,"px"),E(J,"y",W,"px"),z){let O=V7(X.angle,K.angle,H);E(J,"rotate",O,"deg")}if(D0())$0(J);else J.style.transform=w(J)}function V7(J,$,Q){let Z=$-J;if(Z>180)Z-=360;if(Z<-180)Z+=360;return J+Z*Q}var uJ=null,w7=100,C7=500,x7=0.5,p0=[],S7=50;function P7(J){for(let $=0;$<p0.length;$++)if(p0[$].length>=J){let Q=p0.splice($,1)[0];return Q.length=J,Q}return Array(J)}function y7(J){if(p0.length<S7)p0.push(J)}class dJ{target=null;property="";startValue=0;endValue=0;change=0;unit="";next=null;valueType="scalar";startColor=null;endColor=null;changeColor=new Float32Array(4);startFilters=null;endFilters=null;startDraw=null;endDraw=null;pathLength=0;startClipPath=null;endClipPath=null;pathData=null;motionPathLength=0;startProgress=0;endProgress=0;pathRotate=!1;alignOffset=null;pathOffset=null;pathLUT=null;_isElement=!1;init(J,$,Q,Z,j=""){return this.target=J,this.property=$,this.startValue=Q,this.endValue=Z,this.change=Z-Q,this.unit=j,this.valueType="scalar",this._isElement=J instanceof Element,this}initColor(J,$,Q,Z){return this.target=J,this.property=$,this.valueType="color",this.startColor=Q,this.endColor=Z,this.changeColor[0]=Z[0]-Q[0],this.changeColor[1]=Z[1]-Q[1],this.changeColor[2]=Z[2]-Q[2],this.changeColor[3]=Z[3]-Q[3],this._isElement=J instanceof Element,this}initFilter(J,$,Q,Z){return this.target=J,this.property=$,this.valueType="filter",this.startFilters=Q,this.endFilters=Z,this._isElement=J instanceof Element,this}initClipPath(J,$,Q,Z){return this.target=J,this.property=$,this.valueType="clipPath",this.startClipPath=Q,this.endClipPath=Z,this._isElement=J instanceof Element,this}initDrawSVG(J,$,Q,Z,j){return this.target=J,this.property=$,this.valueType="drawSVG",this.startDraw=Q,this.endDraw=Z,this.pathLength=j,this._isElement=J instanceof Element,this}initPath(J,$,Q,Z,j,q,z,G,Y){if(J instanceof Element)x(J,!0);this.target=J,this.property=$,this.valueType="path",this.pathData=Q,this.motionPathLength=Z,this.startProgress=j,this.endProgress=q,this.pathRotate=z,this.alignOffset=G,this.pathOffset=Y,this._isElement=J instanceof Element;let N=Math.abs(q-j),H=Z*N,X=Math.min(C7,Math.max(w7,Math.ceil(H*x7)));this.pathLUT=P7(X+1);for(let K=0;K<=X;K++){let _=K/X,B=j+(q-j)*_;this.pathLUT[K]=xJ(Q,B,z)}return this}render(J){if(!this.target)return;if(this.valueType==="color"&&this.startColor){let $=this.startColor[0]+this.changeColor[0]*J,Q=this.startColor[1]+this.changeColor[1]*J,Z=this.startColor[2]+this.changeColor[2]*J,j=this.startColor[3]+this.changeColor[3]*J;if(this._isElement)U6(this.target,this.property,$,Q,Z,j)}else if(this.valueType==="filter"&&this.startFilters&&this.endFilters){if(this._isElement)O6(this.target,this.startFilters,this.endFilters,J)}else if(this.valueType==="clipPath"&&this.startClipPath&&this.endClipPath){if(this._isElement)I6(this.target,this.property,this.startClipPath,this.endClipPath,J)}else if(this.valueType==="drawSVG"&&this.startDraw&&this.endDraw){if(this._isElement&&this.pathLength>0){let $=this.startDraw.start+(this.endDraw.start-this.startDraw.start)*J,Q=this.startDraw.end+(this.endDraw.end-this.startDraw.end)*J;if(uJ||(uJ=I.drawSVG))uJ.applyDrawSVG(this.target,$,Q,this.pathLength)}}else if(this.valueType==="path"&&this.pathLUT&&this.pathLUT.length>0){if(this._isElement)F6(this.target,J,{pathLUT:this.pathLUT,alignOffset:this.alignOffset??{x:0,y:0},pathOffset:this.pathOffset??{x:0,y:0},pathRotate:this.pathRotate})}else{let $=this.startValue+this.change*J;if(this._isElement)W6(this.target,this.property,$,this.unit);else this.target[this.property]=$}}reset(){if(this.target=null,this.property="",this.startValue=0,this.endValue=0,this.change=0,this.unit="",this.next=null,this.valueType="scalar",this.startColor=null,this.endColor=null,this.startFilters=null,this.endFilters=null,this.startDraw=null,this.endDraw=null,this.pathLength=0,this.startClipPath=null,this.endClipPath=null,this.pathData=null,this.motionPathLength=0,this.startProgress=0,this.endProgress=0,this.pathRotate=!1,this.alignOffset=null,this.pathOffset=null,this.pathLUT)y7(this.pathLUT);this.pathLUT=null,this._isElement=!1}}class g0{pool=[];totalCreated=0;factory;maxSize;constructor(J,$){this.factory=J,this.maxSize=$}acquire(){if(this.pool.length>0)return this.pool.pop();return this.totalCreated++,this.factory()}release(J){if(J.reset(),this.maxSize===void 0||this.pool.length<this.maxSize)this.pool.push(J)}getPoolSize(){return this.pool.length}getTotalCreated(){return this.totalCreated}clear(){this.pool=[]}}var o0=new g0(()=>new dJ,500),K0={acquire:()=>o0.acquire(),release:(J)=>o0.release(J),getPoolSize:()=>o0.getPoolSize(),getTotalCreated:()=>o0.getTotalCreated(),clear:()=>o0.clear()};var L6={x:0,y:0,z:0,rotate:0,rotateX:0,rotateY:0,rotateZ:0,scale:1,scaleX:1,scaleY:1,scaleZ:1,skewX:0,skewY:0,opacity:1};class f{static _createAnimationCallback=null;static setCreateAnimationCallback(J){f._createAnimationCallback=J}_targets;_originalTargets;_fromVars;_toVars;_setVars;_duration=0.5;_delay=0;_ease="power1.out";_animation=null;_animations=[];_built=!1;_splitType;_mask;_repeat;_repeatDelay;_yoyo;_stagger;_axis;_fitConfig;_flapConfig;_onStart;_onUpdate;_onComplete;_onRepeat;_onReverseComplete;_skipInitialFromRender=!1;_plainObjectInitialValues=new Map;_expectedAnimationIds=[];_propsToAnimate=[];constructor(J,$){if(this._targets=a0(J),this._originalTargets=this._targets,$)this._applyAnimationConfig($)}_applyAnimationConfig(J){if(J.from)this._fromVars=J.from;if(J.to)this._toVars=J.to;if(J.set)this._setVars=J.set;if(J.duration!==void 0)if(typeof J.duration!=="number"||!isFinite(J.duration)||J.duration<0)console.warn(`[Motion] Invalid duration: ${J.duration}. Must be a finite number >= 0. Using default.`);else this._duration=J.duration;if(J.delay!==void 0)if(typeof J.delay!=="number"||isNaN(J.delay))console.warn(`[Motion] Invalid delay: ${J.delay}. Must be a number. Using default 0.`);else if(!isFinite(J.delay))console.warn(`[Motion] Invalid delay: ${J.delay}. Infinity is not a valid delay. Using default 0.`);else this._delay=J.delay;if(J.ease)this._ease=J.ease;if(J.split)this._splitType=J.split;if(J.mask)this._mask=J.mask;if(J.stagger!==void 0)this._stagger=J.stagger;if(J.axis)this._axis=J.axis;if(J.fit)this._fitConfig=J.fit;if(J.flap){if(this._flapConfig=J.flap,!this._splitType)this._splitType="chars";else if(!this._splitType.includes("chars"))this._splitType="chars,"+this._splitType;if(this._stagger===void 0)this._stagger={each:0,from:"start"}}if(J.repeat)if(typeof J.repeat==="number")this._repeat=J.repeat;else this._repeat=J.repeat.times,this._repeatDelay=J.repeat.delay,this._yoyo=J.repeat.yoyo;if(J.onStart)this._onStart=J.onStart;if(J.onUpdate)this._onUpdate=J.onUpdate;if(J.onComplete)this._onComplete=J.onComplete;if(J.onRepeat)this._onRepeat=J.onRepeat;if(J.onReverseComplete)this._onReverseComplete=J.onReverseComplete}_capturePlainObjectValues(J){for(let $ of this._targets){if($ instanceof Element)continue;let Q=$,Z={};for(let j of J)if(j in Q&&typeof Q[j]==="number")Z[j]=Q[j];if(Object.keys(Z).length>0)this._plainObjectInitialValues.set($,Z)}}_restorePlainObjectValues(){for(let[J,$]of this._plainObjectInitialValues){let Q=J;for(let[Z,j]of Object.entries($))Q[Z]=j}}_ensureBuilt(){if(!this._built)this._build()}_isInvalidated(){if(this._animations.length===0)return!1;return this._animations.some((J,$)=>{let Q=J.getId(),Z=this._expectedAnimationIds[$];return Q===0||Q!==Z})}rebuildIfPooled(){if(this._isInvalidated()){this._restorePlainObjectValues();for(let J of this._targets)if(J instanceof Element)x(J),I.styleReset?.clearAnimationStylesForProps?.(J,this._propsToAnimate);this._resetBuildState(),this._ensureBuilt()}}_build(){if(this._built)return;if(this._targets.length===0)return;if(!this._fromVars&&!this._toVars&&!this._setVars&&!this._fitConfig&&this._duration<=0)return;if(this._fitConfig){if(!I.fit){console.warn("[Motion] FitResolver not loaded. Did you import the SDK?");return}if(this._built=!0,!f._createAnimationCallback)throw Error("AnimationBuilder: Engine not initialized. Call Engine.init() first.");let G={};if(this._repeat!==void 0)G.repeat=this._repeat;if(this._repeatDelay!==void 0)G.repeatDelay=this._repeatDelay;if(this._yoyo)G.yoyo=this._yoyo;if(this._onStart)G.onStart=this._onStart;if(this._onUpdate)G.onUpdate=this._onUpdate;if(this._onComplete)G.onComplete=this._onComplete;if(this._onRepeat)G.onRepeat=this._onRepeat;if(this._onReverseComplete)G.onReverseComplete=this._onReverseComplete;if(this._stagger!==void 0)G.stagger=this._stagger;let Y=[];for(let H of this._targets){if(!(H instanceof Element))continue;let X=f._createAnimationCallback([H],{},this._duration,this._delay,this._ease,!1,void 0,G);if(Array.isArray(X))Y.push(...X);else Y.push(X)}let N=this._fitConfig;for(let H of Y)for(let X of H.getTargets())if(X instanceof Element)I.fit.registerPendingSetup(H,X,N,K0);this._animation=Y[0]??null,this._animations=Y,this._expectedAnimationIds=Y.map((H)=>H.getId());return}if(this._built=!0,this._setVars&&Object.keys(this._setVars).length>0&&this._toVars&&!this._fromVars)this._fromVars={...this._setVars},this._setVars=void 0;let J={},$=!1,Q;if(this._fromVars&&this._toVars){J={...this._toVars},Q={...this._fromVars},$=!0;for(let G of Object.keys(Q))if(!(G in J))if(G in L6)J[G]=L6[G];else if(_0(G))J[G]="";else if(t(G))J[G]="";else{let Y=Q[G];if(Y===void 0||Y===null)continue;let H=S(Y).unit||l(G),X;for(let _ of this._targets)if(_ instanceof Element){if(j0(G))try{let U=window.getComputedStyle(_).getPropertyValue(G).trim();if(U)X=S(U).value}catch{}else X=QJ(_,G,H);break}let K=X??0;J[G]=H?`${K}${H}`:`${K}`}}else if(this._fromVars)J={...this._fromVars},$=!0;else if(this._toVars)J={...this._toVars};if(this._splitType&&I.textSplitter?.split){let G={mask:!!this._mask,consumer:this},Y=[];for(let N of this._originalTargets)if(N instanceof Element){let H=I.textSplitter?.split(N,this._splitType,G);Y.push(...H)}if(Y.length>0)this._targets=Y}let Z,j;if(this._flapConfig&&I.textFlapper?.prepare&&f._createAnimationCallback){if(Q&&Object.keys(Q).length>0){let Y=[];for(let N of Object.keys(Q)){let H=Q[N],X=J[N];if(H===void 0||X===void 0)continue;if(_0(N)||t(N)||j0(N))continue;if(N==="drawSVG"||N==="path"||N==="clip-path"||N==="clipPath")continue;let K=S(H),_=S(X),B=K.unit||_.unit||l(N);Y.push({prop:N,from:K.value,to:_.value,unit:B,isTransform:y(N)})}if(Y.length>0)j=Y}let G=this._targets.filter((Y)=>Y instanceof HTMLElement);if(G.length>0){let Y=this._repeat!==void 0&&this._repeat!==0,N=I.textFlapper.prepare(G,this._flapConfig,Y,j),H=this._stagger&&I.stagger?I.stagger.resolve(G,this._stagger):void 0;Z=[];let X=0;for(let K=0;K<G.length;K++){let _=G[K].textContent??"";if(_===""||_===" "||_===" "||_===`
32
+ `||_==="\t")continue;if(X>=N.length)break;let U=N[X],W=H?H[K]:0,O=f._createAnimationCallback([U.el],{},this._duration,W,this._ease??"power1.out",!1,void 0,{onUpdate:U.render,onComplete:U.finalize,repeat:Y?Math.ceil(60/this._duration):0,_skipInitialRender:this._skipInitialFromRender||void 0}),F=Array.isArray(O)?O:[O];Z.push(...F),X++}}}if(Z?.length&&this._flapConfig){let G=this._flapConfig.type??"flip",Y=new Set(j?.map((K)=>K.prop)??[]),N=(K)=>{if(Y.has(K))return!0;switch(G){case"fade":return K==="opacity";case"blur":return t(K);default:return!1}},H=[];for(let K of Object.keys(J))if(N(K))H.push(K),delete J[K];if(Q){for(let K of Object.keys(Q))if(N(K)&&!H.includes(K))H.push(K),delete Q[K]}let X=H.filter((K)=>!Y.has(K));if(X.length>0)console.warn(`[Motion.page] Flap type '${G}' owns '${X.join(", ")}' — user-defined values for these properties were removed. Use a different flap type to avoid this conflict.`)}if(this._propsToAnimate=Object.keys(J),Q){for(let G of Object.keys(Q))if(!this._propsToAnimate.includes(G))this._propsToAnimate.push(G)}if(this._plainObjectInitialValues.size===0)this._capturePlainObjectValues(this._propsToAnimate);if($){for(let G of this._targets)if(G instanceof Element)x(G),I.styleReset?.clearAnimationStylesForProps?.(G,this._propsToAnimate)}if(I.styleReset?.registerAnimatedProps){for(let G of this._targets)if(G instanceof Element)I.styleReset?.registerAnimatedProps(G,this._propsToAnimate)}let q={repeat:this._repeat,repeatDelay:this._repeatDelay,yoyo:this._yoyo,stagger:this._stagger,onStart:this._onStart,onUpdate:this._onUpdate,onComplete:this._onComplete,onRepeat:this._onRepeat,onReverseComplete:this._onReverseComplete,_skipInitialRender:this._skipInitialFromRender||void 0};if(!f._createAnimationCallback)throw Error("AnimationBuilder: Engine not initialized. Call AnimationBuilder.setCreateAnimationCallback first.");if(Object.keys(J).length>0||Q&&Object.keys(Q).length>0||!Z?.length){let G=f._createAnimationCallback(this._targets,J,this._duration,this._delay,this._ease,$,Q,q);if(Array.isArray(G))this._animations=G,this._animation=G[0]||null;else this._animation=G,this._animations=[G]}if(Z&&Z.length>0){if(this._animations.push(...Z),!this._animation)this._animation=Z[0]}if(this._expectedAnimationIds=this._animations.map((G)=>G.getId()),this._setVars&&Object.keys(this._setVars).length>0&&f._createAnimationCallback){let G=f._createAnimationCallback(this._targets,{...this._setVars},0,0,"none",!1,void 0,{_skipInitialRender:this._skipInitialFromRender||void 0}),Y=Array.isArray(G)?G:[G];this._animations=[...Y,...this._animations],this._expectedAnimationIds=this._animations.map((N)=>N.getId())}}getAnimation(){return this._ensureBuilt(),this._animation}getAnimations(){return this._ensureBuilt(),this._animations}getTargets(){return this._targets}getOriginalTargets(){return this._originalTargets}hasSplit(){return!!this._splitType}hasFlap(){return!!this._flapConfig}_resetBuildState(){this._built=!1,this._animations=[],this._animation=null,this._expectedAnimationIds=[]}getConfig(){return{fromVars:this._fromVars?{...this._fromVars}:void 0,toVars:this._toVars?{...this._toVars}:void 0,setVars:this._setVars?{...this._setVars}:void 0,duration:this._duration,delay:this._delay,ease:this._ease,axis:this._axis,fit:this._fitConfig?{...this._fitConfig}:void 0,flap:this._flapConfig?{...this._flapConfig}:void 0,split:this._splitType,mask:this._mask,stagger:this._stagger,repeat:this._repeat,repeatDelay:this._repeatDelay,yoyo:this._yoyo,onStart:this._onStart,onUpdate:this._onUpdate,onComplete:this._onComplete,onRepeat:this._onRepeat,onReverseComplete:this._onReverseComplete}}setAxis(J){this._axis=J}getAxis(){return this._axis}setSkipInitialFromRender(J){this._skipInitialFromRender=J}}class GJ{static parse(J,$,Q,Z){if(J===void 0)return $;if(typeof J==="number")return J;let j=J.trim();if(j==="<")return Q;if(j===">")return Z;if(j.startsWith("<")){let q=parseFloat(j.substring(1));if(!isNaN(q))return Q+q}if(j.startsWith(">")){let q=parseFloat(j.substring(1));if(!isNaN(q))return Z+q}if(j.startsWith("+=")){let q=parseFloat(j.substring(2));return $+q}if(j.startsWith("-=")){let q=parseFloat(j.substring(2));return $-q}return console.warn(`Invalid position parameter: "${j}", using current end`),$}}class v{static _eachCounter=0;static _registerWithEngine=null;static setEngineRegisterCallback(J){v._registerWithEngine=J}_name;_children=[];_duration=0;_time=0;_progress=0;_timeScale=1;_isActive=!1;_isReversed=!1;_killed=!1;_atZeroState=!1;_repeat=0;_repeatDelay=0;_yoyo=!1;_currentRepeat=0;_completeFired=!1;_inRepeatDelay=!1;_repeatDelayCounter=0;_onStart;_onUpdate;_onComplete;_onRepeat;_startFired=!1;_trigger;_unregisterCallback;setUnregisterCallback(J){this._unregisterCallback=J}_previousStart=0;_previousEnd=0;_eachInstances;_eachDuration;_initialValues=new Map;_initialTransforms=new Map;_transformElements=new Set;_savedTransitions=new Map;_transitionsDisabled=!1;_splitParentOverrides=new Map;constructor(J,$){if(this._name=J,$?.repeat!==void 0)if(typeof $.repeat==="number")this._repeat=$.repeat;else this._repeat=$.repeat.times,this._repeatDelay=$.repeat.delay??0,this._yoyo=$.repeat.yoyo??!1;if($?.onStart)this._onStart=$.onStart;if($?.onUpdate)this._onUpdate=$.onUpdate;if($?.onComplete)this._onComplete=$.onComplete;if($?.onRepeat)this._onRepeat=$.onRepeat;if(J&&v._registerWithEngine)v._registerWithEngine(J,this)}duration(){if(this._eachDuration!==void 0)return this._eachDuration;return this._duration}totalDuration(){if(this._repeat===-1)return 1/0;return this._duration*(this._repeat+1)+this._repeatDelay*this._repeat}clear(){for(let J of this._children)if(J.type==="animation")J.child.kill();else if(J.type==="timeline")J.child.kill();return this._children=[],this._duration=0,this._time=0,this._progress=0,this._isActive=!1,this._isReversed=!1,this._startFired=!1,this._previousStart=0,this._previousEnd=0,this._initialValues.clear(),this._initialTransforms.clear(),this._transformElements.clear(),this._splitParentOverrides.clear(),this._clearTransitionData(),this._currentRepeat=0,this._completeFired=!1,this._inRepeatDelay=!1,this._repeatDelayCounter=0,this}_captureInitialValues(J){let $=J.getTargets(),Q=J.getFirstPropTween();while(Q){let Z=Q.property;for(let j of $){if(!(j instanceof Element))continue;let q=this._initialValues.get(j);if(!q)q=new Map,this._initialValues.set(j,q);if(!q.has(Z)){let z=j;if(y(Z)||SJ(Z)){if(this._transformElements.add(j),!this._initialTransforms.has(j)){let G=z.style.transform;this._initialTransforms.set(j,G||null)}q.set(Z,{removeInline:!0})}else if(_0(Z)||t(Z))q.set(Z,{removeInline:!0});else if(C0(Z))q.set(Z,{removeInline:!0});else{let G=Z.replace(/([A-Z])/g,"-$1").toLowerCase();if(z.style.getPropertyValue(G)!==""){let N=Y6(j,Z);q.set(Z,{removeInline:!1,value:N.value,unit:N.unit})}else q.set(Z,{removeInline:!0})}}}Q=Q.next}}_restoreInitialValues(){for(let J of this._transformElements){let $=J;x(J);let Q=this._initialTransforms.get(J);if(Q)$.style.transform=Q;else $.style.removeProperty("transform")}for(let[J,$]of this._initialValues){let Q=J;for(let[Z,j]of $){if(y(Z))continue;if(C0(Z)){Q.style.removeProperty("stroke-dasharray"),Q.style.removeProperty("stroke-dashoffset");continue}let q=Z.replace(/([A-Z])/g,"-$1").toLowerCase();if(j.removeInline)Q.style.removeProperty(q);else{let z=`${j.value}${j.unit}`;Q.style.setProperty(q,z)}}}}_disableTransitions(){if(this._transitionsDisabled)return;for(let J of this._savedTransitions.keys())J.style.transition="none";this._transitionsDisabled=!0}_restoreTransitions(){if(!this._transitionsDisabled)return;for(let[J,$]of this._savedTransitions)J.style.transition=$;this._transitionsDisabled=!1}_clearTransitionData(){this._restoreTransitions(),this._savedTransitions.clear(),this._transitionsDisabled=!1}_addEntry(J,$,Q){let Z=GJ.parse(Q,this._duration,this._previousStart,this._previousEnd),j=new f(J,$);return this._addBuilder(j,Z)}_addBuilder(J,$){J.setSkipInitialFromRender(!0);let Q=J.getAnimations();if(Q.length===0)return this;let Z=$;for(let j of Q){let q=j.getDelay(),z=$+q;j.clearDelay();let G=j.totalDuration(),Y={type:"animation",child:j,builder:J,startTime:z,duration:G};this._children.push(Y),j.setTimelineChild(!0),j.pause(),this._captureInitialValues(j);for(let X of j.getTargets())if(X instanceof HTMLElement&&!this._savedTransitions.has(X))this._savedTransitions.set(X,X.style.transition);let N=!!J.getConfig().fromVars;if(z>0&&!N)j.setLazyStartCapture(!0);if(N)j.renderAtTime(0);if(J.hasSplit()){for(let X of J.getOriginalTargets())if(X instanceof Element){let K=X;if(!this._splitParentOverrides.has(K))this._splitParentOverrides.set(K,K.style.opacity);K.style.opacity="1"}}let H=z+G;if(H>Z)Z=H}if(this._previousStart=$,this._previousEnd=Z,Z>this._duration)this._duration=Z;return this}call(J,$,Q){let Z=GJ.parse(Q,this._duration,this._previousStart,this._previousEnd),j={type:"callback",child:J,startTime:Z,duration:0,params:$};if(this._children.push(j),this._previousStart=Z,this._previousEnd=Z,Z>this._duration)this._duration=Z;return this}_getFirstAnimationTarget(){let J=this._children[0];if(J?.type==="animation"&&J.builder){let Q=J.builder,Z=Q.hasSplit()?Q.getOriginalTargets():Q.getTargets();for(let j of Z)if(d0(j))return j}let $=this.getFirstChildAnimation();if($){let Q=$.getTargets();for(let Z of Q)if(d0(Z))return Z}return}_getAllAnimationTargets(){let J=[],$=new Set,Q=new Set;for(let Z of this._children)if(Z.type==="animation"&&Z.builder){if(Q.has(Z.builder))continue;Q.add(Z.builder);let j=Z.builder.hasSplit()?Z.builder.getOriginalTargets():Z.builder.getTargets();for(let q of j)if(d0(q)&&!$.has(q))$.add(q),J.push(q)}return J}_createInstanceForElement(J,$){let Z=`${this._name||"__each"}__each_${$}_${v._eachCounter++}`,j=new v(Z),q=new Set;for(let z of this._children)if(z.type==="animation"&&z.builder){if(q.has(z.builder))continue;if(q.add(z.builder),!(z.builder.hasSplit()?z.builder.getOriginalTargets():z.builder.getTargets()).filter((K)=>d0(K)).includes(J))continue;let Y=z.builder.getConfig(),N=Y.repeat!=null?{times:Y.repeat,delay:Y.repeatDelay,yoyo:Y.yoyo}:void 0,H=z.builder.hasSplit(),X=new f(J,{from:Y.fromVars,to:Y.toVars,set:Y.setVars,duration:Y.duration,delay:Y.delay,ease:Y.ease,repeat:N,...H&&Y.split?{split:Y.split}:{},...H&&Y.mask?{mask:Y.mask}:{},...H&&Y.stagger!==void 0?{stagger:Y.stagger}:{},...Y.flap?{flap:Y.flap}:{},...Y.fit?{fit:Y.fit}:{},onStart:Y.onStart,onUpdate:Y.onUpdate,onComplete:Y.onComplete,onRepeat:Y.onRepeat,onReverseComplete:Y.onReverseComplete});if(Y.axis)X.setAxis(Y.axis);j._addBuilder(X,z.startTime)}else if(z.type==="callback")j.call(z.child,z.params,z.startTime);return j}_createInstanceForElements(J,$){let Z=`${this._name||"__each"}__each_${$}_${v._eachCounter++}`,j=new v(Z),q=new Set;for(let z of this._children)if(z.type==="animation"&&z.builder){if(q.has(z.builder))continue;q.add(z.builder);let G=z.builder.getConfig(),Y=G.repeat!=null?{times:G.repeat,delay:G.repeatDelay,yoyo:G.yoyo}:void 0,N=z.builder.hasSplit(),H=new f(J,{from:G.fromVars,to:G.toVars,set:G.setVars,duration:G.duration,delay:G.delay,ease:G.ease,repeat:Y,...N&&G.split?{split:G.split}:{},...N&&G.mask?{mask:G.mask}:{},...N&&G.stagger!==void 0?{stagger:G.stagger}:{},...G.flap?{flap:G.flap}:{},...G.fit?{fit:G.fit}:{},onStart:G.onStart,onUpdate:G.onUpdate,onComplete:G.onComplete,onRepeat:G.onRepeat,onReverseComplete:G.onReverseComplete});if(G.axis)H.setAxis(G.axis);j._addBuilder(H,z.startTime)}else if(z.type==="callback")j.call(z.child,z.params,z.startTime);return j}_resolveTargetElements(J){if(typeof J!=="string")return[J];if(typeof document<"u")try{return Array.from(document.querySelectorAll(J))}catch($){console.warn(`[Motion] Invalid selector "${J}":`,$)}return[]}_setupEachModeGeneric(J,$){if(J.length===0)return;this._eachInstances=[];let Q=new Set(this._children.filter((Z)=>Z.type==="animation"&&Z.builder?.hasSplit()).map((Z)=>Z.builder));if(Q.size>0)for(let Z of J)for(let j of Q)I.textSplitter?.revert?.(Z,j);this._clearTransitionData();for(let Z=0;Z<J.length;Z++){let j=J[Z],q=this._createInstanceForElement(j,Z);$(q,j),this._eachInstances.push(q)}{let Z=null,j=this._onUpdate,q=this._onStart,z=this._onComplete;for(let G of this._eachInstances){if(j)G.onUpdate((Y,N)=>{let H=Y>0&&Y<1;if(H)Z=G;if(Z===G){if(j(Y,N),!H)Z=null}});if(q)G.onStart(()=>{Z=G,q()});if(z)G.onComplete(()=>{if(Z===G)Z=null,z()})}}this._eachDuration=this._duration;for(let Z of this._children)if(Z.type==="animation"){let j=Z.child;j.setTimelineChild(!1),j.kill()}else if(Z.type==="timeline")Z.child.kill();this._children=[],this._duration=0,this._initialValues.clear(),this._initialTransforms.clear(),this._transformElements.clear(),this._splitParentOverrides.clear(),this._isActive=!1,this._time=0,this._progress=0,this._isReversed=!1,this._startFired=!1}_setupEachMode(J,$){let Q=I.triggerManager?.getInstance?.();if(!Q)return;let{each:Z,...j}=$;if($.target){let z=this._resolveTargetElements($.target);if(z.length===0)return;let G=this._getAllAnimationTargets();if(!G.every((H)=>z.some((X)=>X!==H&&X.contains(H)))){let H=new Set(this._children.filter((X)=>X.type==="animation"&&X.builder?.hasSplit()).map((X)=>X.builder));if(H.size>0)for(let X of G)for(let K of H)I.textSplitter?.revert?.(X,K);this._setupEachModeGeneric(G,(X,K)=>{if(J==="scroll")Q.registerScroll(X,{...j,target:K});else if(J==="hover")Q.registerHover(X,{...j,target:K});else Q.registerClick(X,{...j,target:K})});return}let N=new Set(this._children.filter((H)=>H.type==="animation"&&H.builder?.hasSplit()).map((H)=>H.builder));if(N.size>0)for(let H of G)for(let X of N)I.textSplitter?.revert?.(H,X);this._clearTransitionData(),this._eachInstances=[];for(let H=0;H<z.length;H++){let X=z[H],K=G.filter((B)=>X.contains(B));if(K.length===0)continue;let _=this._createInstanceForElements(K,H);if(J==="scroll")Q.registerScroll(_,{...j,target:X});else if(J==="hover")Q.registerHover(_,{...j,target:X});else Q.registerClick(_,{...j,target:X});this._eachInstances.push(_)}{let H=null,X=this._onUpdate,K=this._onStart,_=this._onComplete;for(let B of this._eachInstances){if(X)B.onUpdate((U,W)=>{let O=U>0&&U<1;if(O)H=B;if(H===B){if(X(U,W),!O)H=null}});if(K)B.onStart(()=>{H=B,K()});if(_)B.onComplete(()=>{if(H===B)H=null,_()})}}this._eachDuration=this._duration;for(let H of this._children)if(H.type==="animation"){let X=H.child;X.setTimelineChild(!1),X.kill()}else if(H.type==="timeline")H.child.kill();this._children=[],this._duration=0,this._initialValues.clear(),this._initialTransforms.clear(),this._transformElements.clear(),this._splitParentOverrides.clear(),this._isActive=!1,this._time=0,this._progress=0,this._isReversed=!1,this._startFired=!1;return}let q=this._getAllAnimationTargets();this._setupEachModeGeneric(q,(z,G)=>{if(J==="scroll")Q.registerScroll(z,{...j,target:G});else if(J==="hover")Q.registerHover(z,{...j,target:G});else Q.registerClick(z,{...j,target:G})})}onHover(J){if(J?.each)return this._setupEachMode("hover",J),this;let $=J?.target??this._getFirstAnimationTarget();return I.triggerManager?.getInstance?.().registerHover(this,{target:$,onEnter:J?.onEnter,onLeave:J?.onLeave,leaveDelay:J?.leaveDelay}),this}onClick(J){if(J?.each)return this._setupEachMode("click",J),this;let $=J?.target??this._getFirstAnimationTarget();return I.triggerManager?.getInstance?.().registerClick(this,{target:$,secondTarget:J?.secondTarget,toggle:J?.toggle,preventDefault:J?.preventDefault}),this}onScroll(J){if(J?.each)return this._setupEachMode("scroll",J),this;let $=J?.target??this._getFirstAnimationTarget();return I.triggerManager?.getInstance?.().registerScroll(this,{...J,target:$}),this}onMouseMove(J){if(J?.each&&J.target)return this._setupMouseMoveEachMode(J),this;return I.triggerManager?.getInstance?.().registerMouseMove(this,{type:J?.type??"distance",target:J?.target,smooth:J?.smooth,startProgress:J?.startProgress,leaveProgress:J?.leaveProgress}),this}_setupMouseMoveEachMode(J){if(!J.target)return;let $=[];if(typeof J.target==="string"){if(typeof document<"u")$=Array.from(document.querySelectorAll(J.target))}else $=[J.target];let Q=I.triggerManager?.getInstance?.();if(!Q)return;this._setupEachModeGeneric($,(Z,j)=>{Q.registerMouseMove(Z,{type:J.type??"distance",target:j,smooth:J.smooth,startProgress:J.startProgress,leaveProgress:J.leaveProgress})})}onPageLoad(J){return I.triggerManager?.getInstance?.().registerPageLoad(this,J||{}),this}onPageExit(J){return I.triggerManager?.getInstance?.().registerPageExit(this,J||{}),this}onGesture(J){if(J.each)return this._setupGestureEachMode(J),this;return I.triggerManager?.getInstance?.().registerGesture(this,J),this}_setupGestureEachMode(J){let $=[];if(J.target)if(typeof J.target==="string"){if(typeof document<"u")$=Array.from(document.querySelectorAll(J.target))}else $=[J.target];else $=this._getAllAnimationTargets();if(this._setupEachModeGeneric($,()=>{}),!this._eachInstances||this._eachInstances.length===0)return;let Q=I.triggerManager?.getInstance?.();if(!Q)return;for(let Z=0;Z<$.length;Z++){let j=$[Z],q=this._eachInstances[Z];Q.registerGesture(q,{...J,target:j,each:!1,_siblings:this._eachInstances,_index:Z})}}onCursor(J){return I.triggerManager?.getInstance?.().registerCursor(this,J),this}_updateCallbackChild(J,$,Q){let Z=J.startTime,j=$<Z&&this._time>=Z,q=$>Z&&this._time<=Z,z=Math.abs(this._time-Z)<0.001;if(j||q||z&&Q===0){let G=J.child,Y=J.params||[];G(...Y)}}_updateAnimationChild(J,$){let Q=J.child,Z=Math.abs(Q.getTimeScale())||1,j=Q.totalDuration()/Z,q=this._time-J.startTime,z=q*Z;if(q>=0&&q<=j){if(!Q.isActive())Q.captureStartValues(),Q.play();Q.renderAtTime(z)}else if(q<0){if(!Q.isLazyCapture())Q.renderAtTime(0);if(Q.isActive())Q.pause(),Q.fireReverseComplete()}else if(Q.isActive())Q.renderAtTime(Q.totalDuration()),Q.pause();else if($===0){if(Q.needsStartCapture())Q.captureStartValues();Q.renderAtTime(Q.totalDuration())}}_updateTimelineChild(J,$){let Q=J.child,Z=Q.duration(),j=this._time-J.startTime;if(j>=0&&j<=Z){if(!Q.isActive())Q.play();Q.time(j)}else if(Q.isActive())if(j<0)Q.time(0),Q.pause();else Q.time(Z),Q.pause();else if($===0)if(j<0);else Q.time(Z)}update(J){if(this._eachInstances){for(let Z of this._eachInstances)Z.update(J);return}let $=this._time;if(!this._isActive&&J===0);else if(!this._isActive)return;let Q=J*this._timeScale;if(this._inRepeatDelay&&J>0){if(this._repeatDelayCounter-=Q,this._repeatDelayCounter>0)return;if(this._inRepeatDelay=!1,this._repeatDelayCounter=0,this._isReversed){this._time=this._duration;for(let Z of this._children)if(Z.type==="animation")Z.child.resetForReplay()}else this._time=0,this._startFired=!1,this._resetChildrenForCycle()}else if(!this._inRepeatDelay){if(this._time+=this._isReversed?-Q:Q,J>0){if(!this._isReversed&&this._time>=this._duration&&this._repeat!==0){if(this._repeat===-1||this._currentRepeat<this._repeat){this._time=this._duration,this._currentRepeat++;try{this._onRepeat?.(this._currentRepeat)}catch(j){console.error("[Motion] onRepeat callback error:",j)}if(this._yoyo){this._isReversed=!0;for(let j of this._children)if(j.type==="animation")j.child.resetForReplay()}else{let j=this._time-this._duration;this._time=Math.max(0,j),this._startFired=!1,this._resetChildrenForCycle()}if(this._repeatDelay>0)this._inRepeatDelay=!0,this._repeatDelayCounter=this._repeatDelay}}else if(this._isReversed&&this._time<=0&&this._yoyo&&this._repeat!==0){if(this._repeat===-1||this._currentRepeat<this._repeat){this._time=0,this._currentRepeat++;try{this._onRepeat?.(this._currentRepeat)}catch(j){console.error("[Motion] onRepeat callback error:",j)}if(this._isReversed=!1,this._startFired=!1,this._resetChildrenForCycle(),this._repeatDelay>0)this._inRepeatDelay=!0,this._repeatDelayCounter=this._repeatDelay}}}}if(this._time<0)this._time=0;else if(this._time>this._duration)this._time=this._duration;if(this._progress=this._duration>0?this._time/this._duration:0,!this._startFired&&this._isActive&&this._time>0)this._startFired=!0,this._disableTransitions(),this._onStart?.();if(this._isActive)this._onUpdate?.(this._progress,this._time);for(let Z of this._children)if(Z.type==="callback")this._updateCallbackChild(Z,$,J);else if(Z.type==="animation")this._updateAnimationChild(Z,J);else if(Z.type==="timeline")this._updateTimelineChild(Z,J);if(!this._completeFired){let Z=!this._isReversed&&this._time>=this._duration,j=this._isReversed&&this._time<=0,q=this._repeat!==-1&&this._currentRepeat>=this._repeat;if(Z&&(this._repeat===0||q))this._completeFired=!0,this._isActive=!1,this._startFired=!1,this._restoreTransitions(),this._onComplete?.();else if(j&&(this._repeat===0||this._yoyo&&q))this._completeFired=!0,this._isActive=!1,this._startFired=!1,this._restoreTransitions(),this._onComplete?.()}}play(J){if(this._killed)return console.warn("[Motion] Cannot play a killed timeline. Create a new one with Motion(name)."),this;if(this._eachInstances){for(let $ of this._eachInstances)$.play(J);return this}if(J!==void 0){if(this._time=J,this._progress=this._duration>0?this._time/this._duration:0,J===0)this._currentRepeat=0,this._inRepeatDelay=!1,this._repeatDelayCounter=0}else if(this._time>=this._duration&&!this._isReversed)return this;return this._completeFired=!1,this._isReversed=!1,this._isActive=!0,this._atZeroState=!1,this}pause(J){if(this._killed)return console.warn("[Motion] Cannot pause a killed timeline. Create a new one with Motion(name)."),this;if(this._eachInstances){for(let $ of this._eachInstances)$.pause(J);return this}if(J!==void 0)this._time=J,this._progress=this._duration>0?this._time/this._duration:0;this._isActive=!1;for(let $ of this._children)if($.type!=="callback"){let Q=$.child;if("pause"in Q)Q.pause()}return this}reverse(J){if(this._killed)return console.warn("[Motion] Cannot reverse a killed timeline. Create a new one with Motion(name)."),this;if(this._eachInstances){for(let $ of this._eachInstances)$.reverse(J);return this}if(J!==void 0)this._time=J,this._progress=this._duration>0?this._time/this._duration:0;else if(this._time<=0&&this._isReversed)return this;return this._completeFired=!1,this._inRepeatDelay=!1,this._repeatDelayCounter=0,this._isReversed=!0,this._isActive=!0,this._atZeroState=!1,this}restart(){if(this._killed)return console.warn("[Motion] Cannot restart a killed timeline. Create a new one with Motion(name)."),this;if(this._eachInstances){for(let J of this._eachInstances)J.restart();return this}this._time=0,this._progress=0,this._isActive=!0,this._isReversed=!1,this._startFired=!1,this._atZeroState=!1,this._currentRepeat=0,this._completeFired=!1,this._inRepeatDelay=!1,this._repeatDelayCounter=0;for(let J of this._children)if(J.type==="animation")J.child.resetForReplay();return this._restoreInitialValues(),this._renderPositionZeroAnimations(),this}_resetChildrenForCycle(){for(let J of this._children)if(J.type==="animation")J.child.resetForReplay();this._restoreInitialValues(),this._renderPositionZeroAnimations()}_renderPositionZeroAnimations(){for(let J of this._children)if(J.type==="animation"){let $=J.child;if(!$.isLazyCapture())$.renderAtTime(0);if($.isActive())$.pause()}else if(J.type==="timeline")J.child.progress(0)}seek(J){if(this._killed)return console.warn("[Motion] Cannot seek a killed timeline. Create a new one with Motion(name)."),this;if(this._eachInstances){for(let $ of this._eachInstances)$.seek(J);return this}if(this._time=Math.max(0,Math.min(J,this._duration)),this._progress=this._duration>0?this._time/this._duration:0,this._atZeroState=!1,this._repeat!==0){for(let $ of this._children)if($.type==="animation")$.child.resetForReplay()}return this.update(0),this}setAxisProgress(J,$){let Q=Math.max(0,Math.min(1,$));for(let Z of this._children)if(Z.type==="animation"&&Z.builder){if(Z.builder.getConfig().axis===J){let q=Z.child,z=q.totalDuration();if(!q.isActive())q.captureStartValues(),q.play();q.renderAtTime(Q*z)}}return this}onStart(J){return this._onStart=J,this}onUpdate(J){return this._onUpdate=J,this}onComplete(J){return this._onComplete=J,this}onRepeat(J){return this._onRepeat=J,this}withRepeat(J){if(typeof J==="number")this._repeat=J,this._repeatDelay=0,this._yoyo=!1;else this._repeat=J.times,this._repeatDelay=J.delay??0,this._yoyo=J.yoyo??!1;return this}progress(J){if(J===void 0){if(this._eachInstances&&this._eachInstances.length>0){let Q=0;for(let Z of this._eachInstances){let j=Z.progress();if(j>Q)Q=j}return Q}return this._progress}if(this._eachInstances){for(let Q of this._eachInstances)Q.progress(J);return this}let $=Math.max(0,Math.min(1,J));if(!this._transitionsDisabled&&this._savedTransitions.size>0)this._disableTransitions();if($===0){for(let Q of this._children)if(Q.type==="animation")Q.child.resetForReplay()}if(this._time=$*this._duration,this._progress=$,$===0)if(this._atZeroState);else this._restoreInitialValues(),this._renderPositionZeroAnimations(),this._atZeroState=!0;else this._atZeroState=!1,this.update(0);return this._onUpdate?.(this._progress,this._time),this}time(J){if(J===void 0){if(this._eachInstances&&this._eachInstances.length>0){let $=0;for(let Q of this._eachInstances){let Z=Q.time();if(Z>$)$=Z}return $}return this._time}if(this._eachInstances){for(let $ of this._eachInstances)$.time(J);return this}return this._time=Math.max(0,Math.min(J,this._duration)),this._progress=this._duration>0?this._time/this._duration:0,this.update(0),this}timeScale(J){if(J===void 0)return this._timeScale;return this._timeScale=J,this}kill(J=!0){if(this._killed=!0,this._isActive=!1,this._atZeroState=!1,I.triggerManager?.getInstance?.().unregister(this),this._eachInstances){for(let Q of this._eachInstances)Q.kill(J);this._eachInstances=void 0}if(this._clearTransitionData(),J&&(this._initialValues.size>0||this._transformElements.size>0))this._restoreInitialValues();if(J&&this._splitParentOverrides.size>0){for(let[Q,Z]of this._splitParentOverrides)if(Z)Q.style.opacity=Z;else Q.style.removeProperty("opacity");this._splitParentOverrides.clear()}let $=new Set(this._children.filter((Q)=>Q.type==="animation"&&Q.builder?.hasSplit()).map((Q)=>Q.builder));if($.size>0){for(let Q of $)for(let Z of Q.getOriginalTargets())if(Z instanceof Element)I.textSplitter?.revert?.(Z,Q)}for(let Q of this._children)if(Q.type==="animation"){let Z=Q.child;Z.setTimelineChild(!1),Z.kill()}else if(Q.type==="timeline")Q.child.kill(J);if(this._unregisterCallback)this._unregisterCallback(),this._unregisterCallback=void 0;this._children=[],this._initialValues.clear(),this._initialTransforms.clear(),this._transformElements.clear(),this._savedTransitions.clear(),this._splitParentOverrides.clear(),this._transitionsDisabled=!1,this._duration=0,this._time=0,this._progress=0,this._previousStart=0,this._previousEnd=0,this._isReversed=!1,this._startFired=!1,this._currentRepeat=0,this._completeFired=!1,this._inRepeatDelay=!1,this._repeatDelayCounter=0}isActive(){if(this._eachInstances)return this._eachInstances.some((J)=>J.isActive());return this._isActive}reversed(){if(this._eachInstances)return this._eachInstances.some((J)=>J.reversed());return this._isReversed}getName(){return this._name}getFirstChildAnimation(){let J=this._children[0];if(J?.type==="animation")return J.child;return null}getFirstChildBuilder(){let J=this._children[0];if(J?.type==="animation"&&J.builder)return J.builder;return null}}function zJ(J,$,Q){let Z=J;if(y($)){let z=Q??($.startsWith("scale")?"":"px");return(G)=>{E(J,$,G,z),Z.style.transform=w(J)}}if($.startsWith("--")){let z=Q??"";return(G)=>{Z.style.setProperty($,`${G}${z}`)}}let j=$.replace(/([A-Z])/g,"-$1").toLowerCase(),q=Q??"";return(z)=>{Z.style.setProperty(j,`${z}${q}`)}}var v7=new Set(["opacity","z-index","font-weight","line-height","flex","flex-grow","flex-shrink","order","scale","column-count","columns","tab-size","orphans","widows","zoom"]);function T7(J){if(typeof location>"u")return!J.includes(":");try{let $=new URL(J,location.href);return $.protocol==="https:"||$.protocol==="http:"}catch{return!J.includes(":")}}class x0 extends m{_element=null;_innerElement=null;_mousePos={x:-100,y:-100};_cursorPos={x:-100,y:-100};_xSetter=null;_ySetter=null;_squeezeSetter=null;_squeezeConfig={min:0.55,max:1.2,multiplier:150};_state="default";_stateTimelines=new Map;_parsedStates=new Map;_textElement=null;_mediaElement=null;_tickerCallback;_boundMouseMove;_boundMouseDown;_boundMouseUp;_hoverSelectors=null;_isHoveringCursorTarget=!1;_boundHoverTargetMoveHandler=null;_cursorStyleTag=null;_attributeListeners=new Map;constructor(J,$){super(J,$);if(this._config={type:"basic",smooth:0.25,hideNative:!1,...$},$.squeeze===!0)this._squeezeConfig={min:0.55,max:1.2,multiplier:150};else if(typeof $.squeeze==="object")this._squeezeConfig={min:$.squeeze.min??0.55,max:$.squeeze.max??1.2,multiplier:$.squeeze.multiplier??150};if(this._parsedStates.set("default",this._parseStateConfig($.default)),$.hover)this._parsedStates.set("hover",this._parseStateConfig($.hover));if($.click)this._parsedStates.set("click",this._parseStateConfig($.click))}_parseStateConfig(J){let{targets:$,duration:Q,ease:Z,enabled:j,...q}=J;return{properties:q,duration:Q??0.15,ease:Z??"power3.inOut",targets:$,enabled:j??!0}}_onEnable(){if(this._element=this._createContainer(),this._innerElement=document.createElement("div"),this._innerElement.setAttribute("data-cursor-inner",""),this._innerElement.style.cssText="pointer-events:none;position:absolute;top:0;left:0;",this._element.appendChild(this._innerElement),E(this._innerElement,"x",-50,"%"),E(this._innerElement,"y",-50,"%"),this._xSetter=zJ(this._element,"x","px"),this._ySetter=zJ(this._element,"y","px"),this._config.squeeze)this._squeezeSetter=zJ(this._element,"scale");if(this._cursorPos={x:-100,y:-100},this._mousePos={x:-100,y:-100},this._xSetter(-100),this._ySetter(-100),this._applyProperties(this._parsedStates.get("default").properties),this._innerElement.style.transform=w(this._innerElement),this._config.hideNative)this._cursorStyleTag=document.createElement("style"),this._cursorStyleTag.setAttribute("data-cursor-hide",""),this._cursorStyleTag.textContent="* { cursor: none !important; }",document.head.appendChild(this._cursorStyleTag);if(this._config.type==="text")this._setupTextCursor();else if(this._config.type==="media")this._setupMediaCursor();this._createStateTimelines(),this._setupEventListeners(),this._tickerCallback=(J)=>this._tick(J),T.getInstance().add(this._tickerCallback)}_onDisable(){if(this._tickerCallback)T.getInstance().remove(this._tickerCallback),this._tickerCallback=void 0;if(this._cursorStyleTag)this._cursorStyleTag.remove(),this._cursorStyleTag=null;if(this._removeEventListeners(),this._stateTimelines.forEach((J)=>J.kill()),this._stateTimelines.clear(),this._innerElement?.parentNode)this._innerElement.remove();if(this._innerElement=null,this._element?.parentNode)this._element.remove();this._element=null}_createContainer(){let J=document.createElement("div");return J.setAttribute("data-cursor-container",""),J.style.cssText="position:fixed;top:0;left:0;pointer-events:none;z-index:999999;width:0;height:0;",document.body.appendChild(J),J}_applyProperties(J){if(!this._innerElement)return;for(let[$,Q]of Object.entries(J))if($==="transform"){let Z=x0._expandTransformShorthand(String(Q));for(let[j,q]of Object.entries(Z))E(this._innerElement,j,q)}else if(y($)){let Z=typeof Q==="number"?{value:Q,unit:l($)}:S(Q);E(this._innerElement,$,Z.value,Z.unit||l($)||void 0)}else{let Z=s($),j=typeof Q==="number"&&!v7.has(Z)?`${Q}px`:String(Q);this._innerElement.style.setProperty(Z,j)}}_createStateTimelines(){if(!this._innerElement)return;let J=this._parsedStates.get("hover");if(J&&J.enabled){let Q=new v;Q._addEntry(this._innerElement,{to:x0._expandStateProperties(J.properties),duration:J.duration,ease:J.ease}),this._stateTimelines.set("hover",Q)}let $=this._parsedStates.get("click");if($&&$.enabled){let Q=new v;Q._addEntry(this._innerElement,{to:x0._expandStateProperties($.properties),duration:$.duration,ease:$.ease}),this._stateTimelines.set("click",Q)}}static _expandStateProperties(J){let $={};for(let[Q,Z]of Object.entries(J))if(Q==="transform"){let j=x0._expandTransformShorthand(String(Z));Object.assign($,j)}else $[Q]=Z;return $}static _expandTransformShorthand(J){let $={},Q=/([a-zA-Z0-9]+)\(([^)]+)\)/g,Z;while((Z=Q.exec(J))!==null){let j=Z[1],q=Z[2].split(",").map((z)=>parseFloat(z.trim()));switch(j){case"scale":{let z=q[0]??1,G=q.length>1?q[1]:z;if(z===G)$.scale=z;else $.scaleX=z,$.scaleY=G;break}case"scaleX":$.scaleX=q[0]??1;break;case"scaleY":$.scaleY=q[0]??1;break;case"scaleZ":$.scaleZ=q[0]??1;break;case"rotate":$.rotate=q[0]??0;break;case"rotateX":$.rotateX=q[0]??0;break;case"rotateY":$.rotateY=q[0]??0;break;case"rotateZ":$.rotateZ=q[0]??0;break;case"skewX":$.skewX=q[0]??0;break;case"skewY":$.skewY=q[0]??0;break}}return $}_setupEventListeners(){if(this._boundMouseMove=(Q)=>{this._mousePos.x=Q.clientX,this._mousePos.y=Q.clientY},document.addEventListener("mousemove",this._boundMouseMove),this._parsedStates.get("click")?.enabled)this._boundMouseDown=()=>this._setState("click"),this._boundMouseUp=()=>this._setState(this._state==="click"?"default":this._state),document.addEventListener("mousedown",this._boundMouseDown),document.addEventListener("mouseup",this._boundMouseUp);let $=this._parsedStates.get("hover");if($?.enabled&&$.targets&&$.targets.length>0)this._setupHoverTargets($.targets)}_setupHoverTargets(J){this._hoverSelectors=J,this._boundHoverTargetMoveHandler=($)=>{let Z=document.elementsFromPoint($.clientX,$.clientY).some((j)=>this._hoverSelectors.some((q)=>{try{return j.matches(q)}catch{return!1}}));if(Z&&!this._isHoveringCursorTarget)this._isHoveringCursorTarget=!0,this._setState("hover");else if(!Z&&this._isHoveringCursorTarget){if(this._isHoveringCursorTarget=!1,this._state==="hover")this._setState("default")}},window.addEventListener("mousemove",this._boundHoverTargetMoveHandler)}_setupTextCursor(){if(!this._innerElement)return;this._innerElement.style.display="grid",this._innerElement.style.placeItems="center",this._innerElement.style.overflow="visible",this._textElement=document.createElement("div"),this._textElement.setAttribute("data-cursor-text",""),this._textElement.style.whiteSpace="nowrap",this._textElement.style.opacity="0",this._innerElement.appendChild(this._textElement);let $=this._parsedStates.get("hover")?.duration??0.15;if(this._textElement.style.transition=`opacity ${$}s ease-in-out`,this._config.text)for(let[Z,j]of Object.entries(this._config.text))this._textElement.style.setProperty(s(Z),String(j));let Q=document.querySelectorAll("[mp-cursor-text], [mp-cursor-tooltip]");for(let Z of Q){let j=(z)=>{let G=z.target,Y=G.getAttribute("mp-cursor-text")??G.getAttribute("mp-cursor-tooltip")??"";if(this._textElement)this._textElement.textContent=Y,this._textElement.style.opacity="1";this._setState("hover")},q=()=>{if(this._textElement)this._textElement.style.opacity="0";if(this._state==="hover")this._setState("default")};Z.addEventListener("mouseenter",j),Z.addEventListener("mouseleave",q),this._attributeListeners.set(Z,{enter:j,leave:q})}}_setupMediaCursor(){if(!this._innerElement)return;let J=document.createElement("img");J.setAttribute("data-cursor-media",""),J.style.display="none",this._innerElement.appendChild(J);let $=document.createElement("video");if($.setAttribute("data-cursor-media",""),$.autoplay=!0,$.muted=!0,$.loop=!0,$.style.display="none",this._innerElement.appendChild($),this._config.media)for(let[Z,j]of Object.entries(this._config.media))J.style.setProperty(s(Z),String(j)),$.style.setProperty(s(Z),String(j));let Q=document.querySelectorAll("[mp-cursor-media]");for(let Z of Q){let j=(z)=>{let G=z.target.getAttribute("mp-cursor-media")||"";if(!G||!T7(G)){if(G)console.warn(`[Motion] Blocked unsafe media URL: "${G}". Only http/https URLs and relative paths are allowed.`);return}if(G.endsWith(".mp4")||G.endsWith(".webm"))$.src=G,$.style.display="block",J.style.display="none",$.play().catch(()=>{}),this._mediaElement=$;else J.src=G,J.style.display="block",$.style.display="none",this._mediaElement=J;this._setState("hover")},q=()=>{if(J.style.display="none",$.style.display="none",$.pause(),this._state==="hover")this._setState("default")};Z.addEventListener("mouseenter",j),Z.addEventListener("mouseleave",q),this._attributeListeners.set(Z,{enter:j,leave:q})}}_removeEventListeners(){if(this._boundMouseMove)document.removeEventListener("mousemove",this._boundMouseMove);if(this._boundMouseDown)document.removeEventListener("mousedown",this._boundMouseDown);if(this._boundMouseUp)document.removeEventListener("mouseup",this._boundMouseUp);if(this._boundHoverTargetMoveHandler)window.removeEventListener("mousemove",this._boundHoverTargetMoveHandler),this._boundHoverTargetMoveHandler=null;this._hoverSelectors=null,this._isHoveringCursorTarget=!1,this._attributeListeners.forEach((J,$)=>{$.removeEventListener("mouseenter",J.enter),$.removeEventListener("mouseleave",J.leave)}),this._attributeListeners.clear()}_setState(J){if(this._state===J)return;let $=this._state;this._state=J;let Q=this._stateTimelines.get(J),Z=this._stateTimelines.get($);if(J==="default"){if(Z)Z.reverse()}else{if($!=="default"&&Z)Z.reverse();if(Q)Q.play()}}_tick(J){if(!this._xSetter||!this._ySetter)return;let $=this._config.smooth??0.25,Q=Math.pow($,2.5)||0.000001,Z=1-Math.pow(1-Q,J*60);if(this._cursorPos.x+=(this._mousePos.x-this._cursorPos.x)*Z,this._cursorPos.y+=(this._mousePos.y-this._cursorPos.y)*Z,this._xSetter(this._cursorPos.x),this._ySetter(this._cursorPos.y),this._squeezeSetter&&this._config.squeeze){let j=this._calculateSqueeze();this._squeezeSetter(j)}for(let j of this._stateTimelines.values())if(j.isActive())j.update(J)}_calculateSqueeze(){let J=this._cursorPos.x-this._mousePos.x,$=this._cursorPos.y-this._mousePos.y,Q=Math.sqrt(J*J+$*$),{min:Z,max:j,multiplier:q}=this._squeezeConfig,z=1-(Math.exp(Q/q)-1)/10;if(Number.isNaN(z))return 1;return Math.max(Z,Math.min(j,z))}getElement(){return this._element}getState(){return this._state}}D.registerTrigger("cursor",x0);class A6 extends m{_links=[];_listeners=new Map;_isNavigating=!1;_pendingUrl=null;_onCompleteHandler=null;_pollTimerId=null;constructor(J,$){super(J,$)}_onEnable(){if(this._isInsideBuilder())return;this._resolveLinks(),this._addClickListeners()}_onDisable(){if(this._cleanupListenerMap(this._listeners),this._links=[],this._isNavigating=!1,this._pendingUrl=null,this._pollTimerId!==null)clearTimeout(this._pollTimerId),this._pollTimerId=null;if(this._onCompleteHandler)this._onCompleteHandler=null}_isInsideBuilder(){try{if(typeof window<"u"&&window.top?.mp_iframe)return!0}catch{}return!1}_resolveLinks(){if(typeof document>"u")return;let J=this._config.mode||"all",$;if(J==="include"&&this._config.selectors&&this._config.selectors.trim()!=="")try{$=Array.from(document.querySelectorAll(this._config.selectors)).filter((Z)=>Z.tagName==="A"),document.querySelectorAll(this._config.selectors).forEach((Z)=>{if(Z.tagName!=="A"){let j=Z.querySelectorAll("a");$.push(...Array.from(j))}})}catch(Q){console.warn(`[Motion] Invalid selector "${this._config.selectors}":`,Q),$=[]}else if(J==="include")$=[];else if(J==="exclude"&&this._config.selectors&&this._config.selectors.trim()!==""){let Q=Array.from(document.querySelectorAll("a")),Z;try{Z=new Set(document.querySelectorAll(this._config.selectors))}catch(j){console.warn(`[Motion] Invalid selector "${this._config.selectors}":`,j),Z=new Set}$=Q.filter((j)=>!Z.has(j))}else $=Array.from(document.querySelectorAll("a"));this._links=[...new Set($)],this._links=this._links.filter((Q)=>this._shouldIntercept(Q))}_shouldIntercept(J){let $=J.getAttribute("href");if(!$||$==="")return!1;let Q=this._config.skipHref||[];if($.startsWith("#"))return!Q.includes("anchor");if($.toLowerCase().startsWith("javascript:"))return!Q.includes("javascript");if($.toLowerCase().startsWith("mailto:")||$.toLowerCase().startsWith("tel:"))return!Q.includes("mailto");return!0}_addClickListeners(){this._links.forEach((J)=>{let $=new Map,Q=(Z)=>{if(this._isNavigating)return;let j=Z;if(j.ctrlKey||j.metaKey||j.shiftKey||j.altKey)return;let q=J.getAttribute("target");if(q&&q!=="_self")return;let z=J.href;if(!z)return;Z.preventDefault(),Z.stopPropagation(),this._isNavigating=!0,this._pendingUrl=z,this._onCompleteHandler=()=>{this._navigate()},this._timeline.restart(),this._waitForCompletion()};J.addEventListener("click",Q),$.set("click",Q),this._listeners.set(J,$)})}_waitForCompletion(){let J=this._timeline,$=16,Q=()=>{if(this._pollTimerId=null,!this._enabled||!this._isNavigating||!this._pendingUrl)return;let Z=J.progress(),j=J.isActive();if(Z>=1||!j&&Z>0)this._navigate();else this._pollTimerId=setTimeout(Q,16)};this._pollTimerId=setTimeout(Q,16)}_navigate(){if(!this._pendingUrl)return;let J=this._pendingUrl;if(this._pendingUrl=null,this._isNavigating=!1,typeof window<"u")window.location.href=J}}D.registerTrigger("pageExit",A6);var cJ=null;function h7(){if(!cJ&&typeof document<"u"){let J=document.createElement("canvas");J.width=1,J.height=1,cJ=J.getContext("2d")}return cJ}function M6(J){let $=J.replace("#",""),Q,Z,j,q=1;if($.length===3)Q=parseInt($[0]+$[0],16),Z=parseInt($[1]+$[1],16),j=parseInt($[2]+$[2],16);else if($.length===4)Q=parseInt($[0]+$[0],16),Z=parseInt($[1]+$[1],16),j=parseInt($[2]+$[2],16),q=parseInt($[3]+$[3],16)/255;else if($.length===6)Q=parseInt($.slice(0,2),16),Z=parseInt($.slice(2,4),16),j=parseInt($.slice(4,6),16);else if($.length===8)Q=parseInt($.slice(0,2),16),Z=parseInt($.slice(2,4),16),j=parseInt($.slice(4,6),16),q=parseInt($.slice(6,8),16)/255;else return null;if(isNaN(Q)||isNaN(Z)||isNaN(j)||isNaN(q))return null;return new Float32Array([Q,Z,j,q])}function f7(J){let $=J.match(/rgba?\s*\(\s*([\d.]+)\s*[,\s]\s*([\d.]+)\s*[,\s]\s*([\d.]+)\s*(?:[,\/]\s*([\d.]+))?\s*\)/i);if(!$)return null;let Q=parseFloat($[1]),Z=parseFloat($[2]),j=parseFloat($[3]),q=$[4]!==void 0?parseFloat($[4]):1;if(isNaN(Q)||isNaN(Z)||isNaN(j)||isNaN(q))return null;return new Float32Array([Q,Z,j,q])}function u7(J,$,Q){J=J/360,$=$/100,Q=Q/100;let Z,j,q;if($===0)Z=j=q=Q;else{let z=(N,H,X)=>{if(X<0)X+=1;if(X>1)X-=1;if(X<0.16666666666666666)return N+(H-N)*6*X;if(X<0.5)return H;if(X<0.6666666666666666)return N+(H-N)*(0.6666666666666666-X)*6;return N},G=Q<0.5?Q*(1+$):Q+$-Q*$,Y=2*Q-G;Z=z(Y,G,J+0.3333333333333333),j=z(Y,G,J),q=z(Y,G,J-0.3333333333333333)}return[Math.round(Z*255),Math.round(j*255),Math.round(q*255)]}function d7(J){let $=J.match(/hsla?\s*\(\s*([\d.]+)\s*[,\s]\s*([\d.]+)%\s*[,\s]\s*([\d.]+)%\s*(?:[,\/]\s*([\d.]+))?\s*\)/i);if(!$)return null;let Q=parseFloat($[1]),Z=parseFloat($[2]),j=parseFloat($[3]),q=$[4]!==void 0?parseFloat($[4]):1;if(isNaN(Q)||isNaN(Z)||isNaN(j)||isNaN(q))return null;let[z,G,Y]=u7(Q,Z,j);return new Float32Array([z,G,Y,q])}function c7(J,$){if(!$||typeof window>"u")return null;let Q=J.match(/var\s*\(\s*(--[\w-]+)\s*(?:,\s*(.+))?\s*\)\s*$/i);if(!Q)return null;let Z=Q[1],j=window.getComputedStyle($).getPropertyValue(Z).trim();if(j)return YJ(j,$);let q=Q[2]?.trim();if(q)return YJ(q,$);return null}function m7(J){let $=h7();if(!$)return null;$.fillStyle="#000000",$.fillStyle=J;let Q=$.fillStyle;if(Q==="#000000"&&J.toLowerCase()!=="black"&&J!=="#000000"&&J!=="#000")return null;return M6(Q)}function YJ(J,$){if(!J||typeof J!=="string")return null;let Q=J.trim().toLowerCase();if(Q==="transparent")return new Float32Array([0,0,0,0]);if(Q.startsWith("#"))return M6(Q);if(Q.startsWith("rgb"))return f7(Q);if(Q.startsWith("hsl"))return d7(Q);if(Q.startsWith("var("))return c7(Q,$);return m7(Q)}function p7(J,$){if(typeof window>"u")return new Float32Array([0,0,0,1]);let Q=window.getComputedStyle(J),Z=$.replace(/[A-Z]/g,(z)=>`-${z.toLowerCase()}`),j=Q.getPropertyValue(Z).trim();if(!j||j==="none")J.offsetHeight,j=window.getComputedStyle(J).getPropertyValue(Z).trim();if(!j||j==="none")return new Float32Array([0,0,0,0]);return YJ(j,J)||new Float32Array([0,0,0,1])}I.color={parseColor:YJ,getCurrentColor:p7};var D6={blur:{value:0,unit:"px"},brightness:{value:1,unit:""},contrast:{value:1,unit:""},saturate:{value:1,unit:""},grayscale:{value:0,unit:""},sepia:{value:0,unit:""},"hue-rotate":{value:0,unit:"deg"},invert:{value:0,unit:""},opacity:{value:1,unit:""}};function g7(J){let $=J.trim().match(/^([\w-]+)\(\s*([\d.]+)(px|%|deg)?\s*\)$/);if(!$)return null;let Q=$[1].toLowerCase(),Z=parseFloat($[2]),j=$[3]||"";if(j==="%")Z=Z/100,j="";return{name:Q,value:Z,unit:j}}function k6(J){if(J===null||J===void 0||typeof J!=="string")return null;let $=J.trim().toLowerCase();if($==="none"||$==="")return[];let Q=[],Z=/([\w-]+)\([^)]+\)/g,j;while((j=Z.exec($))!==null){let q=g7(j[0]);if(q)Q.push(q)}return Q.length>0?Q:null}function o7(J){let $=D6[J.name];if(!$)return!1;return J.value===$.value}function l7(J){if(!J||J.length===0)return"none";if(J.every(o7))return"none";return J.map(($)=>{let Q;if($.name==="blur")Q=`${$.value}${$.unit||"px"}`;else if($.name==="hue-rotate")Q=`${$.value}${$.unit||"deg"}`;else Q=`${$.value}`;return`${$.name}(${Q})`}).join(" ")}function s7(J){if(typeof window>"u")return[];let $=window.getComputedStyle(J),Q=$.filter||$.getPropertyValue("filter");if(!Q||Q==="none")return[];return k6(Q)||[]}function i7(J){let $=D6[J];if($)return{name:J,value:$.value,unit:$.unit};return{name:J,value:0,unit:""}}function n7(J,$){let Q=new Set;for(let q of J)Q.add(q.name);for(let q of $)Q.add(q.name);let Z=[],j=[];for(let q of Q){let z=J.find((N)=>N.name===q),G=$.find((N)=>N.name===q),Y=i7(q);Z.push(z||Y),j.push(G||Y)}return{start:Z,end:j}}var S0=[];function a7(J,$,Q){let Z=J.length;if(S0.length<Z)for(let j=S0.length;j<Z;j++)S0.push({name:"",value:0,unit:""});for(let j=0;j<Z;j++){let q=J[j],z=$[j],G=S0[j];G.name=q.name,G.value=q.value+(z.value-q.value)*Q,G.unit=q.unit||z.unit}return S0.length=Z,S0}I.filter={parseFilter:k6,getCurrentFilter:s7,mergeFilterArrays:n7,interpolateFilters:a7,filterToString:l7};var R6=new WeakMap;function r7(J){return"getTotalLength"in J&&typeof J.getTotalLength==="function"}function NJ(J){let $=R6.get(J);if($!==void 0)return $;if(r7(J)){let Q=J.getTotalLength();return R6.set(J,Q),Q}return 0}function t7(J,$){if(J===null||J===void 0)return null;if(typeof J==="object"){let Q=J.start??0,Z=J.end??100;return{start:Q/100,end:Z/100}}if(typeof J==="string"){let Q=J.trim();if(Q==="true")return{start:0,end:1};if(Q==="false"||Q===""||Q==="none")return{start:0,end:0};let Z=Q.match(/^([-\d.]+)(px|%)?\s+([-\d.]+)(px|%)?$/);if(Z){let q=parseFloat(Z[1]),z=Z[2]||"%",G=parseFloat(Z[3]),Y=Z[4]||"%",N=$?NJ($):0,H=mJ(q,z,N),X=mJ(G,Y,N);return{start:H,end:X}}let j=Q.match(/^([-\d.]+)(px|%)?$/);if(j){let q=parseFloat(j[1]),z=j[2]||"%",G=$?NJ($):0;return{start:0,end:mJ(q,z,G)}}}return null}function mJ(J,$,Q){if($==="px"&&Q>0)return J/Q;return J/100}function e7(J){let $=NJ(J);if($===0)return{start:0,end:1};try{if(typeof window<"u"&&window.getComputedStyle){let Q=window.getComputedStyle(J),Z=Q.strokeDasharray,j=Q.strokeDashoffset;if(!Z||Z==="none")return{start:0,end:1};let q=Z.split(/[\s,]+/).map(parseFloat).filter((G)=>!isNaN(G)),z=parseFloat(j)||0;if(q.length>=1){let G=q[0],Y=-z/$,N=(-z+G)/$;return{start:Y,end:N}}}}catch{}return{start:0,end:1}}function J9(J,$,Q,Z){if(!(J instanceof SVGElement)||Z===0)return;let j=J,q=Math.abs(Q-$)*Z,z=Math.min($,Q)*Z;j.style.strokeDasharray=`${q} ${Z}`,j.style.strokeDashoffset=`${-z}`}I.drawSVG={parseDrawSVG:t7,getCurrentDrawSVG:e7,getPathLength:NJ,applyDrawSVG:J9};var b6=/(-?\d*\.?\d+)([a-z%]*)/gi;function E6(J){b6.lastIndex=0;let $=b6.exec(J);if(!$)return null;let Q=parseFloat($[1]);if(!isFinite(Q))return null;return{value:Q,unit:$[2]||""}}function B0(J){let $=[],Q=/(-?\d*\.?\d+)([a-z%]*)/gi,Z;while((Z=Q.exec(J))!==null){let j=parseFloat(Z[1]);if(!isFinite(j))continue;$.push({value:j,unit:Z[2]||""})}return $}function V6(J){if(J===null||J===void 0||typeof J!=="string")return null;let $=J.trim();if($===""||$==="none")return null;let Q=$.match(/^([a-z-]+)\s*\(\s*([\s\S]*)\s*\)\s*$/i);if(!Q)return null;let Z=Q[1].toLowerCase(),j=Q[2];switch(Z){case"circle":return $9(j);case"ellipse":return Q9(j);case"inset":return Z9(j);case"polygon":return j9(j);case"rect":return q9(j);case"xywh":return G9(j);default:return null}}function $9(J){let[$,Q]=w6(J),Z=E6($)??{value:50,unit:"%"},[j,q]=C6(Q);return{shape:"circle",components:[Z,j,q]}}function Q9(J){let[$,Q]=w6(J),Z=B0($),j=Z[0]??{value:50,unit:"%"},q=Z[1]??j,[z,G]=C6(Q);return{shape:"ellipse",components:[j,q,z,G]}}function Z9(J){let{mainPart:$,roundPart:Q}=pJ(J),Z=B0($),j=Z[0]??{value:0,unit:"px"},q=Z[1]??j,z=Z[2]??j,G=Z[3]??q,Y=[j,q,z,G];if(Q!==null){let N=B0(Q);if(N.length===0)Y.push({value:0,unit:"px"});else for(let H of N)Y.push(H)}return{shape:"inset",components:Y,extras:Q!==null?{hasRound:!0}:void 0}}function j9(J){let $=[],Z=J.replace(/^(nonzero|evenodd)\s*,\s*/i,"").split(",");for(let j of Z){let q=B0(j);if(q.length>=2)$.push(q[0],q[1])}return{shape:"polygon",components:$}}function q9(J){let{mainPart:$,roundPart:Q}=pJ(J),Z=B0($),j=Z[0]??{value:0,unit:"px"},q=Z[1]??j,z=Z[2]??j,G=Z[3]??q,Y=[j,q,z,G];if(Q!==null){let N=B0(Q);if(N.length===0)Y.push({value:0,unit:"px"});else for(let H of N)Y.push(H)}return{shape:"rect",components:Y,extras:Q!==null?{hasRound:!0}:void 0}}function G9(J){let{mainPart:$,roundPart:Q}=pJ(J),Z=B0($),j=Z[0]??{value:0,unit:"px"},q=Z[1]??{value:0,unit:"px"},z=Z[2]??{value:0,unit:"px"},G=Z[3]??{value:0,unit:"px"},Y=[j,q,z,G];if(Q!==null){let N=B0(Q);if(N.length===0)Y.push({value:0,unit:"px"});else for(let H of N)Y.push(H)}return{shape:"xywh",components:Y,extras:Q!==null?{hasRound:!0}:void 0}}function w6(J){let $=J.toLowerCase().search(/\bat\b/);if($===-1)return[J.trim(),""];return[J.slice(0,$).trim(),J.slice($+2).trim()]}function pJ(J){let $=J.toLowerCase().search(/\bround\b/);if($===-1)return{mainPart:J.trim(),roundPart:null};return{mainPart:J.slice(0,$).trim(),roundPart:J.slice($+5).trim()}}function C6(J){let $=[{value:50,unit:"%"},{value:50,unit:"%"}];if(!J)return $;let Q=J.trim().split(/\s+/),Z=[];for(let z of Q){let G=E6(z);if(G){Z.push(G);continue}let Y=z.toLowerCase();if(Y==="center")Z.push({value:50,unit:"%"});else if(Y==="left"||Y==="top")Z.push({value:0,unit:"%"});else if(Y==="right"||Y==="bottom")Z.push({value:100,unit:"%"})}let j=Z[0]??$[0],q=Z[1]??$[1];return[j,q]}function z9(J){if(typeof window>"u")return null;try{let $=window.getComputedStyle(J),Q=$.clipPath||$.getPropertyValue("clip-path")||$.getPropertyValue("-webkit-clip-path");if(!Q||Q==="none")return null;return V6(Q)}catch{return null}}function x6(J,$){if(J.shape!==$.shape)return!1;if(J.components.length!==$.components.length)return!1;return!0}var P0=[];function Y9(J,$,Q){if(!x6(J,$))return Q>=0.5?$:J;let Z=J.components.length;if(P0.length<Z)for(let j=P0.length;j<Z;j++)P0.push({value:0,unit:""});P0.length=Z;for(let j=0;j<Z;j++){let q=J.components[j],z=$.components[j],G=P0[j];G.value=q.value+(z.value-q.value)*Q,G.unit=z.unit||q.unit}return{shape:$.shape,components:P0,extras:$.extras??J.extras}}function b(J){return`${Math.round(J.value*1e4)/1e4}${J.unit}`}function N9(J){let $=J.components;switch(J.shape){case"circle":return`circle(${b($[0])} at ${b($[1])} ${b($[2])})`;case"ellipse":return`ellipse(${b($[0])} ${b($[1])} at ${b($[2])} ${b($[3])})`;case"inset":{let Q=`${b($[0])} ${b($[1])} ${b($[2])} ${b($[3])}`;if(J.extras?.hasRound&&$.length>4){let Z=$.slice(4).map(b).join(" ");return`inset(${Q} round ${Z})`}return`inset(${Q})`}case"polygon":{let Q=[];for(let Z=0;Z<$.length;Z+=2)Q.push(`${b($[Z])} ${b($[Z+1])}`);return`polygon(${Q.join(", ")})`}case"rect":{let Q=`${b($[0])} ${b($[1])} ${b($[2])} ${b($[3])}`;if(J.extras?.hasRound&&$.length>4){let Z=$.slice(4).map(b).join(" ");return`rect(${Q} round ${Z})`}return`rect(${Q})`}case"xywh":{let Q=`${b($[0])} ${b($[1])} ${b($[2])} ${b($[3])}`;if(J.extras?.hasRound&&$.length>4){let Z=$.slice(4).map(b).join(" ");return`xywh(${Q} round ${Z})`}return`xywh(${Q})`}}}I.clipPath={parseClipPath:V6,getCurrentClipPath:z9,interpolateClipPaths:Y9,clipPathToString:N9,canInterpolate:x6};var y0=new WeakMap;class HJ{static split(J,$,Q){if(!(J instanceof HTMLElement))return[];let Z=Q?.consumer,j=y0.get(J);if(j){if(Z&&j.consumers.has(Z)){if((J.getAttribute("data-split")??"")===$)return this._getSpansForType(j.result,$);j.consumers.delete(Z)}if(Z)j.consumers.add(Z);if(j.consumers.size>1){let X=this._tryUpgrade(J,j,$,Q);if(X!==null)return X;let K=$.split(",").map((_)=>_.trim());if(K.includes("chars")&&j.result.chars.length>0)return j.result.chars.slice();if(K.includes("words")&&j.result.words.length>0)return j.result.words.slice();return j.result.elements.slice()}if(Z)j.consumers.delete(Z);J.innerHTML=j.originalHTML,J.removeAttribute("data-split"),y0.delete(J)}let q=J.innerHTML,z={chars:[],words:[],lines:[],elements:[]},G=$.split(",").map((X)=>X.trim()),Y=G.includes("chars"),N=G.includes("words"),H=G.includes("lines");if(H)this._splitWithLinesDom(J,N,Y,z);else if(N&&Y)this._splitWordsWithCharsDom(J,z);else if(N)this._splitWordsDom(J,z);else if(Y)this._splitCharsDom(J,z);if(Y)z.elements=z.chars;else if(N)z.elements=z.words;else if(H)z.elements=z.lines;if(Q?.mask&&z.elements.length>0)this._applyMaskWrappers(z);return this._propagateGradientText(J,z),y0.set(J,{originalHTML:q,result:z,consumers:new Set(Z?[Z]:[])}),J.setAttribute("data-split",$),z.elements}static _tryUpgrade(J,$,Q,Z){let q=(J.getAttribute("data-split")??"").split(",").map((_)=>_.trim()),z=Q.split(",").map((_)=>_.trim()),G=z.includes("chars"),Y=z.includes("words"),N=z.includes("lines"),H=q.includes("chars"),X=q.includes("words"),K=q.includes("lines");if((!G||H)&&(!Y||X)&&(!N||K))return this._getSpansForType($.result,Q);if(N||K)return null;if(X&&!H&&G){let _=[];for(let U of $.result.words)this._nestCharsInElement(U,_);$.result.chars=_,$.result.elements=_;let B=this._buildTypeString(q,z);if(J.setAttribute("data-split",B),Z?.mask)this._applyMaskWrappers($.result);return this._propagateGradientText(J,$.result),G?_:$.result.words.slice()}if(H&&!X&&Y){let _=Array.from(J.querySelectorAll("[data-split-word-wrap]")),B=[];for(let W=0;W<_.length;W++){let O=_[W];O.removeAttribute("data-split-word-wrap"),O.setAttribute("data-split-word",""),O.setAttribute("data-word-index",String(W)),B.push(O)}$.result.words=B;let U=this._buildTypeString(q,z);return J.setAttribute("data-split",U),G?$.result.chars.slice():B}return null}static _getSpansForType(J,$){let Q=$.split(",").map((Z)=>Z.trim());if(Q.includes("chars")&&J.chars.length>0)return J.chars.slice();if(Q.includes("words")&&J.words.length>0)return J.words.slice();if(Q.includes("lines")&&J.lines.length>0)return J.lines.slice();return J.elements.slice()}static _buildTypeString(J,$){let Q=new Set([...J,...$]);return["lines","words","chars"].filter((Z)=>Q.has(Z)).join(",")}static _nestCharsInElement(J,$){let Q=document.createTreeWalker(J,4),Z=[],j=Q.nextNode();while(j!==null)Z.push(j),j=Q.nextNode();for(let q of Z){let z=q.textContent??"";if(!z)continue;let G=document.createDocumentFragment();for(let Y of z)if(/\s/.test(Y))G.appendChild(document.createTextNode(Y));else{let N=document.createElement("span");N.setAttribute("data-split-char",""),N.setAttribute("data-char-index",String($.length)),N.style.display="inline-block",N.textContent=Y,$.push(N),G.appendChild(N)}q.parentNode?.replaceChild(G,q)}}static _splitWordsDom(J,$){let Q=Array.from(J.childNodes);for(let Z of Q)if(Z.nodeType===3){let j=Z.textContent||"";if(!j)continue;let q=j.split(/(\s+)/),z=document.createDocumentFragment(),G=!1;for(let Y of q)if(/^\s+$/.test(Y))z.appendChild(document.createTextNode(Y.replace(/\n/g," "))),G=!0;else if(Y){let N=document.createElement("span");N.setAttribute("data-split-word",""),N.setAttribute("data-word-index",String($.words.length)),N.style.display="inline-block",N.textContent=Y,$.words.push(N),z.appendChild(N),G=!0}if(G)J.replaceChild(z,Z)}else if(Z.nodeType===1){let j=Z;if(j.tagName==="BR")continue;this._splitWordsDom(j,$)}}static _splitCharsDom(J,$){let Q=Array.from(J.childNodes);for(let Z of Q)if(Z.nodeType===3){let j=Z.textContent||"";if(!j)continue;let q=j.split(/(\s+)/),z=document.createDocumentFragment();for(let G of q)if(/^\s+$/.test(G))z.appendChild(document.createTextNode(G.replace(/\n/g," ")));else if(G){let Y=document.createElement("span");Y.setAttribute("data-split-word-wrap",""),Y.style.display="inline-block",Y.style.whiteSpace="nowrap";for(let N of G){let H=document.createElement("span");H.setAttribute("data-split-char",""),H.setAttribute("data-char-index",String($.chars.length)),H.style.display="inline-block",H.textContent=N,$.chars.push(H),Y.appendChild(H)}z.appendChild(Y)}J.replaceChild(z,Z)}else if(Z.nodeType===1){let j=Z;if(j.tagName==="BR")continue;this._splitCharsDom(j,$)}}static _splitWordsWithCharsDom(J,$){let Q=Array.from(J.childNodes);for(let Z of Q)if(Z.nodeType===3){let j=Z.textContent||"";if(!j)continue;let q=j.split(/(\s+)/),z=document.createDocumentFragment();for(let G of q)if(/^\s+$/.test(G))z.appendChild(document.createTextNode(G.replace(/\n/g," ")));else if(G){let Y=document.createElement("span");Y.setAttribute("data-split-word",""),Y.setAttribute("data-word-index",String($.words.length)),Y.style.display="inline-block",Y.style.whiteSpace="nowrap";for(let N of G){let H=document.createElement("span");H.setAttribute("data-split-char",""),H.setAttribute("data-char-index",String($.chars.length)),H.style.display="inline-block",H.textContent=N,$.chars.push(H),Y.appendChild(H)}$.words.push(Y),z.appendChild(Y)}J.replaceChild(z,Z)}else if(Z.nodeType===1){let j=Z;if(j.tagName==="BR")continue;this._splitWordsWithCharsDom(j,$)}}static _splitWithLinesDom(J,$,Q,Z){let j={chars:[],words:[],lines:[],elements:[]};this._splitWordsDom(J,j);let q=[],z=[],G=-1/0;for(let _ of j.words){let B=_.getBoundingClientRect();if(B.top>G+2){if(z.length>0)q.push(z);z=[_],G=B.top}else z.push(_)}if(z.length>0)q.push(z);let Y=new Map;for(let _ of j.words)Y.set(_,this._getWrapperChain(_,J));let N="",H=0,X=0,K=0;for(let _ of q){let B="",U=[];for(let W=0;W<_.length;W++){let O=_[W],F=O.textContent||"",A=Y.get(O)||[],L=0;while(L<U.length&&L<A.length&&U[L]===A[L])L++;for(let R=U.length-1;R>=L;R--)B+=`</${U[R].tagName.toLowerCase()}>`;if(W>0)B+=" ";for(let R=L;R<A.length;R++)B+=this._openTag(A[R]);if(Q){let R="";for(let O0 of F)R+=`<span data-split-char data-char-index="${K}" style="display:inline-block">${this._escapeHtml(O0)}</span>`,K++;if($)B+=`<span data-split-word data-word-index="${X}" style="display:inline-block;white-space:nowrap">${R}</span>`;else B+=R}else if($)B+=`<span data-split-word data-word-index="${X}" style="display:inline-block">${this._escapeHtml(F)}</span>`;else B+=this._escapeHtml(F);X++,U=A}for(let W=U.length-1;W>=0;W--)B+=`</${U[W].tagName.toLowerCase()}>`;N+=`<span data-split-line data-line-index="${H}" style="display:block">${B}</span>`,H++}if(J.innerHTML=N,Q)Z.chars=Array.from(J.querySelectorAll("[data-split-char]"));if($)Z.words=Array.from(J.querySelectorAll("[data-split-word]"));Z.lines=Array.from(J.querySelectorAll("[data-split-line]"))}static _applyMaskWrappers(J){let $=J.elements;for(let Q of $){let Z=Q.hasAttribute("data-split-line"),j=Q.hasAttribute("data-split-word"),q=document.createElement("span");if(q.setAttribute("data-split-mask",""),q.style.overflow="hidden",q.style.display=Z?"block":"inline-block",!Z)q.style.verticalAlign=j?"bottom":"bottom";Q.parentNode.insertBefore(q,Q),q.appendChild(Q)}}static _propagateGradientText(J,$){let Q=window.getComputedStyle(J);if((Q.getPropertyValue("background-clip")||Q.getPropertyValue("-webkit-background-clip"))!=="text")return;let j=Q.getPropertyValue("background-image"),q=J.querySelectorAll("[data-split-mask], [data-split-word], [data-split-word-wrap], [data-split-char], [data-split-line]");for(let z of q)z.style.backgroundImage=j,z.style.backgroundClip="text",z.style.setProperty("-webkit-background-clip","text"),z.style.setProperty("-webkit-text-fill-color","transparent")}static revert(J,$){let Q=y0.get(J);if(!Q)return!1;if($){if(Q.consumers.delete($),Q.consumers.size>0)return!1}if(!(J instanceof HTMLElement))return!1;return J.innerHTML=Q.originalHTML,J.removeAttribute("data-split"),y0.delete(J),!0}static isSplit(J){return J.hasAttribute("data-split")}static getResult(J){return y0.get(J)?.result}static _getWrapperChain(J,$){let Q=[],Z=J.parentElement;while(Z&&Z!==$)Q.unshift(Z),Z=Z.parentElement;return Q}static _openTag(J){let $=J.tagName.toLowerCase(),Q="";for(let Z of Array.from(J.attributes))Q+=` ${Z.name}="${this._escapeHtml(Z.value)}"`;return`<${$}${Q}>`}static _escapeHtml(J){return J.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}}I.textSplitter={split:(J,$,Q)=>HJ.split(J,$,Q),revert:(J,$)=>HJ.revert(J,$),isSplit:HJ.isSplit};var gJ={alphanumeric:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",alpha:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",numeric:"0123456789",hex:"0123456789ABCDEF",binary:"01",katakana:"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲン",symbols:"!@#$%^&*+-=<>?/|~",blocks:"░▒▓█▄▀■□▪▫"},oJ=80,P6=400,H9=[2,5],XJ=new WeakMap,v0=new WeakMap,_J=new WeakMap;function y6(J){let $=J.parentElement;while($&&typeof $.hasAttribute==="function"&&$.hasAttribute("data-split-word-wrap"))$=$.parentElement;return $}function X9(J){if(!J)return gJ.alphanumeric;return Object.prototype.hasOwnProperty.call(gJ,J)?gJ[J]:J}function l0(J){return J[Math.floor(Math.random()*J.length)]}function S6(J){if(J===void 0){let[Z,j]=H9;return Z+Math.floor(Math.random()*(j-Z+1))}if(typeof J==="number")return Math.max(1,J);let[$,Q]=J;return $+Math.floor(Math.random()*(Q-$+1))}function N0(J){return J===""||J===" "||J===" "||J===`
33
+ `||J==="\t"}function _9(J){let $=J.textContent??"";if(!XJ.has(J))XJ.set(J,$);return $===" "?" ":$}function K9(J,$){if(!$||$.length===0)return{width:0,char:""};let Q=J.parentElement;if(!Q)return{width:0,char:""};let Z=document.createElement("span"),j=Z.style;j.position="absolute",j.left="-99999px",j.top="0",j.visibility="hidden",j.whiteSpace="pre",j.display="inline-block",j.pointerEvents="none";let q=[],z=new Set;for(let N of $){if(z.has(N))continue;z.add(N);let H=document.createElement("span");H.style.display="inline-block",H.textContent=N,Z.appendChild(H),q.push({el:H,c:N})}Q.appendChild(Z);let G=0,Y="";try{for(let{el:N,c:H}of q){let X=N.getBoundingClientRect().width;if(X>G)G=X,Y=H}}finally{Q.removeChild(Z)}return{width:G,char:Y}}function B9(J,$,Q=P6,Z=!0,j="none",q=!1,z=""){let G=0,Y=0,N="";if(j!=="none"&&$!=="board"){let H=null;for(let X of J)if(!N0(X.textContent??""))G=Math.max(G,X.offsetWidth),H??=X;if(H&&z){let X=K9(H,z);if(Y=X.width,N=X.char,Y>G)G=Y}G=Math.max(G,8)+4}if(j==="container"&&$!=="board"&&N){let H=new Map;for(let X of J){let K=y6(X);if(!K)continue;let _=H.get(K);if(!_)_=[],H.set(K,_);_.push(X)}for(let[X,K]of H){if(_J.has(X))continue;let _=X.getBoundingClientRect().width,B=0;for(let W of K){if(N0(W.textContent??""))continue;let O=W.getBoundingClientRect().width;if(Y>O)B+=Y-O}let U=Math.ceil(_+B+2);_J.set(X,{display:X.style.display,width:X.style.width}),X.style.display="inline-block",X.style.width=`${U}px`}}if($==="flip"){let H=new Set;for(let X of J){if(X.style.display="inline-block",X.style.backfaceVisibility="hidden",X.style.verticalAlign="top",j==="cells"&&!N0(X.textContent??""))X.style.width=`${G}px`,X.style.textAlign="center";if(X.parentElement&&!H.has(X.parentElement))H.add(X.parentElement),X.parentElement.style.height=`${X.parentElement.offsetHeight}px`}}else if($==="slide")for(let H of J){if(H.style.display="inline-block",H.parentElement)H.parentElement.style.overflow="hidden";if(j==="cells"&&!N0(H.textContent??""))H.style.width=`${G}px`,H.style.textAlign="center"}else if($==="blur"||$==="scale"||$==="fade"||$==="none"){for(let H of J)if(H.style.display="inline-block",j==="cells"&&!N0(H.textContent??""))H.style.width=`${G}px`,H.style.textAlign="center"}else if($==="board"){let H=0;if(Z){for(let X of J)if(!N0(X.textContent??""))H=Math.max(H,X.offsetWidth);H=Math.max(H,8)+4}for(let X of J){let F=function(e){let r=document.createElement("span"),k=r.style;return k.display="block",k.position="absolute",k.left="0",k.width="100%",k.height="200%",k.fontSize=U.fontSize,k.fontFamily=U.fontFamily,k.fontWeight=U.fontWeight,k.color=U.color,k.lineHeight=`${O}px`,k.textAlign="center",k.setProperty("-webkit-text-fill-color",U.color),k.top=e,r},A=function(e){let r=document.createElement("div"),k=r.style;k.position="absolute",k.left="0",k.width="100%",k.height="50%",k.overflow="hidden",k.top=e?"50%":"0",k.zIndex="1";let H0=F(e?"-100%":"0");return r.appendChild(H0),[r,H0]},L=function(e="0"){let r=document.createElement("div"),k=r.style;k.position="absolute",k.left="0",k.top="0",k.width="100%",k.height="100%",k.overflow="hidden",k.backfaceVisibility="hidden";let H0=F(e);return r.appendChild(H0),[r,H0]};if(v0.has(X))continue;let K=X.textContent??"",_=N0(K);if(_&&!q)continue;let B=_?" ":K,U=window.getComputedStyle(X),W=Z?H:X.offsetWidth,O=X.offsetHeight;X.textContent="",X.style.display="inline-block",X.style.position="relative",X.style.width=`${W}px`,X.style.height=`${O}px`,X.style.perspective=`${Q}px`;let[R,O0]=A(!1);O0.textContent=B;let[I0,f0]=A(!0);f0.textContent=B;let F0=document.createElement("div"),p=F0.style;p.position="absolute",p.left="0",p.top="0",p.width="100%",p.height="50%",p.transformOrigin="center bottom",p.transformStyle="preserve-3d",p.zIndex="2";let[k0,L0]=L();L0.textContent=B;let[G0,A0]=L("-100%");G0.style.transform="rotateX(180deg)",A0.textContent=B,F0.appendChild(k0),F0.appendChild(G0);let g=document.createElement("div"),z0=g.style;z0.position="absolute",z0.left="0",z0.width="100%",z0.height="1px",z0.top="calc(50% - 0.5px)",z0.zIndex="3",z0.pointerEvents="none";let u0=document.createElement("div"),a=u0.style;if(a.position="absolute",a.left="0",a.width="100%",a.height="50%",a.top="50%",a.zIndex="2",a.pointerEvents="none",a.opacity="0",a.background="linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 100%)",X.appendChild(R),X.appendChild(I0),X.appendChild(F0),X.appendChild(u0),X.appendChild(g),g.style.background=Z?"rgba(0, 0, 0, 0.6)":"rgba(0, 0, 0, 0.15)",X.style.marginRight=Z?"2px":"1px",Z){R.style.background="linear-gradient(180deg, #2a2a2e 0%, #1e1e22 100%)",R.style.borderRadius="4px 4px 0 0",I0.style.background="linear-gradient(180deg, #1e1e22 0%, #16161a 100%)",I0.style.borderRadius="0 0 4px 4px",k0.style.background="linear-gradient(180deg, #2a2a2e 0%, #1e1e22 100%)",k0.style.borderRadius="4px 4px 0 0",G0.style.background="linear-gradient(180deg, #1e1e22 0%, #16161a 100%)",G0.style.borderRadius="0 0 4px 4px";for(let H0 of[O0,f0,L0,A0])H0.style.color="#e8e8ec",H0.style.setProperty("-webkit-text-fill-color","#e8e8ec")}v0.set(X,{staticTop:R,staticBottom:I0,flapWrap:F0,flapFront:k0,flapBack:G0,splitLine:g,shadow:u0,staticTopText:O0,staticBottomText:f0,flapFrontText:L0,flapBackText:A0})}}}function W9(J,$,Q,Z,j,q,z,G){let Y=[];for(let H=0;H<Q;H++){let X=!z&&H===Q-1?$:l0(Z);Y.push(X)}let N=-1;return(H)=>{let X=Math.min(H,0.9999)*Q,K=Math.floor(X),_=X-K,B=_>=0.5,U=K*2+(B?1:0);if(j!=="board"&&U!==N){if(B)J.textContent=z?l0(Z):Y[K]??$;else J.textContent=K===0?$:z?l0(Z):Y[K-1]??$;N=U}switch(j){case"flip":{let W=_<0.5?-90*(_/0.5):90*(1-(_-0.5)/0.5);E(J,"perspective",q,"px"),E(J,"rotateX",W,"deg"),$0(J);break}case"fade":{let W=_<0.5?1-_/0.5:(_-0.5)/0.5;J.style.opacity=String(W);break}case"slide":{let W=_<0.5?-100*(_/0.5):100*(1-(_-0.5)/0.5),O=_<0.5?1-_/0.5:(_-0.5)/0.5;E(J,"y",W,"%"),$0(J),J.style.opacity=String(O);break}case"blur":{let W=_<0.5?8*(_/0.5):8*(1-(_-0.5)/0.5);J.style.filter=`blur(${W}px)`;break}case"scale":{let W=_<0.5?1-_/0.5:(_-0.5)/0.5;E(J,"scale",W),$0(J);break}case"board":{let W=v0.get(J);if(!W)break;let O=K===0?$:z?l0(Z):Y[K-1]??$,F=z?l0(Z):Y[K]??$;W.staticTopText.textContent=F,W.flapFrontText.textContent=O,W.flapBackText.textContent=F,W.staticBottomText.textContent=O;let A=-180*_;W.flapWrap.style.transform=`rotateX(${A}deg)`;let L=Math.sin(_*Math.PI);W.shadow.style.opacity=String(L);break}default:break}if(G&&G.length>0){let W=!1;for(let O of G){let F=_<0.5?1-_/0.5:(_-0.5)/0.5,A=O.from+(O.to-O.from)*F;if(O.isTransform)E(J,O.prop,A,O.unit||void 0),W=!0;else J.style[O.prop]=O.unit?`${A}${O.unit}`:String(A)}if(W)$0(J)}}}function U9(J,$,Q,Z){return()=>{if(Q==="board"){let j=v0.get(J);if(j)j.staticTopText.textContent=$,j.staticBottomText.textContent=$,j.flapFrontText.textContent=$,j.flapBackText.textContent=$,j.flapWrap.style.transform="",j.shadow.style.opacity="0";if(Z&&Z.length>0){for(let q of Z)if(!q.isTransform)J.style[q.prop]=q.unit?`${q.to}${q.unit}`:String(q.to)}return}if(J.textContent=$,Q==="flip"||Q==="scale")x(J,!0);else if(Q==="slide")x(J,!0),J.style.opacity="";else if(Q==="fade")J.style.opacity="";else if(Q==="blur")J.style.filter="";if(Z&&Z.length>0){for(let j of Z)if(j.isTransform)E(J,j.prop,j.to,j.unit||void 0);else J.style[j.prop]=j.unit?`${j.to}${j.unit}`:String(j.to);if(Z.some((j)=>j.isTransform))$0(J)}}}class s0{static prepare(J,$,Q=!1,Z){let j=$.type??"flip",q=X9($.charset),z=$.perspective??P6,G=$.styledBoard??!0,Y=$.stableWidth??!1,N=Y==="container"?"container":Y==="cells"||Y===!0?"cells":"none",H=$.preserveWhitespaceCells??!1,X=[];for(let _ of J){let B=_9(_),U=_.textContent??"",W=N0(U),O=W&&H&&j==="board";if(W&&!O)continue;let F=O?" ":B;X.push({el:_,target:F,isBlankCell:O})}B9(J,j,z,G,N,H,q);let K=[];for(let{el:_,target:B,isBlankCell:U}of X)if(U)K.push({el:_,render:()=>{},finalize:()=>{}});else{let W=S6($.cycles);K.push({el:_,render:W9(_,B,W,q,j,z,Q,Z),finalize:U9(_,B,j,Z)})}if(K.length===0&&J.length>0){if(J.some((B)=>B.textContent===""))console.warn("[Motion.page SDK] TextFlapper produced zero drivers.","The element likely contains detached char spans from a previous split","(textContent was cleared but spans remain registered).",`Effect type: '${j}'.`,"Fix: call Motion(name).kill() and Motion.reset(element) before re-animating, or mutate innerHTML/textContent on the ORIGINAL container (not the split fragments).",{charElements:J,type:j})}return K}static flap(J,$,Q,Z=!1){let j=s0.prepare(J,$,Z);if(j.length===0)return{kill(){},finished:Promise.resolve(),isComplete:!0};let q=S6($.cycles),z=q*2*oJ+Math.max(0,q-1)*0.5*oJ,G=()=>{},Y=new Promise((W)=>{G=W}),N=!1,H=0,X=0,K=[],_=0;for(let W=0;W<J.length;W++){let O=J[W].textContent??"";if(N0(O))continue;K.push(Q?.[W]??_*oJ*2),_++}let B=performance.now();function U(){if(N)return;let W=performance.now(),O=!0;for(let F=0;F<j.length;F++){let A=j[F],L=W-B-K[F];if(L<0){O=!1;continue}if(Z){let R=L%z/z;A.render(R),O=!1}else{let R=Math.min(L/z,1);if(A.render(R),R>=1)A.finalize();else O=!1}}if(O&&!Z)H=j.length,G();else X=requestAnimationFrame(U)}if(X=requestAnimationFrame(U),Z)G();return{kill(){if(N)return;N=!0,cancelAnimationFrame(X);for(let W of j)W.finalize();G()},get finished(){return Y},get isComplete(){return N||H===j.length}}}static revert(J){for(let $ of J){let Q=v0.get($);if(Q)Q.staticTop.remove(),Q.staticBottom.remove(),Q.flapWrap.remove(),Q.splitLine.remove(),Q.shadow.remove(),v0.delete($),$.style.perspective="",$.style.position="",$.style.width="",$.style.height="",$.style.marginRight="";let Z=XJ.get($);if(Z!==void 0)$.textContent=Z,XJ.delete($);if($.style.display="",$.style.backfaceVisibility="",$.style.overflow="",$.style.transform="",$.style.transition="",$.style.opacity="",$.style.filter="",$.style.width="",$.style.textAlign="",$.style.verticalAlign="",$.parentElement)$.parentElement.style.overflow="",$.parentElement.style.height="";let j=y6($);if(j){let q=_J.get(j);if(q)j.style.display=q.display,j.style.width=q.width,_J.delete(j)}}}}I.textFlapper={prepare:(J,$,Q,Z)=>s0.prepare(J,$,Q,Z),flap:(J,$,Q,Z)=>s0.flap(J,$,Q,Z),revert:(J)=>s0.revert(J)};class v6{static resolve(J,$){if(J.length===0)return[];if(J.length===1)return[0];if(typeof $==="number")return J.map((Q,Z)=>Z*$);return this.resolveComplexStagger(J,$)}static resolveComplexStagger(J,$){let Q=J.length;if(Q===1)return[0];let Z;if($.each!==void 0)Z=$.each;else if($.amount!==void 0)Z=$.amount/(Q-1);else Z=0.1;let j=this.getOrdering(J,$),q=Array(Q);for(let z=0;z<Q;z++)q[j[z].originalIndex]=j[z].order*Z;return q}static getOrdering(J,$){let Q=J.length,Z=$.from??"start";if($.grid)return this.getGridOrdering(J,$);switch(Z){case"start":return J.map((j,q)=>({originalIndex:q,order:q}));case"end":return J.map((j,q)=>({originalIndex:q,order:Q-1-q}));case"center":{let j=Math.floor(Q/2);return J.map((q,z)=>{let G=Math.abs(z-j);return{originalIndex:z,order:G}})}case"edges":return J.map((j,q)=>{let z=Math.min(q,Q-1-q);return{originalIndex:q,order:z}});case"random":{let j=J.map((q,z)=>({originalIndex:z,order:Math.random()}));return j.sort((q,z)=>q.order-z.order),j.forEach((q,z)=>{q.order=z}),j}default:if(typeof Z==="number"){let j=Math.max(0,Math.min(Q-1,Z));return J.map((q,z)=>{let G=Math.abs(z-j);return{originalIndex:z,order:G}})}return J.map((j,q)=>({originalIndex:q,order:q}))}}static getGridOrdering(J,$){let Q,Z;if($.grid==="auto"){let G=this.detectGrid(J);Q=G.cols,Z=G.rows}else[Q,Z]=$.grid;let j=$.from??"start",q=$.axis??"x",z=J.map((G,Y)=>{let N=Y%Q,H=Math.floor(Y/Q);return{originalIndex:Y,col:N,row:H}});if(j==="random"){let G=z.map((Y)=>({originalIndex:Y.originalIndex,order:Math.random()}));return G.sort((Y,N)=>Y.order-N.order),G.forEach((Y,N)=>{Y.order=N}),G}return z.map((G)=>{let Y;if(typeof j==="number"){let N=j%Q,H=Math.floor(j/Q);Y=q==="x"?Math.abs(G.col-N)+Math.abs(G.row-H)*0.5:Math.abs(G.row-H)+Math.abs(G.col-N)*0.5}else if(j==="center"){let N=(Q-1)/2,H=(Z-1)/2;Y=Math.abs(G.col-N)+Math.abs(G.row-H)}else if(j==="edges"){let N=Math.min(G.col,Q-1-G.col),H=Math.min(G.row,Z-1-G.row);Y=Math.min(N,H)}else if(j==="end")Y=q==="x"?(Z-1-G.row)*Q+(Q-1-G.col):(Q-1-G.col)*Z+(Z-1-G.row);else Y=q==="x"?G.row*Q+G.col:G.col*Z+G.row;return{originalIndex:G.originalIndex,order:Y}})}static detectGrid(J){if(J.length===0)return{cols:0,rows:0};let $=J.filter((q)=>q instanceof Element);if($.length===0)return{cols:J.length,rows:1};let Q=new Map;$.forEach((q)=>{let z=q.getBoundingClientRect(),G=Math.round(z.top);Q.set(G,(Q.get(G)||0)+1)});let Z=Q.size;return{cols:Math.ceil(J.length/Z),rows:Z}}}I.stagger={resolve:(J,$)=>v6.resolve(J,$)};function O9(J,$,Q){if(!(J instanceof HTMLElement))return console.warn("[Motion Fit] Fit animations only support HTML elements. SVG elements are not supported."),null;let Z=document.querySelector($);if(!Z)return console.warn(`[Motion Fit] Target element not found: "${$}". Animation skipped.`),null;if(!(Z instanceof HTMLElement))return console.warn("[Motion Fit] Fit animations only support HTML elements. SVG elements are not supported."),null;if(Z===J)return console.warn("[Motion Fit] Target element is the same as source element. Animation skipped."),null;let j=J.getBoundingClientRect(),q=Z.getBoundingClientRect(),z=j.width===0?1:j.width,G=j.height===0?1:j.height,Y=j.left+z/2,N=j.top+G/2,H=q.left+q.width/2,X=q.top+q.height/2,K=H-Y,_=X-N,B=q.width/z,U=q.height/G;if(!Q)return{dx:K,dy:_,sx:B,sy:U,sourceWidth:j.width,sourceHeight:j.height,targetWidth:q.width,targetHeight:q.height};let W=J.offsetParent??document.documentElement,O=W.getBoundingClientRect(),F=W.scrollLeft??0,A=W.scrollTop??0;return{dx:K,dy:_,sx:B,sy:U,sourceWidth:j.width,sourceHeight:j.height,targetWidth:q.width,targetHeight:q.height,sourceLeft:J.offsetLeft,sourceTop:J.offsetTop,targetLeft:q.left-O.left+F,targetTop:q.top-O.top+A}}function T6(J,$,Q,Z){if(!Z||Z==="px")return Q;if(Z==="%"){let j=J,q=$==="x"?j.offsetWidth:j.offsetHeight;return Q/100*q}if(Z==="vw")return Q/100*window.innerWidth;if(Z==="vh")return Q/100*window.innerHeight;if(Z==="vmin")return Q/100*Math.min(window.innerWidth,window.innerHeight);if(Z==="vmax")return Q/100*Math.max(window.innerWidth,window.innerHeight);if(Z==="em"){let j=parseFloat(window.getComputedStyle(J).fontSize);return Q*j}if(Z==="rem"){let j=parseFloat(window.getComputedStyle(document.documentElement).fontSize);return Q*j}return Q}var c=0.01,T0=0.001;function I9(J,$,Q,Z){let{absolute:j=!1,scale:q=!0,resize:z=!1}=Q;if($ instanceof HTMLElement)x($,!1);let G=O9($,Q.target,j);if(!G)return;if(!j)if(z){let Y=G.dx-(G.targetWidth-G.sourceWidth)/2,N=G.dy-(G.targetHeight-G.sourceHeight)/2;if(Math.abs(Y)>c){let H=Z.acquire();H.init($,"x",0,Y,"px"),J.addPropTween(H)}if(Math.abs(N)>c){let H=Z.acquire();H.init($,"y",0,N,"px"),J.addPropTween(H)}if(Math.abs(G.targetWidth-G.sourceWidth)>c){let H=Z.acquire();H.init($,"width",G.sourceWidth,G.targetWidth,"px"),J.addPropTween(H)}if(Math.abs(G.targetHeight-G.sourceHeight)>c){let H=Z.acquire();H.init($,"height",G.sourceHeight,G.targetHeight,"px"),J.addPropTween(H)}}else{let Y=Y0($,"x"),N=Y0($,"y"),H=EJ($,"x"),X=EJ($,"y"),K=T6($,"x",Y,H),_=T6($,"y",N,X),B=K+G.dx,U=_+G.dy;if(Math.abs(B-K)>c||Math.abs(K)>c||Math.abs(B)>c){let W=Z.acquire();W.init($,"x",K,B,"px"),J.addPropTween(W)}if(Math.abs(U-_)>c||Math.abs(_)>c||Math.abs(U)>c){let W=Z.acquire();W.init($,"y",_,U,"px"),J.addPropTween(W)}if(q){let W=Y0($,"scaleX"),O=Y0($,"scaleY"),F=W*G.sx,A=O*G.sy;if(Math.abs(F-W)>T0||Math.abs(W-1)>T0||Math.abs(F-1)>T0){let L=Z.acquire();L.init($,"scaleX",W,F,""),J.addPropTween(L)}if(Math.abs(A-O)>T0||Math.abs(O-1)>T0||Math.abs(A-1)>T0){let L=Z.acquire();L.init($,"scaleY",O,A,""),J.addPropTween(L)}}}else{let Y=$;if(window.getComputedStyle(Y).position==="static")Y.style.position="absolute";let{sourceLeft:H,sourceTop:X,targetLeft:K,targetTop:_}=G;if(Math.abs(K-H)>c){let B=Z.acquire();B.init($,"left",H,K,"px"),J.addPropTween(B)}if(Math.abs(_-X)>c){let B=Z.acquire();B.init($,"top",X,_,"px"),J.addPropTween(B)}if(q){if(Math.abs(G.targetWidth-G.sourceWidth)>c){let B=Z.acquire();B.init($,"width",G.sourceWidth,G.targetWidth,"px"),J.addPropTween(B)}if(Math.abs(G.targetHeight-G.sourceHeight)>c){let B=Z.acquire();B.init($,"height",G.sourceHeight,G.targetHeight,"px"),J.addPropTween(B)}}}}function F9(J,$,Q,Z){J.setPendingFitSetup((z)=>I9(J,$,Q,z)),J.setLazyStartCapture(!0);let{absolute:j=!1,resize:q=!1}=Q;J.setFitCleanup(()=>{if($ instanceof HTMLElement){if(x($,!0),q)$.style.width="",$.style.height="";if(j)$.style.width="",$.style.height="",$.style.left="",$.style.top=""}})}I.fit={registerPendingSetup:F9};var d6=(J)=>J,L9=d6,P={in:(J)=>J*J,out:(J)=>J*(2-J),inOut:(J)=>J<0.5?2*J*J:-1+(4-2*J)*J},W0={in:(J)=>J*J*J,out:(J)=>--J*J*J+1,inOut:(J)=>J<0.5?4*J*J*J:(J-1)*(2*J-2)*(2*J-2)+1},U0={in:(J)=>J*J*J*J,out:(J)=>1- --J*J*J*J,inOut:(J)=>J<0.5?8*J*J*J*J:1-8*--J*J*J*J},i={in:(J)=>J*J*J*J*J,out:(J)=>1+--J*J*J*J*J,inOut:(J)=>J<0.5?16*J*J*J*J*J:1+16*--J*J*J*J*J};var KJ={in:(J)=>1-Math.cos(J*Math.PI/2),out:(J)=>Math.sin(J*Math.PI/2),inOut:(J)=>-(Math.cos(Math.PI*J)-1)/2},BJ={in:(J)=>2**(10*(J-1))*J+J*J*J*J*J*J*(1-J),out:(J)=>1-(2**(10*-J)*(1-J)+(1-J)*(1-J)*(1-J)*(1-J)*(1-J)*(1-J)*J),inOut:(J)=>{if(J<0.5){let Q=J*2;return(2**(10*(Q-1))*Q+Q*Q*Q*Q*Q*Q*(1-Q))/2}let $=(1-J)*2;return 1-(2**(10*($-1))*$+$*$*$*$*$*$*(1-$))/2}},WJ={in:(J)=>1-Math.sqrt(1-J*J),out:(J)=>Math.sqrt(1- --J*J),inOut:(J)=>{if((J*=2)<1)return-0.5*(Math.sqrt(1-J*J)-1);return 0.5*(Math.sqrt(1-(J-=2)*J)+1)}};var c6=(J=1.70158)=>{let $=(Q)=>Q?--Q*Q*((J+1)*Q+J)+1:0;return{in:(Q)=>1-$(1-Q),out:$,inOut:(Q)=>{if(Q<0.5)return(1-$(1-Q*2))/2;return 0.5+$((Q-0.5)*2)/2}}},UJ=c6();var m6=(J=1,$=0.3)=>{let Q=Math.max(1,J),Z=$/(2*Math.PI)*Math.asin(1/Q),j=$*1.5,q=j/(2*Math.PI)*Math.asin(1/Q);return{in:(z)=>{if(z===0)return 0;if(z===1)return 1;return-(Q*Math.pow(2,10*(z-=1))*Math.sin((z-Z)*(2*Math.PI)/$))},out:(z)=>{if(z===0)return 0;if(z===1)return 1;return Q*Math.pow(2,-10*z)*Math.sin((z-Z)*(2*Math.PI)/$)+1},inOut:(z)=>{if(z===0)return 0;if(z===1)return 1;if((z*=2)<1)return-0.5*(Q*Math.pow(2,10*(z-=1))*Math.sin((z-q)*(2*Math.PI)/j));return Q*Math.pow(2,-10*(z-=1))*Math.sin((z-q)*(2*Math.PI)/j)*0.5+1}}},OJ=m6(),h6=(J)=>{if(J<0.36363636363636365)return 7.5625*J*J;else if(J<0.7272727272727273)return 7.5625*(J-=0.5454545454545454)*J+0.75;else if(J<0.9090909090909091)return 7.5625*(J-=0.8181818181818182)*J+0.9375;else return 7.5625*(J-=0.9545454545454546)*J+0.984375},h0={in:(J)=>1-h6(1-J),out:h6,inOut:(J)=>{if(J<0.5)return h0.in(J*2)*0.5;return h0.out(J*2-1)*0.5+0.5}},i0=(J=0.7,$=0.7,Q=!1)=>{let Z=J!==1?$:0,j=(1-J)/2,q=j+J,z=Q;return(G)=>{let Y=G+(0.5-G)*Z;if(G<j){let N=1-G/j;if(z)return 1-N*N;return Y-N*N*N*N*Y}else if(G>q){let N=(G-q)/j;if(z)return G===1?0:1-N*N;return Y+(G-Y)*N*N*N*N}return z?1:Y}},f6={in:i0(0.7,0.7,!1),out:i0(0.7,0.7,!1),inOut:i0(0.7,0.7,!1)},FJ=(J=1,$=20,Q=!1)=>{let Z=[],j=1/$;for(let q=0;q<$;q++){let z=q*j,Y=((q*1327+531)%1000/1000-0.5)*J*0.4,N=z+Y;Z.push({x:z,y:Q?Math.max(0,Math.min(1,N)):N})}return Z[0]={x:0,y:0},Z.push({x:1,y:1}),(q)=>{if(q<=0)return 0;if(q>=1)return 1;let z=0,G=Z.length-1;while(z<G-1){let X=z+G>>1;if(Z[X].x<=q)z=X;else G=X}let Y=Z[z],N=Z[G],H=(q-Y.x)/(N.x-Y.x);return Y.y+(N.y-Y.y)*H}},A9={in:FJ(1,20,!0),out:FJ(1,20,!0),inOut:FJ(1,20,!0)},LJ=(J)=>{return($)=>{if($>=1)return 1;return Math.floor($*J)/J}},IJ={in:LJ(12),out:LJ(12),inOut:LJ(12)},u6={linear:d6,none:L9,power1:P.out,"power1.in":P.in,"power1.out":P.out,"power1.inout":P.inOut,power2:W0.out,"power2.in":W0.in,"power2.out":W0.out,"power2.inout":W0.inOut,power3:U0.out,"power3.in":U0.in,"power3.out":U0.out,"power3.inout":U0.inOut,power4:i.out,"power4.in":i.in,"power4.out":i.out,"power4.inout":i.inOut,quad:P.out,"quad.in":P.in,"quad.out":P.out,"quad.inout":P.inOut,cubic:W0.out,"cubic.in":W0.in,"cubic.out":W0.out,"cubic.inout":W0.inOut,quart:U0.out,"quart.in":U0.in,"quart.out":U0.out,"quart.inout":U0.inOut,quint:i.out,"quint.in":i.in,"quint.out":i.out,"quint.inout":i.inOut,strong:i.out,"strong.in":i.in,"strong.out":i.out,"strong.inout":i.inOut,sine:KJ.out,"sine.in":KJ.in,"sine.out":KJ.out,"sine.inout":KJ.inOut,expo:BJ.out,"expo.in":BJ.in,"expo.out":BJ.out,"expo.inout":BJ.inOut,circ:WJ.out,"circ.in":WJ.in,"circ.out":WJ.out,"circ.inout":WJ.inOut,back:UJ.out,"back.in":UJ.in,"back.out":UJ.out,"back.inout":UJ.inOut,elastic:OJ.out,"elastic.in":OJ.in,"elastic.out":OJ.out,"elastic.inout":OJ.inOut,bounce:h0.out,"bounce.in":h0.in,"bounce.out":h0.out,"bounce.inout":h0.inOut,slow:f6.inOut,"slow.in":P.out,"slow.out":P.out,"slow.inout":P.out,slowmo:f6.inOut,"slowmo.in":P.out,"slowmo.out":P.out,"slowmo.inout":P.out,rough:A9.inOut,"rough.in":P.out,"rough.out":P.out,"rough.inout":P.out,steps:IJ.inOut,"steps.in":IJ.in,"steps.out":IJ.out,"steps.inout":IJ.inOut},M9={back:(J)=>c6(J),elastic:(J,$)=>m6(J,$),slow:(J,$,Q)=>{let Z=i0(J,$,Q===1);return{in:Z,out:Z,inOut:Z}},slowmo:(J,$,Q)=>{let Z=i0(J,$,Q===1);return{in:Z,out:Z,inOut:Z}},rough:(J,$,Q)=>{let Z=FJ(J,$,Q===1);return{in:Z,out:Z,inOut:Z}},steps:(J)=>{let $=LJ(J??12);return{in:$,out:$,inOut:$}}},D9=/^(\w+)(?:\.(\w+))?\(([^)]*)\)$/;function p6(J){let $=J.toLowerCase();if(u6[$])return u6[$];let Q=D9.exec($);if(Q){let[,Z,j,q]=Q,z=M9[Z];if(z){let G=q.split(",").map((Y)=>Y.trim()).filter((Y)=>Y.length>0).map(Number);if(G.every((Y)=>!isNaN(Y))){let Y=z(...G),N=j||"out",X=Y[N==="inout"?"inOut":N];if(X)return X}}}return console.warn(`[Motion] Unknown easing "${J}". Falling back to "power1.out". Valid easings: linear, power1-4.in/out/inOut, quad, cubic, quart, quint, strong, sine, expo, circ, back, elastic, bounce, slow, rough, steps. Parameterized: back.out(overshoot), elastic.out(amplitude, period), steps(n), slow(ratio, power, yoyo), rough(strength, points, clamp)`),P.out}class lJ{_id=0;_targets=[];_duration=0.5;_delay=0;_time=0;_progress=0;_timeScale=1;_isActive=!1;_isReversed=!1;_propTweens=null;_lastPropTween=null;_easingFn=null;_repeat=0;_repeatDelay=0;_yoyo=!1;_currentRepeat=0;_onStart;_onUpdate;_onComplete;_onRepeat;_onReverseComplete;_startFired=!1;_completeFired=!1;_timelineChild=!1;_needsStartCapture=!1;_startCaptured=!1;_fitSetupFn=null;_pendingFitSetup=null;_fitCleanupFn=null;_unregisterCallback=null;init(J,$,Q,Z,j,q){return this._id=J,this._targets=$,this._duration=Q,this._delay=Z,this._easingFn=p6(j),this._time=0,this._progress=0,this._timeScale=1,this._isActive=!1,this._isReversed=!1,this._startFired=!1,this._completeFired=!1,this._currentRepeat=0,this._repeat=q?.repeat??0,this._repeatDelay=q?.repeatDelay??0,this._yoyo=q?.yoyo??!1,this._onStart=q?.onStart,this._onUpdate=q?.onUpdate,this._onComplete=q?.onComplete,this._onRepeat=q?.onRepeat,this._onReverseComplete=q?.onReverseComplete,this}update(J){if(!this._isActive)return;let $=J*this._timeScale;if(this._time+=this._isReversed?-$:$,!this._isReversed&&this._time<0){this._time=0;return}let Q=Math.max(0,this._time-this._delay);if(this._progress=this._duration>0?Math.min(1,Q/this._duration):1,!this._startFired&&this._progress>0)this._startFired=!0,this._onStart?.();if(this.render(this._progress),this._onUpdate?.(this._progress),this._isReversed){if(this._time<=0)this.handleComplete()}else if(this._progress>=1)this.handleComplete()}render(J){let $=this.applyEasing(J),Q=this._propTweens;while(Q)Q.render($),Q=Q.next}renderAtTime(J){let $=Math.max(0,J),Q=this._duration,Z=this._delay,j=this._currentRepeat;if(Q===0){let q=$>=Z?1:0;this._time=$,this._progress=q,this.render(q)}else{let q=Math.max(0,$-Z);if(this._repeat===0){let z=Math.min(1,q/Q);this._time=Math.min(Q,q),this._progress=z,this.render(z)}else{let z=this._repeatDelay,G=Q+z,Y=this._repeat===-1?1/0:Q*(this._repeat+1)+z*this._repeat,N=this._repeat===-1?q:Math.min(q,Y),H=G>0?Math.floor(N/G):0,X=N-H*G,K=X>Q,_=Q>0?Math.min(1,X/Q):1,B=this._yoyo&&H%2===1;if(K)_=B?0:1;else if(B)_=1-_;this._currentRepeat=this._repeat===-1?H:Math.min(H,this._repeat),this._isReversed=B,this._progress=_,this._time=Q*_,this.render(_)}}if(this._isActive){if(!this._startFired){this._startFired=!0;try{this._onStart?.()}catch(q){console.error("[Motion] onStart callback error:",q)}}try{this._onUpdate?.(this._progress)}catch(q){console.error("[Motion] onUpdate callback error:",q)}if(this._currentRepeat>j)try{this._onRepeat?.(this._currentRepeat)}catch(q){console.error("[Motion] onRepeat callback error:",q)}if(!this._completeFired&&this._repeat!==-1){if($>=this.totalDuration()){this._completeFired=!0;try{this._onComplete?.()}catch(q){console.error("[Motion] onComplete callback error:",q)}}}}}applyEasing(J){if(!this._easingFn)return J;return this._easingFn(J)}handleComplete(){if(this._repeat===-1||this._currentRepeat<this._repeat){if(this._currentRepeat++,this._onRepeat?.(this._currentRepeat),this._yoyo)this._isReversed=!this._isReversed,this._time=this._isReversed?this._duration+this._delay:0;else this._time=0,this._startFired=!1;this._time-=this._repeatDelay;return}if(this._isReversed)this._onReverseComplete?.();else this._onComplete?.();this._isActive=!1}play(J){if(J!==void 0)return this.seek(J),this._isActive=!0,this._isReversed=!1,this;if(this._isActive&&!this._isReversed)return this;return this._isActive=!0,this._isReversed=!1,this}pause(J){if(J!==void 0){this._time=J;let $=Math.max(0,this._time-this._delay);this._progress=this._duration>0?Math.min(1,$/this._duration):1,this.render(this._progress)}return this._isActive=!1,this}reverse(J){if(J!==void 0)this.seek(J);return this._isActive=!0,this._isReversed=!0,this}restart(J=!0){return this._time=J?0:this._delay,this._progress=0,this._isActive=!0,this._isReversed=!1,this._startFired=!1,this._currentRepeat=0,this.render(0),this}seek(J){this._time=J;let $=Math.max(0,this._time-this._delay);return this._progress=this._duration>0?Math.min(1,$/this._duration):1,this.render(this._progress),this}progress(J){if(J===void 0)return this._progress;if(this._progress=Math.max(0,Math.min(1,J)),this._progress===0)this._time=0;else this._time=this._progress*this._duration+this._delay;return this.render(this._progress),this}time(J){if(J===void 0)return this._time;this._time=J;let $=Math.max(0,this._time-this._delay);return this._progress=this._duration>0?Math.min(1,$/this._duration):1,this.render(this._progress),this}timeScale(J){if(J===void 0)return this._timeScale;return this._timeScale=J,this}getTimeScale(){return this._timeScale}kill(){this._isActive=!1,this._unregisterCallback?.()}isActive(){return this._isActive}isTimelineChild(){return this._timelineChild}setTimelineChild(J){this._timelineChild=J}setLazyStartCapture(J){this._needsStartCapture=J,this._startCaptured=!1}setPendingFitSetup(J){this._fitSetupFn=J,this._pendingFitSetup=J}setFitCleanup(J){this._fitCleanupFn=J}resetForReplay(){if(this._fitSetupFn)this._fitCleanupFn?.(),this._pendingFitSetup=this._fitSetupFn,this._startCaptured=!1;this._startFired=!1,this._completeFired=!1}needsStartCapture(){return this._needsStartCapture&&!this._startCaptured}isLazyCapture(){return this._needsStartCapture}fireReverseComplete(){try{this._onReverseComplete?.()}catch(J){console.error("[Motion] onReverseComplete callback error:",J)}this._startFired=!1,this._completeFired=!1}setUnregisterCallback(J){this._unregisterCallback=J}captureStartValues(){if(!this._needsStartCapture||this._startCaptured)return;if(this._pendingFitSetup){let $=this._propTweens;while($){let Q=$.next;K0.release($),$=Q}this._propTweens=null,this._lastPropTween=null,this._pendingFitSetup(K0),this._pendingFitSetup=null,this._startCaptured=!0;return}let J=this._propTweens;while(J){if(J.target instanceof Element){let{target:$,property:Q}=J;if(J.valueType==="color"&&_0(Q)){let Z=I.color?.getCurrentColor($,Q);if(Z&&J.endColor)J.startColor=Z,J.changeColor=new Float32Array([J.endColor[0]-Z[0],J.endColor[1]-Z[1],J.endColor[2]-Z[2],J.endColor[3]-Z[3]])}else if(J.valueType==="filter"&&t(Q)){let Z=I.filter?.getCurrentFilter($);if(Z&&J.endFilters){let j=I.filter.mergeFilterArrays(Z,J.endFilters);J.startFilters=j.start,J.endFilters=j.end}}else if(J.valueType==="clipPath"&&PJ(Q)){let Z=I.clipPath;if(Z&&J.endClipPath){let j=Z.getCurrentClipPath($);if(j&&Z.canInterpolate(j,J.endClipPath))J.startClipPath=j}}else{let Z=Y0($,Q);J.startValue=Z,J.change=J.endValue-J.startValue}}J=J.next}this._startCaptured=!0}getId(){return this._id}getTargets(){return this._targets}getDuration(){return this._duration}getDelay(){return this._delay}clearDelay(){this._delay=0}getFirstPropTween(){return this._propTweens}addPropTween(J){if(!this._lastPropTween)this._propTweens=J;else this._lastPropTween.next=J;this._lastPropTween=J}totalDuration(){if(this._repeat===-1)return 1/0;let $=this._duration*(this._repeat+1)+this._repeatDelay*this._repeat;return this._delay+$}reset(){this._id=0,this._targets=[],this._duration=0.5,this._delay=0,this._time=0,this._progress=0,this._timeScale=1,this._isActive=!1,this._isReversed=!1,this._easingFn=null,this._repeat=0,this._repeatDelay=0,this._yoyo=!1,this._currentRepeat=0,this._onStart=void 0,this._onUpdate=void 0,this._onComplete=void 0,this._onRepeat=void 0,this._onReverseComplete=void 0,this._startFired=!1,this._completeFired=!1,this._timelineChild=!1,this._needsStartCapture=!1,this._startCaptured=!1,this._fitSetupFn=null,this._pendingFitSetup=null,this._fitCleanupFn=null,this._unregisterCallback=null;let J=K0,$=this._propTweens;while($){let Q=$.next;J.release($),$=Q}this._propTweens=null,this._lastPropTween=null}}var n0=new g0(()=>new lJ,100),g6={acquire:()=>n0.acquire(),release:(J)=>n0.release(J),getPoolSize:()=>n0.getPoolSize(),getTotalCreated:()=>n0.getTotalCreated(),clear:()=>n0.clear()};class C{static instance;animations=[];animationIdToIndex=new Map;nextAnimationId=1;totalCreated=0;_animationSnapshot=[];timelines=new Map;_captureTarget=null;ticker;animationPool;propTweenPool;constructor(){this.ticker=T.getInstance(),this.animationPool=g6,this.propTweenPool=K0,this.ticker.add(this.update,0)}static getInstance(){if(!C.instance)C.instance=new C,v.setEngineRegisterCallback((J,$)=>{let Q=C.instance;if(!Q.hasTimeline(J))Q.registerTimeline(J,$)}),f.setCreateAnimationCallback((J,$,Q,Z,j,q,z,G)=>{return C.instance.createAnimation(J,$,Q,Z,j,q,z,G)});return C.instance}update=(J)=>{let $=this._animationSnapshot,Q=this.animations.length;$.length=Q;for(let j=0;j<Q;j++)$[j]=this.animations[j];let Z=[];for(let j=0,q=$.length;j<q;j++){let z=$[j];if(z.isTimelineChild())continue;if(z.isActive()){if(z.update(J),!z.isActive()&&!z.isTimelineChild())Z.push(z.getId())}}for(let j of Z)this.unregisterAnimation(j);for(let j of this.timelines.values())if(j.isActive())j.update(J)};createAnimation(J,$,Q,Z,j,q,z,G){let Y=G?.stagger;if(Y&&J.length>1)return this.createStaggeredAnimations(J,$,Q,Z,j,q,z,Y,G);let N=this.animationPool.acquire(),H=this.registerAnimation(N);if(N.init(H,J,Q,Z,j,G),this.setupPropertyTweens(N,J,$,q,z),Q===0)N.render(1);else if(q&&!G?._skipInitialRender)N.render(0);return N}createStaggeredAnimations(J,$,Q,Z,j,q,z,G,Y){if(!I.stagger){let X=this.animationPool.acquire(),K=this.registerAnimation(X);if(X.init(K,J,Q,Z,j,Y),this.setupPropertyTweens(X,J,$,q,z),Q===0)X.render(1);else if(q&&!Y?._skipInitialRender)X.render(0);return[X]}let N=I.stagger.resolve(J,G),H=[];for(let X=0;X<J.length;X++){let K=J[X],_=N[X],B=this.animationPool.acquire(),U=this.registerAnimation(B);if(B.init(U,[K],Q,Z+_,j,Y),this.setupPropertyTweens(B,[K],$,q,z),Q===0)B.render(1);else if(q&&!Y?._skipInitialRender)B.render(0);H.push(B)}return H}setupPropertyTweens(J,$,Q,Z,j){let q=l6(o6(Q)),z=j?l6(o6(j)):void 0,G=Object.keys(q),Y=z?Object.keys(z):[],N=[...new Set([...G,...Y])],H="perspective"in q,X=z&&"perspective"in z,K=H&&X;for(let _ of $){if(!K&&(H||X)&&_ instanceof Element){let B=H?q.perspective:z.perspective,U=typeof B==="number"?B:parseFloat(String(B))||0;if(U>0)E(_,"perspective",U,"px"),_.style.transform=w(_)}for(let B of N){if(B==="perspective"&&!K)continue;let U=q[B],W=yJ(_,B,U,z?z[B]:void 0),O=this.propTweenPool.acquire(),F=Z&&!j;switch(W.type){case"color":{let A=F?W.endColor:W.startColor,L=F?W.startColor:W.endColor;O.initColor(_,B,A,L);break}case"filter":{let A=F?W.endFilters:W.startFilters,L=F?W.startFilters:W.endFilters;O.initFilter(_,B,A,L);break}case"clipPath":{let A=F?W.endClipPath:W.startClipPath,L=F?W.startClipPath:W.endClipPath;O.initClipPath(_,B,A,L);break}case"scalar":{let A=F?W.endValue:W.startValue,L=F?W.startValue:W.endValue;O.init(_,B,A,L,W.unit);break}case"drawSVG":{let A=F?W.endDraw:W.startDraw,L=F?W.startDraw:W.endDraw;O.initDrawSVG(_,B,A,L,W.length);break}case"path":{let A=F?W.endProgress:W.startProgress,L=F?W.startProgress:W.endProgress;O.initPath(_,B,W.pathData,W.pathLength,A,L,W.rotate,W.alignOffset,W.pathOffset);break}}J.addPropTween(O)}}}registerAnimation(J){let $=this.nextAnimationId++,Q=this.animations.length;return this.animations.push(J),this.animationIdToIndex.set($,Q),this.totalCreated++,J.setUnregisterCallback(()=>this.unregisterAnimation($)),$}unregisterAnimation(J){let $=this.animationIdToIndex.get(J);if($===void 0)return;let Q=this.animations[$],Z=this.animations.length-1;if($!==Z){let j=this.animations[Z];this.animations[$]=j,this.animationIdToIndex.set(j.getId(),$)}this.animations.pop(),this.animationIdToIndex.delete(J),this.animationPool.release(Q)}getAnimation(J){let $=this.animationIdToIndex.get(J);return $!==void 0?this.animations[$]:void 0}killAll(){let J=[...this.animations];for(let $=0,Q=J.length;$<Q;$++)J[$].kill();this.animations.length=0,this.animationIdToIndex.clear()}killAnimationsForTargets(J){if(J.length===0)return;let $=new Set(J),Q=[];for(let Z=0,j=this.animations.length;Z<j;Z++){let q=this.animations[Z],z=q.getTargets();for(let G of z)if(G instanceof Element&&$.has(G)){Q.push(q);break}}for(let Z of Q)Z.kill()}getActiveCount(){let J=0;for(let $=0,Q=this.animations.length;$<Q;$++)if(this.animations[$].isActive())J++;return J}getTotalCreated(){return this.totalCreated}getTimeline(J){if(this._captureTarget)this._captureTarget.add(J);let $=this.timelines.get(J);if(!$){if($=new v(J),!this.timelines.has(J))this.timelines.set(J,$),$.setUnregisterCallback(()=>this.removeTimeline(J))}return $}startCapture(J){this._captureTarget=J}stopCapture(){this._captureTarget=null}hasTimeline(J){return this.timelines.has(J)}registerTimeline(J,$){this.timelines.set(J,$),$.setUnregisterCallback(()=>this.removeTimeline(J))}getTimelineCount(){return this.timelines.size}getTimelineNames(){return Array.from(this.timelines.keys())}removeTimeline(J){this.timelines.delete(J)}killAllTimelines(){for(let J of this.timelines.values())J.kill();this.timelines.clear()}killEverything(){this.killAllTimelines(),this.killAll(),Z6()}getAnimationPool(){return this.animationPool}getPropTweenPool(){return this.propTweenPool}getPoolStats(){return{animations:this.animationPool.getPoolSize(),propTweens:this.propTweenPool.getPoolSize()}}clearPools(){this.animationPool.clear(),this.propTweenPool.clear()}getMemoryEstimate(){let J=this.animations.length,$=this.animationPool.getPoolSize(),Q=this.propTweenPool.getPoolSize();return(J+$)*500+Q*100}getTicker(){return this.ticker}}function o6(J){if(!("transform"in J))return J;let $=J.transform;if(typeof $!=="string")return J;let Q=/([a-zA-Z0-9]+)\(([^)]+)\)/g,Z,j={},q=!1;while((Z=Q.exec($))!==null){let G=Z[1],N=Z[2].match(/[-+]?\d*\.?\d+(?:e[-+]?\d+)?[a-z%]*/gi)||[];switch(G){case"perspective":{if(!("perspective"in J))j.perspective=N[0]||"0px",q=!0;break}case"translate":{if(N[0]&&!("x"in J))j.x=N[0],q=!0;if(N[1]&&!("y"in J))j.y=N[1],q=!0;break}case"translate3d":{if(N[0]&&!("x"in J))j.x=N[0],q=!0;if(N[1]&&!("y"in J))j.y=N[1],q=!0;if(N[2]&&!("z"in J))j.z=N[2],q=!0;break}case"translateX":{if(N[0]&&!("x"in J))j.x=N[0],q=!0;break}case"translateY":{if(N[0]&&!("y"in J))j.y=N[0],q=!0;break}case"translateZ":{if(N[0]&&!("z"in J))j.z=N[0],q=!0;break}case"rotate":{if(N[0]&&!("rotate"in J))j.rotate=N[0],q=!0;break}case"rotateX":{if(N[0]&&!("rotateX"in J))j.rotateX=N[0],q=!0;break}case"rotateY":{if(N[0]&&!("rotateY"in J))j.rotateY=N[0],q=!0;break}case"rotateZ":{if(N[0]&&!("rotateZ"in J))j.rotateZ=N[0],q=!0;break}case"scale":{if(N[0]&&!("scale"in J))j.scale=parseFloat(N[0]),q=!0;break}case"scaleX":{if(N[0]&&!("scaleX"in J))j.scaleX=parseFloat(N[0]),q=!0;break}case"scaleY":{if(N[0]&&!("scaleY"in J))j.scaleY=parseFloat(N[0]),q=!0;break}case"scaleZ":{if(N[0]&&!("scaleZ"in J))j.scaleZ=parseFloat(N[0]),q=!0;break}case"skew":{if(N[0]&&!("skewX"in J))j.skewX=N[0],q=!0;if(N[1]&&!("skewY"in J))j.skewY=N[1],q=!0;break}case"skewX":{if(N[0]&&!("skewX"in J))j.skewX=N[0],q=!0;break}case"skewY":{if(N[0]&&!("skewY"in J))j.skewY=N[0],q=!0;break}default:break}}if(!q)return J;let z={...j};for(let[G,Y]of Object.entries(J)){if(G==="transform")continue;z[G]=Y}return z}function l6(J){let $=!1;for(let Z of Object.keys(J))if(Z.includes("-")&&!Z.startsWith("--")){$=!0;break}if(!$)return J;let Q={};for(let[Z,j]of Object.entries(J))if(Z.includes("-")&&!Z.startsWith("--")){let q=Z.replace(/-([a-z])/g,(z,G)=>G.toUpperCase());Q[q]=j}else Q[Z]=j;return Q}class AJ{_fn;_timelineNames=new Set;_reverted=!1;constructor(J){this._fn=J,this._execute()}revert(){if(this._reverted)return;let J=C.getInstance();for(let $ of this._timelineNames)if(J.hasTimeline($))J.getTimeline($).kill();if(typeof document<"u")document.querySelectorAll("[data-scrolltrigger-spacer]").forEach(($)=>$.remove()),document.querySelectorAll("[data-scrolltrigger-markers]").forEach(($)=>$.remove());this._timelineNames.clear(),this._reverted=!0}refresh(){this.revert(),this._reverted=!1,this._execute()}add(J){this._reverted=!1,this._execute(J)}getTimelineNames(){return Array.from(this._timelineNames)}_execute(J){let $=C.getInstance();$.startCapture(this._timelineNames);try{(J||this._fn)()}finally{$.stopCapture()}}}function k9(J,$){if(typeof J==="string"){let Q=$||(typeof document<"u"?document:null);if(!Q)return[];try{return Array.from(Q.querySelectorAll(J))}catch{return[]}}if(typeof Element<"u"&&J instanceof Element)return[J];if(typeof NodeList<"u"&&J instanceof NodeList||typeof HTMLCollection<"u"&&J instanceof HTMLCollection)return Array.from(J);if(Array.isArray(J))return J;if(J&&typeof J==="object"&&"length"in J)return Array.from(J);return[]}function R9(J,$,Q){if(Q===void 0)return(Z)=>Math.min($,Math.max(J,Z));return Math.min($,Math.max(J,Q))}function b9(J,$,Q){let Z=J+Math.random()*($-J);if(Q&&Q>0)return Math.round(Z/Q)*Q;return Z}function E9(J,$){let Q=(Z)=>{if(typeof J==="number"){if(J<=0)return Z;return Math.round(Z/J)*J}let j=J,q=j[0],z=Math.abs(Z-q);for(let G=1;G<j.length;G++){let Y=Math.abs(Z-j[G]);if(Y<z)z=Y,q=j[G]}return q};if($===void 0)return Q;return Q($)}function V9(J,$,Q){return J+($-J)*Q}function w9(J,$,Q,Z,j){let q=(z)=>{let G=(z-J)/($-J);return Q+G*(Z-Q)};if(j===void 0)return q;return q(j)}function C9(J,$,Q){let Z=(j)=>(j-J)/($-J);if(Q===void 0)return Z;return Z(Q)}function x9(J,$,Q){let Z=$-J,j=(q)=>{return((q-J)%Z+Z)%Z+J};if(Q===void 0)return j;return j(Q)}var sJ={toArray:k9,clamp:R9,random:b9,snap:E9,interpolate:V9,mapRange:w9,normalize:C9,wrap:x9};function n(J,$,Q){let j=C.getInstance().getTimeline(J);if($!==void 0&&j.duration()>0)console.warn(`[Motion] Timeline "${J}" already has animations. New entries will be appended. Call Motion("${J}").kill() first to rebuild from scratch.`);if(Array.isArray($)&&$.length>0&&typeof $[0]==="object"&&$[0]!==null&&"target"in $[0])for(let q of $)j._addEntry(q.target,q,q.position);else if($!==void 0&&Q!==void 0)j._addEntry($,Q);return j}n.reset=function(J){C.getInstance();let $=a0(J),Q=[];for(let Z of $)if(Z instanceof Element)Q.push(Z);if(Q.length>0)C.getInstance().killAnimationsForTargets(Q);for(let Z of $){if(!(Z instanceof Element))continue;if(I.textSplitter?.isSplit?.(Z))I.textSplitter?.revert?.(Z);x(Z),I.styleReset?.clearAnimationStylesAndUnregister?.(Z),I.styleReset?.clearPinStylesAndUnregister?.(Z)}};n.set=function(J,$){C.getInstance();let Q=new v;Q._addEntry(J,{to:$,duration:0}),Q.kill(!1)};n.get=function(J){let $=C.getInstance();return $.hasTimeline(J)?$.getTimeline(J):void 0};n.has=function(J){return C.getInstance().hasTimeline(J)};n.getNames=function(){return C.getInstance().getTimelineNames()};n.kill=function(J){let $=C.getInstance();if($.hasTimeline(J))$.getTimeline(J).kill()};n.killAll=function(){C.getInstance().killEverything()};n.refreshScrollTriggers=function(){I.triggerManager?.getInstance?.()?.refreshScrollTriggers()};n.cleanup=function(){if(typeof document>"u")return;document.querySelectorAll("[data-scrolltrigger-spacer]").forEach((J)=>J.remove()),document.querySelectorAll("[data-scrolltrigger-markers]").forEach((J)=>J.remove())};n.context=function(J){return new AJ(J)};n.utils=sJ;var S9=n;var P9={};export{P9 as Types,v as Timeline,sJ as MotionUtils,AJ as MotionContext,S9 as Motion};
32
34
 
33
- //# debugId=B492E69DE71D531264756E2164756E21
35
+ //# debugId=7024CED6728611A264756E2164756E21
34
36
  //# sourceMappingURL=index.js.map