diff --git a/src/browser/base/content/zen-assets.jar.inc.mn b/src/browser/base/content/zen-assets.jar.inc.mn index 7e0ef36d..a62c260d 100644 --- a/src/browser/base/content/zen-assets.jar.inc.mn +++ b/src/browser/base/content/zen-assets.jar.inc.mn @@ -92,7 +92,7 @@ # JS Vendor content/browser/zen-vendor/tsparticles.confetti.bundle.min.js (../../zen/vendor/tsparticles.confetti.bundle.min.js) - content/browser/zen-vendor/motion.min.mjs (../../zen/vendor/motion.min.mjs) + content/browser/zen-vendor/animejs.min.mjs (../../zen/vendor/animejs.min.mjs) # FavIcons for startup content/browser/zen-images/favicons/calendar.ico (../../zen/images/favicons/calendar.ico) diff --git a/src/zen/common/ZenCustomizableUI.sys.mjs b/src/zen/common/ZenCustomizableUI.sys.mjs index 8757e45b..63d44e57 100644 --- a/src/zen/common/ZenCustomizableUI.sys.mjs +++ b/src/zen/common/ZenCustomizableUI.sys.mjs @@ -117,7 +117,7 @@ export var ZenCustomizableUI = new (class { window.setTimeout(() => { button.removeAttribute('open'); }, 500); - window.gZenUIManager.motion.animate( + window.gZenUIManager.anime.animate( image, { transform: ['rotate(45deg)', 'rotate(0deg)'] }, { duration: 0.2 } @@ -125,7 +125,7 @@ export var ZenCustomizableUI = new (class { }; popup.addEventListener('popuphidden', handlePopupHidden, { once: true }); popup.openPopup(button, 'after_start'); - window.gZenUIManager.motion.animate( + window.gZenUIManager.anime.animate( image, { transform: ['rotate(0deg)', 'rotate(45deg)'] }, { duration: 0.2 } diff --git a/src/zen/common/ZenStartup.mjs b/src/zen/common/ZenStartup.mjs index 044752f9..6e586f49 100644 --- a/src/zen/common/ZenStartup.mjs +++ b/src/zen/common/ZenStartup.mjs @@ -107,7 +107,7 @@ document.documentElement.removeAttribute('zen-before-loaded'); if (Services.prefs.getBoolPref('zen.watermark.enabled', false)) { let elementsToIgnore = this._watermarkIgnoreElements.map((id) => '#' + id).join(', '); - gZenUIManager.motion + gZenUIManager.anime .animate( '#browser > *:not(' + elementsToIgnore + '), #urlbar, #tabbrowser-tabbox > *', { @@ -115,7 +115,6 @@ }, { delay: 0.6, - easing: 'ease-in-out', } ) .then(() => { diff --git a/src/zen/common/ZenUIManager.mjs b/src/zen/common/ZenUIManager.mjs index 7372377c..2bd9869f 100644 --- a/src/zen/common/ZenUIManager.mjs +++ b/src/zen/common/ZenUIManager.mjs @@ -36,10 +36,51 @@ var gZenUIManager = { document.addEventListener('mousedown', this.handleMouseDown.bind(this), true); - ChromeUtils.defineLazyGetter(this, 'motion', () => { - return ChromeUtils.importESModule('chrome://browser/content/zen-vendor/motion.min.mjs', { - global: 'current', - }); + ChromeUtils.defineLazyGetter(this, 'anime', () => { + // Polyphill in case we need to change library animations again + const module = ChromeUtils.importESModule( + 'chrome://browser/content/zen-vendor/animejs.min.mjs', + { + global: 'current', + } + ); + return { + animate: (element, keyframes, options) => { + if (options.duration) { + options.duration *= 1000; // convert seconds to milliseconds + } + if (options.delay) { + options.delay *= 1000; // convert seconds to milliseconds + } + delete options.bounce; // anime.js does not support bounce + delete options.type; // anime.js does not support type + return module.animate(element, { + ...keyframes, + ...options, + }); + }, + waapi: (element, keyframes, options) => { + if (options.duration) { + options.duration *= 1000; // convert seconds to milliseconds + } + if (options.delay) { + options.delay *= 1000; // convert seconds to milliseconds + } + return module.waapi.animate(element, { + ...keyframes, + ...options, + }); + }, + stagger: (delay, { + startDelay = 0, + } = {}) => { + delay *= 1000; // convert seconds to milliseconds + startDelay *= 1000; // convert seconds to milliseconds + return module.stagger(delay,{ + start: startDelay, + }); + }, + }; }); ChromeUtils.defineLazyGetter(this, '_toastContainer', () => { @@ -479,7 +520,7 @@ var gZenUIManager = { this._toastContainer.removeAttribute('hidden'); this._toastContainer.appendChild(toast); const timeoutFunction = () => { - this.motion + this.anime .animate(toast, { opacity: [1, 0], scale: [1, 0.5] }, { duration: 0.2, bounce: 0 }) .then(() => { toast.remove(); @@ -489,7 +530,7 @@ var gZenUIManager = { }); }; if (reused) { - await this.motion.animate(toast, { scale: 0.2 }, { duration: 0.1, bounce: 0 }); + await this.anime.animate(toast, { scale: 0.2 }, { duration: 0.1, bounce: 0 }); } else { toast.addEventListener('mouseover', () => { if (this._toastTimeouts[messageId]) { @@ -506,7 +547,7 @@ var gZenUIManager = { if (!toast.style.hasOwnProperty('transform')) { toast.style.transform = 'scale(0)'; } - await this.motion.animate(toast, { scale: 1 }, { type: 'spring', bounce: 0.2, duration: 0.5 }); + await this.anime.animate(toast, { scale: 1 }, { type: 'spring', bounce: 0.2, duration: 0.5 }); if (this._toastTimeouts[messageId]) { clearTimeout(this._toastTimeouts[messageId]); } @@ -601,7 +642,7 @@ var gZenVerticalTabsManager = { }, animateTab(aTab) { - if (!gZenUIManager.motion || !aTab || !gZenUIManager._hasLoadedDOM || !aTab.isConnected) { + if (!gZenUIManager.anime || !aTab || !gZenUIManager._hasLoadedDOM || !aTab.isConnected) { return; } // get next visible tab @@ -613,7 +654,7 @@ var gZenVerticalTabsManager = { try { const tabSize = aTab.getBoundingClientRect().height; const transform = `-${tabSize}px`; - gZenUIManager.motion + gZenUIManager.anime .animate( aTab, { @@ -635,7 +676,7 @@ var gZenVerticalTabsManager = { aTab.style.removeProperty('transform'); aTab.style.removeProperty('opacity'); }); - gZenUIManager.motion + gZenUIManager.anime .animate( aTab.querySelector('.tab-content'), { @@ -1060,7 +1101,7 @@ var gZenVerticalTabsManager = { } // Maybe add some confetti here?!? - gZenUIManager.motion.animate( + gZenUIManager.anime.animate( this._tabEdited, { scale: [1, 0.98, 1], diff --git a/src/zen/compact-mode/ZenCompactMode.mjs b/src/zen/compact-mode/ZenCompactMode.mjs index 46bad8c8..39d32a2d 100644 --- a/src/zen/compact-mode/ZenCompactMode.mjs +++ b/src/zen/compact-mode/ZenCompactMode.mjs @@ -279,7 +279,7 @@ var gZenCompactModeManager = { // TODO: Work on this a bit more, needs polishing if (lazyCompactMode.COMPACT_MODE_CAN_ANIMATE_SIDEBAR && false) { - gZenUIManager.motion + gZenUIManager.anime .animate( [ this.sidebar, @@ -299,7 +299,7 @@ var gZenCompactModeManager = { ], }, { - ease: 'easeIn', + ease: 'in', type: 'spring', bounce: 0, duration: 0.2, @@ -324,18 +324,16 @@ var gZenCompactModeManager = { } else { sidebarWidth -= elementSeparation; } - gZenUIManager.motion - .animate( + gZenUIManager.anime + .waapi( this.sidebar, { marginRight: this.sidebarIsOnRight ? `-${sidebarWidth}px` : 0, marginLeft: this.sidebarIsOnRight ? 0 : `-${sidebarWidth}px`, }, { - ease: 'easeIn', - type: 'spring', - bounce: 0, - duration: 0.2, + ease: 'out', + duration: 0.1, } ) .then(() => { @@ -373,8 +371,8 @@ var gZenCompactModeManager = { } else { this.sidebar.style.marginLeft = `-${sidebarWidth}px`; } - gZenUIManager.motion - .animate( + gZenUIManager.anime + .waapi( this.sidebar, this.sidebarIsOnRight ? { @@ -383,10 +381,8 @@ var gZenCompactModeManager = { } : { marginLeft: 0 }, { - ease: 'easeOut', - type: 'spring', - bounce: 0, - duration: 0.2, + ease: 'in', + duration: 0.1, } ) .then(() => { diff --git a/src/zen/downloads/ZenDownloadAnimation.mjs b/src/zen/downloads/ZenDownloadAnimation.mjs index 4cd5eda1..9a86362f 100644 --- a/src/zen/downloads/ZenDownloadAnimation.mjs +++ b/src/zen/downloads/ZenDownloadAnimation.mjs @@ -221,7 +221,7 @@ this.#startBoxAnimation(areTabsPositionedRight); } - await gZenUIManager.motion.animate(arcAnimationElement, sequence, { + await gZenUIManager.anime.animate(arcAnimationElement, sequence, { duration: Services.prefs.getIntPref('zen.downloads.download-animation-duration') / 1000, easing: 'cubic-bezier(0.37, 0, 0.63, 1)', fill: 'forwards', @@ -353,7 +353,7 @@ wrapper.appendChild(this.#boxAnimationElement); - await gZenUIManager.motion.animate( + await gZenUIManager.anime.animate( this.#boxAnimationElement, { [sideProp]: '34px', @@ -366,7 +366,7 @@ } ).finished; - await gZenUIManager.motion.animate( + await gZenUIManager.anime.animate( this.#boxAnimationElement, { [sideProp]: '24px', @@ -411,7 +411,7 @@ try { const sideProp = areTabsPositionedRight ? 'right' : 'left'; - await gZenUIManager.motion.animate( + await gZenUIManager.anime.animate( this.#boxAnimationElement, { transform: 'scale(0.9)', @@ -422,7 +422,7 @@ } ).finished; - await gZenUIManager.motion.animate( + await gZenUIManager.anime.animate( this.#boxAnimationElement, { [sideProp]: '-50px', diff --git a/src/zen/glance/ZenGlanceManager.mjs b/src/zen/glance/ZenGlanceManager.mjs index ed01f9c6..706534c1 100644 --- a/src/zen/glance/ZenGlanceManager.mjs +++ b/src/zen/glance/ZenGlanceManager.mjs @@ -131,10 +131,10 @@ const startX = isRightSide ? -50 : 50; - gZenUIManager.motion.animate( + gZenUIManager.anime.animate( this.sidebarButtons.querySelectorAll('toolbarbutton'), { x: [startX, 0], opacity: [0, 1] }, - { delay: gZenUIManager.motion.stagger(0.1) } + { delay: gZenUIManager.anime.stagger(0.1) } ); } this.sidebarButtons.removeAttribute('hidden'); @@ -180,7 +180,7 @@ this.quickOpenGlance({ dontOpenButtons: true }); this.showSidebarButtons(true); - gZenUIManager.motion.animate( + gZenUIManager.anime.animate( this.#currentParentTab.linkedBrowser.closest('.browserSidebarContainer'), { scale: [1, 0.98], @@ -211,7 +211,7 @@ }; this.browserWrapper.style.transform = 'translate(-50%, -50%)'; this.overlay.style.overflow = 'visible'; - gZenUIManager.motion + gZenUIManager.anime .animate( this.browserWrapper, { @@ -311,7 +311,7 @@ this.overlay.style.pointerEvents = 'none'; this.quickCloseGlance({ justAnimateParent: true, clearID: false }); const originalPosition = this.#glances.get(this.#currentGlanceID).originalPosition; - gZenUIManager.motion + gZenUIManager.anime .animate( this.#currentParentTab.linkedBrowser.closest('.browserSidebarContainer'), { @@ -332,7 +332,7 @@ }); this.browserWrapper.style.opacity = 1; return new Promise((resolve) => { - gZenUIManager.motion + gZenUIManager.anime .animate( this.browserWrapper, { @@ -653,7 +653,7 @@ this.finishOpeningGlance(); return; } - await gZenUIManager.motion.animate( + await gZenUIManager.anime.animate( this.browserWrapper, { width: ['85%', '100%'], diff --git a/src/zen/media/ZenMediaController.mjs b/src/zen/media/ZenMediaController.mjs index 9b3c18ee..21953e07 100644 --- a/src/zen/media/ZenMediaController.mjs +++ b/src/zen/media/ZenMediaController.mjs @@ -219,7 +219,7 @@ hideMediaControls() { if (this.mediaControlBar.hasAttribute('hidden')) return; - return gZenUIManager.motion + return gZenUIManager.anime .animate( this.mediaControlBar, { @@ -259,7 +259,7 @@ this.mediaControlBar.querySelector('toolbaritem').getBoundingClientRect().height + 'px'; this.mediaControlBar.style.opacity = 0; gZenUIManager.updateTabsToolbar(); - gZenUIManager.motion.animate( + gZenUIManager.anime.animate( this.mediaControlBar, { opacity: [0, 1], diff --git a/src/zen/split-view/ZenViewSplitter.mjs b/src/zen/split-view/ZenViewSplitter.mjs index c67d09e8..3f778093 100644 --- a/src/zen/split-view/ZenViewSplitter.mjs +++ b/src/zen/split-view/ZenViewSplitter.mjs @@ -322,7 +322,7 @@ class nsZenViewSplitter extends ZenDOMOperatedFeature { draggedTab._visuallySelected = true; this.fakeBrowser.setAttribute('side', side); this._finishAllAnimatingPromise = Promise.all([ - gZenUIManager.motion.animate( + gZenUIManager.anime.animate( gBrowser.tabbox, side === 'left' ? { @@ -338,7 +338,7 @@ class nsZenViewSplitter extends ZenDOMOperatedFeature { easing: 'ease-out', } ), - gZenUIManager.motion.animate( + gZenUIManager.anime.animate( this.fakeBrowser, { width: [0, `${halfWidth - padding}px`], @@ -401,7 +401,7 @@ class nsZenViewSplitter extends ZenDOMOperatedFeature { this._draggingTab = null; try { Promise.all([ - gZenUIManager.motion.animate( + gZenUIManager.anime.animate( gBrowser.tabbox, side === 'left' ? { @@ -415,7 +415,7 @@ class nsZenViewSplitter extends ZenDOMOperatedFeature { easing: 'ease-out', } ), - gZenUIManager.motion.animate( + gZenUIManager.anime.animate( this.fakeBrowser, { width: [`${halfWidth - padding * 2}px`, 0], @@ -1763,7 +1763,7 @@ class nsZenViewSplitter extends ZenDOMOperatedFeature { } animateBrowserDrop(browserContainer, callback = () => {}) { - gZenUIManager.motion + gZenUIManager.anime .animate( browserContainer, { diff --git a/src/zen/vendor/animejs.dep b/src/zen/vendor/animejs.dep new file mode 100644 index 00000000..6d6a916f --- /dev/null +++ b/src/zen/vendor/animejs.dep @@ -0,0 +1 @@ +https://cdn.jsdelivr.net/npm/animejs/+esm: v4.0.2 \ No newline at end of file diff --git a/src/zen/vendor/animejs.min.mjs b/src/zen/vendor/animejs.min.mjs new file mode 100644 index 00000000..39223067 --- /dev/null +++ b/src/zen/vendor/animejs.min.mjs @@ -0,0 +1,15 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.2 and Terser v5.39.0. + * Original file: /npm/animejs@4.0.2/lib/anime.esm.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +/** + * anime.js - ESM + * @version v4.0.2 + * @author Julian Garnier + * @license MIT + * @copyright (c) 2025 Julian Garnier + * @see https://animejs.com + */ +const t="undefined"!=typeof window,e=t?window:null,s=t?document:null,i=0,r=1,n=2,o=3,a=4,h=0,l=1,c=2,d=3,u=0,p=1,m=2,f={replace:0,none:1,blend:2},g=Symbol(),_=Symbol(),y=Symbol(),v=Symbol(),b=Symbol(),S=Symbol(),x=1e-11,T=1e12,w=1e3,k="",$=new Map;$.set("x","translateX"),$.set("y","translateY"),$.set("z","translateZ");const E=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],C=E.reduce(((t,e)=>({...t,[e]:e+"("})),{}),B=()=>{},D=/(^#([\da-f]{3}){1,2}$)|(^#([\da-f]{4}){1,2}$)/i,L=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,N=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,A=/hsl\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*\)/i,F=/hsla\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,P=/[-+]?\d*\.?\d+(?:e[-+]?\d)?/gi,R=/^([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z]+|%)$/i,Y=/([a-z])([A-Z])/g,X=/(\w+)(\([^)]+\)+)/g,M=/(\*=|\+=|-=)/,z={id:null,keyframes:null,playbackEase:null,playbackRate:1,frameRate:120,loop:0,reversed:!1,alternate:!1,autoplay:!0,duration:w,delay:0,loopDelay:0,ease:"out(2)",composition:f.replace,modifier:t=>t,onBegin:B,onBeforeUpdate:B,onUpdate:B,onLoop:B,onPause:B,onComplete:B,onRender:B},O={defaults:z,root:s,scope:null,precision:4,timeScale:1,tickThreshold:200},I={version:"4.0.2",engine:null};t&&(e.AnimeJS||(e.AnimeJS=[]),e.AnimeJS.push(I));const W=t=>t.replace(Y,"$1-$2").toLowerCase(),V=(t,e)=>0===t.indexOf(e),U=Date.now,H=Array.isArray,q=t=>t&&t.constructor===Object,Q=t=>"number"==typeof t&&!isNaN(t),j=t=>"string"==typeof t,G=t=>"function"==typeof t,Z=t=>void 0===t,J=t=>Z(t)||null===t,K=e=>t&&e instanceof SVGElement,tt=t=>D.test(t),et=t=>V(t,"rgb"),st=t=>V(t,"hsl"),it=t=>!O.defaults.hasOwnProperty(t),rt=t=>j(t)?parseFloat(t):t,nt=Math.pow,ot=Math.sqrt,at=Math.sin,ht=Math.cos,lt=Math.abs,ct=Math.exp,dt=Math.ceil,ut=Math.floor,pt=Math.asin,mt=Math.max,ft=Math.atan2,gt=Math.PI,_t=Math.round,yt=(t,e,s)=>ts?s:t,vt={},bt=(t,e)=>{if(e<0)return t;if(!e)return _t(t);let s=vt[e];return s||(s=vt[e]=10**e),_t(t*s)/s},St=(t,e)=>H(e)?e.reduce(((e,s)=>lt(s-t)t+(e-t)*s,Tt=t=>t===1/0?T:t===-1/0?-1e12:t,wt=t=>t<=x?x:Tt(bt(t,11)),kt=t=>H(t)?[...t]:t,$t=(t,e)=>{const s={...t};for(let i in e){const r=t[i];s[i]=Z(r)?e[i]:r}return s},Et=(t,e,s,i="_prev",r="_next")=>{let n=t._head,o=r;for(s&&(n=t._tail,o=i);n;){const t=n[o];e(n),n=t}},Ct=(t,e,s="_prev",i="_next")=>{const r=e[s],n=e[i];r?r[i]=n:t._head=n,n?n[s]=r:t._tail=r,e[s]=null,e[i]=null},Bt=(t,e,s,i="_prev",r="_next")=>{let n=t._tail;for(;n&&s&&s(n,e);)n=n[i];const o=n?n[r]:t._head;n?n[r]=e:t._head=e,o?o[i]=e:t._tail=e,e[i]=n,e[r]=o};class Dt{constructor(t=0){this.deltaTime=0,this._currentTime=t,this._elapsedTime=t,this._startTime=t,this._lastTime=t,this._scheduledTime=0,this._frameDuration=bt(w/120,0),this._fps=120,this._speed=1,this._hasChildren=!1,this._head=null,this._tail=null}get fps(){return this._fps}set fps(t){const e=this._frameDuration,s=+t,i=s{const _=t.parent,y=t.duration,b=t.completed,S=t.iterationDuration,T=t.iterationCount,w=t._currentIteration,$=t._loopDelay,E=t._reversed,B=t._alternate,D=t._hasChildren,L=t._delay,N=t._currentTime,A=L+S,F=e-L,P=yt(N,-L,y),R=yt(F,-L,y),Y=F-N,X=R>0,M=R>=y,z=y<=x,I=g===m;let W=0,V=F,U=0;if(T>1){const e=~~(R/(S+(M?0:$)));t._currentIteration=yt(e,0,T),M&&t._currentIteration--,W=t._currentIteration%2,V=R%(S+$)||0}const H=E^(B&&W),q=t._ease;let Q=M?H?0:y:H?S-V:V;q&&(Q=S*q(Q/S)||0);const j=(_?_.backwards:F=L&&e<=A||e<=L&&P>L||e>=A&&P!==y)||Q>=A&&P!==y||Q<=L&&P>0||e<=P&&P===y&&b||M&&!b&&z){if(X&&(t.computeDeltaTime(P),s||t.onBeforeUpdate(t)),!D){const e=I||(j?-1*Y:Y)>=O.tickThreshold,p=t._offset+(_?_._offset:0)+L+Q;let m,g,y,b,S=t._head,x=0;for(;S;){const t=S._composition,s=S._currentTime,_=S._changeDuration,T=S._absoluteStartTime+S._changeDuration,w=S._nextRep,$=S._prevRep,E=t!==f.none;if((e||(s!==_||p<=T+(w?w._delay:0))&&(0!==s||p>=S._absoluteStartTime))&&(!E||!S._isOverridden&&(!S._isOverlapped||p<=T)&&(!w||w._isOverridden||p<=w._absoluteStartTime)&&(!$||$._isOverridden||p>=$._absoluteStartTime+$._changeDuration+S._delay))){const e=S._currentTime=yt(Q-S._startTime,0,_),s=S._ease(e/S._updateDuration),p=S._modifier,T=S._valueType,w=S._tweenType,k=w===i,$=T===h,C=$&&k||0===s||1===s?-1:O.precision;let B,D;if($)B=D=p(bt(xt(S._fromNumber,S._toNumber,s),C));else if(T===l)D=p(bt(xt(S._fromNumber,S._toNumber,s),C)),B=`${D}${S._unit}`;else if(T===c){const t=S._fromNumbers,e=S._toNumbers,i=bt(yt(p(xt(t[0],e[0],s)),0,255),0),r=bt(yt(p(xt(t[1],e[1],s)),0,255),0),n=bt(yt(p(xt(t[2],e[2],s)),0,255),0),o=yt(p(bt(xt(t[3],e[3],s),C)),0,1);if(B=`rgba(${i},${r},${n},${o})`,E){const t=S._numbers;t[0]=i,t[1]=r,t[2]=n,t[3]=o}}else if(T===d){B=S._strings[0];for(let t=0,e=S._toNumbers.length;t=y&&!b||j&&F<=x&&b)&&(t.onComplete(t),t.completed=!j):X&&M?T===1/0?t._startTime+=t.duration:t._currentIteration>=T-1&&(t.paused=!0,b||D||(t.completed=!0,s||_&&(j||!_.began)||(t.onComplete(t),t._resolve(t)))):t.completed=!1,U},Nt=(t,e,s,i,r)=>{const n=t._currentIteration;if(Lt(t,e,s,i,r),t._hasChildren){const o=t,a=o.backwards,h=i?e:o._iterationTime,l=U();let c=0,d=!0;if(!i&&o._currentIteration!==n){const t=o.iterationDuration;Et(o,(e=>{if(a){const i=e.duration,r=e._offset+e._delay;s||!(i<=x)||r&&r+i!==t||e.onComplete(e)}else!e.completed&&!e.backwards&&e._currentTime{const e=bt((h-t._offset)*t._speed,12),n=t._fps=o.duration&&(o.paused=!0,o.completed||(o.completed=!0,s||(o.onComplete(o),o._resolve(o))))}},At={animation:null,update:B},Ft=t?requestAnimationFrame:setImmediate,Pt=t?cancelAnimationFrame:clearImmediate;class Rt extends Dt{constructor(e){super(e),this.useDefaultMainLoop=!0,this.pauseOnDocumentHidden=!0,this.defaults=z,this.paused=!(!t||!s.hidden),this.reqId=null}update(){const t=this._currentTime=U();if(this.requestTick(t)){this.computeDeltaTime(t);const e=this._speed,s=this._fps;let i=this._head;for(;i;){const r=i._next;i.paused?(Ct(this,i),this._hasChildren=!!this._tail,i._running=!1,i.completed&&!i._cancelled&&i.cancel()):Nt(i,(t-i._startTime)*i._speed*e,0,0,i._fpst.resetTime())),this.wake()}get speed(){return this._speed*(1===O.timeScale?1:w)}set speed(t){this._speed=t*O.timeScale,Et(this,(t=>t.speed=t._speed))}get timeUnit(){return 1===O.timeScale?"ms":"s"}set timeUnit(t){const e="s"===t,s=e?.001:1;if(O.timeScale!==s){O.timeScale=s,O.tickThreshold=200*s;const t=e?.001:w;this.defaults.duration*=t,this._speed*=t}}get precision(){return O.precision}set precision(t){O.precision=t}}const Yt=(()=>{const e=new Rt(U());return t&&(I.engine=e,s.addEventListener("visibilitychange",(()=>{e.pauseOnDocumentHidden&&(s.hidden?e.pause():e.resume())}))),e})(),Xt=()=>{Yt._head?(Yt.reqId=Ft(Xt),Yt.update()):Yt.reqId=0},Mt=()=>(Pt(Yt.reqId),Yt.reqId=0,Yt);function zt(t){const e=j(t)?O.root.querySelectorAll(t):t;if(e instanceof NodeList||e instanceof HTMLCollection)return e}function Ot(e){if(J(e))return[];if(H(e)){const t=e.flat(1/0),s=[];for(let e=0,i=t.length;e{const e=Ot(t)[0];if(e&&K(e))return e},Vt=(t,e,s)=>{const i=w,r=getComputedStyle(t),n=r.strokeLinecap,o="non-scaling-stroke"===r.vectorEffect?t:null;let a=n;const h=new Proxy(t,{get(t,e){const s=t[e];return e===S?t:"setAttribute"===e?(...e)=>{if("draw"===e[0]){const s=e[1].split(" "),r=+s[0],h=+s[1],l=(t=>{let e=1;if(t&&t.getCTM){const s=t.getCTM();s&&(e=(ot(s.a*s.a+s.b*s.b)+ot(s.c*s.c+s.d*s.d))/2)}return e})(o),c=-1e3*r*l,d=h*i*l+c,u=i*l+(0===r&&1===h||1===r&&0===h?0:10*l)-d;if("butt"!==n){const e=r===h?"butt":n;a!==e&&(t.style.strokeLinecap=`${e}`,a=e)}t.setAttribute("stroke-dashoffset",`${c}`),t.setAttribute("stroke-dasharray",`${d} ${u}`)}return Reflect.apply(s,t,e)}:G(s)?(...e)=>Reflect.apply(s,t,e):s}});return"1000"!==t.getAttribute("pathLength")&&(t.setAttribute("pathLength","1000"),h.setAttribute("draw",`${e} ${s}`)),h},Ut=(t,e,s=0)=>t.getPointAtLength(e+s>=1?e+s:0),Ht=(t,e)=>s=>{const i=+t.getTotalLength(),r=s[y],n=t.getCTM();return{from:0,to:i,modifier:s=>{if("a"===e){const e=Ut(t,s,-1),i=Ut(t,s,1);return 180*ft(i.y-e.y,i.x-e.x)/gt}{const i=Ut(t,s,0);return"x"===e?r||!n?i.x:i.x*n.a+i.y*n.c+n.e:r||!n?i.y:i.x*n.b+i.y*n.d+n.f}}}},qt=["opacity","rotate","overflow","color"],Qt={morphTo:(t,e=.33)=>s=>{const i=Wt(t);if(!i)return;const r="path"===s.tagName,n=r?" ":",",o=s[b];o&&s.setAttribute(r?"d":"points",o);let a="",h="";if(e){const t=s.getTotalLength(),o=i.getTotalLength(),l=Math.max(Math.ceil(t*e),Math.ceil(o*e));for(let e=0;e{const e=Wt(t);if(e)return{translateX:Ht(e,"x"),translateY:Ht(e,"y"),rotate:Ht(e,"a")}},createDrawable:(t,e=0,s=0)=>Ot(t).map((t=>Vt(t,e,s)))},jt=(t,e,s)=>(s<0&&(s+=1),s>1&&(s-=1),s<1/6?t+6*(e-t)*s:s<.5?e:s<2/3?t+(e-t)*(2/3-s)*6:t),Gt=t=>et(t)?(t=>{const e=L.exec(t)||N.exec(t),s=Z(e[4])?1:+e[4];return[+e[1],+e[2],+e[3],s]})(t):tt(t)?(t=>{const e=t.length,s=4===e||5===e;return[+("0x"+t[1]+t[s?1:2]),+("0x"+t[s?2:3]+t[s?2:4]),+("0x"+t[s?3:5]+t[s?3:6]),5===e||9===e?+(+("0x"+t[s?4:7]+t[s?4:8])/255).toFixed(3):1]})(t):st(t)?(t=>{const e=A.exec(t)||F.exec(t),s=+e[1]/360,i=+e[2]/100,r=+e[3]/100,n=Z(e[4])?1:+e[4];let o,a,h;if(0===i)o=a=h=r;else{const t=r<.5?r*(1+i):r+i-r*i,e=2*r-t;o=bt(255*jt(e,t,s+1/3),0),a=bt(255*jt(e,t,s),0),h=bt(255*jt(e,t,s-1/3),0)}return[o,a,h,n]})(t):[0,0,0,1],Zt=(t,e)=>Z(t)?e:t,Jt=(t,e,s,i,r)=>{if(G(t)){const n=()=>{const r=t(e,s,i);return isNaN(+r)?r||0:+r};return r&&(r.func=n),n()}return t},Kt=(t,e)=>t[_]?t[y]&&((t,e)=>{if(qt.includes(e))return!1;if(t.getAttribute(e)||e in t){if("scale"===e){const e=t.parentNode;return e&&"filter"===e.tagName}return!0}})(t,e)?r:E.includes(e)||$.get(e)?o:V(e,"--")?a:e in t.style?n:e in t?i:r:i,te=(t,e,s)=>{const i=t.style[e];i&&s&&(s[e]=i);const r=i||getComputedStyle(t[S]||t).getPropertyValue(e);return"auto"===r?"0":r},ee=(t,e,s,n)=>{const h=Z(s)?Kt(t,e):s;return h===i?t[e]||0:h===r?t.getAttribute(e):h===o?((t,e,s)=>{const i=t.style.transform;let r;if(i){const n=t[v];let o;for(;o=X.exec(i);){const t=o[1],i=o[2].slice(1,-1);n[t]=i,t===e&&(r=i,s&&(s[e]=i))}}return i&&!Z(r)?r:V(e,"scale")?"1":V(e,"rotate")||V(e,"skew")?"0deg":"0px"})(t,e,n):h===a?te(t,e,n).trimStart():te(t,e,n)},se=(t,e,s)=>"-"===s?t-e:"+"===s?t+e:t*e,ie=()=>({t:h,n:0,u:null,o:null,d:null,s:null}),re=(t,e)=>{if(e.t=h,e.n=0,e.u=null,e.o=null,e.d=null,e.s=null,!t)return e;const s=+t;if(isNaN(s)){let s=t;"="===s[1]&&(e.o=s[0],s=s.slice(2));const r=!s.includes(" ")&&R.exec(s);if(r)return e.t=l,e.n=+r[1],e.u=r[2],e;if(e.o)return e.n=+s,e;if(tt(i=s)||et(i)||st(i))return e.t=c,e.d=Gt(s),e;{const t=s.match(P);return e.t=d,e.d=t?t.map(Number):[],e.s=s.split(P)||[],e}}return e.n=s,e;var i},ne=(t,e)=>(e.t=t._valueType,e.n=t._toNumber,e.u=t._unit,e.o=null,e.d=kt(t._toNumbers),e.s=kt(t._strings),e),oe=ie(),ae={_rep:new WeakMap,_add:new Map},he=(t,e,s="_rep")=>{const i=ae[s];let r=i.get(t);return r||(r={},i.set(t,r)),r[e]?r[e]:r[e]={_head:null,_tail:null}},le=(t,e)=>t._isOverridden||t._absoluteStartTime>e._absoluteStartTime,ce=t=>{t._isOverlapped=1,t._isOverridden=1,t._changeDuration=x,t._currentTime=x},de=(t,e)=>{const s=t._composition;if(s===f.replace){const s=t._absoluteStartTime;Bt(e,t,le,"_prevRep","_nextRep");const i=t._prevRep;if(i){const e=i.parent,r=i._absoluteStartTime+i._changeDuration;if(t.parent.id!==e.id&&e.iterationCount>1&&r+(e.duration-e.iterationDuration)>s){ce(i);let t=i._prevRep;for(;t&&t.parent.id===e.id;)ce(t),t=t._prevRep}const n=s-t._delay;if(r>n){const t=i._startTime,e=r-(t+i._updateDuration);i._changeDuration=n-e-t,i._currentTime=i._changeDuration,i._isOverlapped=1,i._changeDuration{t._isOverlapped||(o=!1)})),o){const t=e.parent;if(t){let s=!0;Et(t,(t=>{t!==e&&Et(t,(t=>{t._isOverlapped||(s=!1)}))})),s&&t.cancel()}else e.cancel()}}}else if(s===f.blend){const e=he(t.target,t.property,"_add"),s=(t=>{let e=At.animation;return e||(e={duration:x,computeDeltaTime:B,_offset:0,_delay:0,_head:null,_tail:null},At.animation=e,At.update=()=>{t.forEach((t=>{for(let e in t){const s=t[e],i=s._head;if(i){const t=i._valueType,e=t===d||t===c?kt(i._fromNumbers):null;let r=i._fromNumber,n=s._tail;for(;n&&n!==i;){if(e)for(let t=0,s=n._numbers.length;t{t._fromNumbers[s]=i._fromNumbers[s]-e,t._toNumbers[s]=0})),i._fromNumbers=e}Bt(e,t,null,"_prevAdd","_nextAdd")}return t},ue=t=>{const e=t._composition;if(e!==f.none){const s=t.target,i=t.property,r=ae._rep.get(s)[i];if(Ct(r,t,"_prevRep","_nextRep"),e===f.blend){const e=ae._add,r=e.get(s);if(!r)return;const n=r[i],o=At.animation;Ct(n,t,"_prevAdd","_nextAdd");const a=n._head;if(a&&a===n._tail){Ct(n,a,"_prevAdd","_nextAdd"),Ct(o,a);let t=!0;for(let e in r)if(r[e]._head){t=!1;break}t&&e.delete(s)}}}return t},pe=t=>(t.paused=!0,t.began=!1,t.completed=!1,t),me=t=>t._cancelled?(t._hasChildren?Et(t,me):Et(t,(t=>{t._composition!==f.none&&de(t,he(t.target,t.property))})),t._cancelled=0,t):t;let fe=0;class ge extends Dt{constructor(t={},e=null,s=0){super(0);const{id:i,delay:r,duration:n,reversed:o,alternate:a,loop:h,loopDelay:l,autoplay:c,frameRate:d,playbackRate:u,onComplete:p,onLoop:m,onPause:f,onBegin:g,onBeforeUpdate:_,onUpdate:y}=t;O.scope&&O.scope.revertibles.push(this);const v=e?0:Yt._elapsedTime,b=e?e.defaults:O.defaults,S=G(r)||Z(r)?b.delay:+r,T=G(n)||Z(n)?1/0:+n,w=Zt(h,b.loop),k=Zt(l,b.loopDelay),$=!0===w||w===1/0||w<0?1/0:w+1;let E=0;if(e)E=s;else{let t=U();Yt.paused&&(Yt.requestTick(t),t=Yt._elapsedTime),E=t-Yt._startTime}this.id=Z(i)?++fe:i,this.parent=e,this.duration=Tt((T+k)*$-k)||x,this.backwards=!1,this.paused=!0,this.began=!1,this.completed=!1,this.onBegin=g||b.onBegin,this.onBeforeUpdate=_||b.onBeforeUpdate,this.onUpdate=y||b.onUpdate,this.onLoop=m||b.onLoop,this.onPause=f||b.onPause,this.onComplete=p||b.onComplete,this.iterationDuration=T,this.iterationCount=$,this._autoplay=!e&&Zt(c,b.autoplay),this._offset=E,this._delay=S,this._loopDelay=k,this._iterationTime=0,this._currentIteration=0,this._resolve=B,this._running=!1,this._reversed=+Zt(o,b.reversed),this._reverse=this._reversed,this._cancelled=0,this._alternate=Zt(a,b.alternate),this._prev=null,this._next=null,this._elapsedTime=v,this._startTime=v,this._lastTime=v,this._fps=Zt(d,b.frameRate),this._speed=Zt(u,b.playbackRate)}get cancelled(){return!!this._cancelled}set cancelled(t){t?this.cancel():this.reset(1).play()}get currentTime(){return yt(bt(this._currentTime,O.precision),-this._delay,this.duration)}set currentTime(t){const e=this.paused;this.pause().seek(+t),e||this.resume()}get iterationCurrentTime(){return bt(this._iterationTime,O.precision)}set iterationCurrentTime(t){this.currentTime=this.iterationDuration*this._currentIteration+t}get progress(){return yt(bt(this._currentTime/this.duration,5),0,1)}set progress(t){this.currentTime=this.duration*t}get iterationProgress(){return yt(bt(this._iterationTime/this.iterationDuration,5),0,1)}set iterationProgress(t){const e=this.iterationDuration;this.currentTime=e*this._currentIteration+e*t}get currentIteration(){return this._currentIteration}set currentIteration(t){this.currentTime=this.iterationDuration*yt(+t,0,this.iterationCount-1)}get reversed(){return!!this._reversed}set reversed(t){t?this.reverse():this.play()}get speed(){return super.speed}set speed(t){super.speed=t,this.resetTime()}reset(t=0){return me(this),this._reversed&&!this._reverse&&(this.reversed=!1),this._iterationTime=this.iterationDuration,Nt(this,0,1,t,m),pe(this),this._hasChildren&&Et(this,pe),this}init(t=0){this.fps=this._fps,this.speed=this._speed,!t&&this._hasChildren&&Nt(this,this.duration,1,t,m),this.reset(t);const e=this._autoplay;return!0===e?this.resume():e&&!Z(e.linked)&&e.link(this),this}resetTime(){const t=1/(this._speed*Yt._speed);return this._startTime=U()-(this._currentTime+this._delay)*t,this}pause(){return this.paused||(this.paused=!0,this.onPause(this)),this}resume(){return this.paused?(this.paused=!1,this.duration<=x&&!this._hasChildren?Nt(this,x,0,0,m):(this._running||(Bt(Yt,this),Yt._hasChildren=!0,this._running=!0),this.resetTime(),this._startTime-=12,Yt.wake()),this):this}restart(){return this.reset(0).resume()}seek(t,e=0,s=0){me(this),this.completed=!1;const i=this.paused;return this.paused=!0,Nt(this,t+this._delay,~~e,~~s,p),i?this:this.resume()}alternate(){const t=this._reversed,e=this.iterationCount,s=this.iterationDuration,i=e===1/0?ut(T/s):e;return this._reversed=+(!this._alternate||i%2?!t:t),e===1/0?this.iterationProgress=this._reversed?1-this.iterationProgress:this.iterationProgress:this.seek(s*i-this._currentTime),this.resetTime(),this}play(){return this._reversed&&this.alternate(),this.resume()}reverse(){return this._reversed||this.alternate(),this.resume()}cancel(){return this._hasChildren?Et(this,(t=>t.cancel()),!0):Et(this,ue),this._cancelled=1,this.pause()}stretch(t){const e=this.duration,s=wt(t);if(e===s)return this;const i=t/e,r=t<=x;return this.duration=r?x:s,this.iterationDuration=r?x:wt(this.iterationDuration*i),this._offset*=i,this._delay*=i,this._loopDelay*=i,this}revert(){Nt(this,0,1,0,p);const t=this._autoplay;return t&&t.linked&&t.linked===this&&t.revert(),this.cancel()}complete(){return this.seek(this.duration).cancel()}then(t=B){const e=this.then,s=()=>{this.then=null,t(this),this.then=e,this._resolve=B};return new Promise((t=>(this._resolve=()=>t(s()),this.completed&&this._resolve(),this)))}}const _e=t=>new ge(t,null,0).init(),ye=t=>t,ve=(t,e,s)=>(((1-3*s+3*e)*t+(3*s-6*e))*t+3*e)*t,be=(t=.5,e=0,s=.5,i=1)=>t===e&&s===i?ye:r=>0===r||1===r?r:ve(((t,e,s)=>{let i,r,n=0,o=1,a=0;do{r=n+(o-n)/2,i=ve(r,e,s)-t,i>0?o=r:n=r}while(lt(i)>1e-7&&++a<100);return r})(r,t,s),e,i),Se=(t=10,e)=>{const s=e?dt:ut;return e=>s(yt(e,0,1)*t)*(1/t)},xe=(...t)=>{const e=t.length;if(!e)return ye;const s=e-1,i=t[0],r=t[s],n=[0],o=[rt(i)];for(let e=1;e{const s=[0],i=t-1;for(let t=1;te=>nt(e,+t),Ee={[k]:$e,Quad:$e(2),Cubic:$e(3),Quart:$e(4),Quint:$e(5),Sine:t=>1-ht(t*we),Circ:t=>1-ot(1-t*t),Expo:t=>t?nt(2,10*t-10):0,Bounce:t=>{let e,s=4;for(;t<((e=nt(2,--s))-1)/11;);return 1/nt(4,3-s)-7.5625*nt((3*e-2)/22-t,2)},Back:(t=1.70158)=>e=>(+t+1)*e*e*e-+t*e*e,Elastic:(t=1,e=.3)=>{const s=yt(+t,1,10),i=yt(+e,x,2),r=i/ke*pt(1/s),n=ke/i;return t=>0===t||1===t?t:-s*nt(2,-10*(1-t))*at((1-t-r)*n)}},Ce={in:t=>e=>t(e),out:t=>e=>1-t(1-e),inOut:t=>e=>e<.5?t(2*e)/2:1-t(-2*e+2)/2,outIn:t=>e=>e<.5?(1-t(1-2*e))/2:(t(2*e-1)+1)/2},Be=(t,e,s)=>{if(s[t])return s[t];if(t.indexOf("(")<=-1){const i=Ce[t]||t.includes("Back")||t.includes("Elastic")?e[t]():e[t];return i?s[t]=i:ye}{const i=t.slice(0,-1).split("("),r=e[i[0]];return r?s[t]=r(...i[1].split(",")):ye}},De=(()=>{const t={linear:xe,irregular:Te,steps:Se,cubicBezier:be};for(let e in Ce)for(let s in Ee){const i=Ee[s],r=Ce[e];t[e+s]=s===k||"Back"===s||"Elastic"===s?(t,e)=>r(i(t,e)):r(i)}return t})(),Le={linear:ye},Ne=t=>G(t)?t:j(t)?Be(t,De,Le):ye,Ae={},Fe=(t,e,s)=>{if(s===o){const e=$.get(t);return e||t}if(s===n||s===r&&K(e)&&t in e.style){const e=Ae[t];if(e)return e;{const e=t?W(t):t;return Ae[t]=e,e}}return t},Pe={deg:1,rad:180/gt,turn:360},Re={},Ye=(t,e,i,r=!1)=>{const n=e.u,o=e.n;if(e.t===l&&n===i)return e;const a=o+n+i,h=Re[a];if(Z(h)||r){let r;if(n in Pe)r=o*Pe[n]/Pe[i];else{const e=100,a=t.cloneNode(),h=t.parentNode,l=h&&h!==s?h:s.body;l.appendChild(a);const c=a.style;c.width=e+n;const d=a.offsetWidth||e;c.width=e+i;const u=d/(a.offsetWidth||e);l.removeChild(a),r=u*o}e.n=r,Re[a]=r}else e.n=h;return e.t,e.u=i,e},Xe=t=>{if(t._hasChildren)Et(t,Xe,!0);else{const e=t;e.pause(),Et(e,(t=>{const s=t.property,i=t.target;if(i[_]){const r=i.style,n=e._inlineStyles[s];if(t._tweenType===o){const e=i[v];if(Z(n)||n===k?delete e[s]:e[s]=n,t._renderTransforms)if(Object.keys(e).length){let t=k;for(let s in e)t+=C[s]+e[s]+") ";r.transform=t}else r.removeProperty("transform")}else Z(n)||n===k?r.removeProperty(s):r[s]=n;e._tail===t&&e.targets.forEach((t=>{t.getAttribute&&t.getAttribute("style")===k&&t.removeAttribute("style")}))}}))}return t},Me=ie(),ze=ie(),Oe={func:null},Ie=[null],We=[null,null],Ve={to:null};let Ue,He,qe=0;class Qe extends ge{constructor(t,e,s,i,r=!1,n=0,a=0){super(e,s,i);const u=It(t),p=u.length,m=e.keyframes,g=m?$t(((t,e)=>{const s={};if(H(t)){const e=[].concat(...t.map((t=>Object.keys(t)))).filter(it);for(let i=0,r=e.length;i{const e={};for(let s in t){const i=t[s];it(s)?s===r&&(e.to=i):e[s]=i}return e}));s[r]=n}}else{const i=Zt(e.duration,O.defaults.duration),r=Object.keys(t).map((e=>({o:parseFloat(e)/100,p:t[e]}))).sort(((t,e)=>t.o-e.o));r.forEach((t=>{const e=t.o,r=t.p;for(let t in r)if(it(t)){let n=s[t];n||(n=s[t]=[]);const o=e*i;let a=n.length,h=n[a-1];const l={to:r[t]};let c=0;for(let t=0;t=w?f.none:Z(T)?$.composition:T,P={},R=this._offset+(s?s._offset:0);let Y=NaN,X=NaN,M=0,z=0;for(let t=0;t2&&e?(Ue=[],u.forEach(((t,e)=>{e?1===e?(We[1]=t,Ue.push(We)):Ue.push(t):We[0]=t}))):Ue=u}else Ie[0]=u,Ue=Ie;let v=null,b=null,S=NaN,T=0,w=0;for(let t=Ue.length;w1?Jt(L,e,i,m)/t:L),e,i,m),$=Jt(Zt(He.delay,w?0:N),e,i,m),E=Jt(Zt(He.composition,F),e,i,m),C=Q(E)?E:f[E],B=He.modifier||A,Y=!Z(p),X=!Z(u),O=H(u),I=O||Y&&X,W=b?T+$:$,V=R+W;z||!Y&&!O||(z=1);let U=b;if(C!==f.none){v||(v=he(e,a));let t=v._head;for(;t&&!t._isOverridden&&t._absoluteStartTime<=V;)if(U=t,t=t._nextRep,t&&t._absoluteStartTime>=V)for(;t;)ce(t),t=t._nextRep}if(I?(re(O?Jt(u[0],e,i,m):p,Me),re(O?Jt(u[1],e,i,m,Oe):u,ze),Me.t===h&&(U?U._valueType===l&&(Me.t=l,Me.u=U._unit):(re(ee(e,a,n,P),oe),oe.t===l&&(Me.t=l,Me.u=oe.u)))):(X?re(u,ze):b?ne(b,ze):re(s&&U&&U.parent.parent===s?U._value:ee(e,a,n,P),ze),Y?re(p,Me):b?ne(b,Me):re(s&&U&&U.parent.parent===s?U._value:ee(e,a,n,P),Me)),Me.o&&(Me.n=se(U?U._toNumber:re(ee(e,a,n,P),oe).n,Me.n,Me.o)),ze.o&&(ze.n=se(Me.n,ze.n,ze.o)),Me.t!==ze.t)if(Me.t===d||ze.t===d){const t=Me.t===d?Me:ze,e=Me.t===d?ze:Me;e.t=d,e.s=kt(t.s),e.d=t.d.map((()=>e.n))}else if(Me.t===l||ze.t===l){const t=Me.t===l?Me:ze,e=Me.t===l?ze:Me;e.t=l,e.u=t.u}else if(Me.t===c||ze.t===c){const t=Me.t===c?Me:ze,e=Me.t===c?ze:Me;e.t=c,e.s=t.s,e.d=[0,0,0,1]}if(Me.u!==ze.u){let t=ze.u?Me:ze;t=Ye(e,t,ze.u?ze.u:Me.u,!1)}if(ze.d&&Me.d&&ze.d.length!==Me.d.length){const t=Me.d.length>ze.d.length?Me:ze,e=t===Me?ze:Me;e.d=t.d.map(((t,s)=>Z(e.d[s])?0:e.d[s])),e.s=kt(t.s)}const j=bt(+k||x,12),G={parent:this,id:qe++,property:a,target:e,_value:null,_func:Oe.func,_ease:Ne(y),_fromNumbers:kt(Me.d),_toNumbers:kt(ze.d),_strings:kt(ze.s),_fromNumber:Me.n,_toNumber:ze.n,_numbers:kt(Me.d),_number:Me.n,_unit:ze.u,_modifier:B,_currentTime:0,_startTime:W,_delay:+$,_updateDuration:j,_changeDuration:j,_absoluteStartTime:V,_tweenType:n,_valueType:ze.t,_composition:C,_isOverlapped:0,_isOverridden:0,_renderTransforms:0,_prevRep:null,_nextRep:null,_prevAdd:null,_nextAdd:null,_prev:null,_next:null};C!==f.none&&de(G,v),isNaN(S)&&(S=G._startTime),T=bt(W+j,12),b=G,M++,Bt(this,G)}(isNaN(X)||SY)&&(Y=T),n===o&&(_=M-w,y=M)}if(!isNaN(_)){let t=0;Et(this,(e=>{t>=_&&t{t.id===e.id&&(t._renderTransforms=1)}))),t++}))}}p||console.warn("No target found. Make sure the element you're trying to animate is accessible before creating your animation."),X?(Et(this,(t=>{t._startTime-t._delay||(t._delay-=X),t._startTime-=X})),Y-=X):X=0,Y||(Y=x,this.iterationCount=0),this.targets=u,this.duration=Y===x?x:Tt((Y+this._loopDelay)*this.iterationCount-this._loopDelay)||x,this.onRender=k||$.onRender,this._ease=C,this._delay=X,this.iterationDuration=Y,this._inlineStyles=P,!this._autoplay&&z&&this.onRender(this)}stretch(t){const e=this.duration;if(e===wt(t))return this;const s=t/e;return Et(this,(t=>{t._updateDuration=wt(t._updateDuration*s),t._changeDuration=wt(t._changeDuration*s),t._currentTime*=s,t._startTime*=s,t._absoluteStartTime*=s})),super.stretch(t)}refresh(){return Et(this,(t=>{const e=ee(t.target,t.property,t._tweenType);re(e,oe),t._fromNumbers=kt(oe.d),t._fromNumber=oe.n,t._func&&(re(t._func(),ze),t._toNumbers=kt(ze.d),t._strings=kt(ze.s),t._toNumber=ze.n)})),this}revert(){return super.revert(),Xe(this)}then(t){return super.then(t)}}const je=(t,e)=>new Qe(t,e,null,0,!1).init(),Ge=(t,e=100)=>{const s=[];for(let i=0;i<=e;i++)s.push(t(i/e));return`linear(${s.join(", ")})`},Ze={in:"ease-in",out:"ease-out",inOut:"ease-in-out"},Je=(()=>{const t={};for(let e in Ce)t[e]=t=>Ce[e]($e(t));return t})(),Ke=t=>{let e=Ze[t];if(e)return e;if(e="linear",j(t)){if(V(t,"linear")||V(t,"cubic-")||V(t,"steps")||V(t,"ease"))e=t;else if(V(t,"cubicB"))e=W(t);else{const s=Be(t,Je,Ze);G(s)&&(e=s===ye?"linear":Ge(s))}Ze[t]=e}else if(G(t)){const s=Ge(t);s&&(e=s)}else t.ease&&(e=Ge(t.ease));return e},ts=["x","y","z"],es=["perspective","width","height","margin","padding","top","right","bottom","left","borderWidth","fontSize","borderRadius",...ts],ss=[...ts,...E.filter((t=>["X","Y","Z"].some((e=>t.endsWith(e)))))];let is=t&&(Z(CSS)||!Object.hasOwnProperty.call(CSS,"registerProperty"));const rs={_head:null,_tail:null},ns=(t,e,s)=>{let i=rs._head;for(;i;){const r=i._next,n=i.$el===t,o=!e||i.property===e,a=!s||i.parent===s;if(n&&o&&a){const t=i.animation;try{t.commitStyles()}catch{}t.cancel(),Ct(rs,i);const e=i.parent;e&&(e._completed++,e.animations.length===e._completed&&(e.completed=!0,e.muteCallbacks||(e.paused=!0,e.onComplete(e),e._resolve(e))))}i=r}},os=(t,e,s,i,r)=>{const n=e.animate(i,r),o=r.delay+ +r.duration*r.iterations;n.playbackRate=t._speed,t.paused&&n.pause(),t.duration{ns(e,s,t)};return n.onremove=a,n.onfinish=a,n},as=(t,e,s,i,r)=>{let n=Jt(e,s,i,r);return Q(n)?es.includes(t)||V(t,"translate")?`${n}px`:V(t,"rotate")||V(t,"skew")?`${n}deg`:`${n}`:n},hs=(t,e,s,i,r,n)=>{let o="0";const a=Z(i)?getComputedStyle(t)[e]:as(e,i,t,r,n);if(Z(s))o=H(i)?i.map((s=>as(e,s,t,r,n))):a;else{o=[as(e,s,t,r,n),a]}return o};class ls{constructor(t,e){O.scope&&O.scope.revertibles.push(this),is||(E.forEach((t=>{const e=V(t,"skew"),s=V(t,"scale"),i=V(t,"rotate"),r=V(t,"translate"),n=i||e,o=n?"":s?"":r?"":"*";try{CSS.registerProperty({name:"--"+t,syntax:o,inherits:!1,initialValue:r?"0px":n?"0deg":s?"1":"0"})}catch{}})),is=!0);const s=It(t),i=s.length;i||console.warn("No target found. Make sure the element you're trying to animate is accessible before creating your animation.");const r=Zt(e.ease,Ke(O.defaults.ease)),n=r.ease&&r,o=Zt(e.autoplay,O.defaults.autoplay),a=!(!o||!o.link)&&o,h=e.alternate&&!0===e.alternate,l=e.reversed&&!0===e.reversed,c=Zt(e.loop,O.defaults.loop),d=!0===c||c===1/0?1/0:Q(c)?c+1:1,u=h?l?"alternate-reverse":"alternate":l?"reverse":"normal",p=Ke(r),m=1===O.timeScale?1:w;this.targets=s,this.animations=[],this.controlAnimation=null,this.onComplete=e.onComplete||B,this.duration=0,this.muteCallbacks=!1,this.completed=!1,this.paused=!o||!1!==a,this.reversed=l,this.autoplay=o,this._speed=Zt(e.playbackRate,O.defaults.playbackRate),this._resolve=B,this._completed=0,this._inlineStyles=s.map((t=>t.getAttribute("style"))),s.forEach(((t,s)=>{const o=t[v],a=ss.some((t=>e.hasOwnProperty(t))),h=(n?n.duration:Jt(Zt(e.duration,O.defaults.duration),t,s,i))*m,l=Jt(Zt(e.delay,O.defaults.delay),t,s,i)*m,c=Zt(e.composition,"replace");for(let n in e){if(!it(n))continue;const f={},g={iterations:d,direction:u,fill:"forwards",easing:p,duration:h,delay:l,composite:c},_=e[n],y=!!a&&(E.includes(n)?n:$.get(n));let v;if(q(_)){const e=_,a=Zt(e.ease,r),d=a.ease&&a,u=e.to,p=e.from;if(g.duration=(d?d.duration:Jt(Zt(e.duration,h),t,s,i))*m,g.delay=Jt(Zt(e.delay,l),t,s,i)*m,g.composite=Zt(e.composition,c),g.easing=Ke(a),v=hs(t,n,p,u,s,i),y?(f[`--${y}`]=v,o[y]=v):f[n]=hs(t,n,p,u,s,i),os(this,t,n,f,g),!Z(p))if(y){const e=`--${y}`;t.style.setProperty(e,f[e][0])}else t.style[n]=f[n][0]}else v=H(_)?_.map((e=>as(n,e,t,s,i))):as(n,_,t,s,i),y?(f[`--${y}`]=v,o[y]=v):f[n]=v,os(this,t,n,f,g)}if(a){let e=k;for(let t in o)e+=`${C[t]}var(--${t})) `;t.style.transform=e}})),a&&this.autoplay.link(this)}forEach(t){const e=j(t)?e=>e[t]():t;return this.animations.forEach(e),this}get speed(){return this._speed}set speed(t){this._speed=+t,this.forEach((e=>e.playbackRate=t))}get currentTime(){const t=this.controlAnimation,e=O.timeScale;return this.completed?this.duration:t?+t.currentTime*(1===e?1:e):0}set currentTime(t){const e=t*(1===O.timeScale?1:w);this.forEach((t=>{e>=this.duration&&t.play(),t.currentTime=e}))}get progress(){return this.currentTime/this.duration}set progress(t){this.forEach((e=>e.currentTime=t*this.duration||0))}resume(){return this.paused?(this.paused=!1,this.forEach("play")):this}pause(){return this.paused?this:(this.paused=!0,this.forEach("pause"))}alternate(){return this.reversed=!this.reversed,this.forEach("reverse"),this.paused&&this.forEach("pause"),this}play(){return this.reversed&&this.alternate(),this.resume()}reverse(){return this.reversed||this.alternate(),this.resume()}seek(t,e=!1){return e&&(this.muteCallbacks=!0),tt.setAttribute("style",this._inlineStyles[e]))),this}then(t=B){const e=this.then,s=()=>{this.then=null,t(this),this.then=e,this._resolve=B};return new Promise((t=>(this._resolve=()=>t(s()),this.completed&&this._resolve(),this)))}}const cs={animate:(t,e)=>new ls(t,e),convertEase:Ge},ds=(t=B)=>new ge({duration:1*O.timeScale,onComplete:t},null,0).resume();function us(t,e,s){const i=It(t);if(!i.length)return;const[r]=i,n=Kt(r,e),o=Fe(e,r,n);let a=ee(r,o);if(Z(s))return a;if(re(a,oe),oe.t===h||oe.t===l){if(!1===s)return oe.n;{const t=Ye(r,oe,s,!1);return`${bt(t.n,O.precision)}${t.u}`}}}const ps=(t,e)=>{if(!Z(e))return e.duration=x,e.composition=Zt(e.composition,f.none),new Qe(t,e,null,0,!0).resume()},ms=(t,e,s)=>{let i=!1;return Et(e,(r=>{const n=r.target;if(t.includes(n)){const t=r.property,a=r._tweenType,h=Fe(s,n,a);(!h||h&&h===t)&&(r.parent._tail===r&&r._tweenType===o&&r._prev&&r._prev._tweenType===o&&(r._prev._renderTransforms=1),Ct(e,r),ue(r),i=!0)}}),!0),i},fs=(t,e,s)=>{const i=Ot(t),r=e||Yt,n=e&&e.controlAnimation&&e;for(let t=0,e=i.length;t{if(!n._hasChildren)if(o=ms(i,n,s),o&&!n._head)n.cancel(),Ct(r,n);else{const t=n._offset+n._delay+n.duration;t>e&&(e=t)}n._head?fs(t,n,s):n._hasChildren=!1}),!0),Z(r.iterationDuration)||(r.iterationDuration=e)}else o=ms(i,r,s);return o&&!r._head&&(r._hasChildren=!1,r.cancel&&r.cancel()),i},gs=(t,e,s)=>{const i=10**(s||0);return ut((Math.random()*(e-t+1/i)+t)*i)/i},_s=(t,e,s,i,r)=>i+(t-e)/(s-e)*(r-i),ys=(t,e,s,i)=>{let r=w/O.defaults.frameRate;if(!1!==i){const t=i||Yt._hasChildren&&Yt;t&&t.deltaTime&&(r=t.deltaTime)}const n=1-Math.exp(-s*r*.1);return s?1===s?e:(1-n)*t+n*e:t},vs=t=>(...e)=>{const s=t(...e);return new Proxy(B,{apply:(t,e,[i])=>s(i),get:(t,e)=>vs(((...t)=>{const i=Ss[e](...t);return t=>i(s(t))}))})},bs=(t,e=0)=>(...s)=>(s.length(...s)=>e?e=>t(...s,e):e=>t(e,...s))(t,e)):t)(...s),Ss={$:It,get:us,set:ps,remove:fs,cleanInlineStyles:Xe,random:gs,randomPick:t=>t[gs(0,t.length-1)],shuffle:t=>{let e,s,i=t.length;for(;i;)s=gs(0,--i),e=t[i],t[i]=t[s],t[s]=e;return t},lerp:ys,sync:ds,clamp:bs(yt),round:bs(bt),snap:bs(St),wrap:bs(((t,e,s)=>((t-e)%(s-e)+(s-e))%(s-e)+e)),interpolate:bs(xt,1),mapRange:bs(_s),roundPad:bs(((t,e)=>(+t).toFixed(e))),padStart:bs(((t,e,s)=>`${t}`.padStart(e,s))),padEnd:bs(((t,e,s)=>`${t}`.padEnd(e,s))),degToRad:bs((t=>t*gt/180)),radToDeg:bs((t=>180*t/gt))},xs=(t,e)=>{let s=t.iterationDuration;if(s===x&&(s=0),Z(e))return s;if(Q(+e))return+e;const i=e,r=t?t.labels:null,n=!J(r),o=((t,e)=>{if(V(e,"<")){const s="<"===e[1],i=t._tail,r=i?i._offset+i._delay:0;return s?r:r+i.duration}})(t,i),a=!Z(o),h=M.exec(i);if(h){const t=h[0],e=i.split(t),l=n&&e[0]?r[e[0]]:s,c=a?o:n?l:s,d=+e[1];return se(c,d,t[0])}return a?o:n?Z(r[i])?s:r[i]:s};function Ts(t,e,s,i,r,n){const o=Q(t.duration)&&t.duration<=x?s-x:s;Nt(e,o,1,1,p);const a=i?new Qe(i,t,e,o,!1,r,n):new ge(t,e,o);return a.init(1),Bt(e,a),Et(e,(t=>{const s=t._offset+t._delay+t.duration;s>e.iterationDuration&&(e.iterationDuration=s)})),e.duration=function(t){return Tt((t.iterationDuration+t._loopDelay)*t.iterationCount-t._loopDelay)||x}(e),e}class ws extends ge{constructor(t={}){super(t,null,0),this.duration=0,this.labels={};const e=t.defaults,s=O.defaults;this.defaults=e?$t(e,s):s,this.onRender=t.onRender||s.onRender;const i=Zt(t.playbackEase,s.playbackEase);this._ease=i?Ne(i):null,this.iterationDuration=0}add(t,e,s){const i=q(e),r=q(t);if(i||r){if(this._hasChildren=!0,i){const i=e;if(G(s)){const e=s,r=Ot(t),n=this.duration,o=this.iterationDuration,a=i.id;let h=0;const l=r.length;r.forEach((t=>{const s={...i};this.duration=n,this.iterationDuration=o,Z(a)||(s.id=a+"-"+h),Ts(s,this,e(t,h,l,this),t,h,l),h++}))}else Ts(i,this,xs(this,s),t)}else Ts(t,this,xs(this,e));return this.init(1)}}sync(t,e){if(Z(t)||t&&Z(t.pause))return this;t.pause();const s=+(t.effect?t.effect.getTiming().duration:t.duration);return this.add(t,{currentTime:[0,s],duration:s,ease:"linear"},e)}set(t,e,s){return Z(e)?this:(e.duration=x,e.composition=f.replace,this.add(t,e,s))}call(t,e){return Z(t)||t&&!G(t)?this:this.add({duration:0,onComplete:()=>t(this)},e)}label(t,e){return Z(t)||t&&!j(t)||(this.labels[t]=xs(this,e)),this}remove(t,e){return fs(t,this,e),this}stretch(t){const e=this.duration;if(e===wt(t))return this;const s=t/e,i=this.labels;Et(this,(t=>t.stretch(t.duration*s)));for(let t in i)i[t]*=s;return super.stretch(t)}refresh(){return Et(this,(t=>{t.refresh&&t.refresh()})),this}revert(){return super.revert(),Et(this,(t=>t.revert),!0),Xe(this)}then(t){return super.then(t)}}const ks=t=>new ws(t).init();class $s{constructor(t,e){O.scope&&O.scope.revertibles.push(this);const s={},i={};if(this.targets=[],this.animations={},!Z(t)&&!Z(e)){for(let t in e){const r=e[t];it(t)?i[t]=r:s[t]=r}for(let e in i){const r=i[e],n=q(r);let o={},a="+=0";if(n){const t=r.unit;j(t)&&(a+=t)}else o.duration=r;o[e]=n?$t({to:a},r):a;const h=$t(s,o);h.composition=f.replace,h.autoplay=!1;const l=this.animations[e]=new Qe(t,h,null,0,!1).init();this.targets.length||this.targets.push(...l.targets),this[e]=(t,e,s)=>{const i=l._head;if(Z(t)&&i){const t=i._numbers;return t&&t.length?t:i._modifier(i._number)}return Et(l,(e=>{if(H(t))for(let s=0,i=t.length;snew $s(t,e);class Cs{constructor(t={}){this.timeStep=.02,this.restThreshold=5e-4,this.restDuration=200,this.maxDuration=6e4,this.maxRestSteps=this.restDuration/this.timeStep/w,this.maxIterations=this.maxDuration/this.timeStep/w,this.m=yt(Zt(t.mass,1),0,w),this.s=yt(Zt(t.stiffness,100),1,w),this.d=yt(Zt(t.damping,10),.1,w),this.v=yt(Zt(t.velocity,0),-1e3,w),this.w0=0,this.zeta=0,this.wd=0,this.b=0,this.solverDuration=0,this.duration=0,this.compute(),this.ease=t=>0===t||1===t?t:this.solve(t*this.solverDuration)}solve(t){const{zeta:e,w0:s,wd:i,b:r}=this;let n=t;return n=e<1?ct(-n*e*s)*(1*ht(i*n)+r*at(i*n)):(1+r*n)*ct(-n*s),1-n}compute(){const{maxRestSteps:t,maxIterations:e,restThreshold:s,timeStep:i,m:r,d:n,s:o,v:a}=this,h=this.w0=yt(ot(o/r),x,w),l=this.zeta=n/(2*ot(o*r)),c=this.wd=l<1?h*ot(1-l*l):0;this.b=l<1?(l*h-a)/c:-a+h;let d=0,u=0,p=0;for(;unew Cs(t),Ds=t=>{t.cancelable&&t.preventDefault()};class Ls{constructor(t){this.el=t,this.zIndex=0,this.parentElement=null,this.classList={add:B,remove:B}}get x(){return this.el.x||0}set x(t){this.el.x=t}get y(){return this.el.y||0}set y(t){this.el.y=t}get width(){return this.el.width||0}set width(t){this.el.width=t}get height(){return this.el.height||0}set height(t){this.el.height=t}getBoundingClientRect(){return{top:this.y,right:this.x,bottom:this.y+this.height,left:this.x+this.width}}}class Ns{constructor(t){this.$el=t,this.inlineTransforms=[],this.point=new DOMPoint,this.inversedMatrix=this.getMatrix().inverse()}normalizePoint(t,e){return this.point.x=t,this.point.y=e,this.point.matrixTransform(this.inversedMatrix)}traverseUp(t){let e=this.$el.parentElement,i=0;for(;e&&e!==s;)t(e,i),e=e.parentElement,i++}getMatrix(){const t=new DOMMatrix;return this.traverseUp((e=>{const s=getComputedStyle(e).transform;if(s){const e=new DOMMatrix(s);t.preMultiplySelf(e)}})),t}remove(){this.traverseUp(((t,e)=>{this.inlineTransforms[e]=t.style.transform,t.style.transform="none"}))}revert(){this.traverseUp(((t,e)=>{const s=this.inlineTransforms[e];""===s?t.style.removeProperty("transform"):t.style.transform=s}))}}const As=(t,e)=>t&&G(t)?t(e):t;let Fs=0;class Ps{constructor(t,i={}){if(!t)return;O.scope&&O.scope.revertibles.push(this);const r=i.x,n=i.y,o=i.trigger,a=i.modifier,h=i.releaseEase,l=h&&Ne(h),c=!Z(h)&&!Z(h.ease),d=q(r)&&!Z(r.mapTo)?r.mapTo:"translateX",u=q(n)&&!Z(n.mapTo)?n.mapTo:"translateY",p=As(i.container,this);this.containerArray=H(p)?p:null,this.$container=p&&!this.containerArray?Ot(p)[0]:s.body,this.useWin=this.$container===s.body,this.$scrollContainer=this.useWin?e:this.$container,this.$target=q(t)?new Ls(t):Ot(t)[0],this.$trigger=Ot(o||t)[0],this.fixed="fixed"===us(this.$target,"position"),this.isFinePointer=!0,this.containerPadding=[0,0,0,0],this.containerFriction=0,this.releaseContainerFriction=0,this.snapX=0,this.snapY=0,this.scrollSpeed=0,this.scrollThreshold=0,this.dragSpeed=0,this.maxVelocity=0,this.minVelocity=0,this.velocityMultiplier=0,this.cursor=!1,this.releaseXSpring=c?h:Bs({mass:Zt(i.releaseMass,1),stiffness:Zt(i.releaseStiffness,80),damping:Zt(i.releaseDamping,20)}),this.releaseYSpring=c?h:Bs({mass:Zt(i.releaseMass,1),stiffness:Zt(i.releaseStiffness,80),damping:Zt(i.releaseDamping,20)}),this.releaseEase=l||De.outQuint,this.hasReleaseSpring=c,this.onGrab=i.onGrab||B,this.onDrag=i.onDrag||B,this.onRelease=i.onRelease||B,this.onUpdate=i.onUpdate||B,this.onSettle=i.onSettle||B,this.onSnap=i.onSnap||B,this.onResize=i.onResize||B,this.onAfterResize=i.onAfterResize||B,this.disabled=[0,0];const m={};if(a&&(m.modifier=a),Z(r)||!0===r)m[d]=0;else if(q(r)){const t=r,e={};t.modifier&&(e.modifier=t.modifier),t.composition&&(e.composition=t.composition),m[d]=e}else!1===r&&(m[d]=0,this.disabled[0]=1);if(Z(n)||!0===n)m[u]=0;else if(q(n)){const t=n,e={};t.modifier&&(e.modifier=t.modifier),t.composition&&(e.composition=t.composition),m[u]=e}else!1===n&&(m[u]=0,this.disabled[1]=1);this.animate=new $s(this.$target,m),this.xProp=d,this.yProp=u,this.destX=0,this.destY=0,this.deltaX=0,this.deltaY=0,this.scroll={x:0,y:0},this.coords=[this.x,this.y,0,0],this.snapped=[0,0],this.pointer=[0,0,0,0,0,0,0,0],this.scrollView=[0,0],this.dragArea=[0,0,0,0],this.containerBounds=[-1e12,T,T,-1e12],this.scrollBounds=[0,0,0,0],this.targetBounds=[0,0,0,0],this.window=[0,0],this.velocityStack=[0,0,0],this.velocityStackIndex=0,this.velocityTime=U(),this.velocity=0,this.angle=0,this.cursorStyles=null,this.triggerStyles=null,this.bodyStyles=null,this.targetStyles=null,this.touchActionStyles=null,this.transforms=new Ns(this.$target),this.overshootCoords={x:0,y:0},this.overshootXTicker=new ge({autoplay:!1},null,0).init(),this.overshootYTicker=new ge({autoplay:!1},null,0).init(),this.updateTicker=new ge({autoplay:!1},null,0).init(),this.overshootXTicker.onUpdate=()=>{this.disabled[0]||(this.updated=!0,this.manual=!0,this.animate[this.xProp](this.overshootCoords.x,0))},this.overshootXTicker.onComplete=()=>{this.disabled[0]||(this.manual=!1,this.animate[this.xProp](this.overshootCoords.x,0))},this.overshootYTicker.onUpdate=()=>{this.disabled[1]||(this.updated=!0,this.manual=!0,this.animate[this.yProp](this.overshootCoords.y,0))},this.overshootYTicker.onComplete=()=>{this.disabled[1]||(this.manual=!1,this.animate[this.yProp](this.overshootCoords.y,0))},this.updateTicker.onUpdate=()=>this.update(),this.contained=!Z(p),this.manual=!1,this.grabbed=!1,this.dragged=!1,this.updated=!1,this.released=!1,this.canScroll=!1,this.enabled=!1,this.initialized=!1,this.activeProp=this.disabled[1]?d:u,this.animate.animations[this.activeProp].onRender=()=>{const t=this.updated,e=!(this.grabbed&&t)&&this.released,s=this.x,i=this.y,r=s-this.coords[2],n=i-this.coords[3];this.deltaX=r,this.deltaY=n,this.coords[2]=s,this.coords[3]=i,t&&this.onUpdate(this),e?(this.computeVelocity(r,n),this.angle=ft(n,r)):this.updated=!1},this.animate.animations[this.activeProp].onComplete=()=>{!this.grabbed&&this.released&&(this.released=!1),this.manual||(this.deltaX=0,this.deltaY=0,this.velocity=0,this.velocityStack[0]=0,this.velocityStack[1]=0,this.velocityStack[2]=0,this.velocityStackIndex=0,this.onSettle(this))},this.resizeTicker=new ge({autoplay:!1,duration:150*O.timeScale,onComplete:()=>{this.onResize(this),this.refresh(),this.onAfterResize(this)}}).init(),this.parameters=i,this.resizeObserver=new ResizeObserver((()=>{this.initialized?this.resizeTicker.restart():this.initialized=!0})),this.enable(),this.refresh(),this.resizeObserver.observe(this.$container),q(t)||this.resizeObserver.observe(this.$target)}computeVelocity(t,e){const s=this.velocityTime,i=U(),r=i-s;if(r<17)return this.velocity;this.velocityTime=i;const n=this.velocityStack,o=this.velocityMultiplier,a=this.minVelocity,h=this.maxVelocity,l=this.velocityStackIndex;n[l]=bt(yt(ot(t*t+e*e)/r*o,a,h),5);const c=mt(n[0],n[1],n[2]);return this.velocity=c,this.velocityStackIndex=(l+1)%3,c}setX(t,e=!1){if(this.disabled[0])return;const s=bt(t,5);return this.overshootXTicker.pause(),this.manual=!0,this.updated=!e,this.destX=s,this.snapped[0]=St(s,this.snapX),this.animate[this.xProp](s,0),this.manual=!1,this}setY(t,e=!1){if(this.disabled[1])return;const s=bt(t,5);return this.overshootYTicker.pause(),this.manual=!0,this.updated=!e,this.destY=s,this.snapped[1]=St(s,this.snapY),this.animate[this.yProp](s,0),this.manual=!1,this}get x(){return bt(this.animate[this.xProp](),O.precision)}set x(t){this.setX(t,!1)}get y(){return bt(this.animate[this.yProp](),O.precision)}set y(t){this.setY(t,!1)}get progressX(){return _s(this.x,this.containerBounds[3],this.containerBounds[1],0,1)}set progressX(t){this.setX(_s(t,0,1,this.containerBounds[3],this.containerBounds[1]),!1)}get progressY(){return _s(this.y,this.containerBounds[0],this.containerBounds[2],0,1)}set progressY(t){this.setY(_s(t,0,1,this.containerBounds[0],this.containerBounds[2]),!1)}updateScrollCoords(){const t=bt(this.useWin?e.scrollX:this.$container.scrollLeft,0),s=bt(this.useWin?e.scrollY:this.$container.scrollTop,0),[i,r,n,o]=this.containerPadding,a=this.scrollThreshold;this.scroll.x=t,this.scroll.y=s,this.scrollBounds[0]=s-this.targetBounds[0]+i-a,this.scrollBounds[1]=t-this.targetBounds[1]-r+a,this.scrollBounds[2]=s-this.targetBounds[2]-n+a,this.scrollBounds[3]=t-this.targetBounds[3]+o-a}updateBoundingValues(){const t=this.$container,i=this.x,r=this.y,n=this.coords[2],o=this.coords[3];this.coords[2]=0,this.coords[3]=0,this.setX(0,!0),this.setY(0,!0),this.transforms.remove();const a=this.window[0]=e.innerWidth,h=this.window[1]=e.innerHeight,l=this.useWin,c=t.scrollWidth,d=t.scrollHeight,u=this.fixed,p=t.getBoundingClientRect(),[m,f,g,_]=this.containerPadding;this.dragArea[0]=l?0:p.left,this.dragArea[1]=l?0:p.top,this.scrollView[0]=l?yt(c,a,c):c,this.scrollView[1]=l?yt(d,h,d):d,this.updateScrollCoords();const{width:y,height:v,left:b,top:S,right:x,bottom:T}=t.getBoundingClientRect();this.dragArea[2]=bt(l?yt(y,a,a):y,0),this.dragArea[3]=bt(l?yt(v,h,h):v,0);const w=us(t,"overflow"),k="visible"===w,$="hidden"===w;if(this.canScroll=!u&&(this.contained&&(t===s.body&&k||!$&&!k)&&(c>this.dragArea[2]+_-f||d>this.dragArea[3]+m-g)&&(!this.containerArray||this.containerArray&&!H(this.containerArray))),this.contained){const e=this.scroll.x,s=this.scroll.y,i=this.canScroll,r=this.$target.getBoundingClientRect(),n=i?l?0:t.scrollLeft:0,o=i?l?0:t.scrollTop:0,c=i?this.scrollView[0]-n-y:0,d=i?this.scrollView[1]-o-v:0;this.targetBounds[0]=bt(r.top+s-(l?0:S),0),this.targetBounds[1]=bt(r.right+e-(l?a:x),0),this.targetBounds[2]=bt(r.bottom+s-(l?h:T),0),this.targetBounds[3]=bt(r.left+e-(l?0:b),0),this.containerArray?(this.containerBounds[0]=this.containerArray[0]+m,this.containerBounds[1]=this.containerArray[1]-f,this.containerBounds[2]=this.containerArray[2]-g,this.containerBounds[3]=this.containerArray[3]+_):(this.containerBounds[0]=-bt(r.top-(u?yt(S,0,h):S)+o-m,0),this.containerBounds[1]=-bt(r.right-(u?yt(x,0,a):x)-c+f,0),this.containerBounds[2]=-bt(r.bottom-(u?yt(T,0,h):T)-d+g,0),this.containerBounds[3]=-bt(r.left-(u?yt(b,0,a):b)+n-_,0))}this.transforms.revert(),this.coords[2]=n,this.coords[3]=o,this.setX(i,!0),this.setY(r,!0)}isOutOfBounds(t,e,s){if(!this.contained)return 0;const[i,r,n,o]=t,[a,h]=this.disabled,l=!a&&er,c=!h&&sn;return l&&!c?1:!l&&c?2:l&&c?3:0}refresh(){const t=this.parameters,i=t.x,r=t.y,n=As(t.container,this),o=As(t.containerPadding,this)||0,a=H(o)?o:[o,o,o,o],h=this.x,l=this.y,c=As(t.cursor,this),d={onHover:"grab",onGrab:"grabbing"};if(c){const{onHover:t,onGrab:e}=c;t&&(d.onHover=t),e&&(d.onGrab=e)}this.containerArray=H(n)?n:null,this.$container=n&&!this.containerArray?Ot(n)[0]:s.body,this.useWin=this.$container===s.body,this.$scrollContainer=this.useWin?e:this.$container,this.isFinePointer=matchMedia("(pointer:fine)").matches,this.containerPadding=Zt(a,[0,0,0,0]),this.containerFriction=yt(Zt(As(t.containerFriction,this),.8),0,1),this.releaseContainerFriction=yt(Zt(As(t.releaseContainerFriction,this),this.containerFriction),0,1),this.snapX=As(q(i)&&!Z(i.snap)?i.snap:t.snap,this),this.snapY=As(q(r)&&!Z(r.snap)?r.snap:t.snap,this),this.scrollSpeed=Zt(As(t.scrollSpeed,this),1.5),this.scrollThreshold=Zt(As(t.scrollThreshold,this),20),this.dragSpeed=Zt(As(t.dragSpeed,this),1),this.minVelocity=Zt(As(t.minVelocity,this),0),this.maxVelocity=Zt(As(t.maxVelocity,this),50),this.velocityMultiplier=Zt(As(t.velocityMultiplier,this),1),this.cursor=!1!==c&&d,this.updateBoundingValues();const[u,p,m,f]=this.containerBounds;this.setX(yt(h,f,p),!0),this.setY(yt(l,u,m),!0)}update(){if(this.updateScrollCoords(),this.canScroll){const[t,e,s,i]=this.containerPadding,[r,n]=this.scrollView,o=this.dragArea[2],a=this.dragArea[3],h=this.scroll.x,l=this.scroll.y,c=this.$container.scrollWidth,d=this.$container.scrollHeight,u=this.useWin?yt(c,this.window[0],c):c,p=this.useWin?yt(d,this.window[1],d):d,m=r-u,f=n-p;this.dragged&&m>0&&(this.coords[0]-=m,this.scrollView[0]=u),this.dragged&&f>0&&(this.coords[1]-=f,this.scrollView[1]=p);const g=10*this.scrollSpeed,_=this.scrollThreshold,[y,v]=this.coords,[b,S,x,T]=this.scrollBounds,w=bt(yt((v-b+t)/_,-1,0)*g,0),k=bt(yt((y-S-e)/_,0,1)*g,0),$=bt(yt((v-x-s)/_,0,1)*g,0),E=bt(yt((y-T+i)/_,-1,0)*g,0);if(w||$||E||k){const[t,e]=this.disabled;let s=h,i=l;t||(s=bt(yt(h+(E||k),0,r-o),0),this.coords[0]-=h-s),e||(i=bt(yt(l+(w||$),0,n-a),0),this.coords[1]-=l-i),this.useWin?this.$scrollContainer.scrollBy(-(h-s),-(l-i)):this.$scrollContainer.scrollTo(s,i)}}const[t,e,s,i]=this.containerBounds,[r,n,o,a,h,l]=this.pointer;this.coords[0]+=(r-h)*this.dragSpeed,this.coords[1]+=(n-l)*this.dragSpeed,this.pointer[4]=r,this.pointer[5]=n;const[c,d]=this.coords,[u,p]=this.snapped,m=(1-this.containerFriction)*this.dragSpeed;this.setX(c>e?e+(c-e)*m:cs?s+(d-s)*m:d{this.canScroll=!1,this.$scrollContainer.scrollTo(n.x,n.y)}}).init().then((()=>{this.canScroll=a}))}return this}handleHover(){this.isFinePointer&&this.cursor&&!this.cursorStyles&&(this.cursorStyles=ps(this.$trigger,{cursor:this.cursor.onHover}))}animateInView(t,e=0,s=De.inOutQuad){this.stop(),this.updateBoundingValues();const i=this.x,r=this.y,[n,o,a,h]=this.containerPadding,l=this.scroll.y-this.targetBounds[0]+n+e,c=this.scroll.x-this.targetBounds[1]-o-e,d=this.scroll.y-this.targetBounds[2]-a-e,u=this.scroll.x-this.targetBounds[3]+h+e,p=this.isOutOfBounds([l,c,d,u],i,r);if(p){const[e,n]=this.disabled,o=yt(St(i,this.snapX),u,c),a=yt(St(r,this.snapY),l,d),h=Z(t)?350*O.timeScale:t;e||1!==p&&3!==p||this.animate[this.xProp](o,h,s),n||2!==p&&3!==p||this.animate[this.yProp](a,h,s)}return this}handleDown(t){const e=t.target;if(this.grabbed||"range"===e.type)return;t.stopPropagation(),this.grabbed=!0,this.released=!1,this.stop(),this.updateBoundingValues();const i=t.changedTouches,r=i?i[0].clientX:t.clientX,n=i?i[0].clientY:t.clientY,{x:o,y:a}=this.transforms.normalizePoint(r,n),[h,l,c,d]=this.containerBounds,u=(1-this.containerFriction)*this.dragSpeed,p=this.x,m=this.y;this.coords[0]=this.coords[2]=u?p>l?l+(p-l)/u:pc?c+(m-c)/u:mFs?f:Fs)+1,this.targetStyles=ps(this.$target,{zIndex:Fs}),this.triggerStyles&&(this.triggerStyles.revert(),this.triggerStyles=null),this.cursorStyles&&(this.cursorStyles.revert(),this.cursorStyles=null),this.isFinePointer&&this.cursor&&(this.bodyStyles=ps(s.body,{cursor:this.cursor.onGrab})),this.scrollInView(100,0,De.out(3)),this.onGrab(this),s.addEventListener("touchmove",this),s.addEventListener("touchend",this),s.addEventListener("touchcancel",this),s.addEventListener("mousemove",this),s.addEventListener("mouseup",this),s.addEventListener("selectstart",this)}handleMove(t){if(!this.grabbed)return;const e=t.changedTouches,s=e?e[0].clientX:t.clientX,i=e?e[0].clientY:t.clientY,{x:r,y:n}=this.transforms.normalizePoint(s,i),o=r-this.pointer[6],a=n-this.pointer[7];let h=t.target,l=!1,c=!1,d=!1;for(;e&&h&&h!==this.$trigger;){const t=us(h,"overflow-y");if("hidden"!==t&&"visible"!==t){const{scrollTop:t,scrollHeight:e,clientHeight:s}=h;if(e>s){d=!0,l=t<=3,c=t>=e-s-3;break}}h=h.parentNode}d&&(!l&&!c||l&&a<0||c&&a>0)?(this.pointer[0]=r,this.pointer[1]=n,this.pointer[2]=r,this.pointer[3]=n,this.pointer[4]=r,this.pointer[5]=n,this.pointer[6]=r,this.pointer[7]=n):(Ds(t),this.triggerStyles||(this.triggerStyles=ps(this.$trigger,{pointerEvents:"none"})),this.$trigger.addEventListener("touchstart",Ds,{passive:!1}),this.$trigger.addEventListener("touchmove",Ds,{passive:!1}),this.$trigger.addEventListener("touchend",Ds),(!this.disabled[0]&<(o)>3||!this.disabled[1]&<(a)>3)&&(this.updateTicker.resume(),this.pointer[2]=this.pointer[0],this.pointer[3]=this.pointer[1],this.pointer[0]=r,this.pointer[1]=n,this.dragged=!0,this.released=!1,this.onDrag(this)))}handleUp(){if(!this.grabbed)return;this.updateTicker.pause(),this.triggerStyles&&(this.triggerStyles.revert(),this.triggerStyles=null),this.bodyStyles&&(this.bodyStyles.revert(),this.bodyStyles=null);const[t,e]=this.disabled,[i,r,n,o,a,h]=this.pointer,[l,c,d,u]=this.containerBounds,[p,m]=this.snapped,g=this.releaseXSpring,_=this.releaseYSpring,y=this.releaseEase,v=this.hasReleaseSpring,b=this.overshootCoords,S=this.x,x=this.y,T=this.computeVelocity(i-a,r-h),w=this.angle=ft(r-o,i-n),k=150*T,$=(1-this.releaseContainerFriction)*this.dragSpeed,E=S+ht(w)*k,C=x+at(w)*k,B=E>c?c+(E-c)*$:Ed?d+(C-d)*$:Cc?-1:1:SX&&(X=F)}if(!e){const e=N===d?x>d?-1:1:xX&&(X=P)}if(!v&&A&&$&&(F||P)){const t=f.blend;new Qe(b,{x:{to:B,duration:.65*F},y:{to:D,duration:.65*P},ease:y,composition:t}).init(),new Qe(b,{x:{to:L,duration:F},y:{to:N,duration:P},ease:y,composition:t}).init(),this.overshootXTicker.stretch(F).restart(),this.overshootYTicker.stretch(P).restart()}else t||this.animate[this.xProp](L,F,R),e||this.animate[this.yProp](N,P,Y);this.scrollInView(X,this.scrollThreshold,y);let M=!1;L!==p&&(this.snapped[0]=L,this.snapX&&(M=!0)),N!==m&&this.snapY&&(this.snapped[1]=N,this.snapY&&(M=!0)),M&&this.onSnap(this),this.grabbed=!1,this.dragged=!1,this.updated=!0,this.released=!0,this.onRelease(this),this.$trigger.removeEventListener("touchstart",Ds),this.$trigger.removeEventListener("touchmove",Ds),this.$trigger.removeEventListener("touchend",Ds),s.removeEventListener("touchmove",this),s.removeEventListener("touchend",this),s.removeEventListener("touchcancel",this),s.removeEventListener("mousemove",this),s.removeEventListener("mouseup",this),s.removeEventListener("selectstart",this)}reset(){return this.stop(),this.resizeTicker.pause(),this.grabbed=!1,this.dragged=!1,this.updated=!1,this.released=!1,this.canScroll=!1,this.setX(0,!0),this.setY(0,!0),this.coords[0]=0,this.coords[1]=0,this.pointer[0]=0,this.pointer[1]=0,this.pointer[2]=0,this.pointer[3]=0,this.pointer[4]=0,this.pointer[5]=0,this.pointer[6]=0,this.pointer[7]=0,this.velocity=0,this.velocityStack[0]=0,this.velocityStack[1]=0,this.velocityStack[2]=0,this.velocityStackIndex=0,this.angle=0,this}enable(){return this.enabled||(this.enabled=!0,this.$target.classList.remove("is-disabled"),this.touchActionStyles=ps(this.$trigger,{touchAction:this.disabled[0]?"pan-x":this.disabled[1]?"pan-y":"none"}),this.$trigger.addEventListener("touchstart",this,{passive:!0}),this.$trigger.addEventListener("mousedown",this,{passive:!0}),this.$trigger.addEventListener("mouseenter",this)),this}disable(){return this.enabled=!1,this.grabbed=!1,this.dragged=!1,this.updated=!1,this.released=!1,this.canScroll=!1,this.touchActionStyles.revert(),this.cursorStyles&&(this.cursorStyles.revert(),this.cursorStyles=null),this.triggerStyles&&(this.triggerStyles.revert(),this.triggerStyles=null),this.bodyStyles&&(this.bodyStyles.revert(),this.bodyStyles=null),this.targetStyles&&(this.targetStyles.revert(),this.targetStyles=null),this.stop(),this.$target.classList.add("is-disabled"),this.$trigger.removeEventListener("touchstart",this),this.$trigger.removeEventListener("mousedown",this),this.$trigger.removeEventListener("mouseenter",this),s.removeEventListener("touchmove",this),s.removeEventListener("touchend",this),s.removeEventListener("touchcancel",this),s.removeEventListener("mousemove",this),s.removeEventListener("mouseup",this),s.removeEventListener("selectstart",this),this}revert(){return this.reset(),this.disable(),this.$target.classList.remove("is-disabled"),this.updateTicker.revert(),this.overshootXTicker.revert(),this.overshootYTicker.revert(),this.resizeTicker.revert(),this.animate.revert(),this}handleEvent(t){switch(t.type){case"mousedown":case"touchstart":this.handleDown(t);break;case"mousemove":case"touchmove":this.handleMove(t);break;case"mouseup":case"touchend":case"touchcancel":this.handleUp();break;case"mouseenter":this.handleHover();break;case"selectstart":Ds(t)}}}const Rs=(t,e)=>new Ps(t,e);class Ys{constructor(t={}){O.scope&&O.scope.revertibles.push(this);const i=t.root;let r=s;i&&(r=i.current||i.nativeElement||Ot(i)[0]||s);const n=t.defaults,o=O.defaults,a=t.mediaQueries;if(this.defaults=n?$t(n,o):o,this.root=r,this.constructors=[],this.revertConstructors=[],this.revertibles=[],this.methods={},this.matches={},this.mediaQueryLists={},this.data={},a)for(let t in a){const s=e.matchMedia(a[t]);this.mediaQueryLists[t]=s,s.addEventListener("change",this)}}execute(t){let e=O.scope,s=O.root,i=O.defaults;O.scope=this,O.root=this.root,O.defaults=this.defaults;const r=this.mediaQueryLists;for(let t in r)this.matches[t]=r[t].matches;const n=t(this);return O.scope=e,O.root=s,O.defaults=i,n}refresh(){return this.execute((()=>{let t=this.revertibles.length,e=this.revertConstructors.length;for(;t--;)this.revertibles[t].revert();for(;e--;)this.revertConstructors[e](this);this.revertibles.length=0,this.revertConstructors.length=0,this.constructors.forEach((t=>{const e=t(this);e&&this.revertConstructors.push(e)}))})),this}add(t,e){if(G(t)){const e=t;this.constructors.push(e),this.execute((()=>{const t=e(this);t&&this.revertConstructors.push(t)}))}else this.methods[t]=(...t)=>this.execute((()=>e(...t)));return this}handleEvent(t){if("change"===t.type)this.refresh()}revert(){const t=this.revertibles,e=this.revertConstructors,s=this.mediaQueryLists;let i=t.length,r=e.length;for(;i--;)t[i].revert();for(;r--;)e[r](this);for(let t in s)s[t].removeEventListener("change",this);t.length=0,e.length=0,this.constructors.length=0,this.matches={},this.methods={},this.mediaQueryLists={},this.data={}}}const Xs=t=>new Ys(t),Ms=(t,e)=>t&&G(t)?t(e):t,zs=new Map;class Os{constructor(t){this.element=t,this.useWin=this.element===s.body,this.winWidth=0,this.winHeight=0,this.width=0,this.height=0,this.left=0,this.top=0,this.zIndex=0,this.scrollX=0,this.scrollY=0,this.prevScrollX=0,this.prevScrollY=0,this.scrollWidth=0,this.scrollHeight=0,this.velocity=0,this.backwardX=!1,this.backwardY=!1,this.scrollTicker=new ge({autoplay:!1,onBegin:()=>this.dataTimer.resume(),onUpdate:()=>{const t=this.backwardX||this.backwardY;Et(this,(t=>t.handleScroll()),t)},onComplete:()=>this.dataTimer.pause()}).init(),this.dataTimer=new ge({autoplay:!1,frameRate:30,onUpdate:t=>{const e=t.deltaTime,s=this.prevScrollX,i=this.prevScrollY,r=this.scrollX,n=this.scrollY,o=s-r,a=i-n;this.prevScrollX=r,this.prevScrollY=n,o&&(this.backwardX=s>r),a&&(this.backwardY=i>n),this.velocity=bt(e>0?Math.sqrt(o*o+a*a)/e:0,5)}}).init(),this.resizeTicker=new ge({autoplay:!1,duration:250*O.timeScale,onComplete:()=>{this.updateWindowBounds(),this.refreshScrollObservers(),this.handleScroll()}}).init(),this.wakeTicker=new ge({autoplay:!1,duration:500*O.timeScale,onBegin:()=>{this.scrollTicker.resume()},onComplete:()=>{this.scrollTicker.pause()}}).init(),this._head=null,this._tail=null,this.updateScrollCoords(),this.updateWindowBounds(),this.updateBounds(),this.refreshScrollObservers(),this.handleScroll(),this.resizeObserver=new ResizeObserver((()=>this.resizeTicker.restart())),this.resizeObserver.observe(this.element),(this.useWin?e:this.element).addEventListener("scroll",this,!1)}updateScrollCoords(){const t=this.useWin,s=this.element;this.scrollX=bt(t?e.scrollX:s.scrollLeft,0),this.scrollY=bt(t?e.scrollY:s.scrollTop,0)}updateWindowBounds(){this.winWidth=e.innerWidth,this.winHeight=(()=>{const t=document.createElement("div");s.body.appendChild(t),t.style.height="100lvh";const e=t.offsetHeight;return s.body.removeChild(t),e})()}updateBounds(){const t=getComputedStyle(this.element),e=this.element;let s,i;if(this.scrollWidth=e.scrollWidth+parseFloat(t.marginLeft)+parseFloat(t.marginRight),this.scrollHeight=e.scrollHeight+parseFloat(t.marginTop)+parseFloat(t.marginBottom),this.updateWindowBounds(),this.useWin)s=this.winWidth,i=this.winHeight;else{const t=e.getBoundingClientRect();s=t.width,i=t.height,this.top=t.top,this.left=t.left}this.width=s,this.height=i}refreshScrollObservers(){Et(this,(t=>{t._debug&&t.removeDebug()})),this.updateBounds(),Et(this,(t=>{t.refresh(),t._debug&&t.debug()}))}refresh(){this.updateWindowBounds(),this.updateBounds(),this.refreshScrollObservers(),this.handleScroll()}handleScroll(){this.updateScrollCoords(),this.wakeTicker.restart()}handleEvent(t){if("scroll"===t.type)this.handleScroll()}revert(){this.scrollTicker.cancel(),this.dataTimer.cancel(),this.resizeTicker.cancel(),this.wakeTicker.cancel(),this.resizeObserver.unobserve(this.element),(this.useWin?e:this.element).removeEventListener("scroll",this),zs.delete(this.element)}}const Is=(t,e,s,i,r)=>{const n="min"===e,o="max"===e,a="top"===e||"left"===e||"start"===e||n?0:"bottom"===e||"right"===e||"end"===e||o?"100%":"center"===e?"50%":e,{n:h,u:l}=re(a,oe);let c=h;return"%"===l?c=h/100*s:l&&(c=Ye(t,oe,"px",!0).n),o&&i<0&&(c+=i),n&&r>0&&(c+=r),c},Ws=(t,e,s,i,r)=>{let n;if(j(e)){const o=M.exec(e);if(o){const a=o[0],h=a[0],l=e.split(a),c="min"===l[0],d="max"===l[0],u=Is(t,l[0],s,i,r),p=Is(t,l[1],s,i,r);if(c){const e=se(Is(t,"min",s),p,h);n=eu?u:e}else n=se(u,p,h)}else n=Is(t,e,s,i,r)}else n=e;return bt(n,0)},Vs=t=>{let e;const s=t.targets;for(let t=0,i=s.length;t()=>{const e=this.linked;return e&&e[t]?e[t]():null})):null,l=a&&h.length>2;this.index=Us++,this.id=Z(t.id)?this.index:t.id,this.container=(t=>{const e=t&&Ot(t)[0]||s.body;let i=zs.get(e);return i||(i=new Os(e),zs.set(e,i)),i})(t.container),this.target=null,this.linked=null,this.repeat=null,this.horizontal=null,this.enter=null,this.leave=null,this.sync=n||o||!!h,this.syncEase=n?i:null,this.syncSmooth=o?!0===e||r?1:e:null,this.onSyncEnter=h&&!l&&h[0]?h[0]:B,this.onSyncLeave=h&&!l&&h[1]?h[1]:B,this.onSyncEnterForward=h&&l&&h[0]?h[0]:B,this.onSyncLeaveForward=h&&l&&h[1]?h[1]:B,this.onSyncEnterBackward=h&&l&&h[2]?h[2]:B,this.onSyncLeaveBackward=h&&l&&h[3]?h[3]:B,this.onEnter=t.onEnter||B,this.onLeave=t.onLeave||B,this.onEnterForward=t.onEnterForward||B,this.onLeaveForward=t.onLeaveForward||B,this.onEnterBackward=t.onEnterBackward||B,this.onLeaveBackward=t.onLeaveBackward||B,this.onUpdate=t.onUpdate||B,this.onSyncComplete=t.onSyncComplete||B,this.reverted=!1,this.completed=!1,this.began=!1,this.isInView=!1,this.forceEnter=!1,this.hasEntered=!1,this.offsets=[],this.offset=0,this.offsetStart=0,this.offsetEnd=0,this.distance=0,this.prevProgress=0,this.thresholds=["start","end","end","start"],this.coords=[0,0,0,0],this.debugStyles=null,this.$debug=null,this._params=t,this._debug=Zt(t.debug,!1),this._next=null,this._prev=null,Bt(this.container,this),ds((()=>{if(!this.reverted){if(!this.target){const e=Ot(t.target)[0];this.target=e||s.body,this.refresh()}this._debug&&this.debug()}}))}link(t){if(t&&(t.pause(),this.linked=t,!this._params.target)){let e;Z(t.targets)?Et(t,(t=>{t.targets&&!e&&(e=Vs(t))})):e=Vs(t),this.target=e||s.body,this.refresh()}return this}get velocity(){return this.container.velocity}get backward(){return this.horizontal?this.container.backwardX:this.container.backwardY}get scroll(){return this.horizontal?this.container.scrollX:this.container.scrollY}get progress(){const t=(this.scroll-this.offsetStart)/this.distance;return t===1/0||isNaN(t)?0:bt(yt(t,0,1),6)}refresh(){this.reverted=!1;const t=this._params;return this.repeat=Zt(Ms(t.repeat,this),!0),this.horizontal="x"===Zt(Ms(t.axis,this),"y"),this.enter=Zt(Ms(t.enter,this),"end start"),this.leave=Zt(Ms(t.leave,this),"start end"),this.updateBounds(),this.handleScroll(),this}removeDebug(){return this.$debug&&(this.$debug.parentNode.removeChild(this.$debug),this.$debug=null),this.debugStyles&&(this.debugStyles.revert(),this.$debug=null),this}debug(){this.removeDebug();const t=this.container,e=this.horizontal,i=t.element.querySelector(":scope > .animejs-onscroll-debug"),r=s.createElement("div"),n=s.createElement("div"),o=s.createElement("div"),a=Hs[this.index%Hs.length],h=t.useWin,l=h?t.winWidth:t.width,c=h?t.winHeight:t.height,d=t.scrollWidth,u=t.scrollHeight,p=this.container.width>360?320:260,m=e?0:10,f=e?10:0,g=e?24:p/2,_=e?g:15,y=e?60:g,v=e?y:_,b=e?"repeat-x":"repeat-y",S=t=>e?"0px "+t+"px":t+"px 2px",x=t=>`linear-gradient(${e?90:0}deg, ${t} 2px, transparent 1px)`,T=(t,e,s,i,r)=>`position:${t};left:${e}px;top:${s}px;width:${i}px;height:${r}px;`;r.style.cssText=`${T("absolute",m,f,e?d:p,e?p:u)}\n pointer-events: none;\n z-index: ${this.container.zIndex++};\n display: flex;\n flex-direction: ${e?"column":"row"};\n filter: drop-shadow(0px 1px 0px rgba(0,0,0,.75));\n `,n.style.cssText=`${T("sticky",0,0,e?l:g,e?g:c)}`,i||(n.style.cssText+=`background:\n ${x("#FFFF")}${S(g-10)} / 100px 100px ${b},\n ${x("#FFF8")}${S(g-10)} / 10px 10px ${b};\n `),o.style.cssText=`${T("relative",0,0,e?d:g,e?g:u)}`,i||(o.style.cssText+=`background:\n ${x("#FFFF")}${S(0)} / ${e?"100px 10px":"10px 100px"} ${b},\n ${x("#FFF8")}${S(0)} / ${e?"10px 0px":"0px 10px"} ${b};\n `);const w=[" enter: "," leave: "];this.coords.forEach(((t,i)=>{const r=i>1,h=(r?0:this.offset)+t,m=i%2,f=h(r?e?l:c:e?d:u)-v,b=(r?m&&!f:!m&&!f)||g,S=s.createElement("div"),x=s.createElement("div"),k=e?b?"right":"left":b?"bottom":"top",$=b?(e?y:_)+(r?e?-1:g?0:-2:e?-1:-2):e?1:0;x.innerHTML=`${this.id}${w[m]}${this.thresholds[i]}`,S.style.cssText=`${T("absolute",0,0,y,_)}\n display: flex;\n flex-direction: ${e?"column":"row"};\n justify-content: flex-${r?"start":"end"};\n align-items: flex-${b?"end":"start"};\n border-${k}: 2px solid ${a};\n `,x.style.cssText=`\n overflow: hidden;\n max-width: ${p/2-10}px;\n height: ${_};\n margin-${e?b?"right":"left":b?"bottom":"top"}: -2px;\n padding: 1px;\n font-family: ui-monospace, monospace;\n font-size: 10px;\n letter-spacing: -.025em;\n line-height: 9px;\n font-weight: 600;\n text-align: ${e&&b||!e&&!r?"right":"left"};\n white-space: pre;\n text-overflow: ellipsis;\n color: ${m?a:"rgba(0,0,0,.75)"};\n background-color: ${m?"rgba(0,0,0,.65)":a};\n border: 2px solid ${m?a:"transparent"};\n border-${e?b?"top-left":"top-right":b?"top-left":"bottom-left"}-radius: 5px;\n border-${e?b?"bottom-left":"bottom-right":b?"top-right":"bottom-right"}-radius: 5px;\n `,S.appendChild(x);let E=h-$+(e?1:0);S.style[e?"left":"top"]=`${E}px`,(r?n:o).appendChild(S)})),r.appendChild(n),r.appendChild(o),t.element.appendChild(r),i||r.classList.add("animejs-onscroll-debug"),this.$debug=r;"static"===us(t.element,"position")&&(this.debugStyles=ps(t.element,{position:"relative "}))}updateBounds(){let t;this._debug&&this.removeDebug();const e=this.target,i=this.container,r=this.horizontal,n=this.linked;let o,a=e,h=0,l=0,c=a;n&&(o=n.currentTime,n.seek(0,!0));const d="static"===us(i.element,"position")&&ps(i.element,{position:"relative "});for(;a&&a!==i.element&&a!==s.body;){const e="sticky"===us(a,"position")&&ps(a,{position:"static"});a===c&&(h+=a.offsetLeft||0,l+=a.offsetTop||0,c=a.offsetParent),a=a.parentElement,e&&(t||(t=[]),t.push(e))}d&&d.revert();const u=r?h:l,p=r?e.offsetWidth:e.offsetHeight,m=r?i.width:i.height,f=(r?i.scrollWidth:i.scrollHeight)-m,g=this.enter,_=this.leave;let y="start",v="end",b="end",S="start";if(j(g)){const t=g.split(" ");b=t[0],y=t.length>1?t[1]:y}else if(q(g)){const t=g;Z(t.container)||(b=t.container),Z(t.target)||(y=t.target)}else Q(g)&&(b=g);if(j(_)){const t=_.split(" ");S=t[0],v=t.length>1?t[1]:v}else if(q(_)){const t=_;Z(t.container)||(S=t.container),Z(t.target)||(v=t.target)}else Q(_)&&(S=_);const x=Ws(e,y,p),T=Ws(e,v,p),w=x+u-m,k=T+u-f,$=Ws(e,b,m,w,k),E=Ws(e,S,m,w,k),C=x+u-$,B=T+u-E,D=B-C;this.offsets[0]=h,this.offsets[1]=l,this.offset=u,this.offsetStart=C,this.offsetEnd=B,this.distance=D<=0?0:D,this.thresholds=[y,v,b,S],this.coords=[x,T,$,E],t&&t.forEach((t=>t.revert())),n&&n.seek(o,!0),this._debug&&this.debug()}handleScroll(){const t=this.linked,e=this.sync,s=this.syncEase,i=this.syncSmooth,r=t&&(s||i),n=this.horizontal,o=this.container,a=this.scroll,h=a<=this.offsetStart,l=a>=this.offsetEnd,c=!h&&!l,d=a===this.offsetStart||a===this.offsetEnd,u=!this.hasEntered&&d,p=this._debug&&this.$debug;let m=!1,f=!1,g=this.progress;if(h&&this.began&&(this.began=!1),g>0&&!this.began&&(this.began=!0),r){const e=t.progress;if(i&&Q(i)){if(i<1){const t=eg&&!g?-1e-4:0;g=bt(ys(e,g,xt(.01,.2,i),!1)+t,6)}}else s&&(g=s(g));m=g!==this.prevProgress,f=1===e,m&&!f&&i&&e&&o.wakeTicker.restart()}if(p){const t=n?o.scrollY:o.scrollX;p.style[n?"top":"left"]=t+10+"px"}(c&&!this.isInView||u&&!this.forceEnter&&!this.hasEntered)&&(c&&(this.isInView=!0),this.forceEnter&&this.hasEntered?c&&(this.forceEnter=!1):(p&&c&&(p.style.zIndex=""+this.container.zIndex++),this.onSyncEnter(this),this.onEnter(this),this.backward?(this.onSyncEnterBackward(this),this.onEnterBackward(this)):(this.onSyncEnterForward(this),this.onEnterForward(this)),this.hasEntered=!0,u&&(this.forceEnter=!0))),(c||!c&&this.isInView)&&(m=!0),m&&(r&&t.seek(t.duration*g),this.onUpdate(this)),!c&&this.isInView&&(this.isInView=!1,this.onSyncLeave(this),this.onLeave(this),this.backward?(this.onSyncLeaveBackward(this),this.onLeaveBackward(this)):(this.onSyncLeaveForward(this),this.onLeaveForward(this)),e&&!i&&(f=!0)),g>=1&&this.began&&!this.completed&&(e&&f||!e)&&(e&&this.onSyncComplete(this),this.completed=!0,(!this.repeat&&!t||!this.repeat&&t&&t.completed)&&this.revert()),g<1&&this.completed&&(this.completed=!1),this.prevProgress=g}revert(){if(this.reverted)return;const t=this.container;return Ct(t,this),t._head||t.revert(),this._debug&&this.removeDebug(),this.reverted=!0,this}}const Qs=(t={})=>new qs(t),js=(t,e={})=>{let s=[],i=0;const r=e.from,n=e.reversed,o=e.ease,a=!Z(o),h=a&&!Z(o.ease)?o.ease:a?Ne(o):null,l=e.grid,c=e.axis,d=Z(r)||0===r||"first"===r,u="center"===r,p="last"===r,m=H(t),f=rt(m?t[0]:t),g=m?rt(t[1]):0,_=R.exec((m?t[1]:t)+k),y=e.start||0+(m?f:0);let v=d?0:Q(r)?r:0;return(t,r,o,a)=>{if(u&&(v=(o-1)/2),p&&(v=o-1),!s.length){for(let t=0;th(t/i)*i))),n&&(s=s.map((t=>c?t<0?-1*t:-t:lt(i-t))))}const d=m?(g-f)/i:f;let b=(a?xs(a,Z(e.start)?a.iterationDuration:y):y)+(d*bt(s[r],2)||0);return e.modifier&&(b=e.modifier(b)),_&&(b=`${b}${_[2]}`),b}};export{$s as Animatable,Ps as Draggable,Qe as JSAnimation,Ys as Scope,qs as ScrollObserver,Cs as Spring,ws as Timeline,ge as Timer,ls as WAAPIAnimation,je as animate,Es as createAnimatable,Rs as createDraggable,Xs as createScope,Bs as createSpring,ks as createTimeline,_e as createTimer,De as eases,Yt as engine,Qs as onScroll,zs as scrollContainers,js as stagger,Qt as svg,Ss as utils,cs as waapi};export default null; \ No newline at end of file diff --git a/src/zen/vendor/motion.dep b/src/zen/vendor/motion.dep deleted file mode 100644 index 36206bd2..00000000 --- a/src/zen/vendor/motion.dep +++ /dev/null @@ -1 +0,0 @@ -https://cdn.jsdelivr.net/npm/motion@latest/+esm: v12.16.0 \ No newline at end of file diff --git a/src/zen/vendor/motion.min.mjs b/src/zen/vendor/motion.min.mjs deleted file mode 100644 index fdb4cd59..00000000 --- a/src/zen/vendor/motion.min.mjs +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Bundled by jsDelivr using Rollup v2.79.2 and Terser v5.39.0. - * Original file: /npm/motion@12.16.0/dist/es/motion/lib/index.mjs - * - * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files - */ -function t(t){return"object"==typeof t&&!Array.isArray(t)}function e(t,e,n){if(t instanceof EventTarget)return[t];if("string"==typeof t){let s=document;e&&(s=e.current);const r=n?.[t]??s.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t)}function n(n,s,r,i){return"string"==typeof n&&t(s)?e(n,r,i):n instanceof NodeList?Array.from(n):Array.isArray(n)?n:[n]}function s(t,e,n){return t*(e+1)}function r(t,e,n,s){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:s.get(e)??t}const i=(t,e,n)=>t+(e-t)*n,o=(t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t},a=t=>Array.isArray(t)&&"number"!=typeof t[0];function u(t,e){return a(t)?t[o(0,t.length,e)]:t}function l(t,e){-1===t.indexOf(e)&&t.push(e)}function c(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}function h([...t],e,n){const s=e<0?t.length+e:e;if(s>=0&&se&&r.atBoolean(t&&t.getVelocity),g=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s};function y(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const r=g(0,e,s);t.push(i(n,1,r))}}function v(t){const e=[0];return y(e,t.length-1),e}function w(t){return"function"==typeof t&&"applyToOptions"in t}const b=2e4;function T(t){let e=0;let n=t.next(e);for(;!n.done&&e=b?1/0:e}const x=t=>1e3*t,M=t=>t/1e3;function A(t,e=100,n){const s=n({...t,keyframes:[0,e]}),r=Math.min(T(s),b);return{type:"keyframes",ease:t=>s.next(r*t).value/e,duration:M(r)}}let S=()=>{},V=()=>{};function k(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function E(t,e){return e[t]||(e[t]=[]),e[t]}function P(t){return Array.isArray(t)?t:[t]}function C(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const O=t=>"number"==typeof t,F=t=>t.every(O),R=new WeakMap;function B(t){const e=[{},{}];return t?.values.forEach(((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()})),e}function L(t,e,n,s){if("function"==typeof e){const[r,i]=B(s);e=e(void 0!==n?n:t.custom,r,i)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[r,i]=B(s);e=e(void 0!==n?n:t.custom,r,i)}return e}const D=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],W={value:null,addProjectionMetrics:null};const I={};function j(t,e){let n=!1,s=!0;const r={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=D.reduce(((t,n)=>(t[n]=function(t,e){let n=new Set,s=new Set,r=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},u=0;function l(e){o.has(e)&&(c.schedule(e),t()),u++,e(a)}const c={schedule:(t,e=!1,i=!1)=>{const a=i&&r?n:s;return e&&o.add(t),a.has(t)||a.add(t),t},cancel:t=>{s.delete(t),o.delete(t)},process:t=>{a=t,r?i=!0:(r=!0,[n,s]=[s,n],n.forEach(l),e&&W.value&&W.value.frameloop[e].push(u),u=0,n.clear(),r=!1,i&&(i=!1,c.process(t)))}};return c}(i,e?n:void 0),t)),{}),{setup:a,read:u,resolveKeyframes:l,preUpdate:c,update:h,preRender:d,render:p,postRender:f}=o,m=()=>{const i=I.useManualTiming?r.timestamp:performance.now();n=!1,I.useManualTiming||(r.delta=s?1e3/60:Math.max(Math.min(i-r.timestamp,40),1)),r.timestamp=i,r.isProcessing=!0,a.process(r),u.process(r),l.process(r),c.process(r),h.process(r),d.process(r),p.process(r),f.process(r),r.isProcessing=!1,n&&e&&(s=!1,t(m))};return{schedule:D.reduce(((e,i)=>{const a=o[i];return e[i]=(e,i=!1,o=!1)=>(n||(n=!0,s=!0,r.isProcessing||t(m)),a.schedule(e,i,o)),e}),{}),cancel:t=>{for(let e=0;et,{schedule:$,cancel:K,state:U,steps:Y}=j("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:N,!0);let X;function z(){X=void 0}const H={now:()=>(void 0===X&&H.set(U.isProcessing||I.useManualTiming?U.timestamp:performance.now()),X),set:t=>{X=t,queueMicrotask(z)}},q=new Set;function Z(t){return q.has(t)}function _(t,e,n){t||q.has(e)||(console.warn(e),n&&console.warn(n),q.add(e))}class G{constructor(){this.subscriptions=[]}add(t){return l(this.subscriptions,t),()=>c(this.subscriptions,t)}notify(t,e,n){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,n);else for(let r=0;r{const n=H.now();if(this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty();e&&this.events.renderRequest?.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=H.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new G);const n=this.events[t].add(e);return"change"===t?()=>{n(),$.read((()=>{this.events.change.getSize()||this.stop()}))}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return Q.current&&Q.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=H.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return J(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise((e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()})).then((()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()}))}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function et(t,e){return new tt(t,e)}function nt(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,et(n))}function st(t){return(t=>Array.isArray(t))(t)?t[t.length-1]||0:t}function rt(t,e){const n=function(t,e,n){const s=t.getProps();return L(s,e,void 0!==n?n:s.custom,t)}(t,e);let{transitionEnd:s={},transition:r={},...i}=n||{};i={...i,...s};for(const e in i){nt(t,e,st(i[e]))}}function it(t,e){const n=t.getValue("willChange");if(s=n,Boolean(m(s)&&s.add))return n.add(e);if(!n&&I.WillChange){const n=new I.WillChange("auto");t.addValue("willChange",n),n.add(e)}var s}const ot=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),at="data-"+ot("framerAppearId");function ut(t){return t.props[at]}const lt=t=>null!==t;const ct=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ht=(()=>new Set(ct))(),dt={type:"spring",stiffness:500,damping:25,restSpeed:10},pt={type:"keyframes",duration:.8},ft={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},mt=(t,{keyframes:e})=>e.length>2?pt:ht.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:dt:ft;function gt(t,e){return t?.[e]??t?.default??t}const yt={layout:0,mainThread:0,waapi:0},vt=t=>e=>"string"==typeof e&&e.startsWith(t),wt=vt("--"),bt=vt("var(--"),Tt=t=>!!bt(t)&&xt.test(t.split("/*")[0].trim()),xt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Mt=(t,e,n)=>n>e?e:n"number"==typeof t,parse:parseFloat,transform:t=>t},St={...At,transform:t=>Mt(0,1,t)},Vt={...At,default:1},kt=t=>Math.round(1e5*t)/1e5,Et=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Pt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ct=(t,e)=>n=>Boolean("string"==typeof n&&Pt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),Ot=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[r,i,o,a]=s.match(Et);return{[t]:parseFloat(r),[e]:parseFloat(i),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},Ft={...At,transform:t=>Math.round((t=>Mt(0,255,t))(t))},Rt={test:Ct("rgb","red"),parse:Ot("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+Ft.transform(t)+", "+Ft.transform(e)+", "+Ft.transform(n)+", "+kt(St.transform(s))+")"};const Bt={test:Ct("#"),parse:function(t){let e="",n="",s="",r="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),r=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),r=t.substring(4,5),e+=e,n+=n,s+=s,r+=r),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:r?parseInt(r,16)/255:1}},transform:Rt.transform},Lt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Dt=Lt("deg"),Wt=Lt("%"),It=Lt("px"),jt=Lt("vh"),Nt=Lt("vw"),$t=(()=>({...Wt,parse:t=>Wt.parse(t)/100,transform:t=>Wt.transform(100*t)}))(),Kt={test:Ct("hsl","hue"),parse:Ot("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+Wt.transform(kt(e))+", "+Wt.transform(kt(n))+", "+kt(St.transform(s))+")"},Ut={test:t=>Rt.test(t)||Bt.test(t)||Kt.test(t),parse:t=>Rt.test(t)?Rt.parse(t):Kt.test(t)?Kt.parse(t):Bt.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?Rt.transform(t):Kt.transform(t)},Yt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Xt="number",zt="color",Ht=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function qt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},r=[];let i=0;const o=e.replace(Ht,(t=>(Ut.test(t)?(s.color.push(i),r.push(zt),n.push(Ut.parse(t))):t.startsWith("var(")?(s.var.push(i),r.push("var"),n.push(t)):(s.number.push(i),r.push(Xt),n.push(parseFloat(t))),++i,"${}"))).split("${}");return{values:n,split:o,indexes:s,types:r}}function Zt(t){return qt(t).values}function _t(t){const{split:e,types:n}=qt(t),s=e.length;return t=>{let r="";for(let i=0;i"number"==typeof t?0:t;const Jt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(Et)?.length||0)+(t.match(Yt)?.length||0)>0},parse:Zt,createTransformer:_t,getAnimatableNone:function(t){const e=Zt(t);return _t(t)(e.map(Gt))}};function Qt(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function te({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let r=0,i=0,o=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,a=2*n-s;r=Qt(a,s,t+1/3),i=Qt(a,s,t),o=Qt(a,s,t-1/3)}else r=i=o=n;return{red:Math.round(255*r),green:Math.round(255*i),blue:Math.round(255*o),alpha:s}}function ee(t,e){return n=>n>0?e:t}const ne=(t,e,n)=>{const s=t*t,r=n*(e*e-s)+s;return r<0?0:Math.sqrt(r)},se=[Bt,Rt,Kt];function re(t){const e=(n=t,se.find((t=>t.test(n))));var n;if(!Boolean(e))return!1;let s=e.parse(t);return e===Kt&&(s=te(s)),s}const ie=(t,e)=>{const n=re(t),s=re(e);if(!n||!s)return ee(t,e);const r={...n};return t=>(r.red=ne(n.red,s.red,t),r.green=ne(n.green,s.green,t),r.blue=ne(n.blue,s.blue,t),r.alpha=i(n.alpha,s.alpha,t),Rt.transform(r))},oe=new Set(["none","hidden"]);function ae(t,e){return oe.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}const ue=(t,e)=>n=>e(t(n)),le=(...t)=>t.reduce(ue);function ce(t,e){return n=>i(t,e,n)}function he(t){return"number"==typeof t?ce:"string"==typeof t?Tt(t)?ee:Ut.test(t)?ie:fe:Array.isArray(t)?de:"object"==typeof t?Ut.test(t)?ie:pe:ee}function de(t,e){const n=[...t],s=n.length,r=t.map(((t,n)=>he(t)(t,e[n])));return t=>{for(let e=0;e{for(const e in s)n[e]=s[e](t);return n}}const fe=(t,e)=>{const n=Jt.createTransformer(e),s=qt(t),r=qt(e);return s.indexes.var.length===r.indexes.var.length&&s.indexes.color.length===r.indexes.color.length&&s.indexes.number.length>=r.indexes.number.length?oe.has(t)&&!r.values.length||oe.has(e)&&!s.values.length?ae(t,e):le(de(function(t,e){const n=[],s={color:0,var:0,number:0};for(let r=0;r{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>$.update(e,t),stop:()=>K(e),now:()=>U.isProcessing?U.timestamp:H.now()}},ye=(t,e,n=10)=>{let s="";const r=Math.max(Math.round(e/n),2);for(let e=0;e{const s=e*o,r=s*t,i=s-n,a=Le(e,o),u=Math.exp(-r);return Fe-i/a*u},i=e=>{const s=e*o*t,i=s*n+n,a=Math.pow(o,2)*Math.pow(e,2)*t,u=Math.exp(-s),l=Le(Math.pow(e,2),o);return(-r(e)+Fe>0?-1:1)*((i-a)*u)/l}):(r=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,i=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let s=n;for(let n=1;nvoid 0!==t[e]))}function je(t=Se,e=Ae){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:r}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:u,damping:l,mass:c,duration:h,velocity:d,isResolvedFromDuration:p}=function(t){let e={velocity:xe,stiffness:we,damping:be,mass:Te,isResolvedFromDuration:!1,...t};if(!Ie(t,We)&&Ie(t,De))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(1.2*n),r=s*s,i=2*Mt(.05,1,1-(t.bounce||0))*Math.sqrt(r);e={...e,mass:Te,stiffness:r,damping:i}}else{const n=Re(t);e={...e,...n,mass:Te},e.isResolvedFromDuration=!0}return e}({...n,velocity:-M(n.velocity||0)}),f=d||0,m=l/(2*Math.sqrt(u*c)),g=o-i,y=M(Math.sqrt(u/c)),v=Math.abs(g)<5;let w;if(s||(s=v?Ve.granular:Ve.default),r||(r=v?ke.granular:ke.default),m<1){const t=Le(y,m);w=e=>{const n=Math.exp(-m*y*e);return o-n*((f+m*y*g)/t*Math.sin(t*e)+g*Math.cos(t*e))}}else if(1===m)w=t=>o-Math.exp(-y*t)*(g+(f+y*g)*t);else{const t=y*Math.sqrt(m*m-1);w=e=>{const n=Math.exp(-m*y*e),s=Math.min(t*e,300);return o-n*((f+m*y*g)*Math.sinh(s)+t*g*Math.cosh(s))/t}}const A={calculatedDuration:p&&h||null,next:t=>{const e=w(t);if(p)a.done=t>=h;else{let n=0===t?f:0;m<1&&(n=0===t?x(f):ve(w,t,e));const i=Math.abs(n)<=s,u=Math.abs(o-e)<=r;a.done=i&&u}return a.value=a.done?o:e,a},toString:()=>{const t=Math.min(T(A),b),e=ye((e=>A.next(t*e).value),t,30);return t+"ms "+e},toTransition:()=>{}};return A}function Ne({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:r=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:u,restDelta:l=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?u:void 0===u||Math.abs(a-t)-f*Math.exp(-t/s),v=t=>g+y(t),w=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=l,d.value=d.done?g:n};let b,T;const x=t=>{var e;(e=d.value,void 0!==a&&eu)&&(b=t,T=je({keyframes:[d.value,p(d.value)],velocity:ve(v,t,d.value),damping:r,stiffness:i,restDelta:l,restSpeed:c}))};return x(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==b||(e=!0,w(t),x(t)),void 0!==b&&t>=b?T.next(t-b):(!e&&w(t),d)}}}function $e(t,e,{clamp:n=!0,ease:s,mixer:r}={}){const i=t.length;if(e.length,1===i)return()=>e[0];if(2===i&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=function(t,e,n){const s=[],r=n||I.mix||me,i=t.length-1;for(let n=0;n{if(o&&n1)for(;sl(Mt(t[0],t[i-1],e)):l}function Ke(t,e){return t.map((t=>t*e))}je.applyToOptions=t=>{const e=A(t,100,je);return t.ease=e.ease,t.duration=x(e.duration),t.type="keyframes",t};const Ue=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function Ye(t,e,n,s){if(t===e&&n===s)return N;const r=e=>function(t,e,n,s,r){let i,o,a=0;do{o=e+(n-e)/2,i=Ue(o,s,r)-t,i>0?n=o:e=o}while(Math.abs(i)>1e-7&&++a<12);return o}(e,0,1,t,n);return t=>0===t||1===t?t:Ue(r(t),e,s)}const Xe=Ye(.42,0,1,1),ze=Ye(0,0,.58,1),He=Ye(.42,0,.58,1),qe=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Ze=t=>e=>1-t(1-e),_e=Ye(.33,1.53,.69,.99),Ge=Ze(_e),Je=qe(Ge),Qe=t=>(t*=2)<1?.5*Ge(t):.5*(2-Math.pow(2,-10*(t-1))),tn=t=>1-Math.sin(Math.acos(t)),en=Ze(tn),nn=qe(tn),sn=t=>Array.isArray(t)&&"number"==typeof t[0],rn={linear:N,easeIn:Xe,easeInOut:He,easeOut:ze,circIn:tn,circInOut:nn,circOut:en,backIn:Ge,backInOut:Je,backOut:_e,anticipate:Qe},on=t=>{if(sn(t)){t.length;const[e,n,s,r]=t;return Ye(e,n,s,r)}return"string"==typeof t?rn[t]:t};function an(t,e){return t.map((()=>e||He)).splice(0,t.length-1)}function un({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const r=a(s)?s.map(on):on(s),i={done:!1,value:e[0]},o=$e(Ke(n&&n.length===e.length?n:v(e),t),e,{ease:Array.isArray(r)?r:an(e,r)});return{calculatedDuration:t,next:e=>(i.value=o(e),i.done=e>=t,i)}}const ln=t=>null!==t;function cn(t,{repeat:e,repeatType:n="loop"},s,r=1){const i=t.filter(ln),o=r<0||e&&"loop"!==n&&e%2==1?0:i.length-1;return o&&void 0!==s?s:i[o]}const hn={decay:Ne,inertia:Ne,tween:un,keyframes:un,spring:je};function dn(t){"string"==typeof t.type&&(t.type=hn[t.type])}class pn{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise((t=>{this.resolve=t}))}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const fn=t=>t/100;class mn extends pn{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==H.now()&&this.tick(H.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},yt.mainThread++,this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;dn(t);const{type:e=un,repeat:n=0,repeatDelay:s=0,repeatType:r,velocity:i=0}=t;let{keyframes:o}=t;const a=e||un;a!==un&&"number"!=typeof o[0]&&(this.mixKeyframes=le(fn,me(o[0],o[1])),o=[0,100]);const u=a({...t,keyframes:o});"mirror"===r&&(this.mirroredGenerator=a({...t,keyframes:[...o].reverse(),velocity:-i})),null===u.calculatedDuration&&(u.calculatedDuration=T(u));const{calculatedDuration:l}=u;this.calculatedDuration=l,this.resolvedDuration=l+s,this.totalDuration=this.resolvedDuration*(n+1)-s,this.generator=u}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:s,mixKeyframes:r,mirroredGenerator:i,resolvedDuration:o,calculatedDuration:a}=this;if(null===this.startTime)return n.next(0);const{delay:u=0,keyframes:l,repeat:c,repeatType:h,repeatDelay:d,type:p,onUpdate:f,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const g=this.currentTime-u*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?g<0:g>s;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=s);let v=this.currentTime,w=n;if(c){const t=Math.min(this.currentTime,s)/o;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,c+1);Boolean(e%2)&&("reverse"===h?(n=1-n,d&&(n-=d/o)):"mirror"===h&&(w=i)),v=Mt(0,1,n)*o}const b=y?{done:!1,value:l[0]}:w.next(v);r&&(b.value=r(b.value));let{done:T}=b;y||null===a||(T=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const x=null===this.holdTime&&("finished"===this.state||"running"===this.state&&T);return x&&p!==Ne&&(b.value=cn(l,this.options,m,this.speed)),f&&f(b.value),x&&this.finish(),b}then(t,e){return this.finished.then(t,e)}get duration(){return M(this.calculatedDuration)}get time(){return M(this.currentTime)}set time(t){t=x(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(H.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=M(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=ge,startTime:e}=this.options;this.driver||(this.driver=t((t=>this.tick(t)))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(H.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,yt.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function gn(t){return new mn(t)}function yn(t){for(let e=1;e180*t/Math.PI,wn=t=>{const e=vn(Math.atan2(t[1],t[0]));return Tn(e)},bn={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:wn,rotateZ:wn,skewX:t=>vn(Math.atan(t[1])),skewY:t=>vn(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Tn=t=>((t%=360)<0&&(t+=360),t),xn=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Mn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),An={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:xn,scaleY:Mn,scale:t=>(xn(t)+Mn(t))/2,rotateX:t=>Tn(vn(Math.atan2(t[6],t[5]))),rotateY:t=>Tn(vn(Math.atan2(-t[2],t[0]))),rotateZ:wn,rotate:wn,skewX:t=>vn(Math.atan(t[4])),skewY:t=>vn(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Sn(t){return t.includes("scale")?1:0}function Vn(t,e){if(!t||"none"===t)return Sn(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,r;if(n)s=An,r=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=bn,r=e}if(!r)return Sn(e);const i=s[e],o=r[1].split(",").map(En);return"function"==typeof i?i(o):o[i]}const kn=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Vn(n,e)};function En(t){return parseFloat(t.trim())}const Pn=t=>t===At||t===It,Cn=new Set(["x","y","z"]),On=ct.filter((t=>!Cn.has(t)));const Fn={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Vn(e,"x"),y:(t,{transform:e})=>Vn(e,"y")};Fn.translateX=Fn.x,Fn.translateY=Fn.y;const Rn=new Set;let Bn=!1,Ln=!1,Dn=!1;function Wn(){if(Ln){const t=Array.from(Rn).filter((t=>t.needsMeasurement)),e=new Set(t.map((t=>t.element))),n=new Map;e.forEach((t=>{const e=function(t){const e=[];return On.forEach((n=>{const s=t.getValue(n);void 0!==s&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))})),e}(t);e.length&&(n.set(t,e),t.render())})),t.forEach((t=>t.measureInitialState())),e.forEach((t=>{t.render();const e=n.get(t);e&&e.forEach((([e,n])=>{t.getValue(e)?.set(n)}))})),t.forEach((t=>t.measureEndState())),t.forEach((t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)}))}Ln=!1,Bn=!1,Rn.forEach((t=>t.complete(Dn))),Rn.clear()}function In(){Rn.forEach((t=>{t.readKeyframes(),t.needsMeasurement&&(Ln=!0)}))}function jn(){Dn=!0,In(),Wn(),Dn=!1}class Nn{constructor(t,e,n,s,r,i=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=s,this.element=r,this.isAsync=i}scheduleResolve(){this.state="scheduled",this.isAsync?(Rn.add(this),Bn||(Bn=!0,$.read(In),$.resolveKeyframes(Wn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;if(null===t[0]){const r=s?.get(),i=t[t.length-1];if(void 0!==r)t[0]=r;else if(n&&e){const s=n.readValue(e,i);null!=s&&(t[0]=s)}void 0===t[0]&&(t[0]=i),s&&void 0===r&&s.set(t[0])}yn(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Rn.delete(this)}cancel(){"scheduled"===this.state&&(Rn.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const $n=t=>t.startsWith("--");function Kn(t,e,n){$n(e)?t.style.setProperty(e,n):t.style[e]=n}function Un(t){let e;return()=>(void 0===e&&(e=t()),e)}const Yn=Un((()=>void 0!==window.ScrollTimeline)),Xn={};function zn(t,e){const n=Un(t);return()=>Xn[e]??n()}const Hn=zn((()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0}),"linearEasing"),qn=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Zn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:qn([0,.65,.55,1]),circOut:qn([.55,0,1,.45]),backIn:qn([.31,.01,.66,-.59]),backOut:qn([.33,1.53,.69,.99])};function _n(t,e){return t?"function"==typeof t?Hn()?ye(t,e):"ease-out":sn(t)?qn(t):Array.isArray(t)?t.map((t=>_n(t,e)||Zn.easeOut)):Zn[t]:void 0}function Gn(t,e,n,{delay:s=0,duration:r=300,repeat:i=0,repeatType:o="loop",ease:a="easeOut",times:u}={},l=void 0){const c={[e]:n};u&&(c.offset=u);const h=_n(a,r);Array.isArray(h)&&(c.easing=h),W.value&&yt.waapi++;const d={delay:s,duration:r,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:i+1,direction:"reverse"===o?"alternate":"normal"};l&&(d.pseudoElement=l);const p=t.animate(c,d);return W.value&&p.finished.finally((()=>{yt.waapi--})),p}function Jn({type:t,...e}){return w(t)&&Hn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Qn extends pn{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:e,name:n,keyframes:s,pseudoElement:r,allowFlatten:i=!1,finalKeyframe:o,onComplete:a}=t;this.isPseudoElement=Boolean(r),this.allowFlatten=i,this.options=t,t.type;const u=Jn(t);this.animation=Gn(e,n,s,u,r),!1===u.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const t=cn(s,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(t):Kn(e,n,t),this.animation.cancel()}a?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return M(Number(t))}get time(){return M(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=x(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Yn()?(this.animation.timeline=t,N):e(this)}}const ts={anticipate:Qe,backInOut:Je,circInOut:nn};function es(t){"string"==typeof t.ease&&t.ease in ts&&(t.ease=ts[t.ease])}class ns extends Qn{constructor(t){es(t),dn(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:s,element:r,...i}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const o=new mn({...i,autoplay:!1}),a=x(this.finishedTime??this.time);e.setWithVelocity(o.sample(a-10).value,o.sample(a).value,10),o.stop()}}const ss=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Jt.test(t)&&"0"!==t||t.startsWith("url(")));function rs(t){return"object"==typeof t&&null!==t}function is(t){return rs(t)&&"offsetHeight"in t}const os=new Set(["opacity","clipPath","filter","transform"]),as=Un((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));function us(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:r,damping:i,type:o}=t;if(!is(e?.owner?.current))return!1;const{onUpdate:a,transformTemplate:u}=e.owner.getProps();return as()&&n&&os.has(n)&&("transform"!==n||!u)&&!a&&!s&&"mirror"!==r&&0!==i&&"inertia"!==o}class ls extends pn{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:s=0,repeatDelay:r=0,repeatType:i="loop",keyframes:o,name:a,motionValue:u,element:l,...c}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=H.now();const h={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:r,repeatType:i,name:a,motionValue:u,element:l,...c},d=l?.KeyframeResolver||Nn;this.keyframeResolver=new d(o,((t,e,n)=>this.onKeyframesResolved(t,e,h,!n)),a,u,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,s){this.keyframeResolver=void 0;const{name:r,type:i,velocity:o,delay:a,isHandoff:u,onUpdate:l}=n;this.resolvedAt=H.now(),function(t,e,n,s){const r=t[0];if(null===r)return!1;if("display"===e||"visibility"===e)return!0;const i=t[t.length-1],o=ss(r,e),a=ss(i,e);return!(!o||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...n,keyframes:t},h=!u&&us(c)?new ns({...c,element:c.motionValue.owner.current}):new mn(c);h.finished.then((()=>this.notifyFinished())).catch(N),this.pendingTimeline&&(this.stopTimeline=h.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=h}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then((()=>{}))}get animation(){return this._animation||(this.keyframeResolver?.resume(),jn()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const cs=(t,e,n,s={},r,i)=>o=>{const a=gt(s,t)||{},u=a.delay||s.delay||0;let{elapsed:l=0}=s;l-=x(u);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-l,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:i?void 0:r};(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:r,repeat:i,repeatType:o,repeatDelay:a,from:u,elapsed:l,...c}){return!!Object.keys(c).length})(a)||Object.assign(c,mt(t,c)),c.duration&&(c.duration=x(c.duration)),c.repeatDelay&&(c.repeatDelay=x(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let h=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(c.duration=0,0===c.delay&&(h=!0)),(I.instantAnimations||I.skipAnimations)&&(h=!0,c.duration=0,c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!i&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:n="loop"},s){const r=t.filter(lt),i=e&&"loop"!==n&&e%2==1?0:r.length-1;return i&&void 0!==s?s:r[i]}(c.keyframes,a);if(void 0!==t)return void $.update((()=>{c.onUpdate(t),c.onComplete()}))}return a.isSync?new mn(c):new ls(c)},hs=new Set(["width","height","top","left","right","bottom",...ct]);function ds({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function ps(t,e,{delay:n=0,transitionOverride:s,type:r}={}){let{transition:i=t.getDefaultTransition(),transitionEnd:o,...a}=e;s&&(i=s);const u=[],l=r&&t.animationState&&t.animationState.getState()[r];for(const e in a){const s=t.getValue(e,t.latestValues[e]??null),r=a[e];if(void 0===r||l&&ds(l,e))continue;const o={delay:n,...gt(i||{},e)},c=s.get();if(void 0!==c&&!s.isAnimating&&!Array.isArray(r)&&r===c&&!o.velocity)continue;let h=!1;if(window.MotionHandoffAnimation){const n=ut(t);if(n){const t=window.MotionHandoffAnimation(n,e,$);null!==t&&(o.startTime=t,h=!0)}}it(t,e),s.start(cs(e,s,r,t.shouldReduceMotion&&hs.has(e)?{type:!1}:o,t,h));const d=s.animation;d&&u.push(d)}return o&&Promise.all(u).then((()=>{$.update((()=>{o&&rt(t,o)}))})),u}const fs={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},ms={};for(const t in fs)ms[t]={isEnabled:e=>fs[t].some((t=>!!e[t]))};const gs=()=>({x:{min:0,max:0},y:{min:0,max:0}}),ys="undefined"!=typeof window,vs={current:null},ws={current:!1};const bs=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function Ts(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||bs.some((e=>function(t){return"string"==typeof t||Array.isArray(t)}(t[e])));var e}const xs=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Ms=t=>/^0[^.\s]+$/u.test(t),As=t=>e=>e.test(t),Ss=[At,It,Wt,Dt,Nt,jt,{test:t=>"auto"===t,parse:t=>t}],Vs=t=>Ss.find(As(t)),ks=[...Ss,Ut,Jt],Es=t=>ks.find(As(t)),Ps=new Set(["brightness","contrast","saturate","opacity"]);function Cs(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(Et)||[];if(!s)return t;const r=n.replace(s,"");let i=Ps.has(e)?1:0;return s!==n&&(i*=100),e+"("+i+r+")"}const Os=/\b([a-z-]*)\(.*?\)/gu,Fs={...Jt,getAnimatableNone:t=>{const e=t.match(Os);return e?e.map(Cs).join(" "):t}},Rs={...At,transform:Math.round},Bs={rotate:Dt,rotateX:Dt,rotateY:Dt,rotateZ:Dt,scale:Vt,scaleX:Vt,scaleY:Vt,scaleZ:Vt,skew:Dt,skewX:Dt,skewY:Dt,distance:It,translateX:It,translateY:It,translateZ:It,x:It,y:It,z:It,perspective:It,transformPerspective:It,opacity:St,originX:$t,originY:$t,originZ:It},Ls={borderWidth:It,borderTopWidth:It,borderRightWidth:It,borderBottomWidth:It,borderLeftWidth:It,borderRadius:It,radius:It,borderTopLeftRadius:It,borderTopRightRadius:It,borderBottomRightRadius:It,borderBottomLeftRadius:It,width:It,maxWidth:It,height:It,maxHeight:It,top:It,right:It,bottom:It,left:It,padding:It,paddingTop:It,paddingRight:It,paddingBottom:It,paddingLeft:It,margin:It,marginTop:It,marginRight:It,marginBottom:It,marginLeft:It,backgroundPositionX:It,backgroundPositionY:It,...Bs,zIndex:Rs,fillOpacity:St,strokeOpacity:St,numOctaves:Rs},Ds={...Ls,color:Ut,backgroundColor:Ut,outlineColor:Ut,fill:Ut,stroke:Ut,borderColor:Ut,borderTopColor:Ut,borderRightColor:Ut,borderBottomColor:Ut,borderLeftColor:Ut,filter:Fs,WebkitFilter:Fs},Ws=t=>Ds[t];function Is(t,e){let n=Ws(t);return n!==Fs&&(n=Jt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const js=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Ns{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,blockInitialAnimation:r,visualState:i},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Nn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=H.now();this.renderScheduledAtthis.bindToMotionValue(e,t))),ws.current||function(){if(ws.current=!0,ys)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>vs.current=t.matches;t.addListener(e),e()}else vs.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||vs.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),K(this.notifyUpdate),K(this.render),this.valueSubscriptions.forEach((t=>t())),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=ht.has(t);n&&this.onBindTransform&&this.onBindTransform();const s=e.on("change",(e=>{this.latestValues[t]=e,this.props.onUpdate&&$.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)})),r=e.on("renderRequest",this.scheduleRender);let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,(()=>{s(),r(),i&&i(),e.owner&&e.stop()}))}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in ms){const e=ms[t];if(!e)continue;const{isEnabled:n,Feature:s}=e;if(!this.features[t]&&s&&n(this.props)&&(this.features[t]=new s(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;ee.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=et(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];return null!=n&&("string"==typeof n&&(xs(n)||Ms(n))?n=parseFloat(n):!Es(n)&&Jt.test(e)&&(n=Is(t,e)),this.setBaseTarget(t,m(n)?n.get():n)),m(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const s=L(this.props,e,this.presenceContext?.custom);s&&(n=s[t])}if(e&&void 0!==n)return n;const s=this.getBaseTargetFromProps(this.props,t);return void 0===s||m(s)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new G),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}const $s=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ks(t){const e=$s.exec(t);if(!e)return[,];const[,n,s,r]=e;return[`--${n??s}`,r]}function Us(t,e,n=1){const[s,r]=Ks(t);if(!s)return;const i=window.getComputedStyle(e).getPropertyValue(s);if(i){const t=i.trim();return xs(t)?parseFloat(t):t}return Tt(r)?Us(r,e,n+1):r}const Ys=new Set(["auto","none","0"]);class Xs extends Nn{constructor(t,e,n,s,r){super(t,e,n,s,r,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)})),this.resolveNoneKeyframes()}}class zs extends Ns{constructor(){super(...arguments),this.KeyframeResolver=Xs}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;m(t)&&(this.childSubscription=t.on("change",(t=>{this.current&&(this.current.textContent=`${t}`)})))}}const Hs=(t,e)=>e&&"number"==typeof t?e.transform(t):t,qs={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Zs=ct.length;function _s(t,e,n){const{style:s,vars:r,transformOrigin:i}=t;let o=!1,a=!1;for(const t in e){const n=e[t];if(ht.has(t))o=!0;else if(wt(t))r[t]=n;else{const e=Hs(n,Ls[t]);t.startsWith("origin")?(a=!0,i[t]=e):s[t]=e}}if(e.transform||(o||n?s.transform=function(t,e,n){let s="",r=!0;for(let i=0;i{const c=P(t),{delay:h=0,times:f=v(c),type:m="keyframes",repeat:g,repeatType:b,repeatDelay:T=0,...M}=n;let{ease:k=e.ease||"easeOut",duration:E}=n;const C="function"==typeof h?h(i,o):h,O=c.length,B=w(m)?m:a?.[m];if(O<=2&&B){let t=100;if(2===O&&F(c)){const e=c[1]-c[0];t=Math.abs(e)}const e={...M};void 0!==E&&(e.duration=x(E));const n=A(e,t,B);k=n.ease,E=n.duration}E??(E=l);const L=S+C;1===f.length&&0===f[0]&&(f[1]=1);const D=f.length-c.length;if(D>0&&y(f,D),1===c.length&&c.unshift(null),g){E=s(E,g);const t=[...c],e=[...f];k=Array.isArray(k)?[...k]:[k];const n=[...k];for(let s=0;s{for(const s in t){const r=t[s];r.sort(f);const o=[],a=[],u=[];for(let t=0;t{o.push(...dr(n,t,e))})),o}class fr{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map((t=>t.finished)))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;ne.attachTimeline(t)));return()=>{e.forEach(((t,e)=>{t&&t(),this.animations[e].stop()}))}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;ee[t]()))}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class mr extends fr{then(t,e){return this.finished.finally(t).then((()=>{}))}}function gr(t){return function(e,n,s){let r=[];var i;i=e,r=Array.isArray(i)&&i.some(Array.isArray)?pr(e,n,t):dr(e,n,s,t);const o=new mr(r);return t&&t.animations.push(o),o}}const yr=gr(),vr=new WeakMap,wr=(t,e="")=>`${t}:${e}`;function br(t){const e=vr.get(t)||new Map;return vr.set(t,e),e}function Tr(t,e){const n=window.getComputedStyle(t);return $n(e)?n.getPropertyValue(e):n[e]}const xr=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","radius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","margin","marginTop","marginRight","marginBottom","marginLeft","backgroundPositionX","backgroundPositionY"]);function Mr(t,e){for(let n=0;nfunction(n,s,r){return new mr(function(t,n,s,r){const i=e(t,r),o=i.length,a=[];for(let t=0;te.delete(n))),u.push(r)}return u}(n,s,r,t))},Sr=Ar(),Vr={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function kr(t,e,n,s){const r=n[e],{length:i,position:o}=Vr[e],a=r.current,u=n.time;r.current=t[`scroll${o}`],r.scrollLength=t[`scroll${i}`]-t[`client${i}`],r.offset.length=0,r.offset[0]=0,r.offset[1]=r.scrollLength,r.progress=g(0,r.scrollLength,r.current);const l=s-u;r.velocity=l>50?0:J(r.current-a,l)}const Er={start:0,center:.5,end:1};function Pr(t,e,n=0){let s=0;if(t in Er&&(t=Er[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?s=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?s=e/100*document.documentElement.clientWidth:t.endsWith("vh")?s=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(s=e*t),n+s}const Cr=[0,0];function Or(t,e,n,s){let r=Array.isArray(t)?t:Cr,i=0,o=0;return"number"==typeof t?r=[t,t]:"string"==typeof t&&(r=(t=t.trim()).includes(" ")?t.split(" "):[t,Er[t]?t:"0"]),i=Pr(r[0],n,s),o=Pr(r[1],e),i-o}const Fr={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Rr={x:0,y:0};function Br(t,e,n){const{offset:s=Fr.All}=n,{target:r=t,axis:i="y"}=n,o="y"===i?"height":"width",a=r!==t?function(t,e){const n={x:0,y:0};let s=t;for(;s&&s!==e;)if(is(s))n.x+=s.offsetLeft,n.y+=s.offsetTop,s=s.offsetParent;else if("svg"===s.tagName){const t=s.getBoundingClientRect();s=s.parentElement;const e=s.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(s instanceof SVGGraphicsElement))break;{const{x:t,y:e}=s.getBBox();n.x+=t,n.y+=e;let r=null,i=s.parentNode;for(;!r;)"svg"===i.tagName&&(r=i),i=s.parentNode;s=r}}return n}(r,t):Rr,u=r===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(r),l={width:t.clientWidth,height:t.clientHeight};e[i].offset.length=0;let c=!e[i].interpolate;const h=s.length;for(let t=0;t{!function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let s=e;for(;s&&s!==t;)n.x.targetOffset+=s.offsetLeft,n.y.targetOffset+=s.offsetTop,s=s.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,s.target,n),function(t,e,n){kr(t,"x",e,n),kr(t,"y",e,n),e.time=n}(t,n,e),(s.offset||s.target)&&Br(t,n,s)},notify:()=>e(n)}}const Dr=new WeakMap;let Wr;const Ir=(t,e,n)=>(s,r)=>r&&r[0]?r[0][t+"Size"]:ur(s)&&"getBBox"in s?s.getBBox()[e]:s[n],jr=Ir("inline","width","offsetWidth"),Nr=Ir("block","height","offsetHeight");function $r({target:t,borderBoxSize:e}){Dr.get(t)?.forEach((n=>{n(t,{get width(){return jr(t,e)},get height(){return Nr(t,e)}})}))}function Kr(t){t.forEach($r)}function Ur(t,n){Wr||"undefined"!=typeof ResizeObserver&&(Wr=new ResizeObserver(Kr));const s=e(t);return s.forEach((t=>{let e=Dr.get(t);e||(e=new Set,Dr.set(t,e)),e.add(n),Wr?.observe(t)})),()=>{s.forEach((t=>{const e=Dr.get(t);e?.delete(n),e?.size||Wr?.unobserve(t)}))}}const Yr=new Set;let Xr;function zr(t){return Yr.add(t),Xr||(Xr=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Yr.forEach((e=>e(t)))},window.addEventListener("resize",Xr)),()=>{Yr.delete(t),Yr.size||"function"!=typeof Xr||(window.removeEventListener("resize",Xr),Xr=void 0)}}function Hr(t,e){return"function"==typeof t?zr(t):Ur(t,e)}const qr=new WeakMap,Zr=new WeakMap,_r=new WeakMap,Gr=t=>t===document.scrollingElement?window:t;function Jr(t,{container:e=document.scrollingElement,...n}={}){if(!e)return N;let s=_r.get(e);s||(s=new Set,_r.set(e,s));const r=Lr(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},n);if(s.add(r),!qr.has(e)){const t=()=>{for(const t of s)t.measure(U.timestamp);$.preUpdate(n)},n=()=>{for(const t of s)t.notify()},r=()=>$.read(t);qr.set(e,r);const i=Gr(e);window.addEventListener("resize",r,{passive:!0}),e!==document.documentElement&&Zr.set(e,Hr(e,r)),i.addEventListener("scroll",r,{passive:!0}),r()}const i=qr.get(e);return $.read(i,!1,!0),()=>{K(i);const t=_r.get(e);if(!t)return;if(t.delete(r),t.size)return;const n=qr.get(e);qr.delete(e),n&&(Gr(e).removeEventListener("scroll",n),Zr.get(e)?.(),window.removeEventListener("resize",n))}}const Qr=new Map;function ti({source:t,container:e,...n}){const{axis:s}=n;t&&(e=t);const r=Qr.get(e)??new Map;Qr.set(e,r);const i=n.target??"self",o=r.get(i)??{},a=s+(n.offset??[]).join(",");return o[a]||(o[a]=!n.target&&Yn()?new ScrollTimeline({source:e,axis:s}):function(t){const e={value:0},n=Jr((n=>{e.value=100*n[t.axis].progress}),t);return{currentTime:e,cancel:n}}({container:e,...n})),o[a]}function ei(t,e){let n;const s=()=>{const{currentTime:s}=e,r=(null===s?0:s.value)/100;n!==r&&t(r),n=r};return $.preUpdate(s,!0),()=>K(s)}function ni(t,{axis:e="y",container:n=document.scrollingElement,...s}={}){if(!n)return N;const r={axis:e,container:n,...s};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)?Jr((n=>{t(n[e.axis].progress,n)}),e):ei(t,ti(e))}(t,r):function(t,e){const n=ti(e);return t.attachTimeline({timeline:e.target?void 0:n,observe:t=>(t.pause(),ei((e=>{t.time=t.duration*e}),n))})}(t,r)}const si={some:0,all:1};function ri(t,n,{root:s,margin:r,amount:i="some"}={}){const o=e(t),a=new WeakMap,u=new IntersectionObserver((t=>{t.forEach((t=>{const e=a.get(t.target);if(t.isIntersecting!==Boolean(e))if(t.isIntersecting){const e=n(t.target,t);"function"==typeof e?a.set(t.target,e):u.unobserve(t.target)}else"function"==typeof e&&(e(t),a.delete(t.target))}))}),{root:s,rootMargin:r,threshold:"number"==typeof i?i:si[i]});return o.forEach((t=>u.observe(t))),()=>u.disconnect()}function ii(t=.1,{startDelay:e=0,from:n=0,ease:s}={}){return(r,i)=>{const o="number"==typeof n?n:function(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}(n,i),a=Math.abs(o-r);let u=t*a;if(s){const e=i*t;u=on(s)(u/e)*e}return e+u}}function oi(t,e){return function(t,e){const n=H.now(),s=({timestamp:r})=>{const i=r-n;i>=e&&(K(s),t(i-e))};return $.setup(s,!0),()=>K(s)}(t,x(e))}const ai=(t,e)=>Math.abs(t-e);function ui(t,e){const n=ai(t.x,e.x),s=ai(t.y,e.y);return Math.sqrt(n**2+s**2)}class li extends Qn{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}}function ci(t){return Boolean("function"==typeof t&&Hn()||!t||"string"==typeof t&&(t in Zn||Hn())||sn(t)||Array.isArray(t)&&t.every(ci))}const hi=Un((()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0})),di=new Set(["opacity","clipPath","filter","transform"]);function pi(t){return(n,s)=>{const r=e(n),i=[];for(const e of r){const n=t(e,s);i.push(n)}return()=>{for(const t of i)t()}}}class fi{constructor(){this.latest={},this.values=new Map}set(t,e,n,s,r=!0){const i=this.values.get(t);i&&i.onRemove();const o=()=>{const s=e.get();this.latest[t]=r?Hs(s,Ls[t]):s,n&&$.render(n)};o();const a=e.on("change",o);s&&e.addDependent(s);const u=()=>{a(),n&&K(n),this.values.delete(t),s&&e.removeDependent(s)};return this.values.set(t,{value:e,onRemove:u}),u}get(t){return this.values.get(t)?.value}destroy(){for(const t of this.values.values())t.onRemove()}}function mi(t){const e=new WeakMap,n=[];return(s,r)=>{const i=e.get(s)??new fi;e.set(s,i);for(const e in r){const o=r[e],a=t(s,i,e,o);n.push(a)}return()=>{for(const t of n)t()}}}const gi=(t,e,n,s)=>{const r=function(t,e){if(!(e in t))return!1;const n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),e)||Object.getOwnPropertyDescriptor(t,e);return n&&"function"==typeof n.set}(t,n),i=r?n:n.startsWith("data")||n.startsWith("aria")?n.replace(/([A-Z])/g,(t=>`-${t.toLowerCase()}`)):n;const o=r?()=>{t[i]=e.latest[n]}:()=>{const s=e.latest[n];null==s?t.removeAttribute(i):t.setAttribute(i,String(s))};return e.set(n,s,o)},yi=pi(mi(gi)),vi=mi(((t,e,n,s)=>e.set(n,s,(()=>{t[n]=e.latest[n]}),void 0,!1))),wi={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};const bi=new Set(["originX","originY","originZ"]),Ti=(t,e,n,s)=>{let r,i;return ht.has(n)?(e.get("transform")||(is(t)||e.get("transformBox")||Ti(t,e,"transformBox",new tt("fill-box")),e.set("transform",new tt("none"),(()=>{t.style.transform=function(t){let e="",n=!0;for(let s=0;s{const n=e.latest.originX??"50%",s=e.latest.originY??"50%",r=e.latest.originZ??0;t.style.transformOrigin=`${n} ${s} ${r}`})),i=e.get("transformOrigin")):r=$n(n)?()=>{t.style.setProperty(n,e.latest[n])}:()=>{t.style[n]=e.latest[n]},e.set(n,s,r,i)},xi=pi(mi(Ti)),Mi=It.transform;const Ai=pi(mi(((t,e,n,s)=>{if(n.startsWith("path"))return function(t,e,n,s){return $.render((()=>t.setAttribute("pathLength","1"))),"pathOffset"===n?e.set(n,s,(()=>t.setAttribute("stroke-dashoffset",Mi(-e.latest[n])))):(e.get("stroke-dasharray")||e.set("stroke-dasharray",new tt("1 1"),(()=>{const{pathLength:n=1,pathSpacing:s}=e.latest;t.setAttribute("stroke-dasharray",`${Mi(n)} ${Mi(s??1-Number(n))}`)})),e.set(n,s,void 0,e.get("stroke-dasharray")))}(t,e,n,s);if(n.startsWith("attr"))return gi(t,e,function(t){return t.replace(/^attr([A-Z])/,((t,e)=>e.toLowerCase()))}(n),s);return(n in t.style?Ti:gi)(t,e,n,s)})));const{schedule:Si,cancel:Vi}=j(queueMicrotask,!1),ki={x:!1,y:!1};function Ei(){return ki.x||ki.y}function Pi(t){return"x"===t||"y"===t?ki[t]?null:(ki[t]=!0,()=>{ki[t]=!1}):ki.x||ki.y?null:(ki.x=ki.y=!0,()=>{ki.x=ki.y=!1})}function Ci(t,n){const s=e(t),r=new AbortController;return[s,{passive:!0,...n,signal:r.signal},()=>r.abort()]}function Oi(t){return!("touch"===t.pointerType||Ei())}function Fi(t,e,n={}){const[s,r,i]=Ci(t,n),o=t=>{if(!Oi(t))return;const{target:n}=t,s=e(n,t);if("function"!=typeof s||!n)return;const i=t=>{Oi(t)&&(s(t),n.removeEventListener("pointerleave",i))};n.addEventListener("pointerleave",i,r)};return s.forEach((t=>{t.addEventListener("pointerenter",o,r)})),i}const Ri=(t,e)=>!!e&&(t===e||Ri(t,e.parentElement)),Bi=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,Li=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Di=new WeakSet;function Wi(t){return e=>{"Enter"===e.key&&t(e)}}function Ii(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function ji(t){return Bi(t)&&!Ei()}function Ni(t,e,n={}){const[s,r,i]=Ci(t,n),o=t=>{const s=t.currentTarget;if(!ji(t))return;Di.add(s);const i=e(s,t),o=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",u),Di.has(s)&&Di.delete(s),ji(t)&&"function"==typeof i&&i(t,{success:e})},a=t=>{o(t,s===window||s===document||n.useGlobalTarget||Ri(s,t.target))},u=t=>{o(t,!1)};window.addEventListener("pointerup",a,r),window.addEventListener("pointercancel",u,r)};return s.forEach((t=>{var e;(n.useGlobalTarget?window:t).addEventListener("pointerdown",o,r),is(t)&&(t.addEventListener("focus",(t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const s=Wi((()=>{if(Di.has(n))return;Ii(n,"down");const t=Wi((()=>{Ii(n,"up")}));n.addEventListener("keyup",t,e),n.addEventListener("blur",(()=>Ii(n,"cancel")),e)}));n.addEventListener("keydown",s,e),n.addEventListener("blur",(()=>n.removeEventListener("keydown",s)),e)})(t,r))),e=t,Li.has(e.tagName)||-1!==e.tabIndex||t.hasAttribute("tabindex")||(t.tabIndex=0))})),i}function $i(){const{value:t}=W;null!==t?(t.frameloop.rate.push(U.delta),t.animations.mainThread.push(yt.mainThread),t.animations.waapi.push(yt.waapi),t.animations.layout.push(yt.layout)):K($i)}function Ki(t){return t.reduce(((t,e)=>t+e),0)/t.length}function Ui(t,e=Ki){return 0===t.length?{min:0,max:0,avg:0}:{min:Math.min(...t),max:Math.max(...t),avg:e(t)}}const Yi=t=>Math.round(1e3/t);function Xi(){W.value=null,W.addProjectionMetrics=null}function zi(){const{value:t}=W;if(!t)throw new Error("Stats are not being measured");Xi(),K($i);const e={frameloop:{setup:Ui(t.frameloop.setup),rate:Ui(t.frameloop.rate),read:Ui(t.frameloop.read),resolveKeyframes:Ui(t.frameloop.resolveKeyframes),preUpdate:Ui(t.frameloop.preUpdate),update:Ui(t.frameloop.update),preRender:Ui(t.frameloop.preRender),render:Ui(t.frameloop.render),postRender:Ui(t.frameloop.postRender)},animations:{mainThread:Ui(t.animations.mainThread),waapi:Ui(t.animations.waapi),layout:Ui(t.animations.layout)},layoutProjection:{nodes:Ui(t.layoutProjection.nodes),calculatedTargetDeltas:Ui(t.layoutProjection.calculatedTargetDeltas),calculatedProjections:Ui(t.layoutProjection.calculatedProjections)}},{rate:n}=e.frameloop;return n.min=Yi(n.min),n.max=Yi(n.max),n.avg=Yi(n.avg),[n.min,n.max]=[n.max,n.min],e}function Hi(){if(W.value)throw Xi(),new Error("Stats are already being measured");const t=W;return t.value={frameloop:{setup:[],rate:[],read:[],resolveKeyframes:[],preUpdate:[],update:[],preRender:[],render:[],postRender:[]},animations:{mainThread:[],waapi:[],layout:[]},layoutProjection:{nodes:[],calculatedTargetDeltas:[],calculatedProjections:[]}},t.addProjectionMetrics=e=>{const{layoutProjection:n}=t.value;n.nodes.push(e.nodes),n.calculatedTargetDeltas.push(e.calculatedTargetDeltas),n.calculatedProjections.push(e.calculatedProjections)},$.postRender($i,!0),zi}function qi(...t){const e=!Array.isArray(t[0]),n=e?0:-1,s=t[0+n],r=$e(t[1+n],t[2+n],t[3+n]);return e?r(s):r}function Zi(t){const e=[];Q.current=e;const n=t();Q.current=void 0;const s=et(n);return function(t,e,n){const s=()=>e.set(n()),r=()=>$.preRender(s,!1,!0),i=t.map((t=>t.on("change",r)));e.on("destroy",(()=>{i.forEach((t=>t())),K(s)}))}(e,s,t),s}function _i(t,e,n,s){const r=qi(e,n,s);return Zi((()=>r(t.get())))}function Gi(t,e){const n=et(m(t)?t.get():t);return Ji(n,t,e),n}function Ji(t,e,n){const s=t.get();let r,i=null,o=s;const a="string"==typeof s?s.replace(/[\d.-]/g,""):void 0,u=()=>{i&&(i.stop(),i=null)},l=()=>{u(),i=new mn({keyframes:[to(t.get()),to(o)],velocity:t.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:r})};let c;return t.attach(((e,n)=>(o=e,r=t=>n(Qi(t,a)),$.postRender(l),t.get())),u),m(e)&&(c=e.on("change",(e=>t.set(Qi(e,a)))),t.on("destroy",c)),c}function Qi(t,e){return e?t+e:t}function to(t){return"number"==typeof t?t:parseFloat(t)}function eo(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"exit"===t||"old"===t?"old":"group"}let no={},so=null;const ro=(t,e)=>{no[t]=e},io=()=>{so||(so=document.createElement("style"),so.id="motion-view");let t="";for(const e in no){const n=no[e];t+=`${e} {\n`;for(const[e,s]of Object.entries(n))t+=` ${e}: ${s};\n`;t+="}\n"}so.textContent=t,document.head.appendChild(so),no={}},oo=()=>{so&&so.parentElement&&so.parentElement.removeChild(so)};function ao(t){const e=t.match(/::view-transition-(old|new|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function uo(t){const{effect:e}=t;return!!e&&(e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition"))}const lo=["layout","enter","exit","new","old"];function co(t){const{update:e,targets:n,options:s}=t;if(!document.startViewTransition)return new Promise((async t=>{await e(),t(new fr([]))}));(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",n)||ro(":root",{"view-transition-name":"none"}),ro("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),io();const r=document.startViewTransition((async()=>{await e()}));return r.finished.finally((()=>{oo()})),new Promise((t=>{r.ready.then((()=>{const e=document.getAnimations().filter(uo),r=[];n.forEach(((t,e)=>{for(const n of lo){if(!t[n])continue;const{keyframes:i,options:o}=t[n];for(let[t,a]of Object.entries(i)){if(!a)continue;const i={...gt(s,t),...gt(o,t)},u=eo(n);if("opacity"===t&&!Array.isArray(a)){a=["new"===u?0:1,a]}"function"==typeof i.delay&&(i.delay=i.delay(0,1)),i.duration&&(i.duration=x(i.duration)),i.delay&&(i.delay=x(i.delay));const l=new Qn({...i,element:document.documentElement,name:t,pseudoElement:`::view-transition-${u}(${e})`,keyframes:a});r.push(l)}}}));for(const t of e){if("finished"===t.playState)continue;const{effect:e}=t;if(!(e&&e instanceof KeyframeEffect))continue;const{pseudoElement:i}=e;if(!i)continue;const o=ao(i);if(!o)continue;const a=n.get(o.layer);if(a)ho(a,"enter")&&ho(a,"exit")&&e.getKeyframes().some((t=>t.mixBlendMode))?r.push(new li(t)):t.cancel();else{const n="group"===o.type?"layout":"";let i={...gt(s,n)};i.duration&&(i.duration=x(i.duration)),i=Jn(i);const a=_n(i.ease,i.duration);e.updateTiming({delay:x(i.delay??0),duration:i.duration,easing:a}),r.push(new li(t))}}t(new fr(r))}))}))}function ho(t,e){return t?.[e]?.keyframes.opacity}let po=[],fo=null;function mo(){fo=null;const[t]=po;var e;t&&(c(po,e=t),fo=e,co(e).then((t=>{e.notifyReady(t),t.finished.finally(mo)})))}function go(){for(let t=po.length-1;t>=0;t--){const e=po[t],{interrupt:n}=e.options;if("immediate"===n){const n=po.slice(0,t+1).map((t=>t.update)),s=po.slice(t+1);e.update=()=>{n.forEach((t=>t()))},po=[e,...s];break}}fo&&"immediate"!==po[0]?.options.interrupt||mo()}class yo{constructor(t,e={}){var n;this.currentTarget="root",this.targets=new Map,this.notifyReady=N,this.readyPromise=new Promise((t=>{this.notifyReady=t})),this.update=t,this.options={interrupt:"wait",...e},n=this,po.push(n),Si.render(go)}get(t){return this.currentTarget=t,this}layout(t,e){return this.updateTarget("layout",t,e),this}new(t,e){return this.updateTarget("new",t,e),this}old(t,e){return this.updateTarget("old",t,e),this}enter(t,e){return this.updateTarget("enter",t,e),this}exit(t,e){return this.updateTarget("exit",t,e),this}crossfade(t){return this.updateTarget("enter",{opacity:1},t),this.updateTarget("exit",{opacity:0},t),this}updateTarget(t,e,n={}){const{currentTarget:s,targets:r}=this;r.has(s)||r.set(s,{});r.get(s)[t]={keyframes:e,options:n}}then(t,e){return this.readyPromise.then(t,e)}}function vo(t,e={}){return new yo(t,e)}const wo=$,bo=D.reduce(((t,e)=>(t[e]=t=>K(t),t)),{});function To(t,e="end"){return n=>{const s=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,r="end"===e?Math.floor(s):Math.ceil(s);return Mt(0,1,r/t)}}export{ls as AsyncMotionValueAnimation,Xs as DOMKeyframesResolver,fr as GroupAnimation,mr as GroupAnimationWithThen,mn as JSAnimation,Nn as KeyframeResolver,I as MotionGlobalConfig,tt as MotionValue,Qn as NativeAnimation,ns as NativeAnimationExtended,li as NativeAnimationWrapper,G as SubscriptionManager,yo as ViewTransitionBuilder,di as acceleratedValues,yt as activeAnimations,gi as addAttrValue,Ti as addStyleValue,l as addUniqueItem,St as alpha,qt as analyseComplexValue,yr as animate,Sr as animateMini,gn as animateValue,vo as animateView,wr as animationMapKey,Qe as anticipate,Mr as applyPxDefaults,Ji as attachSpring,yi as attrEffect,Ge as backIn,Je as backInOut,_e as backOut,T as calcGeneratorDuration,K as cancelFrame,Vi as cancelMicrotask,bo as cancelSync,tn as circIn,nn as circInOut,en as circOut,Mt as clamp,Q as collectMotionValues,Ut as color,Jt as complex,Ke as convertOffsetToTimes,A as createGeneratorEasing,j as createRenderBatcher,gr as createScopedAnimate,Ye as cubicBezier,qn as cubicBezierAsString,an as defaultEasing,v as defaultOffset,Sn as defaultTransformValue,Ds as defaultValueTypes,Dt as degrees,oi as delay,Ss as dimensionValueTypes,ai as distance,ui as distance2D,Xe as easeIn,He as easeInOut,ze as easeOut,on as easingDefinitionToFunction,y as fillOffset,yn as fillWildcards,Vs as findDimensionValueType,Es as findValueType,jn as flushKeyframeResolvers,$ as frame,U as frameData,Y as frameSteps,ye as generateLinearEasing,Is as getAnimatableNone,br as getAnimationMap,Tr as getComputedStyle,Ws as getDefaultValueType,u as getEasingForSegment,he as getMixer,Hs as getValueAsType,gt as getValueTransition,Us as getVariableValue,Z as hasWarned,Bt as hex,Fi as hover,Kt as hsla,te as hslaToRgba,ri as inView,Ne as inertia,$e as interpolate,V as invariant,oe as invisibleValues,sn as isBezierDefinition,wt as isCSSVariableName,Tt as isCSSVariableToken,Ei as isDragActive,ki as isDragging,a as isEasingArray,w as isGenerator,is as isHTMLElement,m as isMotionValue,Ri as isNodeOrChild,xs as isNumericalString,rs as isObject,Bi as isPrimaryPointer,ur as isSVGElement,lr as isSVGSVGElement,ci as isWaapiSupportedEasing,Ms as isZeroValueString,un as keyframes,_n as mapEasingToNativeEasing,_i as mapValue,b as maxGeneratorDuration,Un as memo,Si as microtask,M as millisecondsToSeconds,qe as mirrorEasing,me as mix,de as mixArray,ie as mixColor,fe as mixComplex,ee as mixImmediate,ne as mixLinearColor,i as mixNumber,pe as mixObject,ae as mixVisibility,et as motionValue,h as moveItem,N as noop,At as number,Ls as numberValueTypes,ei as observeTimeline,Ks as parseCSSVariable,Vn as parseValueFromTransform,Wt as percent,le as pipe,hs as positionalKeys,Ni as press,g as progress,$t as progressPercentage,vi as propEffect,It as px,kn as readTransformValue,Hi as recordStats,c as removeItem,Hr as resize,e as resolveElements,Ze as reverseEasing,Ft as rgbUnit,Rt as rgba,Vt as scale,ni as scroll,Jr as scrollInfo,x as secondsToMilliseconds,Pi as setDragLock,Kn as setStyle,je as spring,Gi as springValue,ii as stagger,Gn as startWaapiAnimation,W as statsBuffer,To as steps,xi as styleEffect,Zn as supportedWaapiEasing,us as supportsBrowserAnimation,Xn as supportsFlags,Hn as supportsLinearEasing,hi as supportsPartialKeyframes,Yn as supportsScrollTimeline,Ai as svgEffect,wo as sync,As as testValueType,H as time,qi as transform,ct as transformPropOrder,ht as transformProps,Zi as transformValue,Bs as transformValueTypes,J as velocityPerSecond,jt as vh,Nt as vw,_ as warnOnce,S as warning,o as wrap};export default null; \ No newline at end of file diff --git a/src/zen/welcome/ZenWelcome.mjs b/src/zen/welcome/ZenWelcome.mjs index 295d3c57..fcbdfa79 100644 --- a/src/zen/welcome/ZenWelcome.mjs +++ b/src/zen/welcome/ZenWelcome.mjs @@ -18,7 +18,7 @@ } function getMotion() { - return gZenUIManager.motion; + return gZenUIManager.anime; } async function animate(...args) { diff --git a/src/zen/workspaces/ZenGradientGenerator.mjs b/src/zen/workspaces/ZenGradientGenerator.mjs index df291025..e964e7b7 100644 --- a/src/zen/workspaces/ZenGradientGenerator.mjs +++ b/src/zen/workspaces/ZenGradientGenerator.mjs @@ -772,7 +772,7 @@ ); if (!this.dragging) { - gZenUIManager.motion.animate( + gZenUIManager.anime.animate( existingDot.element, { left: `${dotPosition.position.x}px`, @@ -889,7 +889,7 @@ this.handleColorPositions(colorPositions); this.updateCurrentWorkspace(true); - gZenUIManager.motion.animate( + gZenUIManager.anime.animate( existingPrimaryDot.element, { left: `${existingPrimaryDot.position.x}px`, @@ -1129,7 +1129,7 @@ `linear-gradient(to top, ${color3} -30%, transparent 60%)`, ].join(', '); } - return [`linear-gradient(${rotation}deg, ${color1} -30%, ${color3} 100%)`].join(', '); + return [`linear-gradient(120deg, ${color1} -30%, ${color3} 100%)`].join(', '); } else { // Just return a linear gradient with all colors const gradientColors = themedColors.map((color) => @@ -1508,7 +1508,7 @@ // Set `--toolbox-textcolor` to have a contrast with the primary color const blendTarget = isDarkMode ? [255, 255, 255] : [0, 0, 0]; const blendedColor = this.blendColors(dominantColor, blendTarget, 15); // 15% dominantColor, 85% target - await gZenUIManager.motion.animate( + await gZenUIManager.anime.animate( browser.document.documentElement, { '--toolbox-textcolor': blendedColor, diff --git a/src/zen/workspaces/ZenWorkspaceCreation.mjs b/src/zen/workspaces/ZenWorkspaceCreation.mjs index 52e030cb..6e26ebe3 100644 --- a/src/zen/workspaces/ZenWorkspaceCreation.mjs +++ b/src/zen/workspaces/ZenWorkspaceCreation.mjs @@ -152,7 +152,7 @@ document.getElementById('zen-sidebar-splitter').style.pointerEvents = 'none'; - gZenUIManager.motion + gZenUIManager.anime .animate( [gBrowser.tabContainer, gURLBar.textbox], { @@ -172,7 +172,7 @@ this.style.visibility = 'visible'; gZenCompactModeManager.getAndApplySidebarWidth(); this.resolveInitialized(); - gZenUIManager.motion + gZenUIManager.anime .animate( this.elementsToAnimate, { @@ -184,7 +184,7 @@ duration: 0.6, type: 'spring', bounce: 0, - delay: gZenUIManager.motion.stagger(0.05, { startDelay: 0.2 }), + delay: gZenUIManager.anime.stagger(0.05, { startDelay: 0.2 }), } ) .then(() => { @@ -265,7 +265,7 @@ } async #cleanup() { - await gZenUIManager.motion.animate( + await gZenUIManager.anime.animate( this.elementsToAnimate.reverse(), { y: [0, 20], @@ -276,7 +276,7 @@ duration: 0.4, type: 'spring', bounce: 0, - delay: gZenUIManager.motion.stagger(0.05), + delay: gZenUIManager.anime.stagger(0.05), } ); @@ -311,7 +311,7 @@ await gZenWorkspaces._organizeWorkspaceStripLocations(workspace, true); await gZenWorkspaces.updateTabsContainers(); - await gZenUIManager.motion.animate( + await gZenUIManager.anime.animate( [gBrowser.tabContainer, gURLBar.textbox], { opacity: [0, 1], diff --git a/src/zen/workspaces/ZenWorkspaces.mjs b/src/zen/workspaces/ZenWorkspaces.mjs index cb2cf45c..425a4b34 100644 --- a/src/zen/workspaces/ZenWorkspaces.mjs +++ b/src/zen/workspaces/ZenWorkspaces.mjs @@ -1593,8 +1593,8 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature { ) { delete this._alwaysAnimatePaddingTop; const essentialsHeight = essentialContainer.getBoundingClientRect().height; - if (!forAnimation && animateContainer && gZenUIManager.motion) { - gZenUIManager.motion.animate( + if (!forAnimation && animateContainer && gZenUIManager.anime) { + gZenUIManager.anime.animate( workspaceElement, { paddingTop: [workspaceElement.style.paddingTop, essentialsHeight + 'px'], @@ -1743,7 +1743,7 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature { await new Promise((resolve) => { requestAnimationFrame(() => { animations.push( - gZenUIManager.motion.animate( + gZenUIManager.anime.animate( document.documentElement, { '--zen-background-opacity': [previousBackgroundOpacity, 1], @@ -1773,7 +1773,7 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature { if (shouldAnimate) { const existingPaddingTop = element.style.paddingTop; animations.push( - gZenUIManager.motion.animate( + gZenUIManager.anime.animate( element, { transform: existingTransform ? [existingTransform, newTransform] : newTransform, @@ -1912,7 +1912,7 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature { if (shouldAnimate) { container.style.transform = existingTransform; animations.push( - gZenUIManager.motion.animate( + gZenUIManager.anime.animate( container, { transform: [