@wix/interact 2.2.2 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/react.js +1 -1
- package/dist/cjs/web.js +1 -1
- package/dist/es/index.js +1 -1
- package/dist/es/react.js +2 -2
- package/dist/es/web.js +2 -2
- package/dist/index-B9B40HvU.js +21 -0
- package/dist/index-B9B40HvU.js.map +1 -0
- package/dist/index-CBaynReP.mjs +3262 -0
- package/dist/index-CBaynReP.mjs.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/core/css.d.ts +17 -2
- package/dist/types/core/css.d.ts.map +1 -1
- package/dist/types/core/cssUtils.d.ts +8 -0
- package/dist/types/core/cssUtils.d.ts.map +1 -0
- package/dist/types/core/resolvers.d.ts +4 -0
- package/dist/types/core/resolvers.d.ts.map +1 -0
- package/dist/types/core/utilities.d.ts +6 -0
- package/dist/types/core/utilities.d.ts.map +1 -1
- package/dist/types/handlers/viewProgress.d.ts.map +1 -1
- package/dist/types/types/config.d.ts +23 -2
- package/dist/types/types/config.d.ts.map +1 -1
- package/dist/types/types/css.d.ts +26 -0
- package/dist/types/types/css.d.ts.map +1 -0
- package/dist/types/types/effects.d.ts +12 -0
- package/dist/types/types/effects.d.ts.map +1 -1
- package/dist/types/types/external.d.ts +3 -3
- package/dist/types/types/external.d.ts.map +1 -1
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/index.d.ts.map +1 -1
- package/dist/types/types/internal.d.ts +1 -1
- package/dist/types/types/internal.d.ts.map +1 -1
- package/dist/types/utils.d.ts +11 -2
- package/dist/types/utils.d.ts.map +1 -1
- package/docs/README.md +1 -1
- package/docs/api/README.md +4 -4
- package/docs/api/functions.md +157 -42
- package/docs/examples/entrance-animations.md +7 -5
- package/docs/guides/getting-started.md +1 -1
- package/docs/integration/react.md +8 -8
- package/package.json +4 -3
- package/rules/full-lean.md +24 -15
- package/rules/integration.md +23 -17
- package/rules/viewenter.md +4 -2
- package/rules/viewprogress.md +52 -0
- package/dist/index-A2Q0e94t.js +0 -18
- package/dist/index-A2Q0e94t.js.map +0 -1
- package/dist/index-HeFaJMEX.mjs +0 -2839
- package/dist/index-HeFaJMEX.mjs.map +0 -1
package/dist/cjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-B9B40HvU.js");exports.Interact=e.a;exports.add=e.b;exports.generate=e.g;exports.remove=e.r;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("react"),P=require("../index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("react"),P=require("../index-B9B40HvU.js");var q={exports:{}},$={};var Se;function dr(){if(Se)return $;Se=1;var h=Y,y=Symbol.for("react.element"),w=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,j=h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,x={key:!0,ref:!0,__self:!0,__source:!0};function R(_,f,T){var c,b={},E=null,L=null;T!==void 0&&(E=""+T),f.key!==void 0&&(E=""+f.key),f.ref!==void 0&&(L=f.ref);for(c in f)m.call(f,c)&&!x.hasOwnProperty(c)&&(b[c]=f[c]);if(_&&_.defaultProps)for(c in f=_.defaultProps,f)b[c]===void 0&&(b[c]=f[c]);return{$$typeof:y,type:_,key:E,ref:L,props:b,_owner:j.current}}return $.Fragment=w,$.jsx=R,$.jsxs=R,$}var W={};var Ce;function vr(){return Ce||(Ce=1,process.env.NODE_ENV!=="production"&&(function(){var h=Y,y=Symbol.for("react.element"),w=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),_=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),L=Symbol.for("react.offscreen"),Q=Symbol.iterator,je="@@iterator";function xe(e){if(e===null||typeof e!="object")return null;var r=Q&&e[Q]||e[je];return typeof r=="function"?r:null}var k=h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function d(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];ke("error",e,t)}}function ke(e,r,t){{var n=k.ReactDebugCurrentFrame,o=n.getStackAddendum();o!==""&&(r+="%s",t=t.concat([o]));var u=t.map(function(i){return String(i)});u.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,u)}}var De=!1,Fe=!1,Ae=!1,Ie=!1,$e=!1,ee;ee=Symbol.for("react.module.reference");function We(e){return!!(typeof e=="string"||typeof e=="function"||e===m||e===x||$e||e===j||e===T||e===c||Ie||e===L||De||Fe||Ae||typeof e=="object"&&e!==null&&(e.$$typeof===E||e.$$typeof===b||e.$$typeof===R||e.$$typeof===_||e.$$typeof===f||e.$$typeof===ee||e.getModuleId!==void 0))}function Ye(e,r,t){var n=e.displayName;if(n)return n;var o=r.displayName||r.name||"";return o!==""?t+"("+o+")":t}function re(e){return e.displayName||"Context"}function O(e){if(e==null)return null;if(typeof e.tag=="number"&&d("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case m:return"Fragment";case w:return"Portal";case x:return"Profiler";case j:return"StrictMode";case T:return"Suspense";case c:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case _:var r=e;return re(r)+".Consumer";case R:var t=e;return re(t._context)+".Provider";case f:return Ye(e,e.render,"ForwardRef");case b:var n=e.displayName||null;return n!==null?n:O(e.type)||"Memo";case E:{var o=e,u=o._payload,i=o._init;try{return O(i(u))}catch{return null}}}return null}var S=Object.assign,A=0,te,ne,ae,ie,oe,ue,se;function le(){}le.__reactDisabledLog=!0;function Le(){{if(A===0){te=console.log,ne=console.info,ae=console.warn,ie=console.error,oe=console.group,ue=console.groupCollapsed,se=console.groupEnd;var e={configurable:!0,enumerable:!0,value:le,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}A++}}function Me(){{if(A--,A===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:S({},e,{value:te}),info:S({},e,{value:ne}),warn:S({},e,{value:ae}),error:S({},e,{value:ie}),group:S({},e,{value:oe}),groupCollapsed:S({},e,{value:ue}),groupEnd:S({},e,{value:se})})}A<0&&d("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var J=k.ReactCurrentDispatcher,B;function M(e,r,t){{if(B===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);B=n&&n[1]||""}return`
|
|
2
2
|
`+B+e}}var G=!1,V;{var Ve=typeof WeakMap=="function"?WeakMap:Map;V=new Ve}function fe(e,r){if(!e||G)return"";{var t=V.get(e);if(t!==void 0)return t}var n;G=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=J.current,J.current=null,Le();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(p){n=p}Reflect.construct(e,[],i)}else{try{i.call()}catch(p){n=p}e.call(i.prototype)}}else{try{throw Error()}catch(p){n=p}e()}}catch(p){if(p&&n&&typeof p.stack=="string"){for(var a=p.stack.split(`
|
|
3
3
|
`),v=n.stack.split(`
|
|
4
4
|
`),s=a.length-1,l=v.length-1;s>=1&&l>=0&&a[s]!==v[l];)l--;for(;s>=1&&l>=0;s--,l--)if(a[s]!==v[l]){if(s!==1||l!==1)do if(s--,l--,l<0||a[s]!==v[l]){var g=`
|
package/dist/cjs/web.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../index-B9B40HvU.js");function i(){let s=!1,r=!1;return class extends HTMLElement{_internals;controller;constructor(){if(super(),this.controller=new n.I(this,void 0,{useFirstChild:!0}),this._internals=null,this.attachInternals&&(this._internals=this.attachInternals(),!s)){s=!0;try{this._internals.states.add("test"),this._internals.states.delete("test")}catch{r=!0}}}connectedCallback(){this.connect()}disconnectedCallback(){this.disconnect({removeFromCache:!0})}connect(e){this.controller.connected||this.controller.connect(e)}disconnect(e){this.controller.disconnect(e)}toggleEffect(e,t,l){l!==null&&(r&&(e=`--${e}`),this._internals&&!l?t==="toggle"?this._internals.states.has(e)?this._internals.states.delete(e):this._internals.states.add(e):t==="add"?this._internals.states.add(e):t==="remove"?this._internals.states.delete(e):t==="clear"&&this._internals.states.clear():this.controller?.toggleEffect(e,t,l,!0))}getActiveEffects(){if(this._internals){const e=Array.from(this._internals.states);return r?e.map(t=>t.replace(/^--/g,"")):e}return this.controller?.getActiveEffects()||[]}}}function a(){if(!customElements.get("interact-element")){const s=i();return customElements.define("interact-element",s),!0}return!1}n.a.defineInteractElement=a;exports.Interact=n.a;exports.add=n.b;exports.generate=n.g;exports.remove=n.r;
|
|
2
2
|
//# sourceMappingURL=web.js.map
|
package/dist/es/index.js
CHANGED
package/dist/es/react.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import W from "react";
|
|
2
|
-
import { b as cr, r as Oe } from "../index-
|
|
3
|
-
import { a as mr, g as Tr } from "../index-
|
|
2
|
+
import { b as cr, r as Oe } from "../index-CBaynReP.mjs";
|
|
3
|
+
import { a as mr, g as Tr } from "../index-CBaynReP.mjs";
|
|
4
4
|
var N = { exports: {} }, I = {};
|
|
5
5
|
var Ce;
|
|
6
6
|
function vr() {
|
package/dist/es/web.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as l, a } from "../index-
|
|
2
|
-
import { b as m, g, r as _ } from "../index-
|
|
1
|
+
import { I as l, a } from "../index-CBaynReP.mjs";
|
|
2
|
+
import { b as m, g, r as _ } from "../index-CBaynReP.mjs";
|
|
3
3
|
function i() {
|
|
4
4
|
let n = !1, s = !1;
|
|
5
5
|
return class extends HTMLElement {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";function vt(t){return[...t.matchAll(/\[([-\w]+)]/g)].map(([e,n])=>n)}function $(t,e){const n=vt(e);let s=0;return n.length?t.replace(/\[]/g,()=>{const i=n[s++];return i!==void 0?`[${i}]`:"[]"}):t}function yt(t,e){return t.trigger==="viewEnter"&&e.triggerType==="once"&&G(t)===G(e)}function G(t){const{key:e,listContainer:n,listItemSelector:s,selector:i}=t;return`${e}\0${n||""}\0${s||""}\0${i||""}`}function He(t){let e=0,n=0;for(let s=0;s<t.length;s++){const i=t.charCodeAt(s);e=(e<<5)-e+i|0,n=n<<3^n>>>2^i|0}return((e>>>0)*1048576+(n>>>0)%1048576).toString(36)}class V{animations;options;ready;isCSS;longestAnimation;constructor(e,n){this.animations=e,this.options=n,this.ready=n?.measured||Promise.resolve(),this.isCSS=e[0]instanceof CSSAnimation,this.longestAnimation=this._getAnimationWithLongestEndTime()}_getAnimationWithLongestEndTime(){return this.animations.reduce((e,n)=>{const s=e.effect?.getComputedTiming().endTime??0,i=n.effect?.getComputedTiming().endTime??0;return s>i?e:n},this.animations[0])}getProgress(){return this.longestAnimation?.effect?.getComputedTiming().progress||0}async play(e){await this.ready;for(const n of this.animations)n.play();await Promise.all(this.animations.map(n=>n.ready)),e&&e()}pause(){for(const e of this.animations)e.pause()}async reverse(e){await this.ready;for(const n of this.animations)n.reverse();await Promise.all(this.animations.map(n=>n.ready)),e&&e()}progress(e){for(const n of this.animations){const{delay:s,duration:i,iterations:r}=n.effect.getTiming(),o=(Number.isFinite(i)?i:0)*(Number.isFinite(r)?r:1);n.currentTime=((s||0)+o)*e}}cancel(){for(const e of this.animations)e.cancel()}setPlaybackRate(e){for(const n of this.animations)n.playbackRate=e}async onFinish(e){try{await Promise.all(this.animations.map(s=>s.finished));const n=this.animations[0];if(n&&!this.isCSS){const s=n.effect?.target;if(s){const i=new Event("animationend");s.dispatchEvent(i)}}e()}catch(n){console.warn("animation was interrupted - aborting onFinish callback - ",n)}}async onAbort(e){try{await Promise.all(this.animations.map(n=>n.finished))}catch(n){if(n.name==="AbortError"){const s=this.animations[0];if(s&&!this.isCSS){const i=s.effect?.target;if(i){const r=new Event("animationcancel");i.dispatchEvent(r)}}e()}}}get finished(){return Promise.all(this.animations.map(e=>e.finished))}get playState(){return this.animations[0]?.playState}getTimingOptions(){return this.animations.map(e=>{const n=e.effect?.getTiming(),s=n?.delay??0,i=Number(n?.duration)||0,r=n?.iterations??1;return{delay:s,duration:i,iterations:r}})}}const je=t=>t,Et=t=>1-Math.cos(t*Math.PI/2),wt=t=>Math.sin(t*Math.PI/2),bt=t=>-(Math.cos(Math.PI*t)-1)/2,St=t=>t**2,Tt=t=>1-(1-t)**2,It=t=>t<.5?2*t**2:1-(-2*t+2)**2/2,Ot=t=>t**3,Ct=t=>1-(1-t)**3,kt=t=>t<.5?4*t**3:1-(-2*t+2)**3/2,At=t=>t**4,$t=t=>1-(1-t)**4,_t=t=>t<.5?8*t**4:1-(-2*t+2)**4/2,qt=t=>t**5,Mt=t=>1-(1-t)**5,Pt=t=>t<.5?16*t**5:1-(-2*t+2)**5/2,xt=t=>t===0?0:2**(10*t-10),Lt=t=>t===1?1:1-2**(-10*t),Rt=t=>t===0?0:t===1?1:t<.5?2**(20*t-10)/2:(2-2**(-20*t+10))/2,Ft=t=>1-Math.sqrt(1-t**2),Nt=t=>Math.sqrt(1-(t-1)**2),zt=t=>t<.5?(1-Math.sqrt(1-4*t**2))/2:(Math.sqrt(-(2*t-3)*(2*t-1))+1)/2,Ht=t=>2.70158*t**3-1.70158*t**2,jt=t=>1+2.70158*(t-1)**3+1.70158*(t-1)**2,Dt=(t,e=1.70158*1.525)=>t<.5?(2*t)**2*((e+1)*2*t-e)/2:((2*t-2)**2*((e+1)*(t*2-2)+e)+2)/2,Te={linear:je,sineIn:Et,sineOut:wt,sineInOut:bt,quadIn:St,quadOut:Tt,quadInOut:It,cubicIn:Ot,cubicOut:Ct,cubicInOut:kt,quartIn:At,quartOut:$t,quartInOut:_t,quintIn:qt,quintOut:Mt,quintInOut:Pt,expoIn:xt,expoOut:Lt,expoInOut:Rt,circIn:Ft,circOut:Nt,circInOut:zt,backIn:Ht,backOut:jt,backInOut:Dt},Ie={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",sineIn:"cubic-bezier(0.47, 0, 0.745, 0.715)",sineOut:"cubic-bezier(0.39, 0.575, 0.565, 1)",sineInOut:"cubic-bezier(0.445, 0.05, 0.55, 0.95)",quadIn:"cubic-bezier(0.55, 0.085, 0.68, 0.53)",quadOut:"cubic-bezier(0.25, 0.46, 0.45, 0.94)",quadInOut:"cubic-bezier(0.455, 0.03, 0.515, 0.955)",cubicIn:"cubic-bezier(0.55, 0.055, 0.675, 0.19)",cubicOut:"cubic-bezier(0.215, 0.61, 0.355, 1)",cubicInOut:"cubic-bezier(0.645, 0.045, 0.355, 1)",quartIn:"cubic-bezier(0.895, 0.03, 0.685, 0.22)",quartOut:"cubic-bezier(0.165, 0.84, 0.44, 1)",quartInOut:"cubic-bezier(0.77, 0, 0.175, 1)",quintIn:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",quintOut:"cubic-bezier(0.23, 1, 0.32, 1)",quintInOut:"cubic-bezier(0.86, 0, 0.07, 1)",expoIn:"cubic-bezier(0.95, 0.05, 0.795, 0.035)",expoOut:"cubic-bezier(0.19, 1, 0.22, 1)",expoInOut:"cubic-bezier(1, 0, 0, 1)",circIn:"cubic-bezier(0.6, 0.04, 0.98, 0.335)",circOut:"cubic-bezier(0.075, 0.82, 0.165, 1)",circInOut:"cubic-bezier(0.785, 0.135, 0.15, 0.86)",backIn:"cubic-bezier(0.6, -0.28, 0.735, 0.045)",backOut:"cubic-bezier(0.175, 0.885, 0.32, 1.275)",backInOut:"cubic-bezier(0.68, -0.55, 0.265, 1.55)"};function Gt(t){return t==="percentage"?"%":t||"px"}function J(t){return t?Ie[t]||t:Ie.linear}function Wt(t,e,n,s){const i=3*t,r=3*(n-t)-i,o=1-i-r,c=3*e,a=3*(s-e)-c,l=1-c-a,f=p=>((o*p+r)*p+i)*p,u=p=>((l*p+a)*p+c)*p,d=p=>(3*o*p+2*r)*p+i;function g(p){let m=p;for(let y=0;y<8;y++){const E=f(m)-p;if(Math.abs(E)<1e-7)return m;const w=d(m);if(Math.abs(w)<1e-6)break;m-=E/w}let h=0,v=1;for(m=(h+v)/2;v-h>1e-7;){const y=f(m);if(Math.abs(y-p)<1e-7)return m;p>y?h=m:v=m,m=(h+v)/2}return m}return p=>p<=0?0:p>=1?1:u(g(p))}function Vt(t){const e=t.match(/^cubic-bezier\(\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*\)$/);if(!e)return;const n=parseFloat(e[1]),s=parseFloat(e[2]),i=parseFloat(e[3]),r=parseFloat(e[4]);if(![n,s,i,r].some(isNaN))return Wt(n,s,i,r)}function Yt(t){const e=t.match(/^linear\((.+)\)$/);if(!e)return;const n=e[1].split(",").map(o=>o.trim()).filter(Boolean);if(n.length===0)return;const s=[];for(const o of n){const c=o.split(/\s+/),a=parseFloat(c[0]);if(isNaN(a))return;const l=[];for(let f=1;f<c.length;f++)if(c[f].endsWith("%")){const u=parseFloat(c[f])/100;if(isNaN(u))return;l.push(u)}l.length===0?s.push({output:a,pos:null}):l.length===1?s.push({output:a,pos:l[0]}):(s.push({output:a,pos:l[0]}),s.push({output:a,pos:l[1]}))}if(s.length===0)return;s[0].pos===null&&(s[0].pos=0),s[s.length-1].pos===null&&(s[s.length-1].pos=1);let i=0;for(;i<s.length;)if(s[i].pos===null){const o=i-1;let c=i;for(;c<s.length&&s[c].pos===null;)c++;const a=s[o].pos,l=s[c].pos,f=c-o;for(let u=o+1;u<c;u++)s[u].pos=a+(l-a)*(u-o)/f;i=c+1}else i++;for(let o=1;o<s.length;o++)s[o].pos<s[o-1].pos&&(s[o].pos=s[o-1].pos);const r=s;return o=>{if(o<=r[0].pos)return r[0].output;const c=r[r.length-1];if(o>=c.pos)return c.output;let a=0,l=r.length-1;for(;a<l-1;){const d=a+l>>>1;r[d].pos<=o?a=d:l=d}const f=r[a],u=r[l];return u.pos===f.pos?u.output:f.output+(u.output-f.output)*(o-f.pos)/(u.pos-f.pos)}}function be(t){if(!t)return;const e=Te[t];return e||(Vt(t)??Yt(t)??Te.linear)}class Kt extends V{animationGroups;delay;offset;offsetEasing;timingOptions;constructor(e,n={}){const s=e.flatMap(i=>[...i.animations]);super(s),this.animationGroups=e,this.delay=n.delay??0,this.offset=n.offset??0,this.offsetEasing=typeof n.offsetEasing=="function"?n.offsetEasing:be(n.offsetEasing)??je,this.timingOptions=this.animationGroups.map(i=>i.getTimingOptions().map(({delay:r,duration:o,iterations:c})=>({delay:r,duration:Number.isFinite(o)?o:0,iterations:Number.isFinite(c)?c:1}))),this.applyOffsets(),this.ready=Promise.all(e.map(i=>i.ready)).then(()=>{})}calculateOffsets(){const e=this.animationGroups.length;if(e<=1)return[0];const n=e-1;return Array.from({length:e},(s,i)=>this.offsetEasing(i/n)*n*this.offset|0)}applyOffsets(){if(this.animationGroups.length===0||this.animations.length===0)return;const e=this.calculateOffsets(),n=this.getSequenceActiveDuration(e);this.animationGroups.forEach((s,i)=>{s.animations.forEach((r,o)=>{const c=r.effect;if(!c)return;const{delay:a,duration:l,iterations:f}=this.timingOptions[i][o],u=a+e[i],d=n-(u+l*f);c.updateTiming({delay:u+this.delay,endDelay:d})})})}getSequenceActiveDuration(e){const n=[];for(let s=0;s<this.timingOptions.length;s++){const i=this.timingOptions[s].reduce((r,o)=>{if(!o)return r;const{delay:c,duration:a,iterations:l}=o;return Math.max(r,c+a*l)},0);n.push(e[s]+i)}return Math.max(...n)}addGroups(e){if(e.length===0)return;const n=[...e].sort((s,i)=>i.index-s.index);for(const{index:s,group:i}of n){const r=Math.min(s,this.animationGroups.length);this.animationGroups.splice(r,0,i),this.timingOptions.splice(r,0,i.getTimingOptions());const o=[...i.animations],c=this.animationGroups.slice(0,r).reduce((a,l)=>a+l.animations.length,0);this.animations.splice(c,0,...o)}this.applyOffsets(),this.ready=Promise.all(this.animationGroups.map(s=>s.ready)).then(()=>{})}removeGroups(e){const n=[],s=[],i=[];for(let r=0;r<this.animationGroups.length;r++)e(this.animationGroups[r])?n.push(this.animationGroups[r]):(s.push(this.animationGroups[r]),i.push(this.timingOptions[r]));if(n.length===0)return n;for(const r of n)r.cancel();return this.animationGroups=s,this.timingOptions=i,this.animations=s.flatMap(r=>[...r.animations]),this.applyOffsets(),this.ready=Promise.all(this.animationGroups.map(r=>r.ready)).then(()=>{}),n}async onFinish(e){try{await Promise.all(this.animationGroups.map(n=>n.finished)),e()}catch(n){console.warn("animation was interrupted - aborting onFinish callback - ",n)}}}class Bt{_animation;customEffect;progress;_tickCbId;_finishHandler;constructor(e,n,s,i){const r=new KeyframeEffect(n,[],{...s,composite:"add"}),{timeline:o}=i;this._animation=new Animation(r,o),this._tickCbId=null,this.progress=null,this.customEffect=c=>e(r.target,c),this._finishHandler=c=>{this.effect.target?.getAnimations().find(a=>a===this._animation)||this.cancel()},this.addEventListener("finish",this._finishHandler),this.addEventListener("remove",this._finishHandler)}_tick(){try{const e=this.effect?.getComputedTiming().progress??null;e!==this.progress&&(this.customEffect?.(e),this.progress=e),this._tickCbId=requestAnimationFrame(()=>{this._tick()})}catch(e){this._tickCbId=null,console.error(`failed to run customEffect! effectId: ${this.id}, error: ${e instanceof Error?e.message:e}`)}}get currentTime(){return this._animation.currentTime}set currentTime(e){this._animation.currentTime=e}get startTime(){return this._animation.startTime}set startTime(e){this._animation.startTime=e}get playbackRate(){return this._animation.playbackRate}set playbackRate(e){this._animation.playbackRate=e}get id(){return this._animation.id}set id(e){this._animation.id=e}get effect(){return this._animation.effect}set effect(e){this._animation.effect=e}get timeline(){return this._animation.timeline}set timeline(e){this._animation.timeline=e}get finished(){return this._animation.finished}get pending(){return this._animation.pending}get playState(){return this._animation.playState}get ready(){return this._animation.ready}get replaceState(){return this._animation.replaceState}get oncancel(){return this._animation.oncancel}set oncancel(e){this._animation.oncancel=e}get onfinish(){return this._animation.onfinish}set onfinish(e){this._animation.onfinish=e}get onremove(){return this._animation.onremove}set onremove(e){this._animation.onremove=e}play(){this._animation.play(),cancelAnimationFrame(this._tickCbId),this._tickCbId=requestAnimationFrame(()=>this._tick())}pause(){this._animation.pause(),cancelAnimationFrame(this._tickCbId),this._tickCbId=null}cancel(){this.removeEventListener("finish",this._finishHandler),this.removeEventListener("remove",this._finishHandler),this._animation.cancel(),this.customEffect(null),cancelAnimationFrame(this._tickCbId),this._tickCbId=null}commitStyles(){console.warn("CustomEffect animations do not support commitStyles method as they have no style to commit")}finish(){this._animation.finish()}persist(){this._animation.persist()}reverse(){this._animation.reverse()}updatePlaybackRate(e){this._animation.updatePlaybackRate(e)}addEventListener(e,n,s){this._animation.addEventListener(e,n,s)}removeEventListener(e,n,s){this._animation.removeEventListener(e,n,s)}dispatchEvent(e){return this._animation.dispatchEvent(e)}}function Qt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ee={exports:{}},Oe=ee.exports,Ce;function Ut(){return Ce||(Ce=1,(function(t){(function(e){var n=function(){},s=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.msRequestAnimationFrame||function(f){return setTimeout(f,16)};function i(){var f=this;f.reads=[],f.writes=[],f.raf=s.bind(e)}i.prototype={constructor:i,runTasks:function(f){for(var u;u=f.shift();)u()},measure:function(f,u){var d=u?f.bind(u):f;return this.reads.push(d),r(this),d},mutate:function(f,u){var d=u?f.bind(u):f;return this.writes.push(d),r(this),d},clear:function(f){return c(this.reads,f)||c(this.writes,f)},extend:function(f){if(typeof f!="object")throw new Error("expected object");var u=Object.create(this);return a(u,f),u.fastdom=this,u.initialize&&u.initialize(),u},catch:null};function r(f){f.scheduled||(f.scheduled=!0,f.raf(o.bind(null,f)))}function o(f){var u=f.writes,d=f.reads,g;try{n("flushing reads",d.length),f.runTasks(d),n("flushing writes",u.length),f.runTasks(u)}catch(p){g=p}if(f.scheduled=!1,(d.length||u.length)&&r(f),g)if(n("task errored",g.message),f.catch)f.catch(g);else throw g}function c(f,u){var d=f.indexOf(u);return!!~d&&!!f.splice(d,1)}function a(f,u){for(var d in u)u.hasOwnProperty(d)&&(f[d]=u[d])}var l=e.fastdom=e.fastdom||new i;t.exports=l})(typeof window<"u"?window:typeof Oe<"u"?Oe:globalThis)})(ee)),ee.exports}var Xt=Ut();const O=Qt(Xt),de={};function Zt(t){Object.assign(de,t)}function Jt(t){return t in de?de[t]:(console.warn(`${t} not found in registry. Please make sure to import and register the preset.`),null)}function N(t,e){return t?(e||document).getElementById(t):null}function en(t,e){return t?.matches(`[data-motion-part~="${e}"]`)?t:t?.querySelector(`[data-motion-part~="${e}"]`)}function tn(t){const e=t.alternate?"alternate":"";return t.reversed?`${e?`${e}-`:""}reverse`:e||"normal"}function ae(t){return`${t.value}${Gt(t.unit)}`}function ke(t,e,n){return`${t.name||"cover"} ${n&&t.offset.unit!=="percentage"?`calc(100% + ${ae(t.offset)}${e?` + ${e}`:""})`:e?`calc(${ae(t.offset)} + ${e})`:ae(t.offset)}`}function De(t){return{start:ke(t.startOffset,t.startOffsetAdd),end:ke(t.endOffset,t.endOffsetAdd,!0)}}function Ge(t){return e=>O.measure(()=>e(t))}function We(t){return e=>O.mutate(()=>e(t))}function W(t){if(t.namedEffect){const e=t.namedEffect.type;return typeof e=="string"?Jt(e):null}else if(t.keyframeEffect){const e=s=>{const{name:i,keyframes:r}=s.keyframeEffect;return[{...s,name:i,keyframes:r}]};return{web:e,style:e,getNames:s=>{const{effectId:i}=s,{name:r}=s.keyframeEffect,o=r||i;return o?[o]:[]}}}else if(t.customEffect)return e=>[{...e,keyframes:[]}];return null}function Ve(t,e,n,s){return t.map((i,r)=>{const o={fill:i.fill,easing:J(i.easing),iterations:i.iterations===0?1/0:i.iterations||1,composite:i.composite,direction:tn(i)};return Se(e)?(o.duration=i.duration,o.delay=i.delay||0):e?.trigger==="view-progress"&&(s||window.ViewTimeline)?o.duration="auto":(o.duration=99.99,o.delay=.01),{effect:i,options:o,id:n&&`${n}-${r+1}`,part:i.part}})}function Se(t){return!t||t.trigger!=="pointer-move"&&t.trigger!=="view-progress"}function Ae(t,e,n,s,i){if(t){if(Se(s)&&(e.duration=e.duration||1,i?.reducedMotion))if(e.iterations===1||e.iterations==null)e={...e,duration:1};else return[];let r;return n instanceof HTMLElement&&(r={measure:Ge(n),mutate:We(n)}),t.web?t.web(e,r,i):t(e,r,i)}return[]}function Ye(t,e,n,s,i){const r=t instanceof HTMLElement?t:N(t,i);if(n?.trigger==="pointer-move"&&!e.keyframeEffect){let d=e;e.customEffect&&(d={...e,namedEffect:{id:"",type:"CustomMouse"}});const g=W(d),p=Ae(g,e,r,n,s);return typeof p!="function"?null:p(r)}const o=W(e),c=Ae(o,e,r,n,s);if(!c||c.length===0)return null;const a=Ve(c,n,e.effectId);let l;const f=n?.trigger==="view-progress";f&&window.ViewTimeline&&(l=new ViewTimeline({subject:n.element||N(n.componentId)}));const u=a.map(({effect:d,options:g,id:p,part:m})=>{const h=m?en(r,m):r,v=new KeyframeEffect(h||null,[],g);O.mutate(()=>{"timing"in d&&v.updateTiming(d.timing),v.setKeyframes(d.keyframes)});const y=f&&l?{timeline:l}:{},E=typeof d.customEffect=="function"?new Bt(d.customEffect,h||null,g,y):new Animation(v,y.timeline);if(f)if(l)O.mutate(()=>{const{start:w,end:S}=De(d);E.rangeStart=w,E.rangeEnd=S,E.play()});else{const{startOffset:w,endOffset:S}=e;O.mutate(()=>{const T=d.startOffset||w,I=d.endOffset||S;Object.assign(E,{start:{name:T.name,offset:T.offset?.value,add:d.startOffsetAdd},end:{name:I.name,offset:I.offset?.value,add:d.endOffsetAdd}})})}return p&&(E.id=p),E});return new V(u,{...e,trigger:{...n||{}},measured:new Promise(d=>O.mutate(d))})}function nn(t,e){return t?`#${t}${e?`[data-motion-part~="${e}"]`:""}`:""}function sn(t,e){const{duration:n,delay:s,iterations:i=1,fill:r,easing:o="linear",direction:c}=t.options,a=t.effect.name,l=n==="auto";return`${a} ${l?"auto":`${n}ms`}${l?" ":` ${s||1}ms `}${o}${r&&r!=="none"?` ${r}`:""} ${!i||i===1/0?"infinite":i}${c==="normal"?"":` ${c}`} ${e?"":"paused"}`}function rn(t,e,n){return t?.style?(Se(n)&&(e.duration=e.duration||1),t.style(e)):[]}function on(t,e,n){const s=W(e),i=rn(s,e),r=Ve(i,n,e.effectId,!0),o=n?.trigger==="view-progress";return r.map((c,a)=>{const{start:l,end:f}=o?De(c.effect):{};return{target:nn(t,c.part),animation:sn(c,o),composition:c.options.composite,custom:c.effect.custom,name:c.effect.name,keyframes:c.effect.keyframes,id:c.id&&`${c.id}-${a+1}`,animationTimeline:o?`--${n?.id}`:"",animationRange:l||f?`${l} ${f}`:""}})}function cn(t,e,n){const s=W(e),i=t instanceof HTMLElement?t:N(t);if(s&&s.prepare&&i){const r={measure:Ge(i),mutate:We(i)};s.prepare(e,r)}n&&O.mutate(n)}function an(t,e){const n=W(e);if(!n)return null;if(!n.style)return e.effectId&&t?fn(t,e.effectId):null;const s=n.getNames(e),r=(typeof t=="string"?N(t):t)?.getAnimations(),o=r?.map(a=>a.animationName)||[],c=[];return s.forEach(a=>{o.includes(a)&&c.push(r?.find(l=>l.animationName===a))}),c?.length?new V(c):null}function fn(t,e){const s=(typeof t=="string"?N(t):t)?.getAnimations().filter(i=>{const r=i.id||i.animationName;return r?r.startsWith(e):!0});return s?.length?new V(s):null}function Ke(t,e,n,s={}){const{disabled:i,allowActiveEvent:r,...o}=s,c=Ye(t,e,n,o);if(!c)return null;let a={};if(n.trigger==="view-progress"&&!window.ViewTimeline){const l=n.element||N(n.componentId),{ready:f}=c;return c.animations.map(u=>({get start(){return u.start},get end(){return u.end},viewSource:l,ready:f,getProgress(){return c.getProgress()},effect(d,g){const{activeDuration:p}=u.effect.getComputedTiming(),{delay:m}=u.effect.getTiming();u.currentTime=((m||0)+(p||0))*g},disabled:i,destroy(){u.cancel()}}))}else if(n.trigger==="pointer-move"){const l=e,{centeredToTarget:f,transitionDuration:u,transitionEasing:d}=l,g=n.axis;if(l.keyframeEffect){const p=c;return p.animations?.length===0?null:{target:void 0,centeredToTarget:f,ready:p.ready,_currentProgress:0,getProgress(){return this._currentProgress},effect(h,v){const y=g==="x"?v.x:v.y;this._currentProgress=y,p.progress(y)},disabled:i??!1,destroy(){p.cancel()}}}a={centeredToTarget:f,allowActiveEvent:r},e.customEffect&&u&&(a.transitionDuration=u,a.transitionEasing=be(d)),a.target=c.target}return{...a,getProgress(){return c.getProgress()},effect(l,f,u,d){c.progress(u?{...f,v:u,active:d}:f)},disabled:i,destroy(){c.cancel()}}}function Y(t,e,n,s=!1){const i=an(t,e);return i?(i.ready=new Promise(r=>{cn(t,e,r)}),i):Ye(t,e,n,{reducedMotion:s})}function ln(t){return t===null?[null]:typeof t=="string"?Array.from(document.querySelectorAll(t)):Array.isArray(t)?t:[t]}function Be(t,e){const n=[];for(const{target:s,options:i}of t){const r=ln(s);for(const o of r){const c=Y(o,i,void 0,e?.reducedMotion);c instanceof V&&n.push(c)}}return n}function un(t,e,n){const s=Be(e,n);return new Kt(s,t)}function dn(t,e=2){return parseFloat(t.toFixed(e))}function hn(t){return/\[]/g.test(t)}function mn(t){return`--${t.join("-")}`}function pn(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function gn(t,e,n,s){const i=t.length-1;t.forEach((r,o)=>{if(r){const c=o?s(o/i)*i*n|0:0;r.delay=e+c+(r.delay||0)}})}function te(t,e){return e.includes("&")?e.replace(/&/g,t):`${t}${e}`}function A(){return"wi-12343210".replace(/\d/g,t=>String.fromCharCode((+t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+t/4)+97))}function Qe(t){let{transition:e,transitionProperties:n}=t,s=[];if(e?.styleProperties){const{duration:i,easing:r,delay:o}=e;i&&(e.styleProperties.some(a=>a.name.startsWith("--"))?s=[`all ${i}ms ${J(r||"ease")}${o?` ${o}ms`:""}`,"visibility 0s"]:s=e.styleProperties.map(a=>`${a.name} ${i}ms ${J(r||"ease")}${o?` ${o}ms`:""}`))}else s=n?.filter(i=>i.duration).map(i=>`${i.name} ${i.duration}ms ${J(i.easing)||"ease"}${i.delay?` ${i.delay}ms`:""}`)||[];return s}function vn({key:t,effectId:e,transition:n,transitionProperties:s,childSelector:i="> :first-child",selectorCondition:r}){const o=Qe({transition:n,transitionProperties:s}),c=(n?.styleProperties||s)?.map(p=>`${p.name}: ${p.value};`)||[],a=t.replace(/"/g,"'"),l=`:is(:state(${e}), :--${e}) ${i}`,f=`[data-interact-effect~="${e}"] ${i}`,u=r?te(l,r):l,d=r?te(f,r):f,g=[`${u},
|
|
2
|
+
${d} {
|
|
3
|
+
${c.join(`
|
|
4
|
+
`)}
|
|
5
|
+
}`];if(o.length){const p=`[data-interact-key="${a}"] ${i}`,m=r?te(p,r):p;g.push(`@media (prefers-reduced-motion: no-preference) { ${m} {
|
|
6
|
+
transition: ${o.join(", ")};
|
|
7
|
+
} }`)}return g}function ce(t,e,n){const s=(t||[]).filter(i=>e[i]?.type===n&&e[i].predicate).map(i=>e[i].predicate).join(") and (");return s&&`(${s})`}function _(t,e){const n=ce(t,e,"media");return n&&window.matchMedia(n)}function x(t,e){return(t||[]).filter(n=>e[n]?.type==="selector"&&e[n].predicate).map(n=>`:is(${e[n].predicate})`).join("")}const B={rangeStart:{name:"cover",offset:{value:0,unit:"percentage"}},rangeEnd:{name:"cover",offset:{value:100,unit:"percentage"}}};function yn(t,e){const n=t?.name??B.rangeStart.name,s=e?.name??t?.name??B.rangeEnd.name,i={name:n,offset:t?.offset||B.rangeStart.offset},r={name:s,offset:e?.offset||B.rangeEnd.offset};return{startOffset:i,endOffset:r}}function L(t){if("keyframeEffect"in t&&!t.keyframeEffect.name&&"effectId"in t&&(t.keyframeEffect.name=t.effectId),"duration"in t)return{id:"",...t};const{rangeStart:e,rangeEnd:n,...s}=t,{startOffset:i,endOffset:r}=yn(e,n);return{id:"",startOffset:i,endOffset:r,...s}}function k(t,e,n){let s=t.get(e);s||(s=new Set,t.set(e,s)),s.add(n)}function K(t,e){t.get(e)?.forEach(s=>{const{source:i,target:r,cleanup:o}=s;o();const c=i===e?r:i;t.get(c)?.delete(s)}),t.delete(e)}const En={root:null,rootMargin:"0px 0px -10% 0px",threshold:[0]},wn={root:null,rootMargin:"0px",threshold:[0]},bn=.2;function Sn(t){const e=t.trim().split(/\s+/),n=e[0],s=e.length>1?e[1]:e[0],i=r=>r.startsWith("-")?r.slice(1):parseFloat(r)?`-${r}`:r;return`${i(n)} 0px ${i(s)}`}const D={},q=new WeakMap,re=new WeakSet,z=new WeakMap;let Ue={},H=null;function Tn(t){Ue=t}function Xe(t,e,n){q.get(t)?.forEach(({source:i,handler:r})=>{i===t&&r(e,n)})}function $e(){return H||(H=new IntersectionObserver(t=>{t.forEach(e=>{const n=e.target;e.isIntersecting||Xe(n,!1,!0)})},wn),H)}function Ze(t,e=!1){const n=JSON.stringify({...t,isSafeMode:e});if(D[n])return D[n];const s=t.threshold??bn,i=e?En:{root:null,rootMargin:t.inset?Sn(t.inset):"0px",threshold:s},r=new IntersectionObserver(o=>{o.forEach(c=>{const a=c.target,l=!re.has(a);if(l&&(re.add(a),t.useSafeViewEnter&&!c.isIntersecting)){O.measure(()=>{const f=c.boundingClientRect.height,u=c.rootBounds?.height;if(!u)return;const d=Array.isArray(t.threshold)?Math.min(...t.threshold):t.threshold;d&&f*d>u&&O.mutate(()=>{r.unobserve(a);const p=Ze(t,!0);z.set(a,p),p.observe(a)})});return}(c.isIntersecting||!l)&&Xe(a,c.isIntersecting)})},i);return D[n]=r,r}function In(t,e,n,s={},{reducedMotion:i,selectorCondition:r,animation:o}={}){const c={...Ue,...s},a=n.triggerType||"once",l=o||Y(e,L(n),void 0,i);if(!l)return;const f=Ze(c);a!=="once"&&l.persist?.();let u=!0,d=!1,g;g={source:t,target:e,handler:(h,v)=>{if(!(r&&!e.matches(r)))if(a==="once"){if(h&&!d){d=!0,q.get(t)?.delete(g),q.get(e)?.delete(g);const y=q.get(t);(!y||y.size===0)&&((z.get(t)||f).unobserve(t),re.delete(t)),l.play(()=>{const E=()=>{e.dataset.interactEnter="start"};if(l.isCSS){O.mutate(()=>{requestAnimationFrame(E)});const w=()=>{O.mutate(()=>{e.dataset.interactEnter="done"})};l.onFinish(w),l.onAbort(w)}else O.mutate(E)})}}else a==="alternate"?u&&h?(u=!1,l.play()):u||l.reverse():a==="repeat"?h?(l.progress(0),l.play()):v&&(l.pause(),l.progress(0)):a==="state"&&(h?l.play():v&&l.pause())},cleanup:()=>{(z.get(t)||f).unobserve(t),(a==="repeat"||a==="state")&&$e().unobserve(t),l.cancel(),re.delete(t),z.delete(t)}},k(q,t,g),k(q,e,g),z.set(t,f),f.observe(t),(a==="repeat"||a==="state")&&$e().observe(t)}function On(t){K(q,t)}function Cn(){H=null,Object.keys(D).forEach(t=>delete D[t])}const _e={add:In,remove:On,setOptions:Tn,reset:Cn};function Je(t,e){return Object.assign(Object.create(e),t)}function kn(t,e,n,s){let i=t*(1-n)+e*n;if(s){const r=i-t;Math.abs(r)<s&&(i=t+s*Math.sign(r));const o=e-i;if(Math.abs(o)<s)return e}return i}function An(t){let e=!1;return function(){e||(e=!0,window.requestAnimationFrame(()=>{e=!1,t()}))}}function qe(t,e){let n=0;return function(){n&&window.clearTimeout(n),n=window.setTimeout(()=>{n=0,t()},e)}}function $n(t,e){const n=t.match(/^calc\s*\(\s*(-?\d+((px)|([lsd]?vh)|([lsd]?vw)))\s*\+\s*(-?\d+((px)|([lsd]?vh)|([lsd]?vw)))\s*\)\s*$/);return oe(n[1],e)+oe(n[6],e)}function oe(t,e){return t?/^-?\d+px$/.test(t)?parseInt(t):/^-?\d+[lsd]?vh$/.test(t)?parseInt(t)*e.viewportHeight/100:/^-?\d+[lsd]?vw$/.test(t)?parseInt(t)*e.viewportWidth/100:/^calc\s*\(\s*-?\d+((px)|([lsd]?vh)|([lsd]?vw))\s*\+\s*-?\d+((px)|([lsd]?vh)|([lsd]?vw))\s*\)\s*$/.test(t)?$n(t,e):parseInt(t)||0:0}function R(t,e,n){const{name:s,offset:i=0}=t,{start:r,end:o}=n,c=o-r,a=i/100;let l,f;return s==="entry"?(l=r-e,f=Math.min(e,c)):s==="entry-crossing"?(l=r-e,f=c):s==="contain"?(l=Math.min(o-e,r),f=Math.abs(e-c)):s==="exit"?(l=Math.max(r,o-e),f=Math.min(e,c)):s==="exit-crossing"?(l=r,f=c):s==="cover"&&(l=r-e,f=c+e),l+a*f|0}function fe(t,e,n,s,i){let r=0;const o={start:e,end:n};return t.forEach((c,a)=>{r+=c.offset;const l=c.sticky;if(l){if("end"in l&&t[a-1]?.element){const d=((i?c.element.offsetWidth:c.element.offsetHeight)||0)+l.end-s,g=r+d-c.offset,p=g<o.start,m=!p&&g<=n;let h=0;(p||m)&&(h=c.offset,o.end+=h),p&&(o.start+=h)}if("start"in l){const f=r-l.start,u=f<o.start,d=!u&&f<=o.end;let g=0;const p=t[a-1]?.element;if(p){if(u||d){const m=(i?p.offsetWidth:p.offsetHeight)||0,h=c.offset,v=(i?c.element.offsetWidth:c.element.offsetHeight)||0;g=m-(h+v),r+=g,o.end+=g}u&&(o.start+=g)}}}}),o}function _n(t,e,n,s,i,r){const{start:o,end:c,duration:a}=t;let l=o,f=c,u=t.startRange,d=t.endRange,g;if(typeof a=="string"){u={name:a,offset:0},d={name:a,offset:100},l=R(u,n,e),f=R(d,n,e),g=f-l;const p=fe(r,l,f,n,s);l=p.start,f=p.end}else{if(u||o?.name){u=u||o;const p=oe(u.add,i),m=R({...u,offset:0},n,e),h=R({...u,offset:100},n,e),v=fe(r,m,h,n,s);l=v.start+u.offset/100*(v.end-v.start)+p}if(d||c?.name){d=d||c;const p=oe(d.add,i),m=R({...d,offset:0},n,e),h=R({...d,offset:100},n,e),v=fe(r,m,h,n,s);f=v.start+d.offset/100*(v.end-v.start)+p}else typeof a=="number"&&(f=l+a)}return!g&&!a&&(g=f-l),{...t,start:l,end:f,startRange:u,endRange:d,duration:g||a}}function qn(t){return t.position==="sticky"}function Mn(t,e,n){return t.position==="fixed"&&(!e||e===window.document.body||e===n)}function Pn(t,e){return parseInt(e?t.left:t.top)}function xn(t,e){return parseInt(e?t.right:t.bottom)}function Ln(t,e,n){n&&(t.style.position="static");const s=(e?t.offsetLeft:t.offsetTop)||0;return n&&(t.style.position=null),s}function Rn(t,e){let n;const s=Pn(t,e),i=xn(t,e),r=!isNaN(s),o=!isNaN(i);return(r||o)&&(n={},r&&(n.start=s),o&&(n.end=i)),n}function Q(t,e,n,s,i){const r=t[0].viewSource,o=[];let c=(s?r.offsetWidth:r.offsetHeight)||0,a=0,l=r;for(;l;){const u=window.getComputedStyle(l),d=qn(u),g=d?Rn(u,s):void 0,p=Ln(l,s,d);if((!g||!("end"in g))&&(a+=p),o.push({element:l,offset:p,sticky:g}),l=l.offsetParent,Mn(u,l,e))break;if(l===e){o.push({element:l,offset:0});break}}return o.reverse(),t.map(u=>({..._n(u,{start:a,end:a+c},n,s,i,o)}))}const Me=100,Fn={horizontal:!1,observeViewportEntry:!0,viewportRootMargin:"7% 7%",observeViewportResize:!1,observeSourcesResize:!1,observeContentResize:!1};function Nn(t,e,n,s){let i=0;return t>=e&&t<=n?i=s?(t-e)/s:1:t>n&&(i=1),i}function Pe(t,e){return t===window?e?window.document.documentElement.clientWidth:window.document.documentElement.clientHeight:e?t.clientWidth:t.clientHeight}function zn(){return{viewportWidth:window.document.documentElement.clientWidth,viewportHeight:window.document.documentElement.clientHeight}}function Hn(t){const e=Je(t,Fn),n=e.root,s=e.horizontal,i=new WeakMap;let r=Pe(n,s),o,c,a,l,f;const u=[],d=zn();if(e.scenes=Object.values(t.scenes.reduce((m,h,v)=>{const y=h.groupId?`group-${h.groupId}`:String(v);return m[y]?m[y].push(h):m[y]=[h],m},{})).flatMap(m=>(m.every(h=>h.viewSource&&(typeof h.duration=="string"||h.start?.name))?(m=Q(m,n,r,s,d),(e.observeSourcesResize||e.observeContentResize)&&u.push(m)):m.forEach(h=>{h.end==null&&(h.end=h.start+h.duration),h.duration==null&&(h.duration=h.end-h.start)}),m)),e.scenes.forEach((m,h)=>{m.index=h}),u.length){const m=new Map;window.ResizeObserver&&(a=new window.ResizeObserver(function(h){h.forEach(v=>{const y=m.get(v.target),E=Q(y,n,r,s,d);E.forEach((w,S)=>{e.scenes[w.index]=E[S]}),u.splice(u.indexOf(y),1,E)})}),u.forEach(h=>{a.observe(h[0].viewSource,{box:"border-box"}),m.set(h[0].viewSource,h)}),e.observeContentResize&&e.contentRoot&&new window.ResizeObserver(qe(()=>{const v=u.map(y=>{const E=Q(y,n,r,s,d);return E.forEach((w,S)=>{e.scenes[w.index]=E[S]}),E});u.length=0,u.push(...v),u.forEach(y=>{m.set(y[0].viewSource,y)})},Me)).observe(e.contentRoot,{box:"border-box"})),e.observeViewportResize&&(l=qe(function(){r=Pe(n,s);const h=u.map(v=>{const y=Q(v,n,r,s,d);return y.forEach((E,w)=>{e.scenes[E.index]=y[w]}),y});u.length=0,u.push(...h),u.forEach(v=>{m.set(v[0].viewSource,v)})},Me),n===window?window.addEventListener("resize",l):window.ResizeObserver&&(f=new window.ResizeObserver(l),f.observe(n,{box:"border-box"})))}e.observeViewportEntry&&window.IntersectionObserver&&(c=new window.IntersectionObserver(function(m){m.forEach(h=>{(i.get(h.target)||[]).forEach(v=>{v.disabled=!h.isIntersecting})})},{root:n===window?window.document:n,rootMargin:e.viewportRootMargin,threshold:0}),e.scenes.forEach(m=>{if(m.viewSource){let h=i.get(m.viewSource);h||(h=[],i.set(m.viewSource,h),c.observe(m.viewSource)),h.push(m)}}));function g({p:m,vp:h}){m=+m.toFixed(1);const v=+h.toFixed(4);if(m!==o){for(let y of e.scenes)if(!y.disabled){const{start:E,end:w,duration:S}=y,T=Nn(m,E,w,S);y.effect(y,T,v)}o=m}}function p(){e.scenes.forEach(m=>m.destroy?.()),c&&(c.disconnect(),c=null),a&&(a.disconnect(),a=null),l&&(f?(f.disconnect(),f=null):window.removeEventListener("resize",l))}return{tick:g,destroy:p}}const jn={transitionActive:!1,transitionFriction:.9,transitionEpsilon:1,velocityActive:!1,velocityMax:1};class Dn{constructor(e={}){this.config=Je(e,jn),this.progress={p:0,prevP:0,vp:0},this.currentProgress={p:0,prevP:0,vp:0},this._lerpFrameId=0,this.effect=null;const n=!this.config.root||this.config.root===window.document.body;this.config.root=n?window:this.config.root,this.config.contentRoot=this.config.contentRoot||(n?window.document.body:this.config.root.firstElementChild),this.config.resetProgress=this.config.resetProgress||this.resetProgress.bind(this),this._measure=this.config.measure||(()=>{const s=this.config.root;this.progress.p=this.config.horizontal?s.scrollX||s.scrollLeft||0:s.scrollY||s.scrollTop||0}),this._trigger=An(()=>{this._measure?.(),this.tick(!0)})}start(){this.setupEffect(),this.setupEvent(),this.resetProgress(),this.tick()}pause(){this.removeEvent()}resetProgress(e={}){const n=this.config.root,s=e.x||e.x===0?e.x:n.scrollX||n.scrollLeft||0,i=e.y||e.y===0?e.y:n.scrollY||n.scrollTop||0,r=this.config.horizontal?s:i;this.progress.p=r,this.progress.prevP=r,this.progress.vp=0,this.config.transitionActive&&(this.currentProgress.p=r,this.currentProgress.prevP=r,this.currentProgress.vp=0),e&&this.config.root.scrollTo(s,i)}tick(e){const n=this.config.transitionActive;n&&this.lerp();const s=n?this.currentProgress:this.progress;if(this.config.velocityActive){const i=s.p-s.prevP,r=i<0?-1:1;s.vp=Math.min(this.config.velocityMax,Math.abs(i))/this.config.velocityMax*r}this.effect.tick(s),n&&s.p!==this.progress.p&&(e&&this._lerpFrameId&&window.cancelAnimationFrame(this._lerpFrameId),this._lerpFrameId=window.requestAnimationFrame(()=>this.tick())),s.prevP=s.p}lerp(){this.currentProgress.p=kn(this.currentProgress.p,this.progress.p,+(1-this.config.transitionFriction).toFixed(3),this.config.transitionEpsilon)}destroy(){this.pause(),this.removeEffect()}setupEvent(){this.removeEvent(),this.config.root.addEventListener("scroll",this._trigger)}removeEvent(){this.config.root.removeEventListener("scroll",this._trigger)}setupEffect(){this.removeEffect(),this.effect=Hn(this.config)}removeEffect(){this.effect&&this.effect.destroy(),this.effect=null}}const he=new WeakMap;let et=()=>({});function Gn(t){et=t}function Wn(t,e,n,s,{reducedMotion:i}){if(i)return;const r={trigger:"view-progress",element:t},o=L(n);let c;if("ViewTimeline"in window){const l=Y(e,o,r);l&&!l.isCSS&&(l.play(),c=()=>{l.ready.then(()=>{l.cancel()})})}else{const l=Ke(e,o,r);if(l){const f=Array.isArray(l)?l:[l],u=new Dn({viewSource:t,scenes:f,observeViewportEntry:!1,observeViewportResize:!1,observeSourcesResize:!0,root:document.body,...et()});c=()=>{u.destroy()},Promise.all(f.map(d=>d.ready||Promise.resolve())).then(()=>{u.start()})}}if(!c)return;const a={source:t,target:e,cleanup:c};k(he,t,a),k(he,e,a)}function Vn(t){K(he,t)}const Yn={add:Wn,remove:Vn,registerOptionsGetter:Gn};function xe(t,e,n){return Math.min(Math.max(t,n),e)}function Le(t){let e=!1;return function(){if(!e)return e=!0,window.requestAnimationFrame(()=>{e=!1,t()})}}function Kn(t){let e=t,n=0,s=0;if(e.offsetParent)do n+=e.offsetLeft,s+=e.offsetTop,e=e.offsetParent;while(e);return{left:n,top:s,width:t.offsetWidth,height:t.offsetHeight}}function Bn(){const t=window.devicePixelRatio;let e=!1;if(t===1)return!1;document.body.addEventListener("pointerdown",s=>{e=s.offsetX!==10},{once:!0});const n=new PointerEvent("pointerdown",{clientX:10});return document.body.dispatchEvent(n),e}function Qn(){return new Promise(t=>{const e=window.scrollY;let n=!1,s;function i(){document.body.addEventListener("pointerdown",c=>{s===void 0?s=c.offsetY:n=c.offsetY===s},{once:!0});const o=new PointerEvent("pointerdown",{clientY:500});document.body.dispatchEvent(o)}function r(){window.scrollY!==e&&(window.removeEventListener("scroll",r),i(),t(n))}i(),window.addEventListener("scroll",r),window.scrollY>0&&window.scrollBy(0,-1)})}function Un(t){Qn().then(e=>{t.fixRequired=e,e&&(window.addEventListener("scroll",t.scrollHandler),t.scrollHandler())})}let U=0;const ne=new Set;function Xn(){const t=n=>{for(let s of n.changedTouches)ne.add(s.identifier)},e=n=>{for(let s of n.changedTouches)ne.delete(s.identifier)};return document.addEventListener("touchstart",t,{passive:!0}),document.addEventListener("touchend",e,{passive:!0}),function(){ne.clear(),document.removeEventListener("touchstart",t),document.removeEventListener("touchend",e)}}function Zn(t,e){if("onscrollend"in window)return t.addEventListener("scrollend",e),function(){t.removeEventListener("scrollend",e)};let n=0,s;U||(s=Xn()),U+=1;function i(r){clearTimeout(n),n=setTimeout(()=>{ne.size?setTimeout(i,100):(e(r),n=0)},100)}return t.addEventListener("scroll",i),function(){t.removeEventListener("scroll",i),U-=1,U||s()}}function Jn(t,e,n){return{x(s){const i=t.left-n.x+t.width/2,r=i>=e.width/2,o=(r?i:e.width-i)*2,c=r?0:i-o/2;return(s-c)/o},y(s){const i=t.top-n.y+t.height/2,r=i>=e.height/2,o=(r?i:e.height-i)*2,c=r?0:i-o/2;return(s-c)/o}}}function es(t,e){this.x=window.scrollX,this.y=window.scrollY,requestAnimationFrame(()=>t&&t(e))}function ts(t){t.rect.width=window.document.documentElement.clientWidth,t.rect.height=window.document.documentElement.clientHeight}function ns(t){const e=new ResizeObserver(n=>{n.forEach(s=>{t.rect.width=s.borderBoxSize[0].inlineSize,t.rect.height=s.borderBoxSize[0].blockSize})});return e.observe(t.root,{box:"border-box"}),e}function ss(t){let e=!1,n={x:t.rect.width/2,y:t.rect.height/2,vx:0,vy:0},s,i,r,o,c;const a={x:0,y:0};t.scenes.forEach(f=>{f.target&&f.centeredToTarget&&(f.transform=Jn(Kn(f.target),t.rect,a),e=!0),t.root?i=ns(t):(r=ts.bind(null,t),window.addEventListener("resize",r))}),s=function(f){for(let u of t.scenes)if(!u.disabled){const d=u.transform?.x(f.x)||f.x/t.rect.width,g=u.transform?.y(f.y)||f.y/t.rect.height,p=+xe(0,1,d).toPrecision(4),m=+xe(0,1,g).toPrecision(4),h={x:f.vx,y:f.vy};t.allowActiveEvent&&(f.active=d<=1&&g<=1&&d>=0&&g>=0),u.effect(u,{x:p,y:m},h,f.active)}Object.assign(n,f)},e&&(o=es.bind(a,s,n),c=Zn(document,o));function l(){t.scenes.forEach(f=>f.destroy?.()),c?.(),i?(i.disconnect(),i=null):(window.removeEventListener("resize",r),r=null),s=null,n=null}return{tick:s,destroy:l}}const is=1e3/60*3;let X;function rs(){F.x=window.scrollX,F.y=window.scrollY}const F={x:0,y:0,scrollHandler:rs,fixRequired:void 0};class os{constructor(e={}){this.config={...e},this.effect=null,this._nextTick=null,this._nextTransitionTick=null,this._startTime=0;let n;this.config.transitionDuration?n=this.config.noThrottle?()=>this.transition():Le(()=>this.transition()):n=this.config.noThrottle?()=>(this.tick(),null):Le(()=>{this.tick()}),this.config.rect=this.config.root?{width:this.config.root.offsetWidth,height:this.config.root.offsetHeight}:{width:window.document.documentElement.clientWidth,height:window.document.documentElement.clientHeight},this.progress={x:this.config.rect.width/2,y:this.config.rect.height/2,vx:0,vy:0},this.previousProgress={...this.progress},this.currentProgress=null;const s=i=>{const r=this.config.root?i.offsetX:i.x,o=this.config.root?i.offsetY:i.y;this.progress.vx=r-this.progress.x,this.progress.vy=o-this.progress.y,this.progress.x=r,this.progress.y=o,this._nextTick=n()};if(this._pointerLeave=()=>{this.progress.active=!1,this.progress.vx=0,this.progress.vy=0,this._nextTick=n()},this._pointerEnter=()=>{this.progress.active=!0,this._nextTick=n()},this.config.root){X=typeof X=="boolean"?X:Bn();const i=X?window.devicePixelRatio:1;typeof F.fixRequired>"u"&&Un(F),this._measure=r=>{if(r.target!==this.config.root){const o=new PointerEvent("pointermove",{bubbles:!0,cancelable:!0,clientX:r.x*i+F.x,clientY:r.y*i+F.y});r.stopPropagation(),this.config.root.dispatchEvent(o)}else s(r)}}else this._measure=s}start(){this.setupEffect(),this.setupEvent()}pause(){this.removeEvent()}tick(){this.effect.tick(this.progress)}transition(){const e=this.config.transitionDuration,n=this.config.transitionEasing||(o=>o),s=performance.now();let i=!1;const r=o=>{const c=(o-this._startTime)/e,a=n(Math.min(1,c));i&&(this.progress.vx=0,this.progress.vy=0,i=!1),this.currentProgress=Object.entries(this.progress).reduce((l,[f,u])=>(f==="active"?l[f]=u:l[f]=this.previousProgress[f]+(u-this.previousProgress[f])*a,l),this.currentProgress||{}),c<1&&(this._nextTransitionTick=requestAnimationFrame(r),i=o-this._startTime>is),this.effect.tick(this.currentProgress)};return this._startTime?(this._nextTransitionTick&&cancelAnimationFrame(this._nextTransitionTick),Object.assign(this.previousProgress,this.currentProgress),this._startTime=s,r(s)):this._startTime=s,this._nextTransitionTick}destroy(){this.pause(),this.removeEffect(),this._nextTick&&cancelAnimationFrame(this._nextTick),this._nextTransitionTick&&cancelAnimationFrame(this._nextTransitionTick)}setupEvent(){this.removeEvent();const e=this.config.root||window;e.addEventListener("pointermove",this._measure,{passive:!0}),this.config.eventSource&&this.config.eventSource.addEventListener("pointermove",this._measure,{passive:!0}),this.config.allowActiveEvent&&(e.addEventListener("pointerleave",this._pointerLeave,{passive:!0}),e.addEventListener("pointerenter",this._pointerEnter,{passive:!0}),this.config.eventSource&&(this.config.eventSource.addEventListener("pointerleave",this._pointerLeave,{passive:!0}),this.config.eventSource.addEventListener("pointerenter",this._pointerEnter,{passive:!0})))}removeEvent(){const e=this.config.root||window;e.removeEventListener("pointermove",this._measure),this.config.eventSource&&this.config.eventSource.removeEventListener("pointermove",this._measure),this.config.allowActiveEvent&&(e.removeEventListener("pointerleave",this._pointerLeave),e.removeEventListener("pointerenter",this._pointerEnter),this.config.eventSource&&(this.config.eventSource.removeEventListener("pointerleave",this._pointerLeave),this.config.eventSource.removeEventListener("pointerenter",this._pointerEnter)))}setupEffect(){this.removeEffect(),this.effect=ss(this.config)}removeEffect(){this.effect&&this.effect.destroy(),this.effect=null}}const me=new WeakMap;let tt=()=>({});function cs(t){tt=t}function as(t,e,n,s={},{reducedMotion:i}){if(i)return;const r={trigger:"pointer-move",element:t,axis:s.axis??"y"},o=Ke(e,L(n),r);if(o){const c=Array.isArray(o)?o:[o],a=new os({root:s.hitArea==="self"?t:void 0,scenes:c,...tt()}),f={source:t,target:e,cleanup:()=>{a.destroy()}};k(me,t,f),k(me,e,f),Promise.all(c.map(u=>u.ready||Promise.resolve())).then(()=>{a.start()})}}function fs(t){K(me,t)}const ls={add:as,remove:fs,registerOptionsGetter:cs},pe=new WeakMap;function us(t,e,n,s,{reducedMotion:i,selectorCondition:r,animation:o}){const c=o||Y(e,L(n),void 0,i);if(!c)return;const a=()=>{r&&!e.matches(r)||c.play()},f={source:t,target:e,cleanup:()=>{c.cancel(),t.removeEventListener("animationend",a)}};k(pe,t,f),k(pe,e,f),t.addEventListener("animationend",a)}function ds(t){K(pe,t)}const hs={add:us,remove:ds};function ms(t,e,n=!1,s,i,r){const o=r||Y(t,L(e),void 0,n);if(!o)return null;let c=!0;const a=e.triggerType||"alternate";return l=>{if(s&&!t.matches(s))return;const f=!i,u=i?.enter?.includes(l.type),d=i?.leave?.includes(l.type);if(u||f){if(a==="alternate"||a==="state")c?(c=!1,o.play()):a==="alternate"?o.reverse():a==="state"&&(o.playState==="running"?o.pause():o.playState!=="finished"&&o.play());else{if(o.progress(0),delete t.dataset.interactEnter,o.isCSS){const g=()=>{O.mutate(()=>{t.dataset.interactEnter="done"})};o.onFinish(g),o.onAbort(g)}o.play()}return}d&&(a==="alternate"?o.reverse():a==="repeat"?(o.cancel(),O.mutate(()=>{delete t.dataset.interactEnter})):a==="state"&&o.playState==="running"&&o.pause())}}function ps(t,e,{effectId:n,listContainer:s,listItemSelector:i,stateAction:r},o,c){const a=!!s,l=r??"toggle",f=l==="toggle";return u=>{if(o&&!t.matches(o))return;const d=a?t.closest(`${s} > ${i||""}:has(:scope)`):void 0,g=!c,p=c?.enter?.includes(u.type),m=c?.leave?.includes(u.type);g?e.toggleEffect(n,l,d):(p&&e.toggleEffect(n,f?"add":l,d),m&&f&&e.toggleEffect(n,"remove",d))}}const ge=new WeakMap;function Re(t,e){return n=>{const s=n;t.contains(s.relatedTarget)||e(s)}}function gs(t){return e=>{const n=e;n.pointerType&&t(n)}}function vs(t){return e=>{const n=e;n.code==="Space"?(n.preventDefault(),t(n)):n.code==="Enter"&&t(n)}}const ys={focusin:(t,e)=>Re(t,e),focusout:(t,e)=>Re(t,e),click:(t,e)=>gs(e),keydown:(t,e)=>vs(e)};function Es(t,e,n){const s=ys[t];return s?s(e,n):i=>n(i)}function ws(t){return typeof t=="object"&&!Array.isArray(t)&&("enter"in t||"leave"in t)}function bs(t){if(typeof t=="string")return{toggle:[t]};if(Array.isArray(t))return{toggle:[...t]};if(ws(t)){const e=t.enter?[...t.enter]:[],n=t.leave?[...t.leave]:[];return{enter:e,leave:n}}return{}}function Ss(t){return!!(t.enter?.length||t.leave?.length)}function Ts(t){return Ss(t)?{enter:t.enter??[],leave:t.leave??[]}:void 0}function Is(t,e,n,s,{reducedMotion:i,targetController:r,selectorCondition:o,animation:c}){const a=bs(s.eventConfig),l=n.transition||n.transitionProperties,f=Ts(a);let u,d=!1;if(l?u=ps(e,r,n,o,f):(u=ms(e,n,i,o,f,c),d=n.triggerType==="once"),!u)return;const g=u,p=new AbortController;function m(y,E,w){const S=Es(E,t,g);y.addEventListener(E,S,{...w,signal:p.signal})}const v={source:t,target:e,cleanup:()=>{p.abort()}};if(k(ge,t,v),k(ge,e,v),f){const y=a.enter,E=a.leave;y.forEach(T=>{T==="focusin"&&(t.tabIndex=0),m(t,T,{passive:!0,once:d})});const w=!n.stateAction||n.stateAction==="toggle";(l?w:n.triggerType!=="once")&&E.forEach(T=>{if(T==="focusout"){m(t,T,{once:d});return}m(t,T,{passive:!0})})}else(a.toggle??[]).forEach(E=>{m(t,E,{once:d,passive:E!=="keydown"})})}function Os(t){K(ge,t)}const j={add:Is,remove:Os},ve={click:["click"],activate:["click","keydown"],hover:{enter:["mouseenter"],leave:["mouseleave"]},interest:{enter:["mouseenter","focusin"],leave:["mouseleave","focusout"]}},Fe={click:ve.activate,hover:ve.interest};function Z(t){const e=ve[t];return(n,s,i,r,o)=>{const c=o?.allowA11yTriggers&&t in Fe?Fe[t]:e;j.add(n,s,i,{eventConfig:c},o??{})}}const M={viewEnter:_e,hover:{add:Z("hover"),remove:j.remove},click:{add:Z("click"),remove:j.remove},pageVisible:_e,animationEnd:hs,viewProgress:Yn,pointerMove:ls,activate:{add:Z("activate"),remove:j.remove},interest:{add:Z("interest"),remove:j.remove}};function Cs(t){return t.replace(/\[([-\w]+)]/g,"[]")}class b{static defineInteractElement;dataCache;addedInteractions;mediaQueryListeners;listInteractionsCache;controllers;static forceReducedMotion=!1;static allowA11yTriggers=!0;static instances=[];static controllerCache=new Map;static sequenceCache=new Map;static elementSequenceMap=new WeakMap;constructor(){this.dataCache={effects:{},sequences:{},conditions:{},interactions:{}},this.addedInteractions={},this.mediaQueryListeners=new Map,this.listInteractionsCache={},this.controllers=new Set}init(e,n){if(typeof window>"u"||!window.customElements)return;const s=n?.useCustomElement??!!b.defineInteractElement;this.dataCache=As(e,s);const i=b.defineInteractElement?.();s&&i===!1?document.querySelectorAll("interact-element").forEach(r=>{r.connect()}):b.controllerCache.forEach((r,o)=>r.connect(o))}destroy(){for(const e of this.controllers)e.disconnect();for(const[,e]of this.mediaQueryListeners.entries())e.mql.removeEventListener("change",e.handler);this.mediaQueryListeners.clear(),this.addedInteractions={},this.listInteractionsCache={},this.controllers.clear(),this.dataCache={effects:{},sequences:{},conditions:{},interactions:{}},b.instances.splice(b.instances.indexOf(this),1)}setController(e,n){this.controllers.add(n),b.setController(e,n)}deleteController(e,n=!1){const s=b.controllerCache.get(e);this.clearInteractionStateForKey(e),this.clearMediaQueryListenersForKey(e),s&&n&&(this.controllers.delete(s),b.deleteController(e))}has(e){return!!this.get(e)}get(e){const n=Cs(e);return this.dataCache.interactions[n]}clearMediaQueryListenersForKey(e){for(const[n,s]of this.mediaQueryListeners.entries())s.key===e&&(s.mql.removeEventListener("change",s.handler),this.mediaQueryListeners.delete(n))}clearInteractionStateForKey(e){(this.get(e)?.interactionIds||[]).forEach(i=>{const r=$(i,e);delete this.addedInteractions[r]});const s=`${e}::seq::`;for(const i of b.sequenceCache.keys())i.startsWith(s)&&(b.sequenceCache.delete(i),delete this.addedInteractions[i])}setupMediaQueryListener(e,n,s,i){this.mediaQueryListeners.has(e)||(n.addEventListener("change",i),this.mediaQueryListeners.set(e,{mql:n,handler:i,key:s}))}static create(e,n){const s=new b;return b.instances.push(s),s.init(e,n),s}static destroy(){b.controllerCache.forEach(e=>{e.disconnect()}),b.instances.length=0,b.controllerCache.clear(),b.sequenceCache.clear(),b.elementSequenceMap=new WeakMap}static setup(e){e.scrollOptionsGetter&&M.viewProgress.registerOptionsGetter?.(e.scrollOptionsGetter),e.pointerOptionsGetter&&M.pointerMove.registerOptionsGetter?.(e.pointerOptionsGetter),e.viewEnter&&M.viewEnter.setOptions(e.viewEnter),e.allowA11yTriggers!==void 0&&(b.allowA11yTriggers=e.allowA11yTriggers)}static getInstance(e){const n=b.instances.find(s=>s.has(e));return n||console.warn(`Interact: Instance for key "${e}" not found`),n}static getController(e){const n=e?b.controllerCache.get(e):void 0;return n||console.warn(`Interact: Controller for key "${e}" not found`),n}static setController(e,n){b.controllerCache.set(e,n)}static deleteController(e){b.controllerCache.delete(e)}static registerEffects=Zt;static getSequence(e,n,s,i){const r=b.sequenceCache.get(e);if(r)return r;const o=un(n,s,i);return b.sequenceCache.set(e,o),b._registerSequenceElements(s,o),o}static addToSequence(e,n,s,i){const r=b.sequenceCache.get(e);if(!r)return!1;const c=Be(n,i).map((a,l)=>({index:s[l]??r.animationGroups.length,group:a}));return r.addGroups(c),b._registerSequenceElements(n,r),!0}static _registerSequenceElements(e,n){for(const{target:s}of e){const i=Array.isArray(s)?s:s instanceof HTMLElement?[s]:[];for(const r of i){let o=b.elementSequenceMap.get(r);o||(o=new Set,b.elementSequenceMap.set(r,o)),o.add(n)}}}static removeFromSequences(e){for(const n of e){const s=b.elementSequenceMap.get(n);if(s){for(const i of s)i.removeGroups(r=>r.animations.some(o=>o.effect?.target===n));b.elementSequenceMap.delete(n)}}}}let ks=0;function P(t,{asCombinator:e=!1,addItemFilter:n=!1,useFirstChild:s=!1}={}){if(t.listContainer){const i=`${n&&t.listItemSelector?` > ${t.listItemSelector}`:""}`;return t.selector?`${t.listContainer}${i} ${t.selector}`:`${t.listContainer}${i||" > *"}`}else if(t.selector)return t.selector;return s?e?"> :first-child":":scope > :first-child":""}function Ne(t){return"sequenceId"in t&&!("effects"in t)}function le(t,e){return t[e]||(t[e]={triggers:[],effects:{},sequences:{},interactionIds:new Set,selectors:new Set}),t[e]}function As(t,e=!1){const{effects:n={},sequences:s={},conditions:i={}}=t,r={};return t.interactions?.forEach(o=>{const c=o.key,a=++ks,{effects:l,sequences:f,...u}=o;if(!c){console.error(`Interaction ${a} is missing a key for source element.`);return}le(r,c);const d=l?Array.from(l):[];d.reverse();const g=f?.map(h=>{if(Ne(h)){const y=s[h.sequenceId];return y?{...y,...h}:(console.warn(`Interact: Sequence "${h.sequenceId}" not found in config`),h)}const v=h;return v.sequenceId||(v.sequenceId=A()),v}),p={...u,effects:d.length>0?d:void 0,sequences:g};r[c].triggers.push(p),r[c].selectors.add(P(p,{useFirstChild:e}));const m=p.listContainer;d.forEach(h=>{let v=h.key;if(!v&&h.effectId){const S=n[h.effectId];S&&(v=S.key)}h.effectId||(h.effectId=A()),v=v||c,h.key=v;const y=h.effectId;if(m&&h.listContainer&&(v!==c||h.listContainer!==m))return;const E=`${c}::${v}::${y}::${a}`;if(h.interactionId=E,r[c].interactionIds.add(E),v===c)return;const w=le(r,v);w.effects[E]||(w.effects[E]=[],w.interactionIds.add(E)),w.effects[E].push({...u,effect:h}),w.selectors.add(P(h,{useFirstChild:e}))}),g?.forEach(h=>{if(!h||Ne(h))return;const v=h,y=v.sequenceId||A(),E=v.effects;for(const w of E){w.effectId||(w.effectId=A());let S=w.key;if(!S&&w.effectId){const I=n[w.effectId];I&&(S=I.key)}S=S||c;const T=P(w,{useFirstChild:e});if(T&&r[c].selectors.add(T),S!==c){const I=le(r,S),C=`${S}::seq::${y}::${a}`;I.sequences[C]||(I.sequences[C]=[],I.interactionIds.add(C)),I.sequences[C].push({...u,sequence:v}),I.selectors.add(T)}}})}),{effects:n,sequences:s,conditions:i,interactions:r}}function ye(t,e,n){if(t.listContainer){const s=e.querySelector(t.listContainer);return s?t.selector?Array.from(s.querySelectorAll(t.selector)):Array.from(s.children):(console.warn(`Interact: No container found for list container "${t.listContainer}"`),[])}if(t.selector){const s=e.querySelectorAll(t.selector);if(s.length>0)return Array.from(s);console.warn(`Interact: No elements found for selector "${t.selector}"`)}return n?e.firstElementChild:e}function Ee(t,e){return e.map(n=>t.selector?n.querySelector(t.selector):n).filter(Boolean)}function nt(t,e,n,s,i,r,o,c){return[o?Ee(t,o):ye(t,n,s),c?Ee(e,c):ye(e,i,r)]}function st(t,e,n,s,i,r,o){const c=Array.isArray(s),a=Array.isArray(i);c?s.forEach((l,f)=>{const u=a?i[f]:i;u&&ze(t,l,e.trigger,u,n,e.params,r,o)}):(a?i:[i]).forEach(f=>{ze(t,s,e.trigger,f,n,e.params,r,o)})}function it(t,e,n,s,i){const r={},o=[];(s.effects||[]).forEach(c=>{const a=c.effectId,l={...n.dataCache.effects[a]||{},...c,effectId:a},f=l.key,u=$(c.interactionId,t);if(r[u]||n.addedInteractions[u]&&!i)return;const d=_(l.conditions||[],n.dataCache.conditions);if(d&&n.setupMediaQueryListener(u,d,t,()=>{e.update()}),!d||d.matches){r[u]=!0;const g=f&&$(f,t);let p;if(g){if(p=b.getController(g),!p)return;l.listContainer&&p.watchChildList(l.listContainer)}else p=e;const[m,h]=nt(s,l,e.element,e.useFirstChild,p.element,p.useFirstChild,i);if(!m||!h)return;n.addedInteractions[u]=!0;const v=g||s.key,y=x(l.conditions||[],n.dataCache.conditions);o.push([v,s,l,m,h,y,p.useFirstChild])}}),o.reverse().forEach(c=>{st(...c)}),_s(t,e,n,s,i)}function $s(t){return"sequenceId"in t&&!("effects"in t)}function rt(t,e,n,s,i,r,o){const c=_(t.conditions||[],i.dataCache.conditions);if(c&&i.setupMediaQueryListener(e,c,r.updateKey,r.onUpdate),c&&!c.matches)return null;const a=t.effects||[],l=[];let f=!1;for(const u of a){const d=u.effectId,p={...d?i.dataCache.effects[d]||{}:{},...u},m=_(p.conditions||[],i.dataCache.conditions);if(m){const T=`${e}::${d||"eff"}`;i.setupMediaQueryListener(T,m,r.updateKey,r.onUpdate)}if(m&&!m.matches)continue;const h=p.key,v=h&&$(h,n);let y;if(v){if(y=b.getController(v),!y)return null}else y=s;const E=v||n;let w;if(o&&E===o.controllerKey&&p.listContainer===o.listContainer?(w=Ee(p,o.elements),w.length>0&&(f=!0)):w=ye(p,y.element,y.useFirstChild),!w||Array.isArray(w)&&w.length===0)return null;const S=L(p);l.push({target:w,options:S})}return o&&!f?null:l.length>0?l:null}function ot(t,e,n){const r=(t.useFirstChild?t.element.firstElementChild:t.element)?.querySelector(e);if(!r)return n.map((c,a)=>a);const o=Array.from(r.children);return n.map(c=>{const a=o.indexOf(c);return a>=0?a:o.length})}function _s(t,e,n,s,i){s.sequences?.forEach(r=>{let o;if($s(r)){const g=n.dataCache.sequences[r.sequenceId];if(!g){console.warn(`Interact: Sequence "${r.sequenceId}" not found in cache`);return}o={...g,...r}}else o=r;const c=o.sequenceId||A(),a=$(`${t}::seq::${c}`,t);if(n.addedInteractions[a]&&!i)return;const l=i&&s.listContainer?{controllerKey:t,listContainer:s.listContainer,elements:i}:void 0,f=rt(o,a,t,e,n,{updateKey:t,onUpdate:()=>e.update()},l);if(!f)return;if(i&&n.addedInteractions[a]){const g=ot(e,s.listContainer,i);b.addToSequence(a,f,g,{reducedMotion:b.forceReducedMotion});return}const u=b.getSequence(a,o,f,{reducedMotion:b.forceReducedMotion});n.addedInteractions[a]=!0;const d=x(s.conditions||[],n.dataCache.conditions);M[s.trigger]?.add(e.element,e.element,{triggerType:o.triggerType},s.params||{},{reducedMotion:b.forceReducedMotion,selectorCondition:d,animation:u,allowA11yTriggers:b.allowA11yTriggers})})}function qs(t,e,n,s,i){const r=n.get(t)?.sequences||{};Object.keys(r).forEach(c=>{r[c].some(({sequence:l,...f})=>{const u=_(f.conditions||[],n.dataCache.conditions);if(u&&!u.matches)return!1;const d=f.key&&$(f.key,t),g=b.getController(d);if(!g)return!0;const p=l.sequenceId||A(),m=$(`${d}::seq::${p}`,d);if(n.addedInteractions[m]&&!i)return!0;const v=rt(l,m,d,g,n,{updateKey:t,onUpdate:()=>e.update()},i&&s?{controllerKey:t,listContainer:s,elements:i}:void 0);if(!v)return!0;if(i&&n.addedInteractions[m]){const w=ot(e,s,i);return b.addToSequence(m,v,w,{reducedMotion:b.forceReducedMotion}),!0}const y=b.getSequence(m,l,v,{reducedMotion:b.forceReducedMotion});n.addedInteractions[m]=!0;const E=x(f.conditions||[],n.dataCache.conditions);return M[f.trigger]?.add(g.element,g.element,{triggerType:l.triggerType},f.params||{},{reducedMotion:b.forceReducedMotion,selectorCondition:E,animation:y,allowA11yTriggers:b.allowA11yTriggers}),!0})})}function ct(t,e,n,s,i){const r=n.get(t),o=r?.effects||{},c=Object.keys(o),a=[];c.forEach(f=>{const u=$(f,t);if(n.addedInteractions[u]&&!i)return;o[f].some(({effect:g,...p})=>{const m=_(p.conditions||[],n.dataCache.conditions);if(m&&!m.matches)return!1;const h=g.effectId,v={...n.dataCache.effects[h]||{},...g,effectId:h};if(s&&v.listContainer!==s)return!1;const y=_(v.conditions||[],n.dataCache.conditions);if(y&&n.setupMediaQueryListener(u,y,t,()=>{e.update()}),!y||y.matches){const E=p.key&&$(p.key,t),w=b.getController(E);if(!w)return!0;v.listContainer&&e.watchChildList(v.listContainer);const[S,T]=nt(p,v,w.element,w.useFirstChild,e.element,e.useFirstChild,void 0,i);if(!S||!T)return!0;n.addedInteractions[u]=!0;const I=x(v.conditions||[],n.dataCache.conditions);return a.push([t,p,v,S,T,I,e.useFirstChild]),!0}return!1})}),a.reverse().forEach(f=>{st(...f)}),qs(t,e,n,s,i);const l=Object.keys(r?.sequences||{}).length>0;return c.length>0||l}function ze(t,e,n,s,i,r,o,c){let a;if(i.transition||i.transitionProperties){const l={key:t,effectId:i.effectId,transition:i.transition,transitionProperties:i.transitionProperties,childSelector:P(i,{asCombinator:!0,addItemFilter:!0,useFirstChild:c}),selectorCondition:o};if(a=b.getController(t),!a)return;a.renderStyle(vn(l))}M[n]?.add(e,s,i,r,{reducedMotion:b.forceReducedMotion,targetController:a,selectorCondition:o,allowA11yTriggers:b.allowA11yTriggers})}function Ms(t){const e=t.key,n=b.getInstance(e);if(!n)return console.warn(`No instance found for key: ${e}`),b.setController(e,t),!1;const{triggers:s=[]}=n?.get(e)||{},i=s.length>0;n.setController(e,t),s.forEach((o,c)=>{const a=_(o.conditions,n.dataCache.conditions);if(a){const l=`${e}::trigger::${c}`;n.setupMediaQueryListener(l,a,e,()=>{t.update()})}(!a||a.matches)&&(o.listContainer&&t.watchChildList(o.listContainer),it(e,t,n,o))});let r=!1;return n&&(r=ct(e,t,n)),i||r}function Ps(t,e,n){const s=t.key,i=b.getInstance(s);if(i){const{triggers:r=[]}=i?.get(s)||{};r.forEach((o,c)=>{if(o.listContainer!==e)return;const a=_(o.conditions,i.dataCache.conditions);if(a){const l=`${s}::listTrigger::${e}::${c}`;i.setupMediaQueryListener(l,a,s,()=>{t.update()})}(!a||a.matches)&&it(s,t,i,o,n)}),ct(s,t,i,e,n)}}function xs(t,e=!1){const n=t.key,s=b.getInstance(n);if(!s)return;const i=[...s.get(n)?.selectors.values()||[]].filter(Boolean).join(",");let r;i?(r=[...t.element.querySelectorAll(i)],t.useFirstChild||r.push(t.element)):r=[t.element],at(r),s.deleteController(n,e)}function at(t){const e=Object.values(M);for(const n of t)for(const s of e)s.remove(n);b.removeFromSequences(t)}const ue="interactEffect";class ft{element;key;connected;sheet;useFirstChild;_observers;constructor(e,n,s){this.element=e,this.key=n,this.connected=!1,this.sheet=null,this._observers=new WeakMap,this.useFirstChild=s?.useFirstChild??!1}connect(e){if(this.connected)return;const n=this.element.dataset.interactKey;if(e=e||this.key||n,!e){console.warn("Interact: No key provided");return}n!==e&&(n&&console.warn(`Interact: Key mismatch between element ${n} and parameter ${e}, updating element key`),this.element.dataset.interactKey=e),this.key=e,this.connected=Ms(this)}disconnect({removeFromCache:e=!1}={}){if((this.key||this.element.dataset.interactKey)&&xs(this,e),this.sheet){const s=this.element?.getRootNode(),i=s.host?s:document;i.adoptedStyleSheets.indexOf(this.sheet)!==-1&&(i.adoptedStyleSheets=i.adoptedStyleSheets.filter(o=>o!==this.sheet))}this._observers=new WeakMap,this.sheet=null,this.connected=!1}update(){this.disconnect(),this.connect()}renderStyle(e){const n=this.element?.getRootNode(),s=n.host?n:document;if(!this.sheet)this.sheet=new CSSStyleSheet,this.sheet.replaceSync(e.join(`
|
|
8
|
+
`)),s.adoptedStyleSheets=[...s.adoptedStyleSheets||[],this.sheet];else{let i=this.sheet.cssRules.length;for(const r of e)try{this.sheet.insertRule(r,i),i++}catch(o){console.error(o)}}}toggleEffect(e,n,s,i){if(s===null)return;if(!i&&this.element.toggleEffect){this.element.toggleEffect(e,n,s);return}const r=new Set(this.element.dataset[ue]?.split(" ")||[]);n==="toggle"?r.has(e)?r.delete(e):r.add(e):n==="add"?r.add(e):n==="remove"?r.delete(e):n==="clear"&&r.clear(),(s||this.element).dataset[ue]=Array.from(r).join(" ")}getActiveEffects(){const n=(this.element.dataset[ue]||"").trim();return n?n.split(/\s+/):[]}watchChildList(e){const n=this.element.querySelector(e);if(n){let s=this._observers.get(n);s||(s=new MutationObserver(this._childListChangeHandler.bind(this,e)),this._observers.set(n,s),s.observe(n,{childList:!0}))}}_childListChangeHandler(e,n){const s=this.key||this.element.dataset.interactKey,i=[],r=[];n.forEach(o=>{o.removedNodes.forEach(c=>{c instanceof HTMLElement&&i.push(c)}),o.addedNodes.forEach(c=>{c instanceof HTMLElement&&r.push(c)})}),at(i),s&&Ps(this,e,r)}}function Ls(t,e){new ft(t,e).connect()}function Rs(t){const e=b.getController(t);e&&e.disconnect({removeFromCache:!0})}const lt=new Map([["viewEnter","once"],["pageVisible","once"],["animationEnd","once"],["hover","alternate"],["click","alternate"],["activate","alternate"],["interest","alternate"]]);function ut(t,e,n){const{effects:s={},conditions:i={}}=n,{key:r,trigger:o}=e,c=o==="pointerMove";t.effectId||(t.effectId=A());const{effectId:a}=t,l={...s[a]||{},...t};let{key:f,conditions:u,triggerType:d}=l;if(!f){if(!r)return null;f=r}if(hn(f))return null;u=[...new Set((u||[]).filter(w=>i[w]))],d||(d=lt.get(o));const{namedEffect:g,customEffect:p,keyframeEffect:m,transition:h,transitionProperties:v,...y}={...l,key:f,conditions:u,effectId:a,triggerType:d},E=yt(e,y);if(g)return c||!g.type?null:{namedEffect:g,initial:E,...y};if(m){if(!m.name){const w=a&&!(s[a]&&"keyframeEffect"in t);m.name=w?a:A()}return{keyframeEffect:m,initial:E,...y}}else return p?c?null:{initial:E,...y}:h?{transition:h,initial:E,...y}:v?{transitionProperties:v,initial:E,...y}:{initial:E,...y}}function Fs(t,e,n){const{sequences:s={},conditions:i={}}=n;t.sequenceId||(t.sequenceId=A());const{sequenceId:r}=t,o={...s[r]||{},...t};let{effects:c,conditions:a,triggerType:l,delay:f=0,offset:u=0,offsetEasing:d="linear"}=o;l||(l=lt.get(e.trigger)),a=[...new Set((a||[]).filter(m=>i[m]))];const g=c.map(m=>(m.conditions?m.conditions.push(...a):m.conditions=[...a],ut({...m,triggerType:l},e,n)));typeof d!="function"&&(d=be(d)||(m=>m)),gn(g,f,u,d);const p=g.filter(m=>m!==null);return p.length?{sequenceId:r,triggerType:l,conditions:a,delay:f,offset:u,offsetEasing:d,effects:p}:null}function Ns(t){return t==="cssFloat"?"float":t==="easing"?"animation-timing-function":t==="cssOffset"?"offset":t==="composite"?"animation-composition":t.replace(/([A-Z])/g,"-$1").toLowerCase()}function zs(t){if(!t.length)return[];const e=t.map(i=>({...i}));e[0].offset===void 0&&(e[0].offset=0),(e[e.length-1].offset===void 0||e.length===1)&&(e[e.length-1].offset=1);let n=0,s=e[0].offset;for(let i=1;i<e.length;i++)if(e[i].offset!==void 0){const r=e[i].offset;if(r<s)return console.error("Offsets must be monotonically non-decreasing"),[];if(r>1)return console.error("Offsets must be in the range [0,1]"),[];const o=i-n;for(let c=n+1;c<i;c++){const a=(c-n)/o;e[c].offset=s+(r-s)*a}n=i,s=r}return e}function Hs(t,e){const n=Object.entries(t).filter(([s,i])=>s!=="offset"&&i!==void 0&&i!==null).map(([s,i])=>`${Ns(s)}: ${i};`).join(`
|
|
9
|
+
`);return`${e}% {
|
|
10
|
+
${n}
|
|
11
|
+
}`}function js(t,e){const n=zs(e);if(!n.length)return"";let s=n.map(i=>{const r=i.offset,o=dn(r*100);return Hs(i,o)}).join(`
|
|
12
|
+
`);return`@keyframes ${t} {
|
|
13
|
+
${s}
|
|
14
|
+
}`}function Ds(t){const{key:e,childSelector:n,declarations:s,media:i,states:r,selectorCondition:o,addInitialSelector:c}=t;if(!s.length)return"";let a=`[data-interact-key="${e}"]${c?":is(:not([data-interact-enter]))":""}`;if(r&&r.length){const u=r.map(d=>`:state(${d}), :--${d}, [data-interact-effect~="${d}"]`).join(", ");a=`${a}:is(${u})`}n&&(a=`${a} ${n}`),o&&(a=te(a,o));const l=s.map(({name:u,value:d})=>`${u}: ${d};`).join(`
|
|
15
|
+
`),f=`${a} {
|
|
16
|
+
${l}
|
|
17
|
+
}`;return i?`@media ${i} {
|
|
18
|
+
${f}
|
|
19
|
+
}`:f}function dt(t,e,n,s){const{key:i,childSelector:r,properties:o}=t,c=Object.entries(o).filter(l=>l[1]&&l[1].varNames.length).map(([l,{fallback:f,varNames:u}])=>({name:l,value:u.map(d=>`var(${d}, ${f})`).join(", ")})),a={key:i,childSelector:r,declarations:c};return e&&a.declarations.forEach(l=>{l.name=e[l.name]}),n&&(a.media=ce(n,s||{},"media"),a.selectorCondition=x(n,s||{})),a}const Gs=[{name:"visibility",value:"hidden"},{name:"transform",value:"none"},{name:"translate",value:"none"},{name:"scale",value:"none"},{name:"rotate",value:"none"}],se=["animation","animation-composition","animation-timeline","animation-range"],we=["transition",...se],Ws={animation:"animation","animation-composition":"composition","animation-timeline":"animationTimeline","animation-range":"animationRange"},ie={animation:"none","animation-composition":"replace",transition:"_","animation-timeline":"auto","animation-range":"normal"};function ht(t,e,n){const s=t.get(e);s?n.forEach(i=>s.add(i)):t.set(e,new Set(n))}function mt(t,e,n,s){const{key:i,childSelector:r}=n,o=s?we.filter(a=>s.has(a)):we;t.has(e)||t.set(e,{key:i,childSelector:r,properties:{}});const{properties:c}=t.get(e);for(const a of o)c[a]||(c[a]={fallback:ie[a],varNames:[]}),c[a].varNames.push(n[a])}function pt(t,e){return we.reduce((n,s)=>(n[s]=mn([s,...t,e]),n),{})}function Vs(t,e,n,s,i){return s.has(t)||s.set(t,{key:e,childSelector:i,...pt([n],He(t))}),s.get(t)}function Ys(t,e,n){return pt([e,n],He(t))}function Ks(t,e,n,s=!0){const{key:i,conditions:r}=t,o=ce(r,e,"media"),c=x(r,e),a=P(t,{asCombinator:!0,useFirstChild:s,addItemFilter:!0});return{key:i,media:o,selectorCondition:c,childSelector:a,declarations:[{name:"view-timeline",value:`--${n}`}]}}function Bs(t,e,n,s,i){const{key:r,effectId:o,conditions:c,namedEffect:a,keyframeEffect:l,transition:f,transitionProperties:u,initial:d}=t,g=ce(c,e,"media"),p=x(c,e),m=[{key:r,media:g,selectorCondition:p,childSelector:i,declarations:[]}];let h=[];const{declarations:v}=m[0];let y=[];if(a||l){y=[...se];const E=L(t),w=on(null,E,s).filter(T=>T.name);h=w.map(T=>({name:T.name,keyframes:T.keyframes})),v.push(...w.flatMap(({custom:T})=>Object.entries(T||{}).filter(([I,C])=>C!==void 0).map(([I,C])=>({name:I,value:C}))));const S=se.map(T=>({name:n[T],value:w.map(I=>{const C=Ws[T];return I[C]}).join(", ")||ie[T]}));d?m.push({key:r,media:g,selectorCondition:p,childSelector:i,declarations:S.concat(Gs),addInitialSelector:!0}):v.push(...S)}else if(f||u){y=["transition"];const E=f?.styleProperties||u||[],w=Qe(t);v.push({name:n.transition,value:w.join(", ")||ie.transition}),m.push({key:r,media:g,selectorCondition:p,childSelector:i,states:[o],declarations:E})}else v.push(...se.map(E=>({name:n[E],value:ie[E]})));return{rules:m.filter(E=>E.declarations.length),keyframes:h,usedProperties:y}}function gt(t,e,n,s,i,r,o=!0,c,a){const{key:l}=n,f=a??G(n),u=P(n,{asCombinator:!0,useFirstChild:o,addItemFilter:!0}),g={...Vs(f,l,e,s,u)};c&&Object.assign(g,c);const{rules:p,keyframes:m,usedProperties:h}=Bs(n,t,g,r,u);return m.forEach(({name:v,keyframes:y})=>i.set(v,y)),{rules:p,usedProperties:h}}function Qs(t,e,n,s,i,r,o=!0,c){const a=new Map,l=new Map,f=[];for(const d of n.effects){const g=G(d),{key:p}=d,m=P(d,{asCombinator:!0,useFirstChild:o,addItemFilter:!0}),h=l.get(g)||0;l.set(g,h+1);const v=Ys(g,e,h),{rules:y,usedProperties:E}=gt(t,e,d,s,i,r,o,v,g);f.push(...y);const w=new Set(E);mt(a,g,{key:p,childSelector:m,...v},w),c&&ht(c,g,E)}const{conditions:u}=n;return a.forEach((d,g)=>{const p=s.get(g);f.push(dt(d,p,u,t))}),f}function Us(t,e,n,s,i,r=!0){const{effects:o=[],sequences:c=[]}=e,a=t.conditions||{},l=new Map,f=new Map,u=o.map(h=>ut(h,e,t)).filter(h=>h!==null),d=[],{trigger:g}=e,p={trigger:pn(g),id:["trigger",n].join("-")};g==="viewProgress"&&d.push(Ks(e,a,p.id,r));for(const h of u){const v=G(h),{rules:y,usedProperties:E}=gt(a,n,h,l,i,p,r);d.push(...y),ht(f,v,E)}const m=c.map(h=>Fs(h,e,t)).filter(h=>h!==null);return d.push(...m.flatMap(h=>Qs(a,n,h,l,i,p,r,f))),l.forEach((h,v)=>{mt(s,v,h,f.get(v))}),d}function Xs(t,e=!0){const n=new Map,s=new Map,i=t.interactions.flatMap((r,o)=>Us(t,r,o,n,s,e));return n.forEach(r=>{i.push(dt(r))}),{keyframes:s,cssRules:i}}function Zs(t,e=!0){const{cssRules:n,keyframes:s}=Xs(t,e);return[...[...s.entries()].map(([r,o])=>js(r,o)),...n.map(Ds)].join(`
|
|
20
|
+
`)}exports.I=ft;exports.a=b;exports.b=Ls;exports.g=Zs;exports.r=Rs;
|
|
21
|
+
//# sourceMappingURL=index-B9B40HvU.js.map
|