@motion.page/sdk 1.1.2 → 1.1.4
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/core/Timeline.d.ts +8 -2
- package/dist/index.cjs +11 -11
- package/dist/index.js +11 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
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 O={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}}}O.triggerManager={getInstance:D.getInstance};function eJ(J){if(typeof document>"u"){J();return}if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",J,{once:!0});else J()}function tJ(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 b0(J){return J instanceof Element||typeof J==="object"&&J!==null&&(("nodeType"in J)||("style"in J))}function $J(J){if(tJ(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(tJ(J[0]))return J;return J}if(J&&typeof J==="object"&&"length"in J)return Array.from(J);return[]}class c{_timeline;_config;_enabled=!1;constructor(J,$){this._timeline=J,this._config=$}enable(){if(this._enabled)return;this._enabled=!0,eJ(()=>{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,N=$.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 H=$.getBoundingClientRect();if($.style.transform=Q,$.style.transition=Z,j)$.style.position=q,$.style.top=z,$.style.left=G,$.style.width=N;return H}var p0=new Map;function J6(){return typeof window<"u"?window:null}function J7(J,$){let Q=typeof window<"u"?window.requestAnimationFrame:void 0;if(typeof Q!=="function"){$();return}if(J.rafId!==null)return;J.rafId=Q(()=>{J.rafId=null,$()})}function J0(J,$=J6()){if(!$)return;let Q=p0.get($);if(!Q)Q={callbacks:new Set,lastEvent:null,rafId:null,listener:(Z)=>{let j=p0.get($);if(!j||j.callbacks.size===0)return;j.lastEvent=Z,J7(j,()=>{let q=j.lastEvent;if(!q)return;let z=Array.from(j.callbacks);for(let G of z)try{G(q)}catch(N){console.error("[Motion] Uncaught error in pointer callback:",N)}})}},p0.set($,Q),$.addEventListener("mousemove",Q.listener,{passive:!0});Q.callbacks.add(J)}function H0(J,$=J6()){if(!$)return;let Q=p0.get($);if(!Q)return;if(Q.callbacks.delete(J),Q.callbacks.size===0){if(Q.rafId!==null&&typeof window<"u"&&typeof window.cancelAnimationFrame==="function")window.cancelAnimationFrame(Q.rafId);$.removeEventListener("mousemove",Q.listener),p0.delete($)}}class $6 extends c{_targets=[];_secondTargets=[];_listeners=new Map;_isForward=!0;_frozenRects=new Map;_snapshotScrollX=0;_snapshotScrollY=0;_wasHovering=!1;_hoverLeaveTimeout=null;_boundPointerMoveHandler=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._boundPointerMoveHandler)H0(this._boundPointerMoveHandler),this._boundPointerMoveHandler=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(){if(typeof window>"u")return;this._snapshotScrollX=window.scrollX||0,this._snapshotScrollY=window.scrollY||0;for(let J of this._targets)this._frozenRects.set(J,o(J))}_isInsideFrozenRects(J,$){if(typeof window>"u")return!1;let Q=(window.scrollX||0)-this._snapshotScrollX,Z=(window.scrollY||0)-this._snapshotScrollY,j=J+Q,q=$+Z;for(let z of this._frozenRects.values())if(j>=z.left&&j<=z.right&&q>=z.top&&q<=z.bottom)return!0;return!1}_isOverLiveTarget(J,$){if(typeof document>"u"||typeof document.elementsFromPoint!=="function")return null;let Q=document.elementsFromPoint(J,$);for(let Z of Q)for(let j of this._targets)if(Z===j||typeof j.contains==="function"&&j.contains(Z))return!0;return!1}_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._boundPointerMoveHandler=(Z)=>{let j;if(this._wasHovering)j=this._isInsideFrozenRects(Z.clientX,Z.clientY);else j=this._isOverLiveTarget(Z.clientX,Z.clientY)??this._isInsideFrozenRects(Z.clientX,Z.clientY);if(j&&!this._wasHovering){if(this._wasHovering=!0,this._snapshotRects(),this._hoverLeaveTimeout!==null)clearTimeout(this._hoverLeaveTimeout),this._hoverLeaveTimeout=null;if(J==="restart"){let q=this._timeline.progress();if(q>=1||q===0)this._timeline.restart()}else this._timeline.play()}else if(!j&&this._wasHovering){if(this._wasHovering=!1,$==="none")return;let q=()=>{this._handleLeaveAction($),this._hoverLeaveTimeout=null};if(Q>0)this._hoverLeaveTimeout=window.setTimeout(q,Q*1000);else q()}},J0(this._boundPointerMoveHandler)}_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",$6);var ZJ={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},wJ=["px","px","px","px","deg","deg","deg","deg","","","","","deg","deg"],w0=new WeakMap,QJ=new WeakMap,w=[];function $0(J){let $=J.trim().match(/([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z%]*)/i);if(!$)return{value:0,unit:""};return{value:parseFloat($[1]),unit:$[2]||""}}function V0(J,$){switch($){case"rad":return J*180/Math.PI;case"turn":return J*360;case"grad":return J*0.9;default:return J}}function _0(J){let $=$0(J);return V0($.value,$.unit||"deg")}function M(J,$,Q,Z){let j=ZJ[$];if(j===void 0)return;J.values[j]=Q;let q=Z&&Z.length>0?Z:wJ[j]||"";J.units[j]=q,J.used|=1<<j}function $7(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]?$0(q[0]):{value:0,unit:""},G=q[1]?$0(q[1]):{value:0,unit:""};M($,"x",z.value,z.unit),M($,"y",G.value,G.unit);break}case"translate3d":{let z=q[0]?$0(q[0]):{value:0,unit:""},G=q[1]?$0(q[1]):{value:0,unit:""},N=q[2]?$0(q[2]):{value:0,unit:""};M($,"x",z.value,z.unit),M($,"y",G.value,G.unit),M($,"z",N.value,N.unit);break}case"translateX":{let z=q[0]?$0(q[0]):{value:0,unit:""};M($,"x",z.value,z.unit);break}case"translateY":{let z=q[0]?$0(q[0]):{value:0,unit:""};M($,"y",z.value,z.unit);break}case"translateZ":{let z=q[0]?$0(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,N=q[2]?parseFloat(q[2]):1;M($,"scaleX",z),M($,"scaleY",G),M($,"scaleZ",N);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]?_0(q[0]):0,"deg");break;case"rotateX":M($,"rotateX",q[0]?_0(q[0]):0,"deg");break;case"rotateY":M($,"rotateY",q[0]?_0(q[0]):0,"deg");break;case"rotateZ":M($,"rotateZ",q[0]?_0(q[0]):0,"deg");break;case"skew":{let z=q[0]?_0(q[0]):0,G=q[1]?_0(q[1]):0;M($,"skewX",z,"deg"),M($,"skewY",G,"deg");break}case"skewX":M($,"skewX",q[0]?_0(q[0]):0,"deg");break;case"skewY":M($,"skewY",q[0]?_0(q[0]):0,"deg");break;case"perspective":{let z=q[0]?$0(q[0]):{value:0,unit:""};M($,"perspective",z.value,z.unit);break}default:break}}}function bJ(J,$,Q,Z,j,q,z,G,N,H,Y,X,_,K){if(_){let g=Math.hypot(J,$),N0=J*j-$*Z,c0=g!==0?N0/g:0,a=g!==0?Math.atan2($,J):0,e=g!==0?Math.atan2(J*Z+$*j,g*g):0;if(M(K,"x",H,"px"),M(K,"y",Y,"px"),M(K,"scaleX",g||1),M(K,"scaleY",c0||1),M(K,"rotate",V0(a,"rad"),"deg"),Math.abs(e)>0.000001)M(K,"skewX",V0(e,"rad"),"deg");return}let W=Math.hypot(J,$,Q)||1,U=Math.hypot(Z,j,q)||1,B=Math.hypot(z,G,N)||1,I=J/W,F=$/W,L=Q/W,A=Z/U,k=j/U,F0=q/U,A0=z/B,m0=G/B,L0=N/B,p=Math.sqrt(I*I+A*A),E0=p<0.000001,M0=0,z0=0,D0=0;if(!E0)M0=Math.atan2(m0,L0),z0=Math.atan2(-A0,p),D0=Math.atan2(A,I);else M0=Math.atan2(-F0,k),z0=Math.atan2(-A0,p),D0=0;M(K,"x",H,"px"),M(K,"y",Y,"px"),M(K,"z",X,"px"),M(K,"scaleX",W),M(K,"scaleY",U),M(K,"scaleZ",B),M(K,"rotateX",V0(M0,"rad"),"deg"),M(K,"rotateY",V0(z0,"rad"),"deg"),M(K,"rotateZ",V0(D0,"rad"),"deg")}function Q7(J,$){if(!J||J==="none")return;if(typeof DOMMatrixReadOnly<"u"){let Z=new DOMMatrixReadOnly(J);bJ(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);bJ(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);bJ(Z[0],Z[1],0,Z[2],Z[3],0,0,0,1,Z[4],Z[5],0,!0,$)}}function Z7(J,$){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let Z=J.style.transform;if(Z&&Z!=="none"){$7(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")Q7(q,$),$.cachedString=q}}catch{}}function CJ(J){let $=w0.get(J);if(!$){let Q=new Float32Array(14);Q[8]=1,Q[9]=1,Q[10]=1,Q[11]=1,$={values:Q,units:[...wJ],dirty:0,used:0,cachedString:"",pinDirty:!1},Z7(J,$),w0.set(J,$)}return $}function b(J,$,Q,Z){let j=CJ(J),q=ZJ[$];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 xJ(J,$){let Q=CJ(J),Z=ZJ[$];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 SJ(J,$){let Q=CJ(J),Z=ZJ[$];if(Z===void 0)return"";return Q.units[Z]||wJ[Z]||""}function VJ(J){return J===0?"0":`${Math.round(J)}px`}function Q6(J,$,Q){return`translate3d(${VJ(J)}, ${VJ($)}, ${VJ(Q)})`}function jJ(J,$,Q,Z){QJ.set(J,{x:$,y:Q,z:Z});let j=w0.get(J);if(j)j.pinDirty=!0}function C0(J){let $=QJ.has(J);if(QJ.delete(J),$){let Q=w0.get(J);if(Q)Q.pinDirty=!0}}function C(J){let $=w0.get(J),Q=QJ.get(J);if(!$){if(Q&&(Q.x!==0||Q.y!==0||Q.z!==0))return Q6(Q.x,Q.y,Q.z);return""}if($.dirty===0&&!$.pinDirty&&$.cachedString)return $.cachedString;let{values:Z,units:j}=$;w.length=0;let q=$.used,z=Z[0];if(z!==0){let A=j[0];w.push(`perspective(${z}${A})`)}let G=Z[1],N=Z[2],H=Z[3],Y=j[1],X=j[2],_=j[3],K=q&2,W=q&4,U=q&8;if(G!==0||N!==0||H!==0||K||W||U){let A=Y===X&&(H===0&&!U||X===_);if(H!==0||U)if(A)w.push(`translate3d(${G}${Y}, ${N}${X}, ${H}${_})`);else{if(G!==0||K)w.push(`translateX(${G}${Y})`);if(N!==0||W)w.push(`translateY(${N}${X})`);w.push(`translateZ(${H}${_})`)}else if(A&&(G!==0||K)&&(N!==0||W))w.push(`translate(${G}${Y}, ${N}${X})`);else{if(G!==0||K)w.push(`translateX(${G}${Y})`);if(N!==0||W)w.push(`translateY(${N}${X})`)}}if(Z[4]!==0||q&16)w.push(`rotate(${Z[4]}deg)`);if(Z[5]!==0||q&32)w.push(`rotateX(${Z[5]}deg)`);if(Z[6]!==0||q&64)w.push(`rotateY(${Z[6]}deg)`);if(Z[7]!==0||q&128)w.push(`rotateZ(${Z[7]}deg)`);let B=q&256,I=q&512,F=q&1024;if(Z[8]!==1||B)w.push(`scale(${Z[8]})`);else if(Z[9]!==1||Z[10]!==1||I||F)w.push(`scaleX(${Z[9]})`),w.push(`scaleY(${Z[10]})`);if(Z[11]!==1||q&2048)w.push(`scaleZ(${Z[11]})`);if(Z[12]!==0||q&4096)w.push(`skewX(${Z[12]}deg)`);if(Z[13]!==0||q&8192)w.push(`skewY(${Z[13]}deg)`);let L=w.join(" ");if(Q&&(Q.x!==0||Q.y!==0||Q.z!==0)){let A=Q6(Q.x,Q.y,Q.z);$.cachedString=L?`${A} ${L}`:A}else $.cachedString=L;return $.dirty=0,$.pinDirty=!1,$.cachedString}function S(J,$=!1){if(w0.delete(J),$&&J instanceof HTMLElement)J.style.transform=""}var PJ=new Set,qJ=new Map,GJ=!1;function Q0(J){PJ.add(J),GJ=!0}function x0(J,$,Q){let Z=qJ.get(J);if(!Z)Z=new Map,qJ.set(J,Z);Z.set($,Q),GJ=!0}function vJ(){if(!GJ)return;for(let J of PJ){let $=J;if($.style){let Q=C(J);$.style.transform=Q}}PJ.clear();for(let[J,$]of qJ){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{}}qJ.clear(),GJ=!1}var R0=!1;function k0(){return R0}function g0(J){if(R0){J();return}R0=!0;try{J(),vJ()}finally{R0=!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($),R0=!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{vJ()}catch(Z){console.error("[Motion] Uncaught error in render batch flush:",Z)}if(R0=!1,this._isRunning&&typeof requestAnimationFrame<"u")this.rafId=requestAnimationFrame(this.tick);else this.rafId=null};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 R0}getListenerCount(){return this.listeners.length}removeAll(){this.listeners=[],this.stop()}}var j0=null,S0=null,j7=100,Z0=new Map;function q7(J){let $=Z0.get(J);if($!==void 0)Z0.delete(J),Z0.set(J,$);return $}function G7(J,$){if(Z0.has(J))Z0.delete(J);while(Z0.size>=j7){let Q=Z0.keys().next().value;if(Q!==void 0)Z0.delete(Q);else break}Z0.set(J,$)}function z7(J){return/^\s*[Mm]/.test(J)}function Z6(){if(S0)return S0;if(typeof document>"u")throw Error("PathParser requires a browser environment");return j0=document.createElementNS("http://www.w3.org/2000/svg","svg"),j0.style.cssText="position:absolute;width:0;height:0;overflow:hidden;visibility:hidden;",j0.setAttribute("aria-hidden","true"),S0=document.createElementNS("http://www.w3.org/2000/svg","path"),j0.appendChild(S0),document.body.appendChild(j0),S0}function j6(J){if(J instanceof Element)return J.getAttribute("d");if(typeof J==="string"){if(z7(J))return J;if(typeof document<"u"){let $=document.querySelector(J);if($)return $.getAttribute("d")}}return null}function q6(J){let $=q7(J);if($!==void 0)return $;try{let Q=Z6();Q.setAttribute("d",J);let Z=Q.getTotalLength();return G7(J,Z),Z}catch{return 0}}function yJ(J,$,Q=!1){try{let Z=Z6();Z.setAttribute("d",J);let j=Z.getTotalLength(),q=Math.max(0,Math.min(1,$)),z=j*q,G=Z.getPointAtLength(z),N=0;if(Q)N=N7(Z,z,j);return{x:G.x,y:G.y,angle:N}}catch{return{x:0,y:0,angle:0}}}function N7(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),N=G.x-z.x,H=G.y-z.y;return Math.atan2(H,N)*(180/Math.PI)}function G6(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 z6(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=yJ($,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(),N=Z.getBoundingClientRect();if(z)Q.style.transform=q;let H=N.left+N.width/2-(G.left+G.width/2),Y=N.top+N.height/2-(G.top+G.height/2);return{x:H-j.x,y:Y-j.y}}return{x:-j.x,y:-j.y}}function N6(){if(j0&&j0.parentNode)j0.parentNode.removeChild(j0);j0=null,S0=null,Z0.clear()}var H7=new Set(["perspective","x","y","z","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skewX","skewY"]),Y7=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"]),X7=new Set(["rotate","rotateX","rotateY","rotateZ","skewX","skewY"]),K7=new Set(["opacity","scale","scaleX","scaleY","scaleZ","z-index","zIndex"]),_7=new Set(["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor","textDecorationColor","caretColor","fill","stroke"]),B7=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 H7.has(J)}function B0(J){return _7.has(J)}function t(J){return J==="filter"}function P0(J){return J==="drawSVG"}function TJ(J){return J==="path"}function hJ(J){return J==="clip-path"||J==="clipPath"}function q0(J){return J.startsWith("--")}function H6(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=O.color;if(Q)return Q.parseColor($)!==null;return B7.has($)}function P(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(K7.has(J))return"";if(X7.has(J))return"deg";if(Y7.has(J))return"px";return""}function K6(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 U7($)}if(y($))return xJ(J,$);try{if(typeof window<"u"&&window.getComputedStyle){let Z=window.getComputedStyle(J).getPropertyValue(s($));if(Z)return P(Z).value}}catch(Q){}return K6($)}function W7(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),N=parseFloat(G.getPropertyValue(q));if(z)j.style.setProperty(q,z);else j.style.removeProperty(q);if(N&&isFinite(N)&&N!==0)return Q/N*100}catch{}return Q}function zJ(J,$,Q){let Z=Y0(J,$);if(J instanceof Element&&Q&&Q!=="px")return W7(J,$,Z,Q);return Z}function _6(J,$){let Q=J,Z=s($);if(y($)){let j=Q.style.transform;S(J),Q.style.transform="";let q=xJ(J,$);return Q.style.transform=j,S(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=P(z);return{value:G.value,unit:G.unit}}}}catch(j){}return{value:K6($),unit:l($)}}function U7(J){if(J.startsWith("scale"))return 1;return 0}function s(J){return J.replace(/[A-Z]/g,($)=>`-${$.toLowerCase()}`)}function Y6(J){return typeof J==="string"&&J.trim().toLowerCase()==="auto"}var B6=new Set(["width","height"]);function O7(J,$){if(!B6.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 I7(J){if(typeof J==="string")return/^[+\-*/]=/.test(J);return!1}function F7(J){let $=J.match(/^([+\-*/])=/);return $?$[0]:null}function A7(J,$,Q){switch(Q){case"+=":return J+$;case"-=":return J-$;case"*=":return J*$;case"/=":return $!==0?J/$:J;default:return $}}function L7(J,$,Q,Z){let j=O.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 M7(J,$,Q,Z){let j=O.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 N=j.mergeFilterArrays(G,z);return{type:"filter",property:$,isTransform:!1,startFilters:N.start,endFilters:N.end}}function D7(J,$,Q,Z){if(H6(Q)||Z!==void 0&&H6(Z)){let N=O.color;if(N){let H=String(Q),Y=N.parseColor(H,J),X=Z!==void 0?N.parseColor(String(Z),J):R7(J,$);return{type:"color",property:$,isTransform:!1,startColor:X||new Float32Array([0,0,0,1]),endColor:Y||new Float32Array([0,0,0,1])}}}let q,z,G;if(Z!==void 0&&Q!==void 0){let N=P(Z),H=P(Q);q=N.value,z=H.value,G=H.unit||N.unit}else if(Z!==void 0){let N=P(Z);q=N.value,z=X6(J,$),G=N.unit}else{let N=P(Q);q=X6(J,$),z=N.value,G=N.unit}return{type:"scalar",property:$,isTransform:!1,startValue:q,endValue:z,unit:G}}function R7(J,$){let Q=O.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 X6(J,$){try{if(typeof window<"u"&&window.getComputedStyle){let Z=window.getComputedStyle(J).getPropertyValue($).trim();if(Z)return P(Z).value}}catch{}return 0}function k7(J,$,Q,Z){let j=O.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 E7(J,$,Q,Z){let j=O.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 b7(J,$,Q,Z){let j=Q,q=Z,z=j?.target?j:q;if(!z?.target)return null;let G=j6(z.target);if(!G)return null;let N=q6(G);if(N===0)return null;let H,Y;if(j?.target&&q?.target)H=q.start??0,Y=j.end??1;else if(j?.target)H=j.start??0,Y=j.end??1;else H=q.start??0,Y=q.end??1;let X=j?.rotate??q?.rotate??!1,_=j?.alignAt??q?.alignAt??[50,50],K=G6(J,_),W=j?.align??q?.align,U=z6(W,G,J);return{type:"path",property:$,isTransform:!1,pathData:G,pathLength:N,startProgress:H,endProgress:Y,rotate:X,alignOffset:K,pathOffset:U}}function fJ(J,$,Q,Z){let j=J instanceof Element;if(j&&q0($))return D7(J,$,Q,Z);if(j&&B0($)){let _=L7(J,$,Q,Z);if(_)return _}if(j&&t($)){let _=M7(J,$,Q,Z);if(_)return _}if(j&&P0($)){let _=k7(J,$,Q,Z);if(_)return _}if(j&&hJ($)){let _=E7(J,$,Q,Z);if(_)return _}if(j&&TJ($)){let _=b7(J,$,Q,Z);if(_)return _}let q=Y6(Q),z=Z!==void 0&&Y6(Z);if(j&&(q||z)&&B6.has($)){let _=O7(J,$);return fJ(J,$,q?_:Q,z?_:Z)}let G=y($),N=Z===void 0&&I7(Q),H,Y,X;if(Z!==void 0){let _=P(Z);if(Q!==void 0){let K=P(Q);H=_.value,Y=K.value,X=K.unit||_.unit||l($)}else H=_.value,X=_.unit||l($),Y=zJ(J,$,X)}else if(N){let _=F7(Q),K=Y0(J,$),W=P(Q);H=K,Y=A7(K,W.value,_),X=W.unit||l($)}else{let _=P(Q);X=_.unit||l($),H=zJ(J,$,X),Y=_.value}return{type:"scalar",property:$,isTransform:G,startValue:H,endValue:Y,unit:X}}function W6(){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 uJ=W6(),NJ=new WeakMap,dJ=W6();function U6(J){if(y(J))return["transform"];if(t(J))return["filter"];if(P0(J))return["strokeDasharray","strokeDashoffset"];return[J]}function V7(J,$){if(y($)&&!NJ.has(J)){if(J instanceof HTMLElement||J instanceof SVGElement){let Z=J.style.transform;NJ.set(J,Z||null)}}let Q=U6($);for(let Z of Q)uJ.register(J,Z)}function w7(J,$){for(let Q of $)V7(J,Q)}function C7(J){uJ.clearRegistry(J),NJ.delete(J)}function x7(J,$){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let Q=new Set;for(let Z of $)for(let j of U6(Z))Q.add(j);for(let Z of Q)if(q0(Z))J.style.removeProperty(Z);else J.style[Z]=""}function S7(J){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let $=uJ.get(J);if(!$||$.size===0)return;for(let Q of $){if(Q==="transform"){let Z=NJ.get(J);if(Z!==void 0){if(Z)J.style.transform=Z;else J.style.removeProperty("transform");continue}}if(q0(Q))J.style.removeProperty(Q);else J.style[Q]=""}}function P7(J){S7(J),C7(J)}function o0(J,$){dJ.registerMany(J,$)}function mJ(J){dJ.clearRegistry(J)}function v7(J){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let $=dJ.get(J);if(!$||$.size===0)return;for(let Q of $)J.style[Q]=""}function y7(J){v7(J),mJ(J)}O.styleReset={registerAnimatedProps:w7,clearAnimationStylesForProps:x7,clearAnimationStylesAndUnregister:P7,clearPinStylesAndUnregister:y7};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 N=G&&this._isBodyPin?document.documentElement.style.height:null;if(N!==null)document.documentElement.style.height=this._originalHtmlHeight;let H=J.getBoundingClientRect();if(N!==null)document.documentElement.style.height=N;let Y=G&&this._spacer?window.getComputedStyle(this._spacer):window.getComputedStyle(J);if(this._elementHeight=H.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=H.left,this._width=H.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(),_=window.getComputedStyle(J),K=_.display,W=_.flexDirection,U=G&&this._spacer?.parentElement?this._spacer.parentElement:J.parentElement,B=U?/^(inline-)?flex$/.test(getComputedStyle(U).display):!1,I=/^(inline-)?flex$/.test(K),F=`
|
|
2
|
-
display: ${
|
|
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 O={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}}}O.triggerManager={getInstance:D.getInstance};function eJ(J){if(typeof document>"u"){J();return}if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",J,{once:!0});else J()}function tJ(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 b0(J){return J instanceof Element||typeof J==="object"&&J!==null&&(("nodeType"in J)||("style"in J))}function $J(J){if(tJ(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(tJ(J[0]))return J;return J}if(J&&typeof J==="object"&&"length"in J)return Array.from(J);return[]}class c{_timeline;_config;_enabled=!1;constructor(J,$){this._timeline=J,this._config=$}enable(){if(this._enabled)return;this._enabled=!0,eJ(()=>{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,N=$.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 H=$.getBoundingClientRect();if($.style.transform=Q,$.style.transition=Z,j)$.style.position=q,$.style.top=z,$.style.left=G,$.style.width=N;return H}var p0=new Map;function J6(){return typeof window<"u"?window:null}function J7(J,$){let Q=typeof window<"u"?window.requestAnimationFrame:void 0;if(typeof Q!=="function"){$();return}if(J.rafId!==null)return;J.rafId=Q(()=>{J.rafId=null,$()})}function J0(J,$=J6()){if(!$)return;let Q=p0.get($);if(!Q)Q={callbacks:new Set,lastEvent:null,rafId:null,listener:(Z)=>{let j=p0.get($);if(!j||j.callbacks.size===0)return;j.lastEvent=Z,J7(j,()=>{let q=j.lastEvent;if(!q)return;let z=Array.from(j.callbacks);for(let G of z)try{G(q)}catch(N){console.error("[Motion] Uncaught error in pointer callback:",N)}})}},p0.set($,Q),$.addEventListener("mousemove",Q.listener,{passive:!0});Q.callbacks.add(J)}function H0(J,$=J6()){if(!$)return;let Q=p0.get($);if(!Q)return;if(Q.callbacks.delete(J),Q.callbacks.size===0){if(Q.rafId!==null&&typeof window<"u"&&typeof window.cancelAnimationFrame==="function")window.cancelAnimationFrame(Q.rafId);$.removeEventListener("mousemove",Q.listener),p0.delete($)}}class $6 extends c{_targets=[];_secondTargets=[];_listeners=new Map;_isForward=!0;_frozenRects=new Map;_snapshotScrollX=0;_snapshotScrollY=0;_wasHovering=!1;_hoverLeaveTimeout=null;_boundPointerMoveHandler=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._boundPointerMoveHandler)H0(this._boundPointerMoveHandler),this._boundPointerMoveHandler=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(){if(typeof window>"u")return;this._snapshotScrollX=window.scrollX||0,this._snapshotScrollY=window.scrollY||0;for(let J of this._targets)this._frozenRects.set(J,o(J))}_isInsideFrozenRects(J,$){if(typeof window>"u")return!1;let Q=(window.scrollX||0)-this._snapshotScrollX,Z=(window.scrollY||0)-this._snapshotScrollY,j=J+Q,q=$+Z;for(let z of this._frozenRects.values())if(j>=z.left&&j<=z.right&&q>=z.top&&q<=z.bottom)return!0;return!1}_isOverLiveTarget(J,$){if(typeof document>"u"||typeof document.elementsFromPoint!=="function")return null;let Q=document.elementsFromPoint(J,$);for(let Z of Q)for(let j of this._targets)if(Z===j||typeof j.contains==="function"&&j.contains(Z))return!0;return!1}_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._boundPointerMoveHandler=(Z)=>{let j;if(this._wasHovering)j=this._isInsideFrozenRects(Z.clientX,Z.clientY);else j=this._isOverLiveTarget(Z.clientX,Z.clientY)??this._isInsideFrozenRects(Z.clientX,Z.clientY);if(j&&!this._wasHovering){if(this._wasHovering=!0,this._snapshotRects(),this._hoverLeaveTimeout!==null)clearTimeout(this._hoverLeaveTimeout),this._hoverLeaveTimeout=null;if(J==="restart"){let q=this._timeline.progress();if(q>=1||q===0)this._timeline.restart()}else this._timeline.play()}else if(!j&&this._wasHovering){if(this._wasHovering=!1,$==="none")return;let q=()=>{this._handleLeaveAction($),this._hoverLeaveTimeout=null};if(Q>0)this._hoverLeaveTimeout=window.setTimeout(q,Q*1000);else q()}},J0(this._boundPointerMoveHandler)}_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",$6);var ZJ={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},wJ=["px","px","px","px","deg","deg","deg","deg","","","","","deg","deg"],w0=new WeakMap,QJ=new WeakMap,w=[];function $0(J){let $=J.trim().match(/([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z%]*)/i);if(!$)return{value:0,unit:""};return{value:parseFloat($[1]),unit:$[2]||""}}function V0(J,$){switch($){case"rad":return J*180/Math.PI;case"turn":return J*360;case"grad":return J*0.9;default:return J}}function K0(J){let $=$0(J);return V0($.value,$.unit||"deg")}function M(J,$,Q,Z){let j=ZJ[$];if(j===void 0)return;J.values[j]=Q;let q=Z&&Z.length>0?Z:wJ[j]||"";J.units[j]=q,J.used|=1<<j}function $7(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]?$0(q[0]):{value:0,unit:""},G=q[1]?$0(q[1]):{value:0,unit:""};M($,"x",z.value,z.unit),M($,"y",G.value,G.unit);break}case"translate3d":{let z=q[0]?$0(q[0]):{value:0,unit:""},G=q[1]?$0(q[1]):{value:0,unit:""},N=q[2]?$0(q[2]):{value:0,unit:""};M($,"x",z.value,z.unit),M($,"y",G.value,G.unit),M($,"z",N.value,N.unit);break}case"translateX":{let z=q[0]?$0(q[0]):{value:0,unit:""};M($,"x",z.value,z.unit);break}case"translateY":{let z=q[0]?$0(q[0]):{value:0,unit:""};M($,"y",z.value,z.unit);break}case"translateZ":{let z=q[0]?$0(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,N=q[2]?parseFloat(q[2]):1;M($,"scaleX",z),M($,"scaleY",G),M($,"scaleZ",N);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]?K0(q[0]):0,"deg");break;case"rotateX":M($,"rotateX",q[0]?K0(q[0]):0,"deg");break;case"rotateY":M($,"rotateY",q[0]?K0(q[0]):0,"deg");break;case"rotateZ":M($,"rotateZ",q[0]?K0(q[0]):0,"deg");break;case"skew":{let z=q[0]?K0(q[0]):0,G=q[1]?K0(q[1]):0;M($,"skewX",z,"deg"),M($,"skewY",G,"deg");break}case"skewX":M($,"skewX",q[0]?K0(q[0]):0,"deg");break;case"skewY":M($,"skewY",q[0]?K0(q[0]):0,"deg");break;case"perspective":{let z=q[0]?$0(q[0]):{value:0,unit:""};M($,"perspective",z.value,z.unit);break}default:break}}}function bJ(J,$,Q,Z,j,q,z,G,N,H,X,Y,K,_){if(K){let g=Math.hypot(J,$),N0=J*j-$*Z,c0=g!==0?N0/g:0,a=g!==0?Math.atan2($,J):0,e=g!==0?Math.atan2(J*Z+$*j,g*g):0;if(M(_,"x",H,"px"),M(_,"y",X,"px"),M(_,"scaleX",g||1),M(_,"scaleY",c0||1),M(_,"rotate",V0(a,"rad"),"deg"),Math.abs(e)>0.000001)M(_,"skewX",V0(e,"rad"),"deg");return}let W=Math.hypot(J,$,Q)||1,U=Math.hypot(Z,j,q)||1,B=Math.hypot(z,G,N)||1,I=J/W,F=$/W,A=Q/W,L=Z/U,k=j/U,F0=q/U,L0=z/B,m0=G/B,A0=N/B,p=Math.sqrt(I*I+L*L),E0=p<0.000001,M0=0,z0=0,D0=0;if(!E0)M0=Math.atan2(m0,A0),z0=Math.atan2(-L0,p),D0=Math.atan2(L,I);else M0=Math.atan2(-F0,k),z0=Math.atan2(-L0,p),D0=0;M(_,"x",H,"px"),M(_,"y",X,"px"),M(_,"z",Y,"px"),M(_,"scaleX",W),M(_,"scaleY",U),M(_,"scaleZ",B),M(_,"rotateX",V0(M0,"rad"),"deg"),M(_,"rotateY",V0(z0,"rad"),"deg"),M(_,"rotateZ",V0(D0,"rad"),"deg")}function Q7(J,$){if(!J||J==="none")return;if(typeof DOMMatrixReadOnly<"u"){let Z=new DOMMatrixReadOnly(J);bJ(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);bJ(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);bJ(Z[0],Z[1],0,Z[2],Z[3],0,0,0,1,Z[4],Z[5],0,!0,$)}}function Z7(J,$){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let Z=J.style.transform;if(Z&&Z!=="none"){$7(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")Q7(q,$),$.cachedString=q}}catch{}}function CJ(J){let $=w0.get(J);if(!$){let Q=new Float32Array(14);Q[8]=1,Q[9]=1,Q[10]=1,Q[11]=1,$={values:Q,units:[...wJ],dirty:0,used:0,cachedString:"",pinDirty:!1},Z7(J,$),w0.set(J,$)}return $}function b(J,$,Q,Z){let j=CJ(J),q=ZJ[$];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 xJ(J,$){let Q=CJ(J),Z=ZJ[$];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 SJ(J,$){let Q=CJ(J),Z=ZJ[$];if(Z===void 0)return"";return Q.units[Z]||wJ[Z]||""}function VJ(J){return J===0?"0":`${Math.round(J)}px`}function Q6(J,$,Q){return`translate3d(${VJ(J)}, ${VJ($)}, ${VJ(Q)})`}function jJ(J,$,Q,Z){QJ.set(J,{x:$,y:Q,z:Z});let j=w0.get(J);if(j)j.pinDirty=!0}function C0(J){let $=QJ.has(J);if(QJ.delete(J),$){let Q=w0.get(J);if(Q)Q.pinDirty=!0}}function C(J){let $=w0.get(J),Q=QJ.get(J);if(!$){if(Q&&(Q.x!==0||Q.y!==0||Q.z!==0))return Q6(Q.x,Q.y,Q.z);return""}if($.dirty===0&&!$.pinDirty&&$.cachedString)return $.cachedString;let{values:Z,units:j}=$;w.length=0;let q=$.used,z=Z[0];if(z!==0){let L=j[0];w.push(`perspective(${z}${L})`)}let G=Z[1],N=Z[2],H=Z[3],X=j[1],Y=j[2],K=j[3],_=q&2,W=q&4,U=q&8;if(G!==0||N!==0||H!==0||_||W||U){let L=X===Y&&(H===0&&!U||Y===K);if(H!==0||U)if(L)w.push(`translate3d(${G}${X}, ${N}${Y}, ${H}${K})`);else{if(G!==0||_)w.push(`translateX(${G}${X})`);if(N!==0||W)w.push(`translateY(${N}${Y})`);w.push(`translateZ(${H}${K})`)}else if(L&&(G!==0||_)&&(N!==0||W))w.push(`translate(${G}${X}, ${N}${Y})`);else{if(G!==0||_)w.push(`translateX(${G}${X})`);if(N!==0||W)w.push(`translateY(${N}${Y})`)}}if(Z[4]!==0||q&16)w.push(`rotate(${Z[4]}deg)`);if(Z[5]!==0||q&32)w.push(`rotateX(${Z[5]}deg)`);if(Z[6]!==0||q&64)w.push(`rotateY(${Z[6]}deg)`);if(Z[7]!==0||q&128)w.push(`rotateZ(${Z[7]}deg)`);let B=q&256,I=q&512,F=q&1024;if(Z[8]!==1||B)w.push(`scale(${Z[8]})`);else if(Z[9]!==1||Z[10]!==1||I||F)w.push(`scaleX(${Z[9]})`),w.push(`scaleY(${Z[10]})`);if(Z[11]!==1||q&2048)w.push(`scaleZ(${Z[11]})`);if(Z[12]!==0||q&4096)w.push(`skewX(${Z[12]}deg)`);if(Z[13]!==0||q&8192)w.push(`skewY(${Z[13]}deg)`);let A=w.join(" ");if(Q&&(Q.x!==0||Q.y!==0||Q.z!==0)){let L=Q6(Q.x,Q.y,Q.z);$.cachedString=A?`${L} ${A}`:L}else $.cachedString=A;return $.dirty=0,$.pinDirty=!1,$.cachedString}function S(J,$=!1){if(w0.delete(J),$&&J instanceof HTMLElement)J.style.transform=""}var PJ=new Set,qJ=new Map,GJ=!1;function Q0(J){PJ.add(J),GJ=!0}function x0(J,$,Q){let Z=qJ.get(J);if(!Z)Z=new Map,qJ.set(J,Z);Z.set($,Q),GJ=!0}function vJ(){if(!GJ)return;for(let J of PJ){let $=J;if($.style){let Q=C(J);$.style.transform=Q}}PJ.clear();for(let[J,$]of qJ){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{}}qJ.clear(),GJ=!1}var R0=!1;function k0(){return R0}function g0(J){if(R0){J();return}R0=!0;try{J(),vJ()}finally{R0=!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($),R0=!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{vJ()}catch(Z){console.error("[Motion] Uncaught error in render batch flush:",Z)}if(R0=!1,this._isRunning&&typeof requestAnimationFrame<"u")this.rafId=requestAnimationFrame(this.tick);else this.rafId=null};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 R0}getListenerCount(){return this.listeners.length}removeAll(){this.listeners=[],this.stop()}}var j0=null,S0=null,j7=100,Z0=new Map;function q7(J){let $=Z0.get(J);if($!==void 0)Z0.delete(J),Z0.set(J,$);return $}function G7(J,$){if(Z0.has(J))Z0.delete(J);while(Z0.size>=j7){let Q=Z0.keys().next().value;if(Q!==void 0)Z0.delete(Q);else break}Z0.set(J,$)}function z7(J){return/^\s*[Mm]/.test(J)}function Z6(){if(S0)return S0;if(typeof document>"u")throw Error("PathParser requires a browser environment");return j0=document.createElementNS("http://www.w3.org/2000/svg","svg"),j0.style.cssText="position:absolute;width:0;height:0;overflow:hidden;visibility:hidden;",j0.setAttribute("aria-hidden","true"),S0=document.createElementNS("http://www.w3.org/2000/svg","path"),j0.appendChild(S0),document.body.appendChild(j0),S0}function j6(J){if(J instanceof Element)return J.getAttribute("d");if(typeof J==="string"){if(z7(J))return J;if(typeof document<"u"){let $=document.querySelector(J);if($)return $.getAttribute("d")}}return null}function q6(J){let $=q7(J);if($!==void 0)return $;try{let Q=Z6();Q.setAttribute("d",J);let Z=Q.getTotalLength();return G7(J,Z),Z}catch{return 0}}function yJ(J,$,Q=!1){try{let Z=Z6();Z.setAttribute("d",J);let j=Z.getTotalLength(),q=Math.max(0,Math.min(1,$)),z=j*q,G=Z.getPointAtLength(z),N=0;if(Q)N=N7(Z,z,j);return{x:G.x,y:G.y,angle:N}}catch{return{x:0,y:0,angle:0}}}function N7(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),N=G.x-z.x,H=G.y-z.y;return Math.atan2(H,N)*(180/Math.PI)}function G6(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 z6(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=yJ($,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(),N=Z.getBoundingClientRect();if(z)Q.style.transform=q;let H=N.left+N.width/2-(G.left+G.width/2),X=N.top+N.height/2-(G.top+G.height/2);return{x:H-j.x,y:X-j.y}}return{x:-j.x,y:-j.y}}function N6(){if(j0&&j0.parentNode)j0.parentNode.removeChild(j0);j0=null,S0=null,Z0.clear()}var H7=new Set(["perspective","x","y","z","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skewX","skewY"]),Y7=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"]),X7=new Set(["rotate","rotateX","rotateY","rotateZ","skewX","skewY"]),_7=new Set(["opacity","scale","scaleX","scaleY","scaleZ","z-index","zIndex"]),K7=new Set(["color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor","textDecorationColor","caretColor","fill","stroke"]),B7=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 H7.has(J)}function B0(J){return K7.has(J)}function t(J){return J==="filter"}function P0(J){return J==="drawSVG"}function TJ(J){return J==="path"}function hJ(J){return J==="clip-path"||J==="clipPath"}function q0(J){return J.startsWith("--")}function H6(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=O.color;if(Q)return Q.parseColor($)!==null;return B7.has($)}function P(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(_7.has(J))return"";if(X7.has(J))return"deg";if(Y7.has(J))return"px";return""}function _6(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 U7($)}if(y($))return xJ(J,$);try{if(typeof window<"u"&&window.getComputedStyle){let Z=window.getComputedStyle(J).getPropertyValue(s($));if(Z)return P(Z).value}}catch(Q){}return _6($)}function W7(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),N=parseFloat(G.getPropertyValue(q));if(z)j.style.setProperty(q,z);else j.style.removeProperty(q);if(N&&isFinite(N)&&N!==0)return Q/N*100}catch{}return Q}function zJ(J,$,Q){let Z=Y0(J,$);if(J instanceof Element&&Q&&Q!=="px")return W7(J,$,Z,Q);return Z}function K6(J,$){let Q=J,Z=s($);if(y($)){let j=Q.style.transform;S(J),Q.style.transform="";let q=xJ(J,$);return Q.style.transform=j,S(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=P(z);return{value:G.value,unit:G.unit}}}}catch(j){}return{value:_6($),unit:l($)}}function U7(J){if(J.startsWith("scale"))return 1;return 0}function s(J){return J.replace(/[A-Z]/g,($)=>`-${$.toLowerCase()}`)}function Y6(J){return typeof J==="string"&&J.trim().toLowerCase()==="auto"}var B6=new Set(["width","height"]);function O7(J,$){if(!B6.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 I7(J){if(typeof J==="string")return/^[+\-*/]=/.test(J);return!1}function F7(J){let $=J.match(/^([+\-*/])=/);return $?$[0]:null}function L7(J,$,Q){switch(Q){case"+=":return J+$;case"-=":return J-$;case"*=":return J*$;case"/=":return $!==0?J/$:J;default:return $}}function A7(J,$,Q,Z){let j=O.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 M7(J,$,Q,Z){let j=O.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 N=j.mergeFilterArrays(G,z);return{type:"filter",property:$,isTransform:!1,startFilters:N.start,endFilters:N.end}}function D7(J,$,Q,Z){if(H6(Q)||Z!==void 0&&H6(Z)){let N=O.color;if(N){let H=String(Q),X=N.parseColor(H,J),Y=Z!==void 0?N.parseColor(String(Z),J):R7(J,$);return{type:"color",property:$,isTransform:!1,startColor:Y||new Float32Array([0,0,0,1]),endColor:X||new Float32Array([0,0,0,1])}}}let q,z,G;if(Z!==void 0&&Q!==void 0){let N=P(Z),H=P(Q);q=N.value,z=H.value,G=H.unit||N.unit}else if(Z!==void 0){let N=P(Z);q=N.value,z=X6(J,$),G=N.unit}else{let N=P(Q);q=X6(J,$),z=N.value,G=N.unit}return{type:"scalar",property:$,isTransform:!1,startValue:q,endValue:z,unit:G}}function R7(J,$){let Q=O.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 X6(J,$){try{if(typeof window<"u"&&window.getComputedStyle){let Z=window.getComputedStyle(J).getPropertyValue($).trim();if(Z)return P(Z).value}}catch{}return 0}function k7(J,$,Q,Z){let j=O.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 E7(J,$,Q,Z){let j=O.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 b7(J,$,Q,Z){let j=Q,q=Z,z=j?.target?j:q;if(!z?.target)return null;let G=j6(z.target);if(!G)return null;let N=q6(G);if(N===0)return null;let H,X;if(j?.target&&q?.target)H=q.start??0,X=j.end??1;else if(j?.target)H=j.start??0,X=j.end??1;else H=q.start??0,X=q.end??1;let Y=j?.rotate??q?.rotate??!1,K=j?.alignAt??q?.alignAt??[50,50],_=G6(J,K),W=j?.align??q?.align,U=z6(W,G,J);return{type:"path",property:$,isTransform:!1,pathData:G,pathLength:N,startProgress:H,endProgress:X,rotate:Y,alignOffset:_,pathOffset:U}}function fJ(J,$,Q,Z){let j=J instanceof Element;if(j&&q0($))return D7(J,$,Q,Z);if(j&&B0($)){let K=A7(J,$,Q,Z);if(K)return K}if(j&&t($)){let K=M7(J,$,Q,Z);if(K)return K}if(j&&P0($)){let K=k7(J,$,Q,Z);if(K)return K}if(j&&hJ($)){let K=E7(J,$,Q,Z);if(K)return K}if(j&&TJ($)){let K=b7(J,$,Q,Z);if(K)return K}let q=Y6(Q),z=Z!==void 0&&Y6(Z);if(j&&(q||z)&&B6.has($)){let K=O7(J,$);return fJ(J,$,q?K:Q,z?K:Z)}let G=y($),N=Z===void 0&&I7(Q),H,X,Y;if(Z!==void 0){let K=P(Z);if(Q!==void 0){let _=P(Q);H=K.value,X=_.value,Y=_.unit||K.unit||l($)}else H=K.value,Y=K.unit||l($),X=zJ(J,$,Y)}else if(N){let K=F7(Q),_=Y0(J,$),W=P(Q);H=_,X=L7(_,W.value,K),Y=W.unit||l($)}else{let K=P(Q);Y=K.unit||l($),H=zJ(J,$,Y),X=K.value}return{type:"scalar",property:$,isTransform:G,startValue:H,endValue:X,unit:Y}}function W6(){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 uJ=W6(),NJ=new WeakMap,dJ=W6();function U6(J){if(y(J))return["transform"];if(t(J))return["filter"];if(P0(J))return["strokeDasharray","strokeDashoffset"];return[J]}function V7(J,$){if(y($)&&!NJ.has(J)){if(J instanceof HTMLElement||J instanceof SVGElement){let Z=J.style.transform;NJ.set(J,Z||null)}}let Q=U6($);for(let Z of Q)uJ.register(J,Z)}function w7(J,$){for(let Q of $)V7(J,Q)}function C7(J){uJ.clearRegistry(J),NJ.delete(J)}function x7(J,$){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let Q=new Set;for(let Z of $)for(let j of U6(Z))Q.add(j);for(let Z of Q)if(q0(Z))J.style.removeProperty(Z);else J.style[Z]=""}function S7(J){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let $=uJ.get(J);if(!$||$.size===0)return;for(let Q of $){if(Q==="transform"){let Z=NJ.get(J);if(Z!==void 0){if(Z)J.style.transform=Z;else J.style.removeProperty("transform");continue}}if(q0(Q))J.style.removeProperty(Q);else J.style[Q]=""}}function P7(J){S7(J),C7(J)}function o0(J,$){dJ.registerMany(J,$)}function mJ(J){dJ.clearRegistry(J)}function v7(J){if(!(J instanceof HTMLElement)&&!(J instanceof SVGElement))return;let $=dJ.get(J);if(!$||$.size===0)return;for(let Q of $)J.style[Q]=""}function y7(J){v7(J),mJ(J)}O.styleReset={registerAnimatedProps:w7,clearAnimationStylesForProps:x7,clearAnimationStylesAndUnregister:P7,clearPinStylesAndUnregister:y7};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 N=G&&this._isBodyPin?document.documentElement.style.height:null;if(N!==null)document.documentElement.style.height=this._originalHtmlHeight;let H=J.getBoundingClientRect();if(N!==null)document.documentElement.style.height=N;let X=G&&this._spacer?window.getComputedStyle(this._spacer):window.getComputedStyle(J);if(this._elementHeight=H.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=H.left,this._width=H.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 Y=this._resolvePinSpacing(),K=window.getComputedStyle(J),_=K.display,W=K.flexDirection,U=G&&this._spacer?.parentElement?this._spacer.parentElement:J.parentElement,B=U?/^(inline-)?flex$/.test(getComputedStyle(U).display):!1,I=/^(inline-)?flex$/.test(_),F=`
|
|
2
|
+
display: ${_};
|
|
3
3
|
${I?`flex-direction: ${W};`:""}
|
|
4
4
|
box-sizing: content-box;
|
|
5
5
|
width: ${H.width}px;
|
|
6
6
|
height: ${H.height}px;
|
|
7
|
-
margin-top: ${
|
|
8
|
-
margin-left: ${
|
|
9
|
-
margin-right: ${
|
|
7
|
+
margin-top: ${X.marginTop};
|
|
8
|
+
margin-left: ${X.marginLeft};
|
|
9
|
+
margin-right: ${X.marginRight};
|
|
10
10
|
overflow: visible;
|
|
11
11
|
${B?"flex-shrink: 0;":""}
|
|
12
|
-
`;if(
|
|
12
|
+
`;if(Y==="padding")F+=`padding-bottom: ${this._pinDistance}px;`,F+=`margin-bottom: ${X.marginBottom};`;else if(Y==="margin"){let L=parseFloat(X.marginBottom)||0,k=G?L-z:L;F+=`margin-bottom: ${k+this._pinDistance}px;`}else F+=`margin-bottom: ${X.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;C0(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="",mJ(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||"",C0($),$.style.transform=C($),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",C0($),$.style.transform=C($),this._isBodyPin)o0($,["position","top","left","width","zIndex","transform","marginTop"]);else o0($,["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)C0($),$.style.transform=C($),$.style.marginTop=`${this._pinDistance}px`;else $.style.marginTop="0",$.style.marginLeft="0",jJ($,0,this._pinDistance,0),$.style.transform=C($);$.style.zIndex=this._originalStyles?.zIndex||"",this._restoreFixedBreakingAncestors()}}_updateTransform(J,$){let Q=this._element;if(J==="before")Q.style.zIndex=this._originalStyles?.zIndex||"",C0(Q),Q.style.transform=C(Q);else if(J==="pinned"){let Z=Math.round($-this._pinStart);Q.style.zIndex="100",jJ(Q,0,Z,0),Q.style.transform=C(Q),o0(Q,["transform","zIndex"])}else Q.style.zIndex=this._originalStyles?.zIndex||"",jJ(Q,0,this._pinDistance,0),Q.style.transform=C(Q),o0(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],N=q[2]==="-"?-1:1,H=parseFloat(q[3]),X=q[4]||"px",Y=0;switch(G){case"top":Y=0;break;case"center":Y=$/2;break;case"bottom":Y=$;break}let K=O6(H,X,$,Q,Z);return Y+N*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]),N=z[2]||"px";return O6(G,N,$,Q,Z)}return 0}function O6(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 cJ{_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(" "),N=d(G[1]||"top",z,z),H=this._endConfig.startsWith("+=")?N: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 X=(U,B,I)=>{let F=document.createElement("div");F.setAttribute("data-marker",U),F.style.cssText=`
|
|
13
13
|
position: absolute;
|
|
14
14
|
${I}: 0;
|
|
15
15
|
height: 1px;
|
|
16
16
|
width: 50px;
|
|
17
17
|
background: ${B};
|
|
18
18
|
pointer-events: none;
|
|
19
|
-
`;let
|
|
19
|
+
`;let A=document.createElement("span");return A.textContent=U,A.style.cssText=`
|
|
20
20
|
position: absolute;
|
|
21
21
|
${I}: 0;
|
|
22
22
|
top: 2px;
|
|
@@ -28,8 +28,8 @@ function u(J,$){switch(J){case"play":case"resume":$.play();break;case"pause":$.p
|
|
|
28
28
|
white-space: nowrap;
|
|
29
29
|
border-radius: 2px;
|
|
30
30
|
line-height: 1.2;
|
|
31
|
-
`,F.appendChild(L),F},X=Y("scroller-start",Q,"right"),_=Y("scroller-end",Z,"right"),K=Y("start",Q,"left"),W=Y("end",Z,"left");if(!this._triggerElement)K.style.display="none",W.style.display="none";if(this._markerContainer.appendChild(X),this._markerContainer.appendChild(_),this._markerContainer.appendChild(K),this._markerContainer.appendChild(W),this._markers={scrollerStart:X,scrollerEnd:_,elementStart:K,elementEnd:W},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=N,this._scrollerEndOffset=H,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}}var l0=new Map;function T7(J){if(typeof window<"u"&&J===window)return window.scrollY||window.pageYOffset||0;if(typeof Element<"u"&&J instanceof Element)return J.scrollTop;return 0}function I6(J,$){let Q=l0.get(J);if(!Q){let Z=()=>{let j=l0.get(J);if(!j||j.callbacks.size===0)return;let q=T7(J);g0(()=>{for(let z of j.callbacks)z(q)})};Q={callbacks:new Set,listener:Z},l0.set(J,Q),J.addEventListener("scroll",Z,{passive:!0})}Q.callbacks.add($)}function F6(J,$){let Q=l0.get(J);if(!Q)return;if(Q.callbacks.delete($),Q.callbacks.size===0)J.removeEventListener("scroll",Q.listener),l0.delete(J)}class G0 extends c{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=G0._nextId++,this._scrubLag=typeof $.scrub==="number"?$.scrub:0}static _ensureLoadListener(){if(G0._loadListenerAdded||typeof window>"u")return;if(G0._loadListenerAdded=!0,document.readyState==="complete")return;window.addEventListener("load",()=>{setTimeout(()=>{for(let J of G0._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 K=this._scroller.getBoundingClientRect();q=j.top-K.top+Z}else q=j.top+Z;let G=this._defaultStart().split(" "),N=G[0]||"top",H=G[1]||"top",Y=d(N,j.height,Q),X=d(H,Q,Q);this._triggerStart=q+Y-X;let _=this._defaultEnd();if(_.startsWith("+=")){let K=d(_.slice(2),Q,Q);this._triggerEnd=this._triggerStart+K}else{let K=_.split(" "),W=K[0]||"bottom",U=K[1]||"top",B=d(W,j.height,Q),I=d(U,Q,Q);this._triggerEnd=q+B-I}if(this._triggerEnd<=this._triggerStart)this._triggerEnd=this._triggerStart+Math.max(Q,100)}_onEnable(){this._resolveScroller();let J=this._resolvePinElement();this._calculateTriggerPositions(J),G0._activeInstances.add(this),G0._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),N=d(j[1]||"top",q,q)-z;this._pinManager=h.getOrCreate(this._id,J),this._pinManager.setup(J,this._triggerStart,this._triggerEnd,N,this._scroller===window,this._config.pinSpacing)}if(this._config.markers&&typeof document<"u"){let Z=this._pinManager?.getElement()||this._resolveTriggerElement();this._markerManager=new cJ(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=(Z)=>this._onScroll(Z),this._scroller){if(I6(this._scroller,this._scrollListener),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)F6(this._scroller,this._scrollListener),this._scrollListener=void 0;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(),G0._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),N=d(Z[1]||"top",j,j)-z;this._pinManager.setup(J,this._triggerStart,this._triggerEnd,N,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(J=this._getScrollTop()){if(!this._enabled)return;let $=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,g0(()=>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;g0(()=>{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,G0._SCRUB_TICKER_PRIORITY)}_stopSmoothScrollLoop(){if(this._scrubTickListener)T.getInstance().remove(this._scrubTickListener),this._scrubTickListener=null}}D.registerTrigger("scroll",G0);class A6{_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(A6);class L6 extends c{_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;_pointerMoveHandler=null;_activeTarget=null;_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;if(this._frozenRects.clear(),this._activeTarget=null,this._pointerMoveHandler)H0(this._pointerMoveHandler),this._pointerMoveHandler=null;this._cleanupListenerMap(this._listeners)}_addViewportListeners(){if(typeof window>"u")return;this._pointerMoveHandler=(J)=>{this._handleViewportMouseMove(J.clientX,J.clientY)},J0(this._pointerMoveHandler),this._state.isInside=!0}refresh(){for(let J of this._targets)this._frozenRects.set(J,o(J))}_addTargetListeners(){for(let J of this._targets)this._frozenRects.set(J,o(J));if(typeof window<"u"&&typeof window.requestAnimationFrame==="function"){this._pointerMoveHandler=(J)=>{this._handleTargetPointerMove(J.clientX,J.clientY)},J0(this._pointerMoveHandler);return}this._targets.forEach((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,$)})}_handleTargetPointerMove(J,$){let Q=this._findTargetAtPoint(J,$);if(!Q){if(this._state.isInside)this._state.isInside=!1,this._activeTarget=null,this._handleMouseLeave();return}this._state.isInside=!0,this._activeTarget=Q,this._handleTargetMouseMove(Q,J,$)}_findTargetAtPoint(J,$){for(let Q of this._targets){let Z=this._frozenRects.get(Q);if(!Z)continue;if(J>=Z.left&&J<=Z.right&&$>=Z.top&&$<=Z.bottom)return Q}return null}_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,N=Math.sqrt(z*z+G*G),H=Math.sqrt(j*j+q*q);this._targetState.targetDistance=1-Math.min(N/H,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,N=Math.sqrt(z*z+G*G),H=Math.sqrt(Math.pow(Z.width/2,2)+Math.pow(Z.height/2,2));this._targetState.targetDistance=1-Math.min(N/H,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,N=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||!N)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",L6);class s0 extends c{_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,!s0._sequenceStates.has(this._siblings))s0._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)H0(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._fireEventImmediate("Hover");else if(!Z&&this._gestureHoverActive)this._gestureHoverActive=!1,this._fireEventImmediate("HoverEnd")},J0(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()}_fireEventImmediate(J){let $=this._config.events[J];if($)this._executeAction($,J)}_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 $=s0._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",s0);var HJ=null,YJ=null;function M6(J,$,Q,Z){let j=J;if(!j.style)return;let q=k0();if(y($))if(b(J,$,Q,Z),q)Q0(J);else j.style.transform=C(J);else{let z=Z?`${Q}${Z}`:`${Q}`;if(q)x0(J,$,z);else try{if(q0($))j.style.setProperty($,z);else if($ in j.style)j.style[$]=z;else j.style.setProperty(s($),z)}catch{}}}function D6(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(k0())x0(J,$,G);else try{if(q0($))z.style.setProperty($,G);else if($ in z.style)z.style[$]=G;else z.style.setProperty(s($),G)}catch{}}function R6(J,$,Q,Z){let j=J;if(!j.style)return;if(HJ||(HJ=O.filter)){let q=HJ.interpolateFilters($,Q,Z),z=HJ.filterToString(q);if(k0())x0(J,"filter",z);else j.style.filter=z}}function k6(J,$,Q,Z,j){let q=J;if(!q.style)return;if(YJ||(YJ=O.clipPath)){let z=YJ.interpolateClipPaths(Q,Z,j),G=YJ.clipPathToString(z);if(k0())x0(J,"clip-path",G),x0(J,"-webkit-clip-path",G);else q.style.setProperty("clip-path",G),q.style.setProperty("-webkit-clip-path",G)}}function E6(J,$,Q){let{pathLUT:Z,alignOffset:j,pathOffset:q,pathRotate:z}=Q;if(!Z||Z.length===0)return;let G=$*(Z.length-1),N=Math.floor(G),H=Math.min(N+1,Z.length-1),Y=G-N,X=Z[N],_=Z[H],K=X.x+(_.x-X.x)*Y,W=X.y+(_.y-X.y)*Y,U=(q?.x??0)+K-(j?.x??0),B=(q?.y??0)+W-(j?.y??0);if(b(J,"x",U,"px"),b(J,"y",B,"px"),z){let I=h7(X.angle,_.angle,Y);b(J,"rotate",I,"deg")}if(k0())Q0(J);else J.style.transform=C(J)}function h7(J,$,Q){let Z=$-J;if(Z>180)Z-=360;if(Z<-180)Z+=360;return J+Z*Q}var pJ=null,f7=100,u7=500,d7=0.5,i0=[],m7=50;function c7(J){for(let $=0;$<i0.length;$++)if(i0[$].length>=J){let Q=i0.splice($,1)[0];return Q.length=J,Q}return Array(J)}function p7(J){if(i0.length<m7)i0.push(J)}class gJ{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,N){if(J instanceof Element)S(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=N,this._isElement=J instanceof Element;let H=Math.abs(q-j),Y=Z*H,X=Math.min(u7,Math.max(f7,Math.ceil(Y*d7)));this.pathLUT=c7(X+1);for(let _=0;_<=X;_++){let K=_/X,W=j+(q-j)*K;this.pathLUT[_]=yJ(Q,W,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)D6(this.target,this.property,$,Q,Z,j)}else if(this.valueType==="filter"&&this.startFilters&&this.endFilters){if(this._isElement)R6(this.target,this.startFilters,this.endFilters,J)}else if(this.valueType==="clipPath"&&this.startClipPath&&this.endClipPath){if(this._isElement)k6(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(pJ||(pJ=O.drawSVG))pJ.applyDrawSVG(this.target,$,Q,this.pathLength)}}else if(this.valueType==="path"&&this.pathLUT&&this.pathLUT.length>0){if(this._isElement)E6(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)M6(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)p7(this.pathLUT);this.pathLUT=null,this._isElement=!1}}class n0{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 a0=new n0(()=>new gJ,500),W0={acquire:()=>a0.acquire(),release:(J)=>a0.release(J),getPoolSize:()=>a0.getPoolSize(),getTotalCreated:()=>a0.getTotalCreated(),clear:()=>a0.clear()};var b6={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=$J(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)S(J),O.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(!O.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 N=[];for(let Y of this._targets){if(!(Y instanceof Element))continue;let X=f._createAnimationCallback([Y],{},this._duration,this._delay,this._ease,!1,void 0,G);if(Array.isArray(X))N.push(...X);else N.push(X)}let H=this._fitConfig;for(let Y of N)for(let X of Y.getTargets())if(X instanceof Element)O.fit.registerPendingSetup(Y,X,H,W0);this._animation=N[0]??null,this._animations=N,this._expectedAnimationIds=N.map((Y)=>Y.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 b6)J[G]=b6[G];else if(B0(G))J[G]="";else if(t(G))J[G]="";else{let N=Q[G];if(N===void 0||N===null)continue;let Y=P(N).unit||l(G),X;for(let K of this._targets)if(K instanceof Element){if(q0(G))try{let U=window.getComputedStyle(K).getPropertyValue(G).trim();if(U)X=P(U).value}catch{}else X=zJ(K,G,Y);break}let _=X??0;J[G]=Y?`${_}${Y}`:`${_}`}}else if(this._fromVars)J={...this._fromVars},$=!0;else if(this._toVars)J={...this._toVars};if(this._splitType&&O.textSplitter?.split){let G={mask:!!this._mask,consumer:this},N=[];for(let H of this._originalTargets)if(H instanceof Element){let Y=O.textSplitter?.split(H,this._splitType,G);N.push(...Y)}if(N.length>0)this._targets=N}let Z,j;if(this._flapConfig&&O.textFlapper?.prepare&&f._createAnimationCallback){if(Q&&Object.keys(Q).length>0){let N=[];for(let H of Object.keys(Q)){let Y=Q[H],X=J[H];if(Y===void 0||X===void 0)continue;if(B0(H)||t(H)||q0(H))continue;if(H==="drawSVG"||H==="path"||H==="clip-path"||H==="clipPath")continue;let _=P(Y),K=P(X),W=_.unit||K.unit||l(H);N.push({prop:H,from:_.value,to:K.value,unit:W,isTransform:y(H)})}if(N.length>0)j=N}let G=this._targets.filter((N)=>N instanceof HTMLElement);if(G.length>0){let N=this._repeat!==void 0&&this._repeat!==0,H=O.textFlapper.prepare(G,this._flapConfig,N,j),Y=this._stagger&&O.stagger?O.stagger.resolve(G,this._stagger):void 0;Z=[];let X=0;for(let _=0;_<G.length;_++){let K=G[_].textContent??"";if(K===""||K===" "||K===" "||K===`
|
|
32
|
-
`||K==="\t")continue;if(X>=H.length)break;let U=H[X],B=Y?Y[_]:0,I=f._createAnimationCallback([U.el],{},this._duration,B,this._ease??"power1.out",!1,void 0,{onUpdate:U.render,onComplete:U.finalize,repeat:N?Math.ceil(60/this._duration):0,_skipInitialRender:this._skipInitialFromRender||void 0}),F=Array.isArray(I)?I:[I];Z.push(...F),X++}}}if(Z?.length&&this._flapConfig){let G=this._flapConfig.type??"flip",N=new Set(j?.map((_)=>_.prop)??[]),H=(_)=>{if(N.has(_))return!0;switch(G){case"fade":return _==="opacity";case"blur":return t(_);default:return!1}},Y=[];for(let _ of Object.keys(J))if(H(_))Y.push(_),delete J[_];if(Q){for(let _ of Object.keys(Q))if(H(_)&&!Y.includes(_))Y.push(_),delete Q[_]}let X=Y.filter((_)=>!N.has(_));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)S(G),O.styleReset?.clearAnimationStylesForProps?.(G,this._propsToAnimate)}if(O.styleReset?.registerAnimatedProps){for(let G of this._targets)if(G instanceof Element)O.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}),N=Array.isArray(G)?G:[G];this._animations=[...N,...this._animations],this._expectedAnimationIds=this._animations.map((H)=>H.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 XJ{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 x{static _eachCounter=0;static _registerWithEngine=null;static _activateEngine=null;static setEngineRegisterCallback(J){x._registerWithEngine=J}static setEngineActivationCallback(J){x._activateEngine=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}_notifyActivated(){x._activateEngine?.()}_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&&x._registerWithEngine)x._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)||TJ(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(B0(Z)||t(Z))q.set(Z,{removeInline:!0});else if(P0(Z))q.set(Z,{removeInline:!0});else{let G=Z.replace(/([A-Z])/g,"-$1").toLowerCase();if(z.style.getPropertyValue(G)!==""){let H=_6(j,Z);q.set(Z,{removeInline:!1,value:H.value,unit:H.unit})}else q.set(Z,{removeInline:!0})}}}Q=Q.next}}_restoreInitialValues(){for(let J of this._transformElements){let $=J;S(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(P0(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=XJ.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(),N={type:"animation",child:j,builder:J,startTime:z,duration:G};this._children.push(N),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 H=!!J.getConfig().fromVars;if(z>0&&!H)j.setLazyStartCapture(!0);if(H)j.renderAtTime(0);if(J.hasSplit()){for(let X of J.getOriginalTargets())if(X instanceof Element){let _=X;if(!this._splitParentOverrides.has(_))this._splitParentOverrides.set(_,_.style.opacity);_.style.opacity="1"}}let Y=z+G;if(Y>Z)Z=Y}if(this._previousStart=$,this._previousEnd=Z,Z>this._duration)this._duration=Z;return this}call(J,$,Q){let Z=XJ.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(b0(j))return j}let $=this.getFirstChildAnimation();if($){let Q=$.getTargets();for(let Z of Q)if(b0(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(b0(q)&&!$.has(q))$.add(q),J.push(q)}return J}_createInstanceForElement(J,$){let Z=`${this._name||"__each"}__each_${$}_${x._eachCounter++}`,j=new x(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((_)=>b0(_)).includes(J))continue;let N=z.builder.getConfig(),H=N.repeat!=null?{times:N.repeat,delay:N.repeatDelay,yoyo:N.yoyo}:void 0,Y=z.builder.hasSplit(),X=new f(J,{from:N.fromVars,to:N.toVars,set:N.setVars,duration:N.duration,delay:N.delay,ease:N.ease,repeat:H,...Y&&N.split?{split:N.split}:{},...Y&&N.mask?{mask:N.mask}:{},...Y&&N.stagger!==void 0?{stagger:N.stagger}:{},...N.flap?{flap:N.flap}:{},...N.fit?{fit:N.fit}:{},onStart:N.onStart,onUpdate:N.onUpdate,onComplete:N.onComplete,onRepeat:N.onRepeat,onReverseComplete:N.onReverseComplete});if(N.axis)X.setAxis(N.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_${$}_${x._eachCounter++}`,j=new x(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(),N=(z.builder.hasSplit()?z.builder.getOriginalTargets():z.builder.getTargets()).filter((K)=>b0(K)),H=J.filter((K)=>N.includes(K));if(H.length===0)continue;let Y=G.repeat!=null?{times:G.repeat,delay:G.repeatDelay,yoyo:G.yoyo}:void 0,X=z.builder.hasSplit(),_=new f(H,{from:G.fromVars,to:G.toVars,set:G.setVars,duration:G.duration,delay:G.delay,ease:G.ease,repeat:Y,...X&&G.split?{split:G.split}:{},...X&&G.mask?{mask:G.mask}:{},...X&&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)_.setAxis(G.axis);j._addBuilder(_,z.startTime)}else if(z.type==="callback")j.call(z.child,z.params,z.startTime);return j}_findScopedTargetsForContainer(J,$,Q){let Z=$.filter((q)=>q!==J&&J.contains(q));if(Z.length>0)return Z;let j=J.parentElement;if(j){let q=$.filter((z)=>z!==J&&j.contains(z)&&!Q.some((G)=>G!==J&&G.contains(z)));if(q.length>0)return q}return[]}_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)O.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((N,H)=>{let Y=N>0&&N<1;if(Y)Z=G;if(Z===G){if(j(N,H),!Y)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=O.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(),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 Y of N)O.textSplitter?.revert?.(H,Y);this._clearTransitionData(),this._eachInstances=[];for(let H=0;H<z.length;H++){let Y=z[H],X=this._findScopedTargetsForContainer(Y,G,z);if(X.length===0)continue;let _=this._createInstanceForElements(X,H);if(J==="scroll")Q.registerScroll(_,{...j,target:Y});else if(J==="hover")Q.registerHover(_,{...j,target:Y});else Q.registerClick(_,{...j,target:Y});this._eachInstances.push(_)}{let H=null,Y=this._onUpdate,X=this._onStart,_=this._onComplete;for(let K of this._eachInstances){if(Y)K.onUpdate((W,U)=>{let B=W>0&&W<1;if(B)H=K;if(H===K){if(Y(W,U),!B)H=null}});if(X)K.onStart(()=>{H=K,X()});if(_)K.onComplete(()=>{if(H===K)H=null,_()})}}this._eachDuration=this._duration;for(let H of this._children)if(H.type==="animation"){let Y=H.child;Y.setTimelineChild(!1),Y.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 O.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 O.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 O.triggerManager?.getInstance?.().registerScroll(this,{...J,target:$}),this}onMouseMove(J){if(J?.each&&J.target)return this._setupMouseMoveEachMode(J),this;return O.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=O.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 O.triggerManager?.getInstance?.().registerPageLoad(this,J||{}),this}onPageExit(J){return O.triggerManager?.getInstance?.().registerPageExit(this,J||{}),this}onGesture(J){if(J.each)return this._setupGestureEachMode(J),this;return O.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=O.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 O.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,N=J.params||[];G(...N)}}_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._notifyActivated(),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._notifyActivated(),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._notifyActivated(),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,O.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)O.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 KJ(J,$,Q){let Z=J;if(y($)){let z=Q??($.startsWith("scale")?"":"px");return(G)=>{b(J,$,G,z),Z.style.transform=C(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 g7=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 o7(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 v0 extends c{_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;_pointerMoveTarget=null;_hoverSelectors=null;_isHoveringCursorTarget=!1;_boundHoverTargetMoveHandler=null;_hoverPointerMoveTarget=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),b(this._innerElement,"x",-50,"%"),b(this._innerElement,"y",-50,"%"),this._xSetter=KJ(this._element,"x","px"),this._ySetter=KJ(this._element,"y","px"),this._config.squeeze)this._squeezeSetter=KJ(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=C(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=v0._expandTransformShorthand(String(Q));for(let[j,q]of Object.entries(Z))b(this._innerElement,j,q)}else if(y($)){let Z=typeof Q==="number"?{value:Q,unit:l($)}:P(Q);b(this._innerElement,$,Z.value,Z.unit||l($)||void 0)}else{let Z=s($),j=typeof Q==="number"&&!g7.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 x;Q._addEntry(this._innerElement,{to:v0._expandStateProperties(J.properties),duration:J.duration,ease:J.ease}),this._stateTimelines.set("hover",Q)}let $=this._parsedStates.get("click");if($&&$.enabled){let Q=new x;Q._addEntry(this._innerElement,{to:v0._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=v0._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},this._pointerMoveTarget=typeof document<"u"?document:typeof window<"u"?window:null,J0(this._boundMouseMove,this._pointerMoveTarget),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")}},this._hoverPointerMoveTarget=typeof window<"u"?window:null,J0(this._boundHoverTargetMoveHandler,this._hoverPointerMoveTarget)}_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,N=G.getAttribute("mp-cursor-text")??G.getAttribute("mp-cursor-tooltip")??"";if(this._textElement)this._textElement.textContent=N,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||!o7(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)H0(this._boundMouseMove,this._pointerMoveTarget),this._boundMouseMove=void 0,this._pointerMoveTarget=null;if(this._boundMouseDown)document.removeEventListener("mousedown",this._boundMouseDown);if(this._boundMouseUp)document.removeEventListener("mouseup",this._boundMouseUp);if(this._boundHoverTargetMoveHandler)H0(this._boundHoverTargetMoveHandler,this._hoverPointerMoveTarget),this._boundHoverTargetMoveHandler=null,this._hoverPointerMoveTarget=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",v0);class V6 extends c{_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",V6);var oJ=null;function l7(){if(!oJ&&typeof document<"u"){let J=document.createElement("canvas");J.width=1,J.height=1,oJ=J.getContext("2d")}return oJ}function w6(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 s7(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 i7(J,$,Q){J=J/360,$=$/100,Q=Q/100;let Z,j,q;if($===0)Z=j=q=Q;else{let z=(H,Y,X)=>{if(X<0)X+=1;if(X>1)X-=1;if(X<0.16666666666666666)return H+(Y-H)*6*X;if(X<0.5)return Y;if(X<0.6666666666666666)return H+(Y-H)*(0.6666666666666666-X)*6;return H},G=Q<0.5?Q*(1+$):Q+$-Q*$,N=2*Q-G;Z=z(N,G,J+0.3333333333333333),j=z(N,G,J),q=z(N,G,J-0.3333333333333333)}return[Math.round(Z*255),Math.round(j*255),Math.round(q*255)]}function n7(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,N]=i7(Q,Z,j);return new Float32Array([z,G,N,q])}function a7(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 _J(j,$);let q=Q[2]?.trim();if(q)return _J(q,$);return null}function r7(J){let $=l7();if(!$)return null;$.fillStyle="#000000",$.fillStyle=J;let Q=$.fillStyle;if(Q==="#000000"&&J.toLowerCase()!=="black"&&J!=="#000000"&&J!=="#000")return null;return w6(Q)}function _J(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 w6(Q);if(Q.startsWith("rgb"))return s7(Q);if(Q.startsWith("hsl"))return n7(Q);if(Q.startsWith("var("))return a7(Q,$);return r7(Q)}function t7(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 _J(j,J)||new Float32Array([0,0,0,1])}O.color={parseColor:_J,getCurrentColor:t7};var C6={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 e7(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 x6(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=e7(j[0]);if(q)Q.push(q)}return Q.length>0?Q:null}function J9(J){let $=C6[J.name];if(!$)return!1;return J.value===$.value}function $9(J){if(!J||J.length===0)return"none";if(J.every(J9))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 Q9(J){if(typeof window>"u")return[];let $=window.getComputedStyle(J),Q=$.filter||$.getPropertyValue("filter");if(!Q||Q==="none")return[];return x6(Q)||[]}function Z9(J){let $=C6[J];if($)return{name:J,value:$.value,unit:$.unit};return{name:J,value:0,unit:""}}function j9(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((H)=>H.name===q),G=$.find((H)=>H.name===q),N=Z9(q);Z.push(z||N),j.push(G||N)}return{start:Z,end:j}}var y0=[];function q9(J,$,Q){let Z=J.length;if(y0.length<Z)for(let j=y0.length;j<Z;j++)y0.push({name:"",value:0,unit:""});for(let j=0;j<Z;j++){let q=J[j],z=$[j],G=y0[j];G.name=q.name,G.value=q.value+(z.value-q.value)*Q,G.unit=q.unit||z.unit}return y0.length=Z,y0}O.filter={parseFilter:x6,getCurrentFilter:Q9,mergeFilterArrays:j9,interpolateFilters:q9,filterToString:$9};var S6=new WeakMap;function G9(J){return"getTotalLength"in J&&typeof J.getTotalLength==="function"}function BJ(J){let $=S6.get(J);if($!==void 0)return $;if(G9(J)){let Q=J.getTotalLength();return S6.set(J,Q),Q}return 0}function z9(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]),N=Z[4]||"%",H=$?BJ($):0,Y=lJ(q,z,H),X=lJ(G,N,H);return{start:Y,end:X}}let j=Q.match(/^([-\d.]+)(px|%)?$/);if(j){let q=parseFloat(j[1]),z=j[2]||"%",G=$?BJ($):0;return{start:0,end:lJ(q,z,G)}}}return null}function lJ(J,$,Q){if($==="px"&&Q>0)return J/Q;return J/100}function N9(J){let $=BJ(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],N=-z/$,H=(-z+G)/$;return{start:N,end:H}}}}catch{}return{start:0,end:1}}function H9(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}`}O.drawSVG={parseDrawSVG:z9,getCurrentDrawSVG:N9,getPathLength:BJ,applyDrawSVG:H9};var P6=/(-?\d*\.?\d+)([a-z%]*)/gi;function v6(J){P6.lastIndex=0;let $=P6.exec(J);if(!$)return null;let Q=parseFloat($[1]);if(!isFinite(Q))return null;return{value:Q,unit:$[2]||""}}function U0(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 y6(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 Y9(j);case"ellipse":return X9(j);case"inset":return K9(j);case"polygon":return _9(j);case"rect":return B9(j);case"xywh":return W9(j);default:return null}}function Y9(J){let[$,Q]=T6(J),Z=v6($)??{value:50,unit:"%"},[j,q]=h6(Q);return{shape:"circle",components:[Z,j,q]}}function X9(J){let[$,Q]=T6(J),Z=U0($),j=Z[0]??{value:50,unit:"%"},q=Z[1]??j,[z,G]=h6(Q);return{shape:"ellipse",components:[j,q,z,G]}}function K9(J){let{mainPart:$,roundPart:Q}=sJ(J),Z=U0($),j=Z[0]??{value:0,unit:"px"},q=Z[1]??j,z=Z[2]??j,G=Z[3]??q,N=[j,q,z,G];if(Q!==null){let H=U0(Q);if(H.length===0)N.push({value:0,unit:"px"});else for(let Y of H)N.push(Y)}return{shape:"inset",components:N,extras:Q!==null?{hasRound:!0}:void 0}}function _9(J){let $=[],Z=J.replace(/^(nonzero|evenodd)\s*,\s*/i,"").split(",");for(let j of Z){let q=U0(j);if(q.length>=2)$.push(q[0],q[1])}return{shape:"polygon",components:$}}function B9(J){let{mainPart:$,roundPart:Q}=sJ(J),Z=U0($),j=Z[0]??{value:0,unit:"px"},q=Z[1]??j,z=Z[2]??j,G=Z[3]??q,N=[j,q,z,G];if(Q!==null){let H=U0(Q);if(H.length===0)N.push({value:0,unit:"px"});else for(let Y of H)N.push(Y)}return{shape:"rect",components:N,extras:Q!==null?{hasRound:!0}:void 0}}function W9(J){let{mainPart:$,roundPart:Q}=sJ(J),Z=U0($),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"},N=[j,q,z,G];if(Q!==null){let H=U0(Q);if(H.length===0)N.push({value:0,unit:"px"});else for(let Y of H)N.push(Y)}return{shape:"xywh",components:N,extras:Q!==null?{hasRound:!0}:void 0}}function T6(J){let $=J.toLowerCase().search(/\bat\b/);if($===-1)return[J.trim(),""];return[J.slice(0,$).trim(),J.slice($+2).trim()]}function sJ(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 h6(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=v6(z);if(G){Z.push(G);continue}let N=z.toLowerCase();if(N==="center")Z.push({value:50,unit:"%"});else if(N==="left"||N==="top")Z.push({value:0,unit:"%"});else if(N==="right"||N==="bottom")Z.push({value:100,unit:"%"})}let j=Z[0]??$[0],q=Z[1]??$[1];return[j,q]}function U9(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 y6(Q)}catch{return null}}function f6(J,$){if(J.shape!==$.shape)return!1;if(J.components.length!==$.components.length)return!1;return!0}var T0=[];function O9(J,$,Q){if(!f6(J,$))return Q>=0.5?$:J;let Z=J.components.length;if(T0.length<Z)for(let j=T0.length;j<Z;j++)T0.push({value:0,unit:""});T0.length=Z;for(let j=0;j<Z;j++){let q=J.components[j],z=$.components[j],G=T0[j];G.value=q.value+(z.value-q.value)*Q,G.unit=z.unit||q.unit}return{shape:$.shape,components:T0,extras:$.extras??J.extras}}function E(J){return`${Math.round(J.value*1e4)/1e4}${J.unit}`}function I9(J){let $=J.components;switch(J.shape){case"circle":return`circle(${E($[0])} at ${E($[1])} ${E($[2])})`;case"ellipse":return`ellipse(${E($[0])} ${E($[1])} at ${E($[2])} ${E($[3])})`;case"inset":{let Q=`${E($[0])} ${E($[1])} ${E($[2])} ${E($[3])}`;if(J.extras?.hasRound&&$.length>4){let Z=$.slice(4).map(E).join(" ");return`inset(${Q} round ${Z})`}return`inset(${Q})`}case"polygon":{let Q=[];for(let Z=0;Z<$.length;Z+=2)Q.push(`${E($[Z])} ${E($[Z+1])}`);return`polygon(${Q.join(", ")})`}case"rect":{let Q=`${E($[0])} ${E($[1])} ${E($[2])} ${E($[3])}`;if(J.extras?.hasRound&&$.length>4){let Z=$.slice(4).map(E).join(" ");return`rect(${Q} round ${Z})`}return`rect(${Q})`}case"xywh":{let Q=`${E($[0])} ${E($[1])} ${E($[2])} ${E($[3])}`;if(J.extras?.hasRound&&$.length>4){let Z=$.slice(4).map(E).join(" ");return`xywh(${Q} round ${Z})`}return`xywh(${Q})`}}}O.clipPath={parseClipPath:y6,getCurrentClipPath:U9,interpolateClipPaths:O9,clipPathToString:I9,canInterpolate:f6};var h0=new WeakMap;class WJ{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 X=this._tryUpgrade(J,j,$,Q);if(X!==null)return X;let _=$.split(",").map((K)=>K.trim());if(_.includes("chars")&&j.result.chars.length>0)return j.result.chars.slice();if(_.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,z={chars:[],words:[],lines:[],elements:[]},G=$.split(",").map((X)=>X.trim()),N=G.includes("chars"),H=G.includes("words"),Y=G.includes("lines");if(Y)this._splitWithLinesDom(J,H,N,z);else if(H&&N)this._splitWordsWithCharsDom(J,z);else if(H)this._splitWordsDom(J,z);else if(N)this._splitCharsDom(J,z);if(N)z.elements=z.chars;else if(H)z.elements=z.words;else if(Y)z.elements=z.lines;if(Q?.mask&&z.elements.length>0)this._applyMaskWrappers(z);return this._propagateGradientText(J,z),h0.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((K)=>K.trim()),z=Q.split(",").map((K)=>K.trim()),G=z.includes("chars"),N=z.includes("words"),H=z.includes("lines"),Y=q.includes("chars"),X=q.includes("words"),_=q.includes("lines");if((!G||Y)&&(!N||X)&&(!H||_))return this._getSpansForType($.result,Q);if(H||_)return null;if(X&&!Y&&G){let K=[];for(let U of $.result.words)this._nestCharsInElement(U,K);$.result.chars=K,$.result.elements=K;let W=this._buildTypeString(q,z);if(J.setAttribute("data-split",W),Z?.mask)this._applyMaskWrappers($.result);return this._propagateGradientText(J,$.result),G?K:$.result.words.slice()}if(Y&&!X&&N){let K=Array.from(J.querySelectorAll("[data-split-word-wrap]")),W=[];for(let B=0;B<K.length;B++){let I=K[B];I.removeAttribute("data-split-word-wrap"),I.setAttribute("data-split-word",""),I.setAttribute("data-word-index",String(B)),W.push(I)}$.result.words=W;let U=this._buildTypeString(q,z);return J.setAttribute("data-split",U),G?$.result.chars.slice():W}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 N of z)if(/\s/.test(N))G.appendChild(document.createTextNode(N));else{let H=document.createElement("span");H.setAttribute("data-split-char",""),H.setAttribute("data-char-index",String($.length)),H.style.display="inline-block",H.textContent=N,$.push(H),G.appendChild(H)}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 N of q)if(/^\s+$/.test(N))z.appendChild(document.createTextNode(N.replace(/\n/g," "))),G=!0;else if(N){let H=document.createElement("span");H.setAttribute("data-split-word",""),H.setAttribute("data-word-index",String($.words.length)),H.style.display="inline-block",H.textContent=N,$.words.push(H),z.appendChild(H),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 N=document.createElement("span");N.setAttribute("data-split-word-wrap",""),N.style.display="inline-block",N.style.whiteSpace="nowrap";for(let H of G){let Y=document.createElement("span");Y.setAttribute("data-split-char",""),Y.setAttribute("data-char-index",String($.chars.length)),Y.style.display="inline-block",Y.textContent=H,$.chars.push(Y),N.appendChild(Y)}z.appendChild(N)}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 N=document.createElement("span");N.setAttribute("data-split-word",""),N.setAttribute("data-word-index",String($.words.length)),N.style.display="inline-block",N.style.whiteSpace="nowrap";for(let H of G){let Y=document.createElement("span");Y.setAttribute("data-split-char",""),Y.setAttribute("data-char-index",String($.chars.length)),Y.style.display="inline-block",Y.textContent=H,$.chars.push(Y),N.appendChild(Y)}$.words.push(N),z.appendChild(N)}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 K of j.words){let W=K.getBoundingClientRect();if(W.top>G+2){if(z.length>0)q.push(z);z=[K],G=W.top}else z.push(K)}if(z.length>0)q.push(z);let N=new Map;for(let K of j.words)N.set(K,this._getWrapperChain(K,J));let H="",Y=0,X=0,_=0;for(let K of q){let W="",U=[];for(let B=0;B<K.length;B++){let I=K[B],F=I.textContent||"",L=N.get(I)||[],A=0;while(A<U.length&&A<L.length&&U[A]===L[A])A++;for(let k=U.length-1;k>=A;k--)W+=`</${U[k].tagName.toLowerCase()}>`;if(B>0)W+=" ";for(let k=A;k<L.length;k++)W+=this._openTag(L[k]);if(Q){let k="";for(let F0 of F)k+=`<span data-split-char data-char-index="${_}" style="display:inline-block">${this._escapeHtml(F0)}</span>`,_++;if($)W+=`<span data-split-word data-word-index="${X}" style="display:inline-block;white-space:nowrap">${k}</span>`;else W+=k}else if($)W+=`<span data-split-word data-word-index="${X}" style="display:inline-block">${this._escapeHtml(F)}</span>`;else W+=this._escapeHtml(F);X++,U=L}for(let B=U.length-1;B>=0;B--)W+=`</${U[B].tagName.toLowerCase()}>`;H+=`<span data-split-line data-line-index="${Y}" style="display:block">${W}</span>`,Y++}if(J.innerHTML=H,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=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,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}}O.textSplitter={split:(J,$,Q)=>WJ.split(J,$,Q),revert:(J,$)=>WJ.revert(J,$),isSplit:WJ.isSplit};var iJ={alphanumeric:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",alpha:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",numeric:"0123456789",hex:"0123456789ABCDEF",binary:"01",katakana:"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲン",symbols:"!@#$%^&*+-=<>?/|~",blocks:"░▒▓█▄▀■□▪▫"},nJ=80,d6=400,F9=[2,5],UJ=new WeakMap,f0=new WeakMap,OJ=new WeakMap;function m6(J){let $=J.parentElement;while($&&typeof $.hasAttribute==="function"&&$.hasAttribute("data-split-word-wrap"))$=$.parentElement;return $}function A9(J){if(!J)return iJ.alphanumeric;return Object.prototype.hasOwnProperty.call(iJ,J)?iJ[J]:J}function r0(J){return J[Math.floor(Math.random()*J.length)]}function u6(J){if(J===void 0){let[Z,j]=F9;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 X0(J){return J===""||J===" "||J===" "||J===`
|
|
33
|
-
`||J==="\t"}function L9(J){let $=J.textContent??"";if(!UJ.has(J))UJ.set(J,$);return $===" "?" ":$}function M9(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 H of $){if(z.has(H))continue;z.add(H);let Y=document.createElement("span");Y.style.display="inline-block",Y.textContent=H,Z.appendChild(Y),q.push({el:Y,c:H})}Q.appendChild(Z);let G=0,N="";try{for(let{el:H,c:Y}of q){let X=H.getBoundingClientRect().width;if(X>G)G=X,N=Y}}finally{Q.removeChild(Z)}return{width:G,char:N}}function D9(J,$,Q=d6,Z=!0,j="none",q=!1,z=""){let G=0,N=0,H="";if(j!=="none"&&$!=="board"){let Y=null;for(let X of J)if(!X0(X.textContent??""))G=Math.max(G,X.offsetWidth),Y??=X;if(Y&&z){let X=M9(Y,z);if(N=X.width,H=X.char,N>G)G=N}G=Math.max(G,8)+4}if(j==="container"&&$!=="board"&&H){let Y=new Map;for(let X of J){let _=m6(X);if(!_)continue;let K=Y.get(_);if(!K)K=[],Y.set(_,K);K.push(X)}for(let[X,_]of Y){if(OJ.has(X))continue;let K=X.getBoundingClientRect().width,W=0;for(let B of _){if(X0(B.textContent??""))continue;let I=B.getBoundingClientRect().width;if(N>I)W+=N-I}let U=Math.ceil(K+W+2);OJ.set(X,{display:X.style.display,width:X.style.width}),X.style.display="inline-block",X.style.width=`${U}px`}}if($==="flip"){let Y=new Set;for(let X of J){if(X.style.display="inline-block",X.style.backfaceVisibility="hidden",X.style.verticalAlign="top",j==="cells"&&!X0(X.textContent??""))X.style.width=`${G}px`,X.style.textAlign="center";if(X.parentElement&&!Y.has(X.parentElement))Y.add(X.parentElement),X.parentElement.style.height=`${X.parentElement.offsetHeight}px`}}else if($==="slide")for(let Y of J){if(Y.style.display="inline-block",Y.parentElement)Y.parentElement.style.overflow="hidden";if(j==="cells"&&!X0(Y.textContent??""))Y.style.width=`${G}px`,Y.style.textAlign="center"}else if($==="blur"||$==="scale"||$==="fade"||$==="none"){for(let Y of J)if(Y.style.display="inline-block",j==="cells"&&!X0(Y.textContent??""))Y.style.width=`${G}px`,Y.style.textAlign="center"}else if($==="board"){let Y=0;if(Z){for(let X of J)if(!X0(X.textContent??""))Y=Math.max(Y,X.offsetWidth);Y=Math.max(Y,8)+4}for(let X of J){let F=function(e){let r=document.createElement("span"),R=r.style;return R.display="block",R.position="absolute",R.left="0",R.width="100%",R.height="200%",R.fontSize=U.fontSize,R.fontFamily=U.fontFamily,R.fontWeight=U.fontWeight,R.color=U.color,R.lineHeight=`${I}px`,R.textAlign="center",R.setProperty("-webkit-text-fill-color",U.color),R.top=e,r},L=function(e){let r=document.createElement("div"),R=r.style;R.position="absolute",R.left="0",R.width="100%",R.height="50%",R.overflow="hidden",R.top=e?"50%":"0",R.zIndex="1";let K0=F(e?"-100%":"0");return r.appendChild(K0),[r,K0]},A=function(e="0"){let r=document.createElement("div"),R=r.style;R.position="absolute",R.left="0",R.top="0",R.width="100%",R.height="100%",R.overflow="hidden",R.backfaceVisibility="hidden";let K0=F(e);return r.appendChild(K0),[r,K0]};if(f0.has(X))continue;let _=X.textContent??"",K=X0(_);if(K&&!q)continue;let W=K?" ":_,U=window.getComputedStyle(X),B=Z?Y:X.offsetWidth,I=X.offsetHeight;X.textContent="",X.style.display="inline-block",X.style.position="relative",X.style.width=`${B}px`,X.style.height=`${I}px`,X.style.perspective=`${Q}px`;let[k,F0]=L(!1);F0.textContent=W;let[A0,m0]=L(!0);m0.textContent=W;let L0=document.createElement("div"),p=L0.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[E0,M0]=A();M0.textContent=W;let[z0,D0]=A("-100%");z0.style.transform="rotateX(180deg)",D0.textContent=W,L0.appendChild(E0),L0.appendChild(z0);let g=document.createElement("div"),N0=g.style;N0.position="absolute",N0.left="0",N0.width="100%",N0.height="1px",N0.top="calc(50% - 0.5px)",N0.zIndex="3",N0.pointerEvents="none";let c0=document.createElement("div"),a=c0.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(k),X.appendChild(A0),X.appendChild(L0),X.appendChild(c0),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){k.style.background="linear-gradient(180deg, #2a2a2e 0%, #1e1e22 100%)",k.style.borderRadius="4px 4px 0 0",A0.style.background="linear-gradient(180deg, #1e1e22 0%, #16161a 100%)",A0.style.borderRadius="0 0 4px 4px",E0.style.background="linear-gradient(180deg, #2a2a2e 0%, #1e1e22 100%)",E0.style.borderRadius="4px 4px 0 0",z0.style.background="linear-gradient(180deg, #1e1e22 0%, #16161a 100%)",z0.style.borderRadius="0 0 4px 4px";for(let K0 of[F0,m0,M0,D0])K0.style.color="#e8e8ec",K0.style.setProperty("-webkit-text-fill-color","#e8e8ec")}f0.set(X,{staticTop:k,staticBottom:A0,flapWrap:L0,flapFront:E0,flapBack:z0,splitLine:g,shadow:c0,staticTopText:F0,staticBottomText:m0,flapFrontText:M0,flapBackText:D0})}}}function R9(J,$,Q,Z,j,q,z,G){let N=[];for(let Y=0;Y<Q;Y++){let X=!z&&Y===Q-1?$:r0(Z);N.push(X)}let H=-1;return(Y)=>{let X=Math.min(Y,0.9999)*Q,_=Math.floor(X),K=X-_,W=K>=0.5,U=_*2+(W?1:0);if(j!=="board"&&U!==H){if(W)J.textContent=z?r0(Z):N[_]??$;else J.textContent=_===0?$:z?r0(Z):N[_-1]??$;H=U}switch(j){case"flip":{let B=K<0.5?-90*(K/0.5):90*(1-(K-0.5)/0.5);b(J,"perspective",q,"px"),b(J,"rotateX",B,"deg"),Q0(J);break}case"fade":{let B=K<0.5?1-K/0.5:(K-0.5)/0.5;J.style.opacity=String(B);break}case"slide":{let B=K<0.5?-100*(K/0.5):100*(1-(K-0.5)/0.5),I=K<0.5?1-K/0.5:(K-0.5)/0.5;b(J,"y",B,"%"),Q0(J),J.style.opacity=String(I);break}case"blur":{let B=K<0.5?8*(K/0.5):8*(1-(K-0.5)/0.5);J.style.filter=`blur(${B}px)`;break}case"scale":{let B=K<0.5?1-K/0.5:(K-0.5)/0.5;b(J,"scale",B),Q0(J);break}case"board":{let B=f0.get(J);if(!B)break;let I=_===0?$:z?r0(Z):N[_-1]??$,F=z?r0(Z):N[_]??$;B.staticTopText.textContent=F,B.flapFrontText.textContent=I,B.flapBackText.textContent=F,B.staticBottomText.textContent=I;let L=-180*K;B.flapWrap.style.transform=`rotateX(${L}deg)`;let A=Math.sin(K*Math.PI);B.shadow.style.opacity=String(A);break}default:break}if(G&&G.length>0){let B=!1;for(let I of G){let F=K<0.5?1-K/0.5:(K-0.5)/0.5,L=I.from+(I.to-I.from)*F;if(I.isTransform)b(J,I.prop,L,I.unit||void 0),B=!0;else J.style[I.prop]=I.unit?`${L}${I.unit}`:String(L)}if(B)Q0(J)}}}function k9(J,$,Q,Z){return()=>{if(Q==="board"){let j=f0.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")S(J,!0);else if(Q==="slide")S(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)b(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))Q0(J)}}}class t0{static prepare(J,$,Q=!1,Z){let j=$.type??"flip",q=A9($.charset),z=$.perspective??d6,G=$.styledBoard??!0,N=$.stableWidth??!1,H=N==="container"?"container":N==="cells"||N===!0?"cells":"none",Y=$.preserveWhitespaceCells??!1,X=[];for(let K of J){let W=L9(K),U=K.textContent??"",B=X0(U),I=B&&Y&&j==="board";if(B&&!I)continue;let F=I?" ":W;X.push({el:K,target:F,isBlankCell:I})}D9(J,j,z,G,H,Y,q);let _=[];for(let{el:K,target:W,isBlankCell:U}of X)if(U)_.push({el:K,render:()=>{},finalize:()=>{}});else{let B=u6($.cycles);_.push({el:K,render:R9(K,W,B,q,j,z,Q,Z),finalize:k9(K,W,j,Z)})}if(_.length===0&&J.length>0){if(J.some((W)=>W.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 _}static flap(J,$,Q,Z=!1){let j=t0.prepare(J,$,Z);if(j.length===0)return{kill(){},finished:Promise.resolve(),isComplete:!0};let q=u6($.cycles),z=q*2*nJ+Math.max(0,q-1)*0.5*nJ,G=()=>{},N=new Promise((B)=>{G=B}),H=!1,Y=0,X=0,_=[],K=0;for(let B=0;B<J.length;B++){let I=J[B].textContent??"";if(X0(I))continue;_.push(Q?.[B]??K*nJ*2),K++}let W=performance.now();function U(){if(H)return;let B=performance.now(),I=!0;for(let F=0;F<j.length;F++){let L=j[F],A=B-W-_[F];if(A<0){I=!1;continue}if(Z){let k=A%z/z;L.render(k),I=!1}else{let k=Math.min(A/z,1);if(L.render(k),k>=1)L.finalize();else I=!1}}if(I&&!Z)Y=j.length,G();else X=requestAnimationFrame(U)}if(X=requestAnimationFrame(U),Z)G();return{kill(){if(H)return;H=!0,cancelAnimationFrame(X);for(let B of j)B.finalize();G()},get finished(){return N},get isComplete(){return H||Y===j.length}}}static revert(J){for(let $ of J){let Q=f0.get($);if(Q)Q.staticTop.remove(),Q.staticBottom.remove(),Q.flapWrap.remove(),Q.splitLine.remove(),Q.shadow.remove(),f0.delete($),$.style.perspective="",$.style.position="",$.style.width="",$.style.height="",$.style.marginRight="";let Z=UJ.get($);if(Z!==void 0)$.textContent=Z,UJ.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=m6($);if(j){let q=OJ.get(j);if(q)j.style.display=q.display,j.style.width=q.width,OJ.delete(j)}}}}O.textFlapper={prepare:(J,$,Q,Z)=>t0.prepare(J,$,Q,Z),flap:(J,$,Q,Z)=>t0.flap(J,$,Q,Z),revert:(J)=>t0.revert(J)};class c6{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,N)=>{let H=N%Q,Y=Math.floor(N/Q);return{originalIndex:N,col:H,row:Y}});if(j==="random"){let G=z.map((N)=>({originalIndex:N.originalIndex,order:Math.random()}));return G.sort((N,H)=>N.order-H.order),G.forEach((N,H)=>{N.order=H}),G}return z.map((G)=>{let N;if(typeof j==="number"){let H=j%Q,Y=Math.floor(j/Q);N=q==="x"?Math.abs(G.col-H)+Math.abs(G.row-Y)*0.5:Math.abs(G.row-Y)+Math.abs(G.col-H)*0.5}else if(j==="center"){let H=(Q-1)/2,Y=(Z-1)/2;N=Math.abs(G.col-H)+Math.abs(G.row-Y)}else if(j==="edges"){let H=Math.min(G.col,Q-1-G.col),Y=Math.min(G.row,Z-1-G.row);N=Math.min(H,Y)}else if(j==="end")N=q==="x"?(Z-1-G.row)*Q+(Q-1-G.col):(Q-1-G.col)*Z+(Z-1-G.row);else N=q==="x"?G.row*Q+G.col:G.col*Z+G.row;return{originalIndex:G.originalIndex,order:N}})}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}}}O.stagger={resolve:(J,$)=>c6.resolve(J,$)};function E9(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,N=j.left+z/2,H=j.top+G/2,Y=q.left+q.width/2,X=q.top+q.height/2,_=Y-N,K=X-H,W=q.width/z,U=q.height/G;if(!Q)return{dx:_,dy:K,sx:W,sy:U,sourceWidth:j.width,sourceHeight:j.height,targetWidth:q.width,targetHeight:q.height};let B=J.offsetParent??document.documentElement,I=B.getBoundingClientRect(),F=B.scrollLeft??0,L=B.scrollTop??0;return{dx:_,dy:K,sx:W,sy:U,sourceWidth:j.width,sourceHeight:j.height,targetWidth:q.width,targetHeight:q.height,sourceLeft:J.offsetLeft,sourceTop:J.offsetTop,targetLeft:q.left-I.left+F,targetTop:q.top-I.top+L}}function p6(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 m=0.01,u0=0.001;function b9(J,$,Q,Z){let{absolute:j=!1,scale:q=!0,resize:z=!1}=Q;if($ instanceof HTMLElement)S($,!1);let G=E9($,Q.target,j);if(!G)return;if(!j)if(z){let N=G.dx-(G.targetWidth-G.sourceWidth)/2,H=G.dy-(G.targetHeight-G.sourceHeight)/2;if(Math.abs(N)>m){let Y=Z.acquire();Y.init($,"x",0,N,"px"),J.addPropTween(Y)}if(Math.abs(H)>m){let Y=Z.acquire();Y.init($,"y",0,H,"px"),J.addPropTween(Y)}if(Math.abs(G.targetWidth-G.sourceWidth)>m){let Y=Z.acquire();Y.init($,"width",G.sourceWidth,G.targetWidth,"px"),J.addPropTween(Y)}if(Math.abs(G.targetHeight-G.sourceHeight)>m){let Y=Z.acquire();Y.init($,"height",G.sourceHeight,G.targetHeight,"px"),J.addPropTween(Y)}}else{let N=Y0($,"x"),H=Y0($,"y"),Y=SJ($,"x"),X=SJ($,"y"),_=p6($,"x",N,Y),K=p6($,"y",H,X),W=_+G.dx,U=K+G.dy;if(Math.abs(W-_)>m||Math.abs(_)>m||Math.abs(W)>m){let B=Z.acquire();B.init($,"x",_,W,"px"),J.addPropTween(B)}if(Math.abs(U-K)>m||Math.abs(K)>m||Math.abs(U)>m){let B=Z.acquire();B.init($,"y",K,U,"px"),J.addPropTween(B)}if(q){let B=Y0($,"scaleX"),I=Y0($,"scaleY"),F=B*G.sx,L=I*G.sy;if(Math.abs(F-B)>u0||Math.abs(B-1)>u0||Math.abs(F-1)>u0){let A=Z.acquire();A.init($,"scaleX",B,F,""),J.addPropTween(A)}if(Math.abs(L-I)>u0||Math.abs(I-1)>u0||Math.abs(L-1)>u0){let A=Z.acquire();A.init($,"scaleY",I,L,""),J.addPropTween(A)}}}else{let N=$;if(window.getComputedStyle(N).position==="static")N.style.position="absolute";let{sourceLeft:Y,sourceTop:X,targetLeft:_,targetTop:K}=G;if(Math.abs(_-Y)>m){let W=Z.acquire();W.init($,"left",Y,_,"px"),J.addPropTween(W)}if(Math.abs(K-X)>m){let W=Z.acquire();W.init($,"top",X,K,"px"),J.addPropTween(W)}if(q){if(Math.abs(G.targetWidth-G.sourceWidth)>m){let W=Z.acquire();W.init($,"width",G.sourceWidth,G.targetWidth,"px"),J.addPropTween(W)}if(Math.abs(G.targetHeight-G.sourceHeight)>m){let W=Z.acquire();W.init($,"height",G.sourceHeight,G.targetHeight,"px"),J.addPropTween(W)}}}}function V9(J,$,Q,Z){J.setPendingFitSetup((z)=>b9(J,$,Q,z)),J.setLazyStartCapture(!0);let{absolute:j=!1,resize:q=!1}=Q;J.setFitCleanup(()=>{if($ instanceof HTMLElement){if(S($,!0),q)$.style.width="",$.style.height="";if(j)$.style.width="",$.style.height="",$.style.left="",$.style.top=""}})}O.fit={registerPendingSetup:V9};var s6=(J)=>J,w9=s6,v={in:(J)=>J*J,out:(J)=>J*(2-J),inOut:(J)=>J<0.5?2*J*J:-1+(4-2*J)*J},O0={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},I0={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 IJ={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},FJ={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}},AJ={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 i6=(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}}},LJ=i6();var n6=(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}}},MJ=n6(),g6=(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},d0={in:(J)=>1-g6(1-J),out:g6,inOut:(J)=>{if(J<0.5)return d0.in(J*2)*0.5;return d0.out(J*2-1)*0.5+0.5}},e0=(J=0.7,$=0.7,Q=!1)=>{let Z=J!==1?$:0,j=(1-J)/2,q=j+J,z=Q;return(G)=>{let N=G+(0.5-G)*Z;if(G<j){let H=1-G/j;if(z)return 1-H*H;return N-H*H*H*H*N}else if(G>q){let H=(G-q)/j;if(z)return G===1?0:1-H*H;return N+(G-N)*H*H*H*H}return z?1:N}},o6={in:e0(0.7,0.7,!1),out:e0(0.7,0.7,!1),inOut:e0(0.7,0.7,!1)},RJ=(J=1,$=20,Q=!1)=>{let Z=[],j=1/$;for(let q=0;q<$;q++){let z=q*j,N=((q*1327+531)%1000/1000-0.5)*J*0.4,H=z+N;Z.push({x:z,y:Q?Math.max(0,Math.min(1,H)):H})}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 N=Z[z],H=Z[G],Y=(q-N.x)/(H.x-N.x);return N.y+(H.y-N.y)*Y}},C9={in:RJ(1,20,!0),out:RJ(1,20,!0),inOut:RJ(1,20,!0)},kJ=(J)=>{return($)=>{if($>=1)return 1;return Math.floor($*J)/J}},DJ={in:kJ(12),out:kJ(12),inOut:kJ(12)},l6={linear:s6,none:w9,power1:v.out,"power1.in":v.in,"power1.out":v.out,"power1.inout":v.inOut,power2:O0.out,"power2.in":O0.in,"power2.out":O0.out,"power2.inout":O0.inOut,power3:I0.out,"power3.in":I0.in,"power3.out":I0.out,"power3.inout":I0.inOut,power4:i.out,"power4.in":i.in,"power4.out":i.out,"power4.inout":i.inOut,quad:v.out,"quad.in":v.in,"quad.out":v.out,"quad.inout":v.inOut,cubic:O0.out,"cubic.in":O0.in,"cubic.out":O0.out,"cubic.inout":O0.inOut,quart:I0.out,"quart.in":I0.in,"quart.out":I0.out,"quart.inout":I0.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:IJ.out,"sine.in":IJ.in,"sine.out":IJ.out,"sine.inout":IJ.inOut,expo:FJ.out,"expo.in":FJ.in,"expo.out":FJ.out,"expo.inout":FJ.inOut,circ:AJ.out,"circ.in":AJ.in,"circ.out":AJ.out,"circ.inout":AJ.inOut,back:LJ.out,"back.in":LJ.in,"back.out":LJ.out,"back.inout":LJ.inOut,elastic:MJ.out,"elastic.in":MJ.in,"elastic.out":MJ.out,"elastic.inout":MJ.inOut,bounce:d0.out,"bounce.in":d0.in,"bounce.out":d0.out,"bounce.inout":d0.inOut,slow:o6.inOut,"slow.in":v.out,"slow.out":v.out,"slow.inout":v.out,slowmo:o6.inOut,"slowmo.in":v.out,"slowmo.out":v.out,"slowmo.inout":v.out,rough:C9.inOut,"rough.in":v.out,"rough.out":v.out,"rough.inout":v.out,steps:DJ.inOut,"steps.in":DJ.in,"steps.out":DJ.out,"steps.inout":DJ.inOut},x9={back:(J)=>i6(J),elastic:(J,$)=>n6(J,$),slow:(J,$,Q)=>{let Z=e0(J,$,Q===1);return{in:Z,out:Z,inOut:Z}},slowmo:(J,$,Q)=>{let Z=e0(J,$,Q===1);return{in:Z,out:Z,inOut:Z}},rough:(J,$,Q)=>{let Z=RJ(J,$,Q===1);return{in:Z,out:Z,inOut:Z}},steps:(J)=>{let $=kJ(J??12);return{in:$,out:$,inOut:$}}},S9=/^(\w+)(?:\.(\w+))?\(([^)]*)\)$/;function a6(J){let $=J.toLowerCase();if(l6[$])return l6[$];let Q=S9.exec($);if(Q){let[,Z,j,q]=Q,z=x9[Z];if(z){let G=q.split(",").map((N)=>N.trim()).filter((N)=>N.length>0).map(Number);if(G.every((N)=>!isNaN(N))){let N=z(...G),H=j||"out",X=N[H==="inout"?"inOut":H];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)`),v.out}class aJ{_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;_activationCallback=null;init(J,$,Q,Z,j,q){return this._id=J,this._targets=$,this._duration=Q,this._delay=Z,this._easingFn=a6(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,N=this._repeat===-1?1/0:Q*(this._repeat+1)+z*this._repeat,H=this._repeat===-1?q:Math.min(q,N),Y=G>0?Math.floor(H/G):0,X=H-Y*G,_=X>Q,K=Q>0?Math.min(1,X/Q):1,W=this._yoyo&&Y%2===1;if(_)K=W?0:1;else if(W)K=1-K;this._currentRepeat=this._repeat===-1?Y:Math.min(Y,this._repeat),this._isReversed=W,this._progress=K,this._time=Q*K,this.render(K)}}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._activationCallback?.(),this;if(this._isActive&&!this._isReversed)return this;return this._isActive=!0,this._isReversed=!1,this._activationCallback?.(),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._activationCallback?.(),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._activationCallback?.(),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}setActivationCallback(J){this._activationCallback=J}captureStartValues(){if(!this._needsStartCapture||this._startCaptured)return;if(this._pendingFitSetup){let $=this._propTweens;while($){let Q=$.next;W0.release($),$=Q}this._propTweens=null,this._lastPropTween=null,this._pendingFitSetup(W0),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"&&B0(Q)){let Z=O.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=O.filter?.getCurrentFilter($);if(Z&&J.endFilters){let j=O.filter.mergeFilterArrays(Z,J.endFilters);J.startFilters=j.start,J.endFilters=j.end}}else if(J.valueType==="clipPath"&&hJ(Q)){let Z=O.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,this._activationCallback=null;let J=W0,$=this._propTweens;while($){let Q=$.next;J.release($),$=Q}this._propTweens=null,this._lastPropTween=null}}var JJ=new n0(()=>new aJ,100),r6={acquire:()=>JJ.acquire(),release:(J)=>JJ.release(J),getPoolSize:()=>JJ.getPoolSize(),getTotalCreated:()=>JJ.getTotalCreated(),clear:()=>JJ.clear()};class V{static instance;animations=[];animationIdToIndex=new Map;nextAnimationId=1;totalCreated=0;_animationSnapshot=[];timelines=new Map;_captureTarget=null;ticker;_tickerSubscribed=!1;animationPool;propTweenPool;constructor(){this.ticker=T.getInstance(),this.animationPool=r6,this.propTweenPool=W0}static getInstance(){if(!V.instance)V.instance=new V,x.setEngineRegisterCallback((J,$)=>{let Q=V.instance;if(!Q.hasTimeline(J))Q.registerTimeline(J,$)}),x.setEngineActivationCallback(()=>{V.instance._ensureTickerSubscription()}),f.setCreateAnimationCallback((J,$,Q,Z,j,q,z,G)=>{return V.instance.createAnimation(J,$,Q,Z,j,q,z,G)});return V.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);this._releaseTickerIfIdle()};_ensureTickerSubscription(){if(this._tickerSubscribed)return;this.ticker.add(this.update,0),this._tickerSubscribed=!0}_hasActiveWork(){for(let J=0,$=this.animations.length;J<$;J++){let Q=this.animations[J];if(!Q.isTimelineChild()&&Q.isActive())return!0}for(let J of this.timelines.values())if(J.isActive())return!0;return!1}_releaseTickerIfIdle(){if(!this._tickerSubscribed||this._hasActiveWork())return;this.ticker.remove(this.update),this._tickerSubscribed=!1}createAnimation(J,$,Q,Z,j,q,z,G){let N=G?.stagger;if(N&&J.length>1)return this.createStaggeredAnimations(J,$,Q,Z,j,q,z,N,G);let H=this.animationPool.acquire(),Y=this.registerAnimation(H);if(H.init(Y,J,Q,Z,j,G),this.setupPropertyTweens(H,J,$,q,z),Q===0)H.render(1);else if(q&&!G?._skipInitialRender)H.render(0);return H}createStaggeredAnimations(J,$,Q,Z,j,q,z,G,N){if(!O.stagger){let X=this.animationPool.acquire(),_=this.registerAnimation(X);if(X.init(_,J,Q,Z,j,N),this.setupPropertyTweens(X,J,$,q,z),Q===0)X.render(1);else if(q&&!N?._skipInitialRender)X.render(0);return[X]}let H=O.stagger.resolve(J,G),Y=[];for(let X=0;X<J.length;X++){let _=J[X],K=H[X],W=this.animationPool.acquire(),U=this.registerAnimation(W);if(W.init(U,[_],Q,Z+K,j,N),this.setupPropertyTweens(W,[_],$,q,z),Q===0)W.render(1);else if(q&&!N?._skipInitialRender)W.render(0);Y.push(W)}return Y}setupPropertyTweens(J,$,Q,Z,j){let q=e6(t6(Q)),z=j?e6(t6(j)):void 0,G=Object.keys(q),N=z?Object.keys(z):[],H=[...new Set([...G,...N])],Y="perspective"in q,X=z&&"perspective"in z,_=Y&&X;for(let K of $){if(!_&&(Y||X)&&K instanceof Element){let W=Y?q.perspective:z.perspective,U=typeof W==="number"?W:parseFloat(String(W))||0;if(U>0)b(K,"perspective",U,"px"),K.style.transform=C(K)}for(let W of H){if(W==="perspective"&&!_)continue;let U=q[W],B=fJ(K,W,U,z?z[W]:void 0),I=this.propTweenPool.acquire(),F=Z&&!j;switch(B.type){case"color":{let L=F?B.endColor:B.startColor,A=F?B.startColor:B.endColor;I.initColor(K,W,L,A);break}case"filter":{let L=F?B.endFilters:B.startFilters,A=F?B.startFilters:B.endFilters;I.initFilter(K,W,L,A);break}case"clipPath":{let L=F?B.endClipPath:B.startClipPath,A=F?B.startClipPath:B.endClipPath;I.initClipPath(K,W,L,A);break}case"scalar":{let L=F?B.endValue:B.startValue,A=F?B.startValue:B.endValue;I.init(K,W,L,A,B.unit);break}case"drawSVG":{let L=F?B.endDraw:B.startDraw,A=F?B.startDraw:B.endDraw;I.initDrawSVG(K,W,L,A,B.length);break}case"path":{let L=F?B.endProgress:B.startProgress,A=F?B.startProgress:B.endProgress;I.initPath(K,W,B.pathData,B.pathLength,L,A,B.rotate,B.alignOffset,B.pathOffset);break}}J.addPropTween(I)}}}registerAnimation(J){let $=this.nextAnimationId++,Q=this.animations.length;return this.animations.push(J),this.animationIdToIndex.set($,Q),this.totalCreated++,J.setUnregisterCallback(()=>this.unregisterAnimation($)),J.setActivationCallback(()=>this._ensureTickerSubscription()),$}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),this._releaseTickerIfIdle()}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(),this._releaseTickerIfIdle()}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 x(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),this._releaseTickerIfIdle()}killAllTimelines(){for(let J of this.timelines.values())J.kill();this.timelines.clear(),this._releaseTickerIfIdle()}killEverything(){this.killAllTimelines(),this.killAll(),N6()}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 t6(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],H=Z[2].match(/[-+]?\d*\.?\d+(?:e[-+]?\d+)?[a-z%]*/gi)||[];switch(G){case"perspective":{if(!("perspective"in J))j.perspective=H[0]||"0px",q=!0;break}case"translate":{if(H[0]&&!("x"in J))j.x=H[0],q=!0;if(H[1]&&!("y"in J))j.y=H[1],q=!0;break}case"translate3d":{if(H[0]&&!("x"in J))j.x=H[0],q=!0;if(H[1]&&!("y"in J))j.y=H[1],q=!0;if(H[2]&&!("z"in J))j.z=H[2],q=!0;break}case"translateX":{if(H[0]&&!("x"in J))j.x=H[0],q=!0;break}case"translateY":{if(H[0]&&!("y"in J))j.y=H[0],q=!0;break}case"translateZ":{if(H[0]&&!("z"in J))j.z=H[0],q=!0;break}case"rotate":{if(H[0]&&!("rotate"in J))j.rotate=H[0],q=!0;break}case"rotateX":{if(H[0]&&!("rotateX"in J))j.rotateX=H[0],q=!0;break}case"rotateY":{if(H[0]&&!("rotateY"in J))j.rotateY=H[0],q=!0;break}case"rotateZ":{if(H[0]&&!("rotateZ"in J))j.rotateZ=H[0],q=!0;break}case"scale":{if(H[0]&&!("scale"in J))j.scale=parseFloat(H[0]),q=!0;break}case"scaleX":{if(H[0]&&!("scaleX"in J))j.scaleX=parseFloat(H[0]),q=!0;break}case"scaleY":{if(H[0]&&!("scaleY"in J))j.scaleY=parseFloat(H[0]),q=!0;break}case"scaleZ":{if(H[0]&&!("scaleZ"in J))j.scaleZ=parseFloat(H[0]),q=!0;break}case"skew":{if(H[0]&&!("skewX"in J))j.skewX=H[0],q=!0;if(H[1]&&!("skewY"in J))j.skewY=H[1],q=!0;break}case"skewX":{if(H[0]&&!("skewX"in J))j.skewX=H[0],q=!0;break}case"skewY":{if(H[0]&&!("skewY"in J))j.skewY=H[0],q=!0;break}default:break}}if(!q)return J;let z={...j};for(let[G,N]of Object.entries(J)){if(G==="transform")continue;z[G]=N}return z}function e6(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 EJ{_fn;_timelineNames=new Set;_reverted=!1;constructor(J){this._fn=J,this._execute()}revert(){if(this._reverted)return;let J=V.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 $=V.getInstance();$.startCapture(this._timelineNames);try{(J||this._fn)()}finally{$.stopCapture()}}}function P9(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 v9(J,$,Q){if(Q===void 0)return(Z)=>Math.min($,Math.max(J,Z));return Math.min($,Math.max(J,Q))}function y9(J,$,Q){let Z=J+Math.random()*($-J);if(Q&&Q>0)return Math.round(Z/Q)*Q;return Z}function T9(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 N=Math.abs(Z-j[G]);if(N<z)z=N,q=j[G]}return q};if($===void 0)return Q;return Q($)}function h9(J,$,Q){return J+($-J)*Q}function f9(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 u9(J,$,Q){let Z=(j)=>(j-J)/($-J);if(Q===void 0)return Z;return Z(Q)}function d9(J,$,Q){let Z=$-J,j=(q)=>{return((q-J)%Z+Z)%Z+J};if(Q===void 0)return j;return j(Q)}var rJ={toArray:P9,clamp:v9,random:y9,snap:T9,interpolate:h9,mapRange:f9,normalize:u9,wrap:d9};function n(J,$,Q){let j=V.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){V.getInstance();let $=$J(J),Q=[];for(let Z of $)if(Z instanceof Element)Q.push(Z);if(Q.length>0)V.getInstance().killAnimationsForTargets(Q);for(let Z of $){if(!(Z instanceof Element))continue;if(O.textSplitter?.isSplit?.(Z))O.textSplitter?.revert?.(Z);S(Z),O.styleReset?.clearAnimationStylesAndUnregister?.(Z),O.styleReset?.clearPinStylesAndUnregister?.(Z)}};n.set=function(J,$){V.getInstance();let Q=new x;Q._addEntry(J,{to:$,duration:0}),Q.kill(!1)};n.get=function(J){let $=V.getInstance();return $.hasTimeline(J)?$.getTimeline(J):void 0};n.has=function(J){return V.getInstance().hasTimeline(J)};n.getNames=function(){return V.getInstance().getTimelineNames()};n.kill=function(J){let $=V.getInstance();if($.hasTimeline(J))$.getTimeline(J).kill()};n.killAll=function(){V.getInstance().killEverything()};n.refreshScrollTriggers=function(){O.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 EJ(J)};n.utils=rJ;var m9=n;var c9={};export{c9 as Types,x as Timeline,rJ as MotionUtils,EJ as MotionContext,m9 as Motion};
|
|
31
|
+
`,F.appendChild(A),F},Y=X("scroller-start",Q,"right"),K=X("scroller-end",Z,"right"),_=X("start",Q,"left"),W=X("end",Z,"left");if(!this._triggerElement)_.style.display="none",W.style.display="none";if(this._markerContainer.appendChild(Y),this._markerContainer.appendChild(K),this._markerContainer.appendChild(_),this._markerContainer.appendChild(W),this._markers={scrollerStart:Y,scrollerEnd:K,elementStart:_,elementEnd:W},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=N,this._scrollerEndOffset=H,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}}var l0=new Map;function T7(J){if(typeof window<"u"&&J===window)return window.scrollY||window.pageYOffset||0;if(typeof Element<"u"&&J instanceof Element)return J.scrollTop;return 0}function I6(J,$){let Q=l0.get(J);if(!Q){let Z=()=>{let j=l0.get(J);if(!j||j.callbacks.size===0)return;let q=T7(J);g0(()=>{for(let z of j.callbacks)z(q)})};Q={callbacks:new Set,listener:Z},l0.set(J,Q),J.addEventListener("scroll",Z,{passive:!0})}Q.callbacks.add($)}function F6(J,$){let Q=l0.get(J);if(!Q)return;if(Q.callbacks.delete($),Q.callbacks.size===0)J.removeEventListener("scroll",Q.listener),l0.delete(J)}class G0 extends c{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=G0._nextId++,this._scrubLag=typeof $.scrub==="number"?$.scrub:0}static _ensureLoadListener(){if(G0._loadListenerAdded||typeof window>"u")return;if(G0._loadListenerAdded=!0,document.readyState==="complete")return;window.addEventListener("load",()=>{setTimeout(()=>{for(let J of G0._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(" "),N=G[0]||"top",H=G[1]||"top",X=d(N,j.height,Q),Y=d(H,Q,Q);this._triggerStart=q+X-Y;let K=this._defaultEnd();if(K.startsWith("+=")){let _=d(K.slice(2),Q,Q);this._triggerEnd=this._triggerStart+_}else{let _=K.split(" "),W=_[0]||"bottom",U=_[1]||"top",B=d(W,j.height,Q),I=d(U,Q,Q);this._triggerEnd=q+B-I}if(this._triggerEnd<=this._triggerStart)this._triggerEnd=this._triggerStart+Math.max(Q,100)}_onEnable(){this._resolveScroller();let J=this._resolvePinElement();this._calculateTriggerPositions(J),G0._activeInstances.add(this),G0._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),N=d(j[1]||"top",q,q)-z;this._pinManager=h.getOrCreate(this._id,J),this._pinManager.setup(J,this._triggerStart,this._triggerEnd,N,this._scroller===window,this._config.pinSpacing)}if(this._config.markers&&typeof document<"u"){let Z=this._pinManager?.getElement()||this._resolveTriggerElement();this._markerManager=new cJ(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=(Z)=>this._onScroll(Z),this._scroller){if(I6(this._scroller,this._scrollListener),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)F6(this._scroller,this._scrollListener),this._scrollListener=void 0;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(),G0._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),N=d(Z[1]||"top",j,j)-z;this._pinManager.setup(J,this._triggerStart,this._triggerEnd,N,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(J=this._getScrollTop()){if(!this._enabled)return;let $=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,g0(()=>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;g0(()=>{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,G0._SCRUB_TICKER_PRIORITY)}_stopSmoothScrollLoop(){if(this._scrubTickListener)T.getInstance().remove(this._scrubTickListener),this._scrubTickListener=null}}D.registerTrigger("scroll",G0);class L6{_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(L6);class A6 extends c{_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;_pointerMoveHandler=null;_activeTarget=null;_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;if(this._frozenRects.clear(),this._activeTarget=null,this._pointerMoveHandler)H0(this._pointerMoveHandler),this._pointerMoveHandler=null;this._cleanupListenerMap(this._listeners)}_addViewportListeners(){if(typeof window>"u")return;this._pointerMoveHandler=(J)=>{this._handleViewportMouseMove(J.clientX,J.clientY)},J0(this._pointerMoveHandler),this._state.isInside=!0}refresh(){for(let J of this._targets)this._frozenRects.set(J,o(J))}_addTargetListeners(){for(let J of this._targets)this._frozenRects.set(J,o(J));if(typeof window<"u"&&typeof window.requestAnimationFrame==="function"){this._pointerMoveHandler=(J)=>{this._handleTargetPointerMove(J.clientX,J.clientY)},J0(this._pointerMoveHandler);return}this._targets.forEach((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,$)})}_handleTargetPointerMove(J,$){let Q=this._findTargetAtPoint(J,$);if(!Q){if(this._state.isInside)this._state.isInside=!1,this._activeTarget=null,this._handleMouseLeave();return}this._state.isInside=!0,this._activeTarget=Q,this._handleTargetMouseMove(Q,J,$)}_findTargetAtPoint(J,$){for(let Q of this._targets){let Z=this._frozenRects.get(Q);if(!Z)continue;if(J>=Z.left&&J<=Z.right&&$>=Z.top&&$<=Z.bottom)return Q}return null}_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,N=Math.sqrt(z*z+G*G),H=Math.sqrt(j*j+q*q);this._targetState.targetDistance=1-Math.min(N/H,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,N=Math.sqrt(z*z+G*G),H=Math.sqrt(Math.pow(Z.width/2,2)+Math.pow(Z.height/2,2));this._targetState.targetDistance=1-Math.min(N/H,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,N=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||!N)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",A6);class s0 extends c{_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,!s0._sequenceStates.has(this._siblings))s0._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)H0(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._fireEventImmediate("Hover");else if(!Z&&this._gestureHoverActive)this._gestureHoverActive=!1,this._fireEventImmediate("HoverEnd")},J0(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()}_fireEventImmediate(J){let $=this._config.events[J];if($)this._executeAction($,J)}_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 $=s0._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",s0);var HJ=null,YJ=null;function M6(J,$,Q,Z){let j=J;if(!j.style)return;let q=k0();if(y($))if(b(J,$,Q,Z),q)Q0(J);else j.style.transform=C(J);else{let z=Z?`${Q}${Z}`:`${Q}`;if(q)x0(J,$,z);else try{if(q0($))j.style.setProperty($,z);else if($ in j.style)j.style[$]=z;else j.style.setProperty(s($),z)}catch{}}}function D6(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(k0())x0(J,$,G);else try{if(q0($))z.style.setProperty($,G);else if($ in z.style)z.style[$]=G;else z.style.setProperty(s($),G)}catch{}}function R6(J,$,Q,Z){let j=J;if(!j.style)return;if(HJ||(HJ=O.filter)){let q=HJ.interpolateFilters($,Q,Z),z=HJ.filterToString(q);if(k0())x0(J,"filter",z);else j.style.filter=z}}function k6(J,$,Q,Z,j){let q=J;if(!q.style)return;if(YJ||(YJ=O.clipPath)){let z=YJ.interpolateClipPaths(Q,Z,j),G=YJ.clipPathToString(z);if(k0())x0(J,"clip-path",G),x0(J,"-webkit-clip-path",G);else q.style.setProperty("clip-path",G),q.style.setProperty("-webkit-clip-path",G)}}function E6(J,$,Q){let{pathLUT:Z,alignOffset:j,pathOffset:q,pathRotate:z}=Q;if(!Z||Z.length===0)return;let G=$*(Z.length-1),N=Math.floor(G),H=Math.min(N+1,Z.length-1),X=G-N,Y=Z[N],K=Z[H],_=Y.x+(K.x-Y.x)*X,W=Y.y+(K.y-Y.y)*X,U=(q?.x??0)+_-(j?.x??0),B=(q?.y??0)+W-(j?.y??0);if(b(J,"x",U,"px"),b(J,"y",B,"px"),z){let I=h7(Y.angle,K.angle,X);b(J,"rotate",I,"deg")}if(k0())Q0(J);else J.style.transform=C(J)}function h7(J,$,Q){let Z=$-J;if(Z>180)Z-=360;if(Z<-180)Z+=360;return J+Z*Q}var pJ=null,f7=100,u7=500,d7=0.5,i0=[],m7=50;function c7(J){for(let $=0;$<i0.length;$++)if(i0[$].length>=J){let Q=i0.splice($,1)[0];return Q.length=J,Q}return Array(J)}function p7(J){if(i0.length<m7)i0.push(J)}class gJ{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,N){if(J instanceof Element)S(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=N,this._isElement=J instanceof Element;let H=Math.abs(q-j),X=Z*H,Y=Math.min(u7,Math.max(f7,Math.ceil(X*d7)));this.pathLUT=c7(Y+1);for(let K=0;K<=Y;K++){let _=K/Y,W=j+(q-j)*_;this.pathLUT[K]=yJ(Q,W,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)D6(this.target,this.property,$,Q,Z,j)}else if(this.valueType==="filter"&&this.startFilters&&this.endFilters){if(this._isElement)R6(this.target,this.startFilters,this.endFilters,J)}else if(this.valueType==="clipPath"&&this.startClipPath&&this.endClipPath){if(this._isElement)k6(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(pJ||(pJ=O.drawSVG))pJ.applyDrawSVG(this.target,$,Q,this.pathLength)}}else if(this.valueType==="path"&&this.pathLUT&&this.pathLUT.length>0){if(this._isElement)E6(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)M6(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)p7(this.pathLUT);this.pathLUT=null,this._isElement=!1}}class n0{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 a0=new n0(()=>new gJ,500),W0={acquire:()=>a0.acquire(),release:(J)=>a0.release(J),getPoolSize:()=>a0.getPoolSize(),getTotalCreated:()=>a0.getTotalCreated(),clear:()=>a0.clear()};var b6={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=$J(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)S(J),O.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(!O.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 N=[];for(let X of this._targets){if(!(X instanceof Element))continue;let Y=f._createAnimationCallback([X],{},this._duration,this._delay,this._ease,!1,void 0,G);if(Array.isArray(Y))N.push(...Y);else N.push(Y)}let H=this._fitConfig;for(let X of N)for(let Y of X.getTargets())if(Y instanceof Element)O.fit.registerPendingSetup(X,Y,H,W0);this._animation=N[0]??null,this._animations=N,this._expectedAnimationIds=N.map((X)=>X.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 b6)J[G]=b6[G];else if(B0(G))J[G]="";else if(t(G))J[G]="";else{let N=Q[G];if(N===void 0||N===null)continue;let X=P(N).unit||l(G),Y;for(let _ of this._targets)if(_ instanceof Element){if(q0(G))try{let U=window.getComputedStyle(_).getPropertyValue(G).trim();if(U)Y=P(U).value}catch{}else Y=zJ(_,G,X);break}let K=Y??0;J[G]=X?`${K}${X}`:`${K}`}}else if(this._fromVars)J={...this._fromVars},$=!0;else if(this._toVars)J={...this._toVars};if(this._splitType&&O.textSplitter?.split){let G={mask:!!this._mask,consumer:this},N=[];for(let H of this._originalTargets)if(H instanceof Element){let X=O.textSplitter?.split(H,this._splitType,G);N.push(...X)}if(N.length>0)this._targets=N}let Z,j;if(this._flapConfig&&O.textFlapper?.prepare&&f._createAnimationCallback){if(Q&&Object.keys(Q).length>0){let N=[];for(let H of Object.keys(Q)){let X=Q[H],Y=J[H];if(X===void 0||Y===void 0)continue;if(B0(H)||t(H)||q0(H))continue;if(H==="drawSVG"||H==="path"||H==="clip-path"||H==="clipPath")continue;let K=P(X),_=P(Y),W=K.unit||_.unit||l(H);N.push({prop:H,from:K.value,to:_.value,unit:W,isTransform:y(H)})}if(N.length>0)j=N}let G=this._targets.filter((N)=>N instanceof HTMLElement);if(G.length>0){let N=this._repeat!==void 0&&this._repeat!==0,H=O.textFlapper.prepare(G,this._flapConfig,N,j),X=this._stagger&&O.stagger?O.stagger.resolve(G,this._stagger):void 0;Z=[];let Y=0;for(let K=0;K<G.length;K++){let _=G[K].textContent??"";if(_===""||_===" "||_===" "||_===`
|
|
32
|
+
`||_==="\t")continue;if(Y>=H.length)break;let U=H[Y],B=X?X[K]:0,I=f._createAnimationCallback([U.el],{},this._duration,B,this._ease??"power1.out",!1,void 0,{onUpdate:U.render,onComplete:U.finalize,repeat:N?Math.ceil(60/this._duration):0,_skipInitialRender:this._skipInitialFromRender||void 0}),F=Array.isArray(I)?I:[I];Z.push(...F),Y++}}}if(Z?.length&&this._flapConfig){let G=this._flapConfig.type??"flip",N=new Set(j?.map((K)=>K.prop)??[]),H=(K)=>{if(N.has(K))return!0;switch(G){case"fade":return K==="opacity";case"blur":return t(K);default:return!1}},X=[];for(let K of Object.keys(J))if(H(K))X.push(K),delete J[K];if(Q){for(let K of Object.keys(Q))if(H(K)&&!X.includes(K))X.push(K),delete Q[K]}let Y=X.filter((K)=>!N.has(K));if(Y.length>0)console.warn(`[Motion.page] Flap type '${G}' owns '${Y.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)S(G),O.styleReset?.clearAnimationStylesForProps?.(G,this._propsToAnimate)}if(O.styleReset?.registerAnimatedProps){for(let G of this._targets)if(G instanceof Element)O.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}),N=Array.isArray(G)?G:[G];this._animations=[...N,...this._animations],this._expectedAnimationIds=this._animations.map((H)=>H.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 XJ{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 x{static _eachCounter=0;static _registerWithEngine=null;static _activateEngine=null;static setEngineRegisterCallback(J){x._registerWithEngine=J}static setEngineActivationCallback(J){x._activateEngine=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}_notifyActivated(){x._activateEngine?.()}_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&&x._registerWithEngine)x._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)||TJ(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(B0(Z)||t(Z))q.set(Z,{removeInline:!0});else if(P0(Z))q.set(Z,{removeInline:!0});else{let G=Z.replace(/([A-Z])/g,"-$1").toLowerCase();if(z.style.getPropertyValue(G)!==""){let H=K6(j,Z);q.set(Z,{removeInline:!1,value:H.value,unit:H.unit})}else q.set(Z,{removeInline:!0})}}}Q=Q.next}}_restoreInitialValues(){for(let J of this._transformElements){let $=J;S(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(P0(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=XJ.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(),N={type:"animation",child:j,builder:J,startTime:z,duration:G};this._children.push(N),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 H=!!J.getConfig().fromVars;if(z>0&&!H)j.setLazyStartCapture(!0);if(H)j.renderAtTime(0);if(J.hasSplit()){for(let Y of J.getOriginalTargets())if(Y instanceof Element){let K=Y;if(!this._splitParentOverrides.has(K))this._splitParentOverrides.set(K,K.style.opacity);K.style.opacity="1"}}let X=z+G;if(X>Z)Z=X}if(this._previousStart=$,this._previousEnd=Z,Z>this._duration)this._duration=Z;return this}call(J,$,Q){let Z=XJ.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(b0(j))return j}let $=this.getFirstChildAnimation();if($){let Q=$.getTargets();for(let Z of Q)if(b0(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(b0(q)&&!$.has(q))$.add(q),J.push(q)}return J}_createInstanceForElement(J,$){let Z=`${this._name||"__each"}__each_${$}_${x._eachCounter++}`,j=new x(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)=>b0(K)).includes(J))continue;let N=z.builder.getConfig(),H=N.repeat!=null?{times:N.repeat,delay:N.repeatDelay,yoyo:N.yoyo}:void 0,X=z.builder.hasSplit(),Y=new f(J,{from:N.fromVars,to:N.toVars,set:N.setVars,duration:N.duration,delay:N.delay,ease:N.ease,repeat:H,...X&&N.split?{split:N.split}:{},...X&&N.mask?{mask:N.mask}:{},...X&&N.stagger!==void 0?{stagger:N.stagger}:{},...N.flap?{flap:N.flap}:{},...N.fit?{fit:N.fit}:{},onStart:N.onStart,onUpdate:N.onUpdate,onComplete:N.onComplete,onRepeat:N.onRepeat,onReverseComplete:N.onReverseComplete});if(N.axis)Y.setAxis(N.axis);j._addBuilder(Y,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_${$}_${x._eachCounter++}`,j=new x(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(),N=(z.builder.hasSplit()?z.builder.getOriginalTargets():z.builder.getTargets()).filter((_)=>b0(_)),H=J.filter((_)=>N.includes(_));if(H.length===0)continue;let X=G.repeat!=null?{times:G.repeat,delay:G.repeatDelay,yoyo:G.yoyo}:void 0,Y=z.builder.hasSplit(),K=new f(H,{from:G.fromVars,to:G.toVars,set:G.setVars,duration:G.duration,delay:G.delay,ease:G.ease,repeat:X,...Y&&G.split?{split:G.split}:{},...Y&&G.mask?{mask:G.mask}:{},...Y&&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)K.setAxis(G.axis);j._addBuilder(K,z.startTime)}else if(z.type==="callback")j.call(z.child,z.params,z.startTime);return j}_findScopedTargetsForContainer(J,$,Q){let Z=$.filter((q)=>J.contains(q));if(Z.length>0)return Z;let j=J.parentElement;if(j){let q=$.filter((z)=>z!==J&&j.contains(z)&&!Q.some((G)=>G!==J&&G.contains(z)));if(q.length>0)return q}return[]}_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)O.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((N,H)=>{let X=N>0&&N<1;if(X)Z=G;if(Z===G){if(j(N,H),!X)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=O.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(),N=new Set;for(let Y of z){let K=G.filter((W)=>Y.contains(W));if(K.length>0){for(let W of K)N.add(W);continue}let _=Y.parentElement;if(_){let W=G.filter((U)=>U!==Y&&_.contains(U)&&!z.some((B)=>B!==Y&&B.contains(U)));for(let U of W)N.add(U)}}if(!G.every((Y)=>N.has(Y))){let Y=new Set(this._children.filter((K)=>K.type==="animation"&&K.builder?.hasSplit()).map((K)=>K.builder));if(Y.size>0)for(let K of G)for(let _ of Y)O.textSplitter?.revert?.(K,_);this._setupEachModeGeneric(G,(K,_)=>{if(J==="scroll")Q.registerScroll(K,{...j,target:_});else if(J==="hover")Q.registerHover(K,{...j,target:_});else Q.registerClick(K,{...j,target:_})});return}let X=new Set(this._children.filter((Y)=>Y.type==="animation"&&Y.builder?.hasSplit()).map((Y)=>Y.builder));if(X.size>0)for(let Y of G)for(let K of X)O.textSplitter?.revert?.(Y,K);this._clearTransitionData(),this._eachInstances=[];for(let Y=0;Y<z.length;Y++){let K=z[Y],_=this._findScopedTargetsForContainer(K,G,z);if(_.length===0)continue;let W=this._createInstanceForElements(_,Y);if(J==="scroll")Q.registerScroll(W,{...j,target:K});else if(J==="hover")Q.registerHover(W,{...j,target:K});else Q.registerClick(W,{...j,target:K});this._eachInstances.push(W)}{let Y=null,K=this._onUpdate,_=this._onStart,W=this._onComplete;for(let U of this._eachInstances){if(K)U.onUpdate((B,I)=>{let F=B>0&&B<1;if(F)Y=U;if(Y===U){if(K(B,I),!F)Y=null}});if(_)U.onStart(()=>{Y=U,_()});if(W)U.onComplete(()=>{if(Y===U)Y=null,W()})}}this._eachDuration=this._duration;for(let Y of this._children)if(Y.type==="animation"){let K=Y.child;K.setTimelineChild(!1),K.kill()}else if(Y.type==="timeline")Y.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 O.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 O.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 O.triggerManager?.getInstance?.().registerScroll(this,{...J,target:$}),this}onMouseMove(J){if(J?.each&&J.target)return this._setupMouseMoveEachMode(J),this;return O.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=O.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 O.triggerManager?.getInstance?.().registerPageLoad(this,J||{}),this}onPageExit(J){return O.triggerManager?.getInstance?.().registerPageExit(this,J||{}),this}onGesture(J){if(J.each)return this._setupGestureEachMode(J),this;return O.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=O.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 O.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,N=J.params||[];G(...N)}}_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._notifyActivated(),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._notifyActivated(),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._notifyActivated(),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,O.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)O.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 _J(J,$,Q){let Z=J;if(y($)){let z=Q??($.startsWith("scale")?"":"px");return(G)=>{b(J,$,G,z),Z.style.transform=C(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 g7=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 o7(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 v0 extends c{_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;_pointerMoveTarget=null;_hoverSelectors=null;_isHoveringCursorTarget=!1;_boundHoverTargetMoveHandler=null;_hoverPointerMoveTarget=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),b(this._innerElement,"x",-50,"%"),b(this._innerElement,"y",-50,"%"),this._xSetter=_J(this._element,"x","px"),this._ySetter=_J(this._element,"y","px"),this._config.squeeze)this._squeezeSetter=_J(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=C(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=v0._expandTransformShorthand(String(Q));for(let[j,q]of Object.entries(Z))b(this._innerElement,j,q)}else if(y($)){let Z=typeof Q==="number"?{value:Q,unit:l($)}:P(Q);b(this._innerElement,$,Z.value,Z.unit||l($)||void 0)}else{let Z=s($),j=typeof Q==="number"&&!g7.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 x;Q._addEntry(this._innerElement,{to:v0._expandStateProperties(J.properties),duration:J.duration,ease:J.ease}),this._stateTimelines.set("hover",Q)}let $=this._parsedStates.get("click");if($&&$.enabled){let Q=new x;Q._addEntry(this._innerElement,{to:v0._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=v0._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},this._pointerMoveTarget=typeof document<"u"?document:typeof window<"u"?window:null,J0(this._boundMouseMove,this._pointerMoveTarget),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")}},this._hoverPointerMoveTarget=typeof window<"u"?window:null,J0(this._boundHoverTargetMoveHandler,this._hoverPointerMoveTarget)}_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,N=G.getAttribute("mp-cursor-text")??G.getAttribute("mp-cursor-tooltip")??"";if(this._textElement)this._textElement.textContent=N,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||!o7(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)H0(this._boundMouseMove,this._pointerMoveTarget),this._boundMouseMove=void 0,this._pointerMoveTarget=null;if(this._boundMouseDown)document.removeEventListener("mousedown",this._boundMouseDown);if(this._boundMouseUp)document.removeEventListener("mouseup",this._boundMouseUp);if(this._boundHoverTargetMoveHandler)H0(this._boundHoverTargetMoveHandler,this._hoverPointerMoveTarget),this._boundHoverTargetMoveHandler=null,this._hoverPointerMoveTarget=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",v0);class V6 extends c{_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",V6);var oJ=null;function l7(){if(!oJ&&typeof document<"u"){let J=document.createElement("canvas");J.width=1,J.height=1,oJ=J.getContext("2d")}return oJ}function w6(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 s7(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 i7(J,$,Q){J=J/360,$=$/100,Q=Q/100;let Z,j,q;if($===0)Z=j=q=Q;else{let z=(H,X,Y)=>{if(Y<0)Y+=1;if(Y>1)Y-=1;if(Y<0.16666666666666666)return H+(X-H)*6*Y;if(Y<0.5)return X;if(Y<0.6666666666666666)return H+(X-H)*(0.6666666666666666-Y)*6;return H},G=Q<0.5?Q*(1+$):Q+$-Q*$,N=2*Q-G;Z=z(N,G,J+0.3333333333333333),j=z(N,G,J),q=z(N,G,J-0.3333333333333333)}return[Math.round(Z*255),Math.round(j*255),Math.round(q*255)]}function n7(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,N]=i7(Q,Z,j);return new Float32Array([z,G,N,q])}function a7(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 KJ(j,$);let q=Q[2]?.trim();if(q)return KJ(q,$);return null}function r7(J){let $=l7();if(!$)return null;$.fillStyle="#000000",$.fillStyle=J;let Q=$.fillStyle;if(Q==="#000000"&&J.toLowerCase()!=="black"&&J!=="#000000"&&J!=="#000")return null;return w6(Q)}function KJ(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 w6(Q);if(Q.startsWith("rgb"))return s7(Q);if(Q.startsWith("hsl"))return n7(Q);if(Q.startsWith("var("))return a7(Q,$);return r7(Q)}function t7(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 KJ(j,J)||new Float32Array([0,0,0,1])}O.color={parseColor:KJ,getCurrentColor:t7};var C6={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 e7(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 x6(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=e7(j[0]);if(q)Q.push(q)}return Q.length>0?Q:null}function J9(J){let $=C6[J.name];if(!$)return!1;return J.value===$.value}function $9(J){if(!J||J.length===0)return"none";if(J.every(J9))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 Q9(J){if(typeof window>"u")return[];let $=window.getComputedStyle(J),Q=$.filter||$.getPropertyValue("filter");if(!Q||Q==="none")return[];return x6(Q)||[]}function Z9(J){let $=C6[J];if($)return{name:J,value:$.value,unit:$.unit};return{name:J,value:0,unit:""}}function j9(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((H)=>H.name===q),G=$.find((H)=>H.name===q),N=Z9(q);Z.push(z||N),j.push(G||N)}return{start:Z,end:j}}var y0=[];function q9(J,$,Q){let Z=J.length;if(y0.length<Z)for(let j=y0.length;j<Z;j++)y0.push({name:"",value:0,unit:""});for(let j=0;j<Z;j++){let q=J[j],z=$[j],G=y0[j];G.name=q.name,G.value=q.value+(z.value-q.value)*Q,G.unit=q.unit||z.unit}return y0.length=Z,y0}O.filter={parseFilter:x6,getCurrentFilter:Q9,mergeFilterArrays:j9,interpolateFilters:q9,filterToString:$9};var S6=new WeakMap;function G9(J){return"getTotalLength"in J&&typeof J.getTotalLength==="function"}function BJ(J){let $=S6.get(J);if($!==void 0)return $;if(G9(J)){let Q=J.getTotalLength();return S6.set(J,Q),Q}return 0}function z9(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]),N=Z[4]||"%",H=$?BJ($):0,X=lJ(q,z,H),Y=lJ(G,N,H);return{start:X,end:Y}}let j=Q.match(/^([-\d.]+)(px|%)?$/);if(j){let q=parseFloat(j[1]),z=j[2]||"%",G=$?BJ($):0;return{start:0,end:lJ(q,z,G)}}}return null}function lJ(J,$,Q){if($==="px"&&Q>0)return J/Q;return J/100}function N9(J){let $=BJ(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],N=-z/$,H=(-z+G)/$;return{start:N,end:H}}}}catch{}return{start:0,end:1}}function H9(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}`}O.drawSVG={parseDrawSVG:z9,getCurrentDrawSVG:N9,getPathLength:BJ,applyDrawSVG:H9};var P6=/(-?\d*\.?\d+)([a-z%]*)/gi;function v6(J){P6.lastIndex=0;let $=P6.exec(J);if(!$)return null;let Q=parseFloat($[1]);if(!isFinite(Q))return null;return{value:Q,unit:$[2]||""}}function U0(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 y6(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 Y9(j);case"ellipse":return X9(j);case"inset":return _9(j);case"polygon":return K9(j);case"rect":return B9(j);case"xywh":return W9(j);default:return null}}function Y9(J){let[$,Q]=T6(J),Z=v6($)??{value:50,unit:"%"},[j,q]=h6(Q);return{shape:"circle",components:[Z,j,q]}}function X9(J){let[$,Q]=T6(J),Z=U0($),j=Z[0]??{value:50,unit:"%"},q=Z[1]??j,[z,G]=h6(Q);return{shape:"ellipse",components:[j,q,z,G]}}function _9(J){let{mainPart:$,roundPart:Q}=sJ(J),Z=U0($),j=Z[0]??{value:0,unit:"px"},q=Z[1]??j,z=Z[2]??j,G=Z[3]??q,N=[j,q,z,G];if(Q!==null){let H=U0(Q);if(H.length===0)N.push({value:0,unit:"px"});else for(let X of H)N.push(X)}return{shape:"inset",components:N,extras:Q!==null?{hasRound:!0}:void 0}}function K9(J){let $=[],Z=J.replace(/^(nonzero|evenodd)\s*,\s*/i,"").split(",");for(let j of Z){let q=U0(j);if(q.length>=2)$.push(q[0],q[1])}return{shape:"polygon",components:$}}function B9(J){let{mainPart:$,roundPart:Q}=sJ(J),Z=U0($),j=Z[0]??{value:0,unit:"px"},q=Z[1]??j,z=Z[2]??j,G=Z[3]??q,N=[j,q,z,G];if(Q!==null){let H=U0(Q);if(H.length===0)N.push({value:0,unit:"px"});else for(let X of H)N.push(X)}return{shape:"rect",components:N,extras:Q!==null?{hasRound:!0}:void 0}}function W9(J){let{mainPart:$,roundPart:Q}=sJ(J),Z=U0($),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"},N=[j,q,z,G];if(Q!==null){let H=U0(Q);if(H.length===0)N.push({value:0,unit:"px"});else for(let X of H)N.push(X)}return{shape:"xywh",components:N,extras:Q!==null?{hasRound:!0}:void 0}}function T6(J){let $=J.toLowerCase().search(/\bat\b/);if($===-1)return[J.trim(),""];return[J.slice(0,$).trim(),J.slice($+2).trim()]}function sJ(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 h6(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=v6(z);if(G){Z.push(G);continue}let N=z.toLowerCase();if(N==="center")Z.push({value:50,unit:"%"});else if(N==="left"||N==="top")Z.push({value:0,unit:"%"});else if(N==="right"||N==="bottom")Z.push({value:100,unit:"%"})}let j=Z[0]??$[0],q=Z[1]??$[1];return[j,q]}function U9(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 y6(Q)}catch{return null}}function f6(J,$){if(J.shape!==$.shape)return!1;if(J.components.length!==$.components.length)return!1;return!0}var T0=[];function O9(J,$,Q){if(!f6(J,$))return Q>=0.5?$:J;let Z=J.components.length;if(T0.length<Z)for(let j=T0.length;j<Z;j++)T0.push({value:0,unit:""});T0.length=Z;for(let j=0;j<Z;j++){let q=J.components[j],z=$.components[j],G=T0[j];G.value=q.value+(z.value-q.value)*Q,G.unit=z.unit||q.unit}return{shape:$.shape,components:T0,extras:$.extras??J.extras}}function E(J){return`${Math.round(J.value*1e4)/1e4}${J.unit}`}function I9(J){let $=J.components;switch(J.shape){case"circle":return`circle(${E($[0])} at ${E($[1])} ${E($[2])})`;case"ellipse":return`ellipse(${E($[0])} ${E($[1])} at ${E($[2])} ${E($[3])})`;case"inset":{let Q=`${E($[0])} ${E($[1])} ${E($[2])} ${E($[3])}`;if(J.extras?.hasRound&&$.length>4){let Z=$.slice(4).map(E).join(" ");return`inset(${Q} round ${Z})`}return`inset(${Q})`}case"polygon":{let Q=[];for(let Z=0;Z<$.length;Z+=2)Q.push(`${E($[Z])} ${E($[Z+1])}`);return`polygon(${Q.join(", ")})`}case"rect":{let Q=`${E($[0])} ${E($[1])} ${E($[2])} ${E($[3])}`;if(J.extras?.hasRound&&$.length>4){let Z=$.slice(4).map(E).join(" ");return`rect(${Q} round ${Z})`}return`rect(${Q})`}case"xywh":{let Q=`${E($[0])} ${E($[1])} ${E($[2])} ${E($[3])}`;if(J.extras?.hasRound&&$.length>4){let Z=$.slice(4).map(E).join(" ");return`xywh(${Q} round ${Z})`}return`xywh(${Q})`}}}O.clipPath={parseClipPath:y6,getCurrentClipPath:U9,interpolateClipPaths:O9,clipPathToString:I9,canInterpolate:f6};var h0=new WeakMap;class WJ{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 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"),h0.delete(J)}let q=J.innerHTML,z={chars:[],words:[],lines:[],elements:[]},G=$.split(",").map((Y)=>Y.trim()),N=G.includes("chars"),H=G.includes("words"),X=G.includes("lines");if(X)this._splitWithLinesDom(J,H,N,z);else if(H&&N)this._splitWordsWithCharsDom(J,z);else if(H)this._splitWordsDom(J,z);else if(N)this._splitCharsDom(J,z);if(N)z.elements=z.chars;else if(H)z.elements=z.words;else if(X)z.elements=z.lines;if(Q?.mask&&z.elements.length>0)this._applyMaskWrappers(z);return this._propagateGradientText(J,z),h0.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"),N=z.includes("words"),H=z.includes("lines"),X=q.includes("chars"),Y=q.includes("words"),K=q.includes("lines");if((!G||X)&&(!N||Y)&&(!H||K))return this._getSpansForType($.result,Q);if(H||K)return null;if(Y&&!X&&G){let _=[];for(let U of $.result.words)this._nestCharsInElement(U,_);$.result.chars=_,$.result.elements=_;let W=this._buildTypeString(q,z);if(J.setAttribute("data-split",W),Z?.mask)this._applyMaskWrappers($.result);return this._propagateGradientText(J,$.result),G?_:$.result.words.slice()}if(X&&!Y&&N){let _=Array.from(J.querySelectorAll("[data-split-word-wrap]")),W=[];for(let B=0;B<_.length;B++){let I=_[B];I.removeAttribute("data-split-word-wrap"),I.setAttribute("data-split-word",""),I.setAttribute("data-word-index",String(B)),W.push(I)}$.result.words=W;let U=this._buildTypeString(q,z);return J.setAttribute("data-split",U),G?$.result.chars.slice():W}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 N of z)if(/\s/.test(N))G.appendChild(document.createTextNode(N));else{let H=document.createElement("span");H.setAttribute("data-split-char",""),H.setAttribute("data-char-index",String($.length)),H.style.display="inline-block",H.textContent=N,$.push(H),G.appendChild(H)}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 N of q)if(/^\s+$/.test(N))z.appendChild(document.createTextNode(N.replace(/\n/g," "))),G=!0;else if(N){let H=document.createElement("span");H.setAttribute("data-split-word",""),H.setAttribute("data-word-index",String($.words.length)),H.style.display="inline-block",H.textContent=N,$.words.push(H),z.appendChild(H),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 N=document.createElement("span");N.setAttribute("data-split-word-wrap",""),N.style.display="inline-block",N.style.whiteSpace="nowrap";for(let H of G){let X=document.createElement("span");X.setAttribute("data-split-char",""),X.setAttribute("data-char-index",String($.chars.length)),X.style.display="inline-block",X.textContent=H,$.chars.push(X),N.appendChild(X)}z.appendChild(N)}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 N=document.createElement("span");N.setAttribute("data-split-word",""),N.setAttribute("data-word-index",String($.words.length)),N.style.display="inline-block",N.style.whiteSpace="nowrap";for(let H of G){let X=document.createElement("span");X.setAttribute("data-split-char",""),X.setAttribute("data-char-index",String($.chars.length)),X.style.display="inline-block",X.textContent=H,$.chars.push(X),N.appendChild(X)}$.words.push(N),z.appendChild(N)}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 W=_.getBoundingClientRect();if(W.top>G+2){if(z.length>0)q.push(z);z=[_],G=W.top}else z.push(_)}if(z.length>0)q.push(z);let N=new Map;for(let _ of j.words)N.set(_,this._getWrapperChain(_,J));let H="",X=0,Y=0,K=0;for(let _ of q){let W="",U=[];for(let B=0;B<_.length;B++){let I=_[B],F=I.textContent||"",A=N.get(I)||[],L=0;while(L<U.length&&L<A.length&&U[L]===A[L])L++;for(let k=U.length-1;k>=L;k--)W+=`</${U[k].tagName.toLowerCase()}>`;if(B>0)W+=" ";for(let k=L;k<A.length;k++)W+=this._openTag(A[k]);if(Q){let k="";for(let F0 of F)k+=`<span data-split-char data-char-index="${K}" style="display:inline-block">${this._escapeHtml(F0)}</span>`,K++;if($)W+=`<span data-split-word data-word-index="${Y}" style="display:inline-block;white-space:nowrap">${k}</span>`;else W+=k}else if($)W+=`<span data-split-word data-word-index="${Y}" style="display:inline-block">${this._escapeHtml(F)}</span>`;else W+=this._escapeHtml(F);Y++,U=A}for(let B=U.length-1;B>=0;B--)W+=`</${U[B].tagName.toLowerCase()}>`;H+=`<span data-split-line data-line-index="${X}" style="display:block">${W}</span>`,X++}if(J.innerHTML=H,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=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,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}}O.textSplitter={split:(J,$,Q)=>WJ.split(J,$,Q),revert:(J,$)=>WJ.revert(J,$),isSplit:WJ.isSplit};var iJ={alphanumeric:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",alpha:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",numeric:"0123456789",hex:"0123456789ABCDEF",binary:"01",katakana:"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲン",symbols:"!@#$%^&*+-=<>?/|~",blocks:"░▒▓█▄▀■□▪▫"},nJ=80,d6=400,F9=[2,5],UJ=new WeakMap,f0=new WeakMap,OJ=new WeakMap;function m6(J){let $=J.parentElement;while($&&typeof $.hasAttribute==="function"&&$.hasAttribute("data-split-word-wrap"))$=$.parentElement;return $}function L9(J){if(!J)return iJ.alphanumeric;return Object.prototype.hasOwnProperty.call(iJ,J)?iJ[J]:J}function r0(J){return J[Math.floor(Math.random()*J.length)]}function u6(J){if(J===void 0){let[Z,j]=F9;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 X0(J){return J===""||J===" "||J===" "||J===`
|
|
33
|
+
`||J==="\t"}function A9(J){let $=J.textContent??"";if(!UJ.has(J))UJ.set(J,$);return $===" "?" ":$}function M9(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 H of $){if(z.has(H))continue;z.add(H);let X=document.createElement("span");X.style.display="inline-block",X.textContent=H,Z.appendChild(X),q.push({el:X,c:H})}Q.appendChild(Z);let G=0,N="";try{for(let{el:H,c:X}of q){let Y=H.getBoundingClientRect().width;if(Y>G)G=Y,N=X}}finally{Q.removeChild(Z)}return{width:G,char:N}}function D9(J,$,Q=d6,Z=!0,j="none",q=!1,z=""){let G=0,N=0,H="";if(j!=="none"&&$!=="board"){let X=null;for(let Y of J)if(!X0(Y.textContent??""))G=Math.max(G,Y.offsetWidth),X??=Y;if(X&&z){let Y=M9(X,z);if(N=Y.width,H=Y.char,N>G)G=N}G=Math.max(G,8)+4}if(j==="container"&&$!=="board"&&H){let X=new Map;for(let Y of J){let K=m6(Y);if(!K)continue;let _=X.get(K);if(!_)_=[],X.set(K,_);_.push(Y)}for(let[Y,K]of X){if(OJ.has(Y))continue;let _=Y.getBoundingClientRect().width,W=0;for(let B of K){if(X0(B.textContent??""))continue;let I=B.getBoundingClientRect().width;if(N>I)W+=N-I}let U=Math.ceil(_+W+2);OJ.set(Y,{display:Y.style.display,width:Y.style.width}),Y.style.display="inline-block",Y.style.width=`${U}px`}}if($==="flip"){let X=new Set;for(let Y of J){if(Y.style.display="inline-block",Y.style.backfaceVisibility="hidden",Y.style.verticalAlign="top",j==="cells"&&!X0(Y.textContent??""))Y.style.width=`${G}px`,Y.style.textAlign="center";if(Y.parentElement&&!X.has(Y.parentElement))X.add(Y.parentElement),Y.parentElement.style.height=`${Y.parentElement.offsetHeight}px`}}else if($==="slide")for(let X of J){if(X.style.display="inline-block",X.parentElement)X.parentElement.style.overflow="hidden";if(j==="cells"&&!X0(X.textContent??""))X.style.width=`${G}px`,X.style.textAlign="center"}else if($==="blur"||$==="scale"||$==="fade"||$==="none"){for(let X of J)if(X.style.display="inline-block",j==="cells"&&!X0(X.textContent??""))X.style.width=`${G}px`,X.style.textAlign="center"}else if($==="board"){let X=0;if(Z){for(let Y of J)if(!X0(Y.textContent??""))X=Math.max(X,Y.offsetWidth);X=Math.max(X,8)+4}for(let Y of J){let F=function(e){let r=document.createElement("span"),R=r.style;return R.display="block",R.position="absolute",R.left="0",R.width="100%",R.height="200%",R.fontSize=U.fontSize,R.fontFamily=U.fontFamily,R.fontWeight=U.fontWeight,R.color=U.color,R.lineHeight=`${I}px`,R.textAlign="center",R.setProperty("-webkit-text-fill-color",U.color),R.top=e,r},A=function(e){let r=document.createElement("div"),R=r.style;R.position="absolute",R.left="0",R.width="100%",R.height="50%",R.overflow="hidden",R.top=e?"50%":"0",R.zIndex="1";let _0=F(e?"-100%":"0");return r.appendChild(_0),[r,_0]},L=function(e="0"){let r=document.createElement("div"),R=r.style;R.position="absolute",R.left="0",R.top="0",R.width="100%",R.height="100%",R.overflow="hidden",R.backfaceVisibility="hidden";let _0=F(e);return r.appendChild(_0),[r,_0]};if(f0.has(Y))continue;let K=Y.textContent??"",_=X0(K);if(_&&!q)continue;let W=_?" ":K,U=window.getComputedStyle(Y),B=Z?X:Y.offsetWidth,I=Y.offsetHeight;Y.textContent="",Y.style.display="inline-block",Y.style.position="relative",Y.style.width=`${B}px`,Y.style.height=`${I}px`,Y.style.perspective=`${Q}px`;let[k,F0]=A(!1);F0.textContent=W;let[L0,m0]=A(!0);m0.textContent=W;let A0=document.createElement("div"),p=A0.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[E0,M0]=L();M0.textContent=W;let[z0,D0]=L("-100%");z0.style.transform="rotateX(180deg)",D0.textContent=W,A0.appendChild(E0),A0.appendChild(z0);let g=document.createElement("div"),N0=g.style;N0.position="absolute",N0.left="0",N0.width="100%",N0.height="1px",N0.top="calc(50% - 0.5px)",N0.zIndex="3",N0.pointerEvents="none";let c0=document.createElement("div"),a=c0.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%)",Y.appendChild(k),Y.appendChild(L0),Y.appendChild(A0),Y.appendChild(c0),Y.appendChild(g),g.style.background=Z?"rgba(0, 0, 0, 0.6)":"rgba(0, 0, 0, 0.15)",Y.style.marginRight=Z?"2px":"1px",Z){k.style.background="linear-gradient(180deg, #2a2a2e 0%, #1e1e22 100%)",k.style.borderRadius="4px 4px 0 0",L0.style.background="linear-gradient(180deg, #1e1e22 0%, #16161a 100%)",L0.style.borderRadius="0 0 4px 4px",E0.style.background="linear-gradient(180deg, #2a2a2e 0%, #1e1e22 100%)",E0.style.borderRadius="4px 4px 0 0",z0.style.background="linear-gradient(180deg, #1e1e22 0%, #16161a 100%)",z0.style.borderRadius="0 0 4px 4px";for(let _0 of[F0,m0,M0,D0])_0.style.color="#e8e8ec",_0.style.setProperty("-webkit-text-fill-color","#e8e8ec")}f0.set(Y,{staticTop:k,staticBottom:L0,flapWrap:A0,flapFront:E0,flapBack:z0,splitLine:g,shadow:c0,staticTopText:F0,staticBottomText:m0,flapFrontText:M0,flapBackText:D0})}}}function R9(J,$,Q,Z,j,q,z,G){let N=[];for(let X=0;X<Q;X++){let Y=!z&&X===Q-1?$:r0(Z);N.push(Y)}let H=-1;return(X)=>{let Y=Math.min(X,0.9999)*Q,K=Math.floor(Y),_=Y-K,W=_>=0.5,U=K*2+(W?1:0);if(j!=="board"&&U!==H){if(W)J.textContent=z?r0(Z):N[K]??$;else J.textContent=K===0?$:z?r0(Z):N[K-1]??$;H=U}switch(j){case"flip":{let B=_<0.5?-90*(_/0.5):90*(1-(_-0.5)/0.5);b(J,"perspective",q,"px"),b(J,"rotateX",B,"deg"),Q0(J);break}case"fade":{let B=_<0.5?1-_/0.5:(_-0.5)/0.5;J.style.opacity=String(B);break}case"slide":{let B=_<0.5?-100*(_/0.5):100*(1-(_-0.5)/0.5),I=_<0.5?1-_/0.5:(_-0.5)/0.5;b(J,"y",B,"%"),Q0(J),J.style.opacity=String(I);break}case"blur":{let B=_<0.5?8*(_/0.5):8*(1-(_-0.5)/0.5);J.style.filter=`blur(${B}px)`;break}case"scale":{let B=_<0.5?1-_/0.5:(_-0.5)/0.5;b(J,"scale",B),Q0(J);break}case"board":{let B=f0.get(J);if(!B)break;let I=K===0?$:z?r0(Z):N[K-1]??$,F=z?r0(Z):N[K]??$;B.staticTopText.textContent=F,B.flapFrontText.textContent=I,B.flapBackText.textContent=F,B.staticBottomText.textContent=I;let A=-180*_;B.flapWrap.style.transform=`rotateX(${A}deg)`;let L=Math.sin(_*Math.PI);B.shadow.style.opacity=String(L);break}default:break}if(G&&G.length>0){let B=!1;for(let I of G){let F=_<0.5?1-_/0.5:(_-0.5)/0.5,A=I.from+(I.to-I.from)*F;if(I.isTransform)b(J,I.prop,A,I.unit||void 0),B=!0;else J.style[I.prop]=I.unit?`${A}${I.unit}`:String(A)}if(B)Q0(J)}}}function k9(J,$,Q,Z){return()=>{if(Q==="board"){let j=f0.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")S(J,!0);else if(Q==="slide")S(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)b(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))Q0(J)}}}class t0{static prepare(J,$,Q=!1,Z){let j=$.type??"flip",q=L9($.charset),z=$.perspective??d6,G=$.styledBoard??!0,N=$.stableWidth??!1,H=N==="container"?"container":N==="cells"||N===!0?"cells":"none",X=$.preserveWhitespaceCells??!1,Y=[];for(let _ of J){let W=A9(_),U=_.textContent??"",B=X0(U),I=B&&X&&j==="board";if(B&&!I)continue;let F=I?" ":W;Y.push({el:_,target:F,isBlankCell:I})}D9(J,j,z,G,H,X,q);let K=[];for(let{el:_,target:W,isBlankCell:U}of Y)if(U)K.push({el:_,render:()=>{},finalize:()=>{}});else{let B=u6($.cycles);K.push({el:_,render:R9(_,W,B,q,j,z,Q,Z),finalize:k9(_,W,j,Z)})}if(K.length===0&&J.length>0){if(J.some((W)=>W.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=t0.prepare(J,$,Z);if(j.length===0)return{kill(){},finished:Promise.resolve(),isComplete:!0};let q=u6($.cycles),z=q*2*nJ+Math.max(0,q-1)*0.5*nJ,G=()=>{},N=new Promise((B)=>{G=B}),H=!1,X=0,Y=0,K=[],_=0;for(let B=0;B<J.length;B++){let I=J[B].textContent??"";if(X0(I))continue;K.push(Q?.[B]??_*nJ*2),_++}let W=performance.now();function U(){if(H)return;let B=performance.now(),I=!0;for(let F=0;F<j.length;F++){let A=j[F],L=B-W-K[F];if(L<0){I=!1;continue}if(Z){let k=L%z/z;A.render(k),I=!1}else{let k=Math.min(L/z,1);if(A.render(k),k>=1)A.finalize();else I=!1}}if(I&&!Z)X=j.length,G();else Y=requestAnimationFrame(U)}if(Y=requestAnimationFrame(U),Z)G();return{kill(){if(H)return;H=!0,cancelAnimationFrame(Y);for(let B of j)B.finalize();G()},get finished(){return N},get isComplete(){return H||X===j.length}}}static revert(J){for(let $ of J){let Q=f0.get($);if(Q)Q.staticTop.remove(),Q.staticBottom.remove(),Q.flapWrap.remove(),Q.splitLine.remove(),Q.shadow.remove(),f0.delete($),$.style.perspective="",$.style.position="",$.style.width="",$.style.height="",$.style.marginRight="";let Z=UJ.get($);if(Z!==void 0)$.textContent=Z,UJ.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=m6($);if(j){let q=OJ.get(j);if(q)j.style.display=q.display,j.style.width=q.width,OJ.delete(j)}}}}O.textFlapper={prepare:(J,$,Q,Z)=>t0.prepare(J,$,Q,Z),flap:(J,$,Q,Z)=>t0.flap(J,$,Q,Z),revert:(J)=>t0.revert(J)};class c6{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,N)=>{let H=N%Q,X=Math.floor(N/Q);return{originalIndex:N,col:H,row:X}});if(j==="random"){let G=z.map((N)=>({originalIndex:N.originalIndex,order:Math.random()}));return G.sort((N,H)=>N.order-H.order),G.forEach((N,H)=>{N.order=H}),G}return z.map((G)=>{let N;if(typeof j==="number"){let H=j%Q,X=Math.floor(j/Q);N=q==="x"?Math.abs(G.col-H)+Math.abs(G.row-X)*0.5:Math.abs(G.row-X)+Math.abs(G.col-H)*0.5}else if(j==="center"){let H=(Q-1)/2,X=(Z-1)/2;N=Math.abs(G.col-H)+Math.abs(G.row-X)}else if(j==="edges"){let H=Math.min(G.col,Q-1-G.col),X=Math.min(G.row,Z-1-G.row);N=Math.min(H,X)}else if(j==="end")N=q==="x"?(Z-1-G.row)*Q+(Q-1-G.col):(Q-1-G.col)*Z+(Z-1-G.row);else N=q==="x"?G.row*Q+G.col:G.col*Z+G.row;return{originalIndex:G.originalIndex,order:N}})}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}}}O.stagger={resolve:(J,$)=>c6.resolve(J,$)};function E9(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,N=j.left+z/2,H=j.top+G/2,X=q.left+q.width/2,Y=q.top+q.height/2,K=X-N,_=Y-H,W=q.width/z,U=q.height/G;if(!Q)return{dx:K,dy:_,sx:W,sy:U,sourceWidth:j.width,sourceHeight:j.height,targetWidth:q.width,targetHeight:q.height};let B=J.offsetParent??document.documentElement,I=B.getBoundingClientRect(),F=B.scrollLeft??0,A=B.scrollTop??0;return{dx:K,dy:_,sx:W,sy:U,sourceWidth:j.width,sourceHeight:j.height,targetWidth:q.width,targetHeight:q.height,sourceLeft:J.offsetLeft,sourceTop:J.offsetTop,targetLeft:q.left-I.left+F,targetTop:q.top-I.top+A}}function p6(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 m=0.01,u0=0.001;function b9(J,$,Q,Z){let{absolute:j=!1,scale:q=!0,resize:z=!1}=Q;if($ instanceof HTMLElement)S($,!1);let G=E9($,Q.target,j);if(!G)return;if(!j)if(z){let N=G.dx-(G.targetWidth-G.sourceWidth)/2,H=G.dy-(G.targetHeight-G.sourceHeight)/2;if(Math.abs(N)>m){let X=Z.acquire();X.init($,"x",0,N,"px"),J.addPropTween(X)}if(Math.abs(H)>m){let X=Z.acquire();X.init($,"y",0,H,"px"),J.addPropTween(X)}if(Math.abs(G.targetWidth-G.sourceWidth)>m){let X=Z.acquire();X.init($,"width",G.sourceWidth,G.targetWidth,"px"),J.addPropTween(X)}if(Math.abs(G.targetHeight-G.sourceHeight)>m){let X=Z.acquire();X.init($,"height",G.sourceHeight,G.targetHeight,"px"),J.addPropTween(X)}}else{let N=Y0($,"x"),H=Y0($,"y"),X=SJ($,"x"),Y=SJ($,"y"),K=p6($,"x",N,X),_=p6($,"y",H,Y),W=K+G.dx,U=_+G.dy;if(Math.abs(W-K)>m||Math.abs(K)>m||Math.abs(W)>m){let B=Z.acquire();B.init($,"x",K,W,"px"),J.addPropTween(B)}if(Math.abs(U-_)>m||Math.abs(_)>m||Math.abs(U)>m){let B=Z.acquire();B.init($,"y",_,U,"px"),J.addPropTween(B)}if(q){let B=Y0($,"scaleX"),I=Y0($,"scaleY"),F=B*G.sx,A=I*G.sy;if(Math.abs(F-B)>u0||Math.abs(B-1)>u0||Math.abs(F-1)>u0){let L=Z.acquire();L.init($,"scaleX",B,F,""),J.addPropTween(L)}if(Math.abs(A-I)>u0||Math.abs(I-1)>u0||Math.abs(A-1)>u0){let L=Z.acquire();L.init($,"scaleY",I,A,""),J.addPropTween(L)}}}else{let N=$;if(window.getComputedStyle(N).position==="static")N.style.position="absolute";let{sourceLeft:X,sourceTop:Y,targetLeft:K,targetTop:_}=G;if(Math.abs(K-X)>m){let W=Z.acquire();W.init($,"left",X,K,"px"),J.addPropTween(W)}if(Math.abs(_-Y)>m){let W=Z.acquire();W.init($,"top",Y,_,"px"),J.addPropTween(W)}if(q){if(Math.abs(G.targetWidth-G.sourceWidth)>m){let W=Z.acquire();W.init($,"width",G.sourceWidth,G.targetWidth,"px"),J.addPropTween(W)}if(Math.abs(G.targetHeight-G.sourceHeight)>m){let W=Z.acquire();W.init($,"height",G.sourceHeight,G.targetHeight,"px"),J.addPropTween(W)}}}}function V9(J,$,Q,Z){J.setPendingFitSetup((z)=>b9(J,$,Q,z)),J.setLazyStartCapture(!0);let{absolute:j=!1,resize:q=!1}=Q;J.setFitCleanup(()=>{if($ instanceof HTMLElement){if(S($,!0),q)$.style.width="",$.style.height="";if(j)$.style.width="",$.style.height="",$.style.left="",$.style.top=""}})}O.fit={registerPendingSetup:V9};var s6=(J)=>J,w9=s6,v={in:(J)=>J*J,out:(J)=>J*(2-J),inOut:(J)=>J<0.5?2*J*J:-1+(4-2*J)*J},O0={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},I0={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 IJ={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},FJ={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}},LJ={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 i6=(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}}},AJ=i6();var n6=(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}}},MJ=n6(),g6=(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},d0={in:(J)=>1-g6(1-J),out:g6,inOut:(J)=>{if(J<0.5)return d0.in(J*2)*0.5;return d0.out(J*2-1)*0.5+0.5}},e0=(J=0.7,$=0.7,Q=!1)=>{let Z=J!==1?$:0,j=(1-J)/2,q=j+J,z=Q;return(G)=>{let N=G+(0.5-G)*Z;if(G<j){let H=1-G/j;if(z)return 1-H*H;return N-H*H*H*H*N}else if(G>q){let H=(G-q)/j;if(z)return G===1?0:1-H*H;return N+(G-N)*H*H*H*H}return z?1:N}},o6={in:e0(0.7,0.7,!1),out:e0(0.7,0.7,!1),inOut:e0(0.7,0.7,!1)},RJ=(J=1,$=20,Q=!1)=>{let Z=[],j=1/$;for(let q=0;q<$;q++){let z=q*j,N=((q*1327+531)%1000/1000-0.5)*J*0.4,H=z+N;Z.push({x:z,y:Q?Math.max(0,Math.min(1,H)):H})}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 Y=z+G>>1;if(Z[Y].x<=q)z=Y;else G=Y}let N=Z[z],H=Z[G],X=(q-N.x)/(H.x-N.x);return N.y+(H.y-N.y)*X}},C9={in:RJ(1,20,!0),out:RJ(1,20,!0),inOut:RJ(1,20,!0)},kJ=(J)=>{return($)=>{if($>=1)return 1;return Math.floor($*J)/J}},DJ={in:kJ(12),out:kJ(12),inOut:kJ(12)},l6={linear:s6,none:w9,power1:v.out,"power1.in":v.in,"power1.out":v.out,"power1.inout":v.inOut,power2:O0.out,"power2.in":O0.in,"power2.out":O0.out,"power2.inout":O0.inOut,power3:I0.out,"power3.in":I0.in,"power3.out":I0.out,"power3.inout":I0.inOut,power4:i.out,"power4.in":i.in,"power4.out":i.out,"power4.inout":i.inOut,quad:v.out,"quad.in":v.in,"quad.out":v.out,"quad.inout":v.inOut,cubic:O0.out,"cubic.in":O0.in,"cubic.out":O0.out,"cubic.inout":O0.inOut,quart:I0.out,"quart.in":I0.in,"quart.out":I0.out,"quart.inout":I0.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:IJ.out,"sine.in":IJ.in,"sine.out":IJ.out,"sine.inout":IJ.inOut,expo:FJ.out,"expo.in":FJ.in,"expo.out":FJ.out,"expo.inout":FJ.inOut,circ:LJ.out,"circ.in":LJ.in,"circ.out":LJ.out,"circ.inout":LJ.inOut,back:AJ.out,"back.in":AJ.in,"back.out":AJ.out,"back.inout":AJ.inOut,elastic:MJ.out,"elastic.in":MJ.in,"elastic.out":MJ.out,"elastic.inout":MJ.inOut,bounce:d0.out,"bounce.in":d0.in,"bounce.out":d0.out,"bounce.inout":d0.inOut,slow:o6.inOut,"slow.in":v.out,"slow.out":v.out,"slow.inout":v.out,slowmo:o6.inOut,"slowmo.in":v.out,"slowmo.out":v.out,"slowmo.inout":v.out,rough:C9.inOut,"rough.in":v.out,"rough.out":v.out,"rough.inout":v.out,steps:DJ.inOut,"steps.in":DJ.in,"steps.out":DJ.out,"steps.inout":DJ.inOut},x9={back:(J)=>i6(J),elastic:(J,$)=>n6(J,$),slow:(J,$,Q)=>{let Z=e0(J,$,Q===1);return{in:Z,out:Z,inOut:Z}},slowmo:(J,$,Q)=>{let Z=e0(J,$,Q===1);return{in:Z,out:Z,inOut:Z}},rough:(J,$,Q)=>{let Z=RJ(J,$,Q===1);return{in:Z,out:Z,inOut:Z}},steps:(J)=>{let $=kJ(J??12);return{in:$,out:$,inOut:$}}},S9=/^(\w+)(?:\.(\w+))?\(([^)]*)\)$/;function a6(J){let $=J.toLowerCase();if(l6[$])return l6[$];let Q=S9.exec($);if(Q){let[,Z,j,q]=Q,z=x9[Z];if(z){let G=q.split(",").map((N)=>N.trim()).filter((N)=>N.length>0).map(Number);if(G.every((N)=>!isNaN(N))){let N=z(...G),H=j||"out",Y=N[H==="inout"?"inOut":H];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)`),v.out}class aJ{_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;_activationCallback=null;init(J,$,Q,Z,j,q){return this._id=J,this._targets=$,this._duration=Q,this._delay=Z,this._easingFn=a6(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,N=this._repeat===-1?1/0:Q*(this._repeat+1)+z*this._repeat,H=this._repeat===-1?q:Math.min(q,N),X=G>0?Math.floor(H/G):0,Y=H-X*G,K=Y>Q,_=Q>0?Math.min(1,Y/Q):1,W=this._yoyo&&X%2===1;if(K)_=W?0:1;else if(W)_=1-_;this._currentRepeat=this._repeat===-1?X:Math.min(X,this._repeat),this._isReversed=W,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._activationCallback?.(),this;if(this._isActive&&!this._isReversed)return this;return this._isActive=!0,this._isReversed=!1,this._activationCallback?.(),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._activationCallback?.(),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._activationCallback?.(),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}setActivationCallback(J){this._activationCallback=J}captureStartValues(){if(!this._needsStartCapture||this._startCaptured)return;if(this._pendingFitSetup){let $=this._propTweens;while($){let Q=$.next;W0.release($),$=Q}this._propTweens=null,this._lastPropTween=null,this._pendingFitSetup(W0),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"&&B0(Q)){let Z=O.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=O.filter?.getCurrentFilter($);if(Z&&J.endFilters){let j=O.filter.mergeFilterArrays(Z,J.endFilters);J.startFilters=j.start,J.endFilters=j.end}}else if(J.valueType==="clipPath"&&hJ(Q)){let Z=O.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,this._activationCallback=null;let J=W0,$=this._propTweens;while($){let Q=$.next;J.release($),$=Q}this._propTweens=null,this._lastPropTween=null}}var JJ=new n0(()=>new aJ,100),r6={acquire:()=>JJ.acquire(),release:(J)=>JJ.release(J),getPoolSize:()=>JJ.getPoolSize(),getTotalCreated:()=>JJ.getTotalCreated(),clear:()=>JJ.clear()};class V{static instance;animations=[];animationIdToIndex=new Map;nextAnimationId=1;totalCreated=0;_animationSnapshot=[];timelines=new Map;_captureTarget=null;ticker;_tickerSubscribed=!1;animationPool;propTweenPool;constructor(){this.ticker=T.getInstance(),this.animationPool=r6,this.propTweenPool=W0}static getInstance(){if(!V.instance)V.instance=new V,x.setEngineRegisterCallback((J,$)=>{let Q=V.instance;if(!Q.hasTimeline(J))Q.registerTimeline(J,$)}),x.setEngineActivationCallback(()=>{V.instance._ensureTickerSubscription()}),f.setCreateAnimationCallback((J,$,Q,Z,j,q,z,G)=>{return V.instance.createAnimation(J,$,Q,Z,j,q,z,G)});return V.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);this._releaseTickerIfIdle()};_ensureTickerSubscription(){if(this._tickerSubscribed)return;this.ticker.add(this.update,0),this._tickerSubscribed=!0}_hasActiveWork(){for(let J=0,$=this.animations.length;J<$;J++){let Q=this.animations[J];if(!Q.isTimelineChild()&&Q.isActive())return!0}for(let J of this.timelines.values())if(J.isActive())return!0;return!1}_releaseTickerIfIdle(){if(!this._tickerSubscribed||this._hasActiveWork())return;this.ticker.remove(this.update),this._tickerSubscribed=!1}createAnimation(J,$,Q,Z,j,q,z,G){let N=G?.stagger;if(N&&J.length>1)return this.createStaggeredAnimations(J,$,Q,Z,j,q,z,N,G);let H=this.animationPool.acquire(),X=this.registerAnimation(H);if(H.init(X,J,Q,Z,j,G),this.setupPropertyTweens(H,J,$,q,z),Q===0)H.render(1);else if(q&&!G?._skipInitialRender)H.render(0);return H}createStaggeredAnimations(J,$,Q,Z,j,q,z,G,N){if(!O.stagger){let Y=this.animationPool.acquire(),K=this.registerAnimation(Y);if(Y.init(K,J,Q,Z,j,N),this.setupPropertyTweens(Y,J,$,q,z),Q===0)Y.render(1);else if(q&&!N?._skipInitialRender)Y.render(0);return[Y]}let H=O.stagger.resolve(J,G),X=[];for(let Y=0;Y<J.length;Y++){let K=J[Y],_=H[Y],W=this.animationPool.acquire(),U=this.registerAnimation(W);if(W.init(U,[K],Q,Z+_,j,N),this.setupPropertyTweens(W,[K],$,q,z),Q===0)W.render(1);else if(q&&!N?._skipInitialRender)W.render(0);X.push(W)}return X}setupPropertyTweens(J,$,Q,Z,j){let q=e6(t6(Q)),z=j?e6(t6(j)):void 0,G=Object.keys(q),N=z?Object.keys(z):[],H=[...new Set([...G,...N])],X="perspective"in q,Y=z&&"perspective"in z,K=X&&Y;for(let _ of $){if(!K&&(X||Y)&&_ instanceof Element){let W=X?q.perspective:z.perspective,U=typeof W==="number"?W:parseFloat(String(W))||0;if(U>0)b(_,"perspective",U,"px"),_.style.transform=C(_)}for(let W of H){if(W==="perspective"&&!K)continue;let U=q[W],B=fJ(_,W,U,z?z[W]:void 0),I=this.propTweenPool.acquire(),F=Z&&!j;switch(B.type){case"color":{let A=F?B.endColor:B.startColor,L=F?B.startColor:B.endColor;I.initColor(_,W,A,L);break}case"filter":{let A=F?B.endFilters:B.startFilters,L=F?B.startFilters:B.endFilters;I.initFilter(_,W,A,L);break}case"clipPath":{let A=F?B.endClipPath:B.startClipPath,L=F?B.startClipPath:B.endClipPath;I.initClipPath(_,W,A,L);break}case"scalar":{let A=F?B.endValue:B.startValue,L=F?B.startValue:B.endValue;I.init(_,W,A,L,B.unit);break}case"drawSVG":{let A=F?B.endDraw:B.startDraw,L=F?B.startDraw:B.endDraw;I.initDrawSVG(_,W,A,L,B.length);break}case"path":{let A=F?B.endProgress:B.startProgress,L=F?B.startProgress:B.endProgress;I.initPath(_,W,B.pathData,B.pathLength,A,L,B.rotate,B.alignOffset,B.pathOffset);break}}J.addPropTween(I)}}}registerAnimation(J){let $=this.nextAnimationId++,Q=this.animations.length;return this.animations.push(J),this.animationIdToIndex.set($,Q),this.totalCreated++,J.setUnregisterCallback(()=>this.unregisterAnimation($)),J.setActivationCallback(()=>this._ensureTickerSubscription()),$}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),this._releaseTickerIfIdle()}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(),this._releaseTickerIfIdle()}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 x(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),this._releaseTickerIfIdle()}killAllTimelines(){for(let J of this.timelines.values())J.kill();this.timelines.clear(),this._releaseTickerIfIdle()}killEverything(){this.killAllTimelines(),this.killAll(),N6()}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 t6(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],H=Z[2].match(/[-+]?\d*\.?\d+(?:e[-+]?\d+)?[a-z%]*/gi)||[];switch(G){case"perspective":{if(!("perspective"in J))j.perspective=H[0]||"0px",q=!0;break}case"translate":{if(H[0]&&!("x"in J))j.x=H[0],q=!0;if(H[1]&&!("y"in J))j.y=H[1],q=!0;break}case"translate3d":{if(H[0]&&!("x"in J))j.x=H[0],q=!0;if(H[1]&&!("y"in J))j.y=H[1],q=!0;if(H[2]&&!("z"in J))j.z=H[2],q=!0;break}case"translateX":{if(H[0]&&!("x"in J))j.x=H[0],q=!0;break}case"translateY":{if(H[0]&&!("y"in J))j.y=H[0],q=!0;break}case"translateZ":{if(H[0]&&!("z"in J))j.z=H[0],q=!0;break}case"rotate":{if(H[0]&&!("rotate"in J))j.rotate=H[0],q=!0;break}case"rotateX":{if(H[0]&&!("rotateX"in J))j.rotateX=H[0],q=!0;break}case"rotateY":{if(H[0]&&!("rotateY"in J))j.rotateY=H[0],q=!0;break}case"rotateZ":{if(H[0]&&!("rotateZ"in J))j.rotateZ=H[0],q=!0;break}case"scale":{if(H[0]&&!("scale"in J))j.scale=parseFloat(H[0]),q=!0;break}case"scaleX":{if(H[0]&&!("scaleX"in J))j.scaleX=parseFloat(H[0]),q=!0;break}case"scaleY":{if(H[0]&&!("scaleY"in J))j.scaleY=parseFloat(H[0]),q=!0;break}case"scaleZ":{if(H[0]&&!("scaleZ"in J))j.scaleZ=parseFloat(H[0]),q=!0;break}case"skew":{if(H[0]&&!("skewX"in J))j.skewX=H[0],q=!0;if(H[1]&&!("skewY"in J))j.skewY=H[1],q=!0;break}case"skewX":{if(H[0]&&!("skewX"in J))j.skewX=H[0],q=!0;break}case"skewY":{if(H[0]&&!("skewY"in J))j.skewY=H[0],q=!0;break}default:break}}if(!q)return J;let z={...j};for(let[G,N]of Object.entries(J)){if(G==="transform")continue;z[G]=N}return z}function e6(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 EJ{_fn;_timelineNames=new Set;_reverted=!1;constructor(J){this._fn=J,this._execute()}revert(){if(this._reverted)return;let J=V.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 $=V.getInstance();$.startCapture(this._timelineNames);try{(J||this._fn)()}finally{$.stopCapture()}}}function P9(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 v9(J,$,Q){if(Q===void 0)return(Z)=>Math.min($,Math.max(J,Z));return Math.min($,Math.max(J,Q))}function y9(J,$,Q){let Z=J+Math.random()*($-J);if(Q&&Q>0)return Math.round(Z/Q)*Q;return Z}function T9(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 N=Math.abs(Z-j[G]);if(N<z)z=N,q=j[G]}return q};if($===void 0)return Q;return Q($)}function h9(J,$,Q){return J+($-J)*Q}function f9(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 u9(J,$,Q){let Z=(j)=>(j-J)/($-J);if(Q===void 0)return Z;return Z(Q)}function d9(J,$,Q){let Z=$-J,j=(q)=>{return((q-J)%Z+Z)%Z+J};if(Q===void 0)return j;return j(Q)}var rJ={toArray:P9,clamp:v9,random:y9,snap:T9,interpolate:h9,mapRange:f9,normalize:u9,wrap:d9};function n(J,$,Q){let j=V.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){V.getInstance();let $=$J(J),Q=[];for(let Z of $)if(Z instanceof Element)Q.push(Z);if(Q.length>0)V.getInstance().killAnimationsForTargets(Q);for(let Z of $){if(!(Z instanceof Element))continue;if(O.textSplitter?.isSplit?.(Z))O.textSplitter?.revert?.(Z);S(Z),O.styleReset?.clearAnimationStylesAndUnregister?.(Z),O.styleReset?.clearPinStylesAndUnregister?.(Z)}};n.set=function(J,$){V.getInstance();let Q=new x;Q._addEntry(J,{to:$,duration:0}),Q.kill(!1)};n.get=function(J){let $=V.getInstance();return $.hasTimeline(J)?$.getTimeline(J):void 0};n.has=function(J){return V.getInstance().hasTimeline(J)};n.getNames=function(){return V.getInstance().getTimelineNames()};n.kill=function(J){let $=V.getInstance();if($.hasTimeline(J))$.getTimeline(J).kill()};n.killAll=function(){V.getInstance().killEverything()};n.refreshScrollTriggers=function(){O.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 EJ(J)};n.utils=rJ;var m9=n;var c9={};export{c9 as Types,x as Timeline,rJ as MotionUtils,EJ as MotionContext,m9 as Motion};
|
|
34
34
|
|
|
35
|
-
//# debugId=
|
|
35
|
+
//# debugId=6BB1A022CE3AD89964756E2164756E21
|