@wix/interact 2.5.4 → 2.5.6
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/README.md +1 -1
- 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-CfagoYAR.mjs → index-CEt49C5d.mjs} +1246 -1112
- package/dist/index-CEt49C5d.mjs.map +1 -0
- package/dist/index-CxaQDD-U.js +21 -0
- package/dist/index-CxaQDD-U.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/core/Interact.d.ts +10 -1
- package/dist/types/core/Interact.d.ts.map +1 -1
- package/dist/types/core/InteractionController.d.ts +3 -1
- package/dist/types/core/InteractionController.d.ts.map +1 -1
- package/dist/types/core/add.d.ts.map +1 -1
- package/dist/types/core/css.d.ts +19 -6
- package/dist/types/core/css.d.ts.map +1 -1
- package/dist/types/core/cssUtils.d.ts.map +1 -1
- package/dist/types/types/config.d.ts +2 -1
- package/dist/types/types/config.d.ts.map +1 -1
- package/dist/types/types/controller.d.ts +5 -0
- package/dist/types/types/controller.d.ts.map +1 -1
- package/dist/types/types/css.d.ts +16 -1
- package/dist/types/types/css.d.ts.map +1 -1
- package/dist/types/types/effects.d.ts +2 -1
- package/dist/types/types/effects.d.ts.map +1 -1
- package/dist/types/types/external.d.ts +2 -0
- 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/plugins.d.ts +81 -0
- package/dist/types/types/plugins.d.ts.map +1 -0
- package/dist/types/utils.d.ts +7 -1
- package/dist/types/utils.d.ts.map +1 -1
- package/docs/api/README.md +1 -1
- package/docs/api/functions.md +23 -13
- package/docs/api/interact-class.md +35 -0
- package/docs/api/types.md +93 -1
- package/docs/examples/entrance-animations.md +1 -0
- package/docs/guides/README.md +4 -0
- package/docs/guides/configuration-structure.md +2 -0
- package/docs/guides/plugins.md +192 -0
- package/package.json +2 -2
- package/rules/click.md +2 -2
- package/rules/full-lean.md +58 -12
- package/rules/hover.md +2 -2
- package/rules/integration.md +11 -11
- package/rules/plugins.md +122 -0
- package/rules/validate.md +5 -3
- package/rules/viewenter.md +5 -2
- package/rules/viewprogress.md +1 -1
- package/dist/index-CfagoYAR.mjs.map +0 -1
- package/dist/index-DdqUOFMC.js +0 -21
- package/dist/index-DdqUOFMC.js.map +0 -1
package/dist/index-DdqUOFMC.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";function Et(t){return[...t.matchAll(/\[([-\w]+)]/g)].map(([e,n])=>n)}function $(t,e){const n=Et(e);let s=0;return n.length?t.replace(/\[]/g,()=>{const i=n[s++];return i!==void 0?`[${i}]`:"[]"}):t}function wt(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 je(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=this.options?.effectId||n.id,r=new CustomEvent("animationend",{detail:{effectId:i}});s.dispatchEvent(r)}}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.some(e=>e.playState==="running")?"running":this.animations[0]?.playState}hasAnimationName(e){return this.animations.some(n=>n.animationName===e)}hasAnimationId(e){return this.animations.some(n=>n.id===e)}getTimingOptions(){return this.animations.map(e=>{const n=e.effect?.getTiming(),s=n?.delay??0,i=Number(n?.duration)||0,r=n?.iterations??1;return{delay:s,duration:i,iterations:r}})}}const De=t=>t,bt=t=>1-Math.cos(t*Math.PI/2),St=t=>Math.sin(t*Math.PI/2),Tt=t=>-(Math.cos(Math.PI*t)-1)/2,It=t=>t**2,Ot=t=>1-(1-t)**2,At=t=>t<.5?2*t**2:1-(-2*t+2)**2/2,Ct=t=>t**3,kt=t=>1-(1-t)**3,$t=t=>t<.5?4*t**3:1-(-2*t+2)**3/2,_t=t=>t**4,qt=t=>1-(1-t)**4,Mt=t=>t<.5?8*t**4:1-(-2*t+2)**4/2,Pt=t=>t**5,xt=t=>1-(1-t)**5,Lt=t=>t<.5?16*t**5:1-(-2*t+2)**5/2,Rt=t=>t===0?0:2**(10*t-10),Ft=t=>t===1?1:1-2**(-10*t),Nt=t=>t===0?0:t===1?1:t<.5?2**(20*t-10)/2:(2-2**(-20*t+10))/2,zt=t=>1-Math.sqrt(1-t**2),Ht=t=>Math.sqrt(1-(t-1)**2),jt=t=>t<.5?(1-Math.sqrt(1-4*t**2))/2:(Math.sqrt(-(2*t-3)*(2*t-1))+1)/2,Dt=t=>2.70158*t**3-1.70158*t**2,Gt=t=>1+2.70158*(t-1)**3+1.70158*(t-1)**2,Wt=(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,Oe={linear:De,sineIn:bt,sineOut:St,sineInOut:Tt,quadIn:It,quadOut:Ot,quadInOut:At,cubicIn:Ct,cubicOut:kt,cubicInOut:$t,quartIn:_t,quartOut:qt,quartInOut:Mt,quintIn:Pt,quintOut:xt,quintInOut:Lt,expoIn:Rt,expoOut:Ft,expoInOut:Nt,circIn:zt,circOut:Ht,circInOut:jt,backIn:Dt,backOut:Gt,backInOut:Wt},Ae={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 Vt(t){return t==="percentage"?"%":t||"px"}function J(t){return t?Ae[t]||t:Ae.linear}function Yt(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 Bt(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 Yt(n,s,i,r)}function Kt(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 Te(t){if(!t)return;const e=Oe[t];return e||(Bt(t)??Kt(t)??Oe.linear)}class Qt 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:Te(n.offsetEasing)??De,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 Ut{_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 Xt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ee={exports:{}},Ce=ee.exports,ke;function Zt(){return ke||(ke=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 Ce<"u"?Ce:globalThis)})(ee)),ee.exports}var Jt=Zt();const O=Xt(Jt),me={};function en(t){Object.assign(me,t)}function tn(t){return t in me?me[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 nn(t,e){return t?.matches(`[data-motion-part~="${e}"]`)?t:t?.querySelector(`[data-motion-part~="${e}"]`)}function sn(t){const e=t.alternate?"alternate":"";return t.reversed?`${e?`${e}-`:""}reverse`:e||"normal"}function le(t){return`${t.value}${Vt(t.unit)}`}function $e(t,e,n){return`${t.name||"cover"} ${n&&t.offset.unit!=="percentage"?`calc(100% + ${le(t.offset)}${e?` + ${e}`:""})`:e?`calc(${le(t.offset)} + ${e})`:le(t.offset)}`}function Ge(t){return{start:$e(t.startOffset,t.startOffsetAdd),end:$e(t.endOffset,t.endOffsetAdd,!0)}}function We(t){return e=>O.measure(()=>e(t))}function Ve(t){return e=>O.mutate(()=>e(t))}function W(t){if(t.namedEffect){const e=t.namedEffect.type;return typeof e=="string"?tn(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 Ye(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:sn(i)};return Ie(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 Ie(t){return!t||t.trigger!=="pointer-move"&&t.trigger!=="view-progress"}function _e(t,e,n,s,i){if(t){if(Ie(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:We(n),mutate:Ve(n)}),t.web?t.web(e,r,i):t(e,r,i)}return[]}function Be(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=_e(g,e,r,n,s);return typeof p!="function"?null:p(r)}const o=W(e),c=_e(o,e,r,n,s);if(!c||c.length===0)return null;const a=Ye(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?nn(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 Ut(d.customEffect,h||null,g,y):new Animation(v,y.timeline);if(f)if(l)O.mutate(()=>{const{start:w,end:S}=Ge(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 rn(t,e){return t?`#${t}${e?`[data-motion-part~="${e}"]`:""}`:""}function on(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 cn(t,e,n){return t?.style?(Ie(n)&&(e.duration=e.duration||1),t.style(e)):[]}function an(t,e,n){const s=W(e),i=cn(s,e),r=Ye(i,n,e.effectId,!0),o=n?.trigger==="view-progress";return r.map((c,a)=>{const{start:l,end:f}=o?Ge(c.effect):{};return{target:rn(t,c.part),animation:on(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 fn(t,e,n){const s=W(e),i=t instanceof HTMLElement?t:N(t);if(s&&s.prepare&&i){const r={measure:We(i),mutate:Ve(i)};s.prepare(e,r)}n&&O.mutate(n)}function Ke(t,e){const n=W(e);if(!n)return null;if(!n.style)return e.effectId&&t?ln(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 ln(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 Qe(t,e,n,s={}){const{disabled:i,allowActiveEvent:r,...o}=s,c=Be(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=Te(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=Ke(t,e);return i?(i.ready=new Promise(r=>{fn(t,e,r)}),i):Be(t,e,n,{reducedMotion:s})}function un(t){return t===null?[null]:typeof t=="string"?Array.from(document.querySelectorAll(t)):Array.isArray(t)?t:[t]}function Ue(t,e){const n=[];for(const{target:s,options:i}of t){const r=un(s);for(const o of r){const c=Y(o,i,void 0,e?.reducedMotion);c instanceof V&&n.push(c)}}return n}function dn(t,e,n){const s=Ue(e,n);return new Qt(s,t)}function hn(t,e=2){return parseFloat(t.toFixed(e))}function mn(t){return/\[]/g.test(t)}function pn(t){return`--${t.join("-")}`}function gn(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function vn(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 k(){return"wi-12343210".replace(/\d/g,t=>String.fromCharCode((+t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+t/4)+97))}function Xe(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 yn({key:t,effectId:e,transition:n,transitionProperties:s,childSelector:i="> :first-child",selectorCondition:r}){const o=Xe({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 fe(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=fe(t,e,"media");return n&&window.matchMedia(n)}function q(t,e){return(t||[]).filter(n=>e[n]?.type==="selector"&&e[n].predicate).map(n=>`:is(${e[n].predicate})`).join("")}const K={rangeStart:{name:"cover",offset:{value:0,unit:"percentage"}},rangeEnd:{name:"cover",offset:{value:100,unit:"percentage"}}};function En(t,e){const n=t?.name??K.rangeStart.name,s=e?.name??t?.name??K.rangeEnd.name,i={name:n,offset:t?.offset||K.rangeStart.offset},r={name:s,offset:e?.offset||K.rangeEnd.offset};return{startOffset:i,endOffset:r}}function M(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}=En(e,n);return{id:"",startOffset:i,endOffset:r,...s}}function C(t,e,n){let s=t.get(e);s||(s=new Set,t.set(e,s)),s.add(n)}function B(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 wn={root:null,rootMargin:"0px 0px -10% 0px",threshold:[0]},bn={root:null,rootMargin:"0px",threshold:[0]},Sn=.2;function Tn(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={},P=new WeakMap,re=new WeakSet,z=new WeakMap;let Ze={},H=null;function In(t){Ze=t}function Je(t,e,n){P.get(t)?.forEach(({source:i,handler:r})=>{i===t&&r(e,n)})}function qe(){return H||(H=new IntersectionObserver(t=>{t.forEach(e=>{const n=e.target;e.isIntersecting||Je(n,!1,!0)})},bn),H)}function et(t,e=!1){const n=JSON.stringify({...t,isSafeMode:e});if(D[n])return D[n];const s=t.threshold??Sn,i=e?wn:{root:null,rootMargin:t.inset?Tn(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=et(t,!0);z.set(a,p),p.observe(a)})});return}(c.isIntersecting||!l)&&Je(a,c.isIntersecting)})},i);return D[n]=r,r}function On(t,e,n,s={},{reducedMotion:i,selectorCondition:r,animation:o}={}){const c={...Ze,...s},a=n.triggerType||"once",l=o||Y(e,M(n),void 0,i);if(!l)return;const f=et(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,P.get(t)?.delete(g),P.get(e)?.delete(g);const y=P.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")&&qe().unobserve(t),l.cancel(),re.delete(t),z.delete(t)}},C(P,t,g),C(P,e,g),z.set(t,f),f.observe(t),(a==="repeat"||a==="state")&&qe().observe(t)}function An(t){B(P,t)}function Cn(){H=null,Object.keys(D).forEach(t=>delete D[t])}const kn={add:On,remove:An,setOptions:In,reset:Cn};function tt(t,e){return Object.assign(Object.create(e),t)}function $n(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 _n(t){let e=!1;return function(){e||(e=!0,window.requestAnimationFrame(()=>{e=!1,t()}))}}function Me(t,e){let n=0;return function(){n&&window.clearTimeout(n),n=window.setTimeout(()=>{n=0,t()},e)}}function qn(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)?qn(t,e):parseInt(t)||0:0}function L(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 ue(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 Mn(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=L(u,n,e),f=L(d,n,e),g=f-l;const p=ue(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=L({...u,offset:0},n,e),h=L({...u,offset:100},n,e),v=ue(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=L({...d,offset:0},n,e),h=L({...d,offset:100},n,e),v=ue(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 Pn(t){return t.position==="sticky"}function xn(t,e,n){return t.position==="fixed"&&(!e||e===window.document.body||e===n)}function Ln(t,e){return parseInt(e?t.left:t.top)}function Rn(t,e){return parseInt(e?t.right:t.bottom)}function Fn(t,e,n){n&&(t.style.position="static");const s=(e?t.offsetLeft:t.offsetTop)||0;return n&&(t.style.position=null),s}function Nn(t,e){let n;const s=Ln(t,e),i=Rn(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=Pn(u),g=d?Nn(u,s):void 0,p=Fn(l,s,d);if((!g||!("end"in g))&&(a+=p),o.push({element:l,offset:p,sticky:g}),l=l.offsetParent,xn(u,l,e))break;if(l===e){o.push({element:l,offset:0});break}}return o.reverse(),t.map(u=>({...Mn(u,{start:a,end:a+c},n,s,i,o)}))}const Pe=100,zn={horizontal:!1,observeViewportEntry:!0,viewportRootMargin:"7% 7%",observeViewportResize:!1,observeSourcesResize:!1,observeContentResize:!1};function Hn(t,e,n,s){let i=0;return t>=e&&t<=n?i=s?(t-e)/s:1:t>n&&(i=1),i}function xe(t,e){return t===window?e?window.document.documentElement.clientWidth:window.document.documentElement.clientHeight:e?t.clientWidth:t.clientHeight}function jn(){return{viewportWidth:window.document.documentElement.clientWidth,viewportHeight:window.document.documentElement.clientHeight}}function Dn(t){const e=tt(t,zn),n=e.root,s=e.horizontal,i=new WeakMap;let r=xe(n,s),o,c,a,l,f;const u=[],d=jn();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(Me(()=>{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)})},Pe)).observe(e.contentRoot,{box:"border-box"})),e.observeViewportResize&&(l=Me(function(){r=xe(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)})},Pe),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=Hn(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 Gn={transitionActive:!1,transitionFriction:.9,transitionEpsilon:1,velocityActive:!1,velocityMax:1};class Wn{constructor(e={}){this.config=tt(e,Gn),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=_n(()=>{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=$n(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=Dn(this.config)}removeEffect(){this.effect&&this.effect.destroy(),this.effect=null}}const pe=new WeakMap;let nt=()=>({});function Vn(t){nt=t}function Yn(t,e,n,s,{reducedMotion:i}){if(i)return;const r={trigger:"view-progress",element:t},o=M(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=Qe(e,o,r);if(l){const f=Array.isArray(l)?l:[l],u=new Wn({viewSource:t,scenes:f,observeViewportEntry:!1,observeViewportResize:!1,observeSourcesResize:!0,root:document.body,...nt()});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};C(pe,t,a),C(pe,e,a)}function Bn(t){B(pe,t)}const Kn={add:Yn,remove:Bn,registerOptionsGetter:Vn};function Le(t,e,n){return Math.min(Math.max(t,n),e)}function Re(t){let e=!1;return function(){if(!e)return e=!0,window.requestAnimationFrame(()=>{e=!1,t()})}}function Qn(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 Un(){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 Xn(){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 Zn(t){Xn().then(e=>{t.fixRequired=e,e&&(window.addEventListener("scroll",t.scrollHandler),t.scrollHandler())})}let U=0;const ne=new Set;function Jn(){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 es(t,e){if("onscrollend"in window)return t.addEventListener("scrollend",e),function(){t.removeEventListener("scrollend",e)};let n=0,s;U||(s=Jn()),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 ts(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 ns(t,e){this.x=window.scrollX,this.y=window.scrollY,requestAnimationFrame(()=>t&&t(e))}function ss(t){t.rect.width=window.document.documentElement.clientWidth,t.rect.height=window.document.documentElement.clientHeight}function is(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 rs(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=ts(Qn(f.target),t.rect,a),e=!0),t.root?i=is(t):(r=ss.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=+Le(0,1,d).toPrecision(4),m=+Le(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=ns.bind(a,s,n),c=es(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 os=1e3/60*3;let X;function cs(){R.x=window.scrollX,R.y=window.scrollY}const R={x:0,y:0,scrollHandler:cs,fixRequired:void 0};class as{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():Re(()=>this.transition()):n=this.config.noThrottle?()=>(this.tick(),null):Re(()=>{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:Un();const i=X?window.devicePixelRatio:1;typeof R.fixRequired>"u"&&Zn(R),this._measure=r=>{if(r.target!==this.config.root){const o=new PointerEvent("pointermove",{bubbles:!0,cancelable:!0,clientX:r.x*i+R.x,clientY:r.y*i+R.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>os),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=rs(this.config)}removeEffect(){this.effect&&this.effect.destroy(),this.effect=null}}const ge=new WeakMap;let st=()=>({});function fs(t){st=t}function ls(t,e,n,s={},{reducedMotion:i}){if(i)return;const r={trigger:"pointer-move",element:t,axis:s.axis??"y"},o=Qe(e,M(n),r);if(o){const c=Array.isArray(o)?o:[o],a=new as({root:s.hitArea==="self"?t:void 0,scenes:c,...st()}),f={source:t,target:e,cleanup:()=>{a.destroy()}};C(ge,t,f),C(ge,e,f),Promise.all(c.map(u=>u.ready||Promise.resolve())).then(()=>{a.start()})}}function us(t){B(ge,t)}const ds={add:ls,remove:us,registerOptionsGetter:fs},ve=new WeakMap;function hs(t,e,n,s,{reducedMotion:i,selectorCondition:r,animation:o,sourceAnimationOptions:c}){const a=o||Y(e,M(n),void 0,i);if(!a)return;const{effectId:l}=s,f=g=>{if(r&&!e.matches(r))return;const p=g.animationName,m=g.detail?.effectId,h=c?Ke(t,c):null;if(h){if(h.playState==="running"||p&&!h.hasAnimationName(p))return;if(m&&m!==l&&!h.hasAnimationId(m))return}a.play()},d={source:t,target:e,cleanup:()=>{a.cancel(),t.removeEventListener("animationend",f)}};C(ve,t,d),C(ve,e,d),t.addEventListener("animationend",f)}function ms(t){B(ve,t)}const ps={add:hs,remove:ms};function gs(t,e,n=!1,s,i,r){const o=r||Y(t,M(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 vs(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 ye=new WeakMap;function Fe(t,e){return n=>{const s=n;t.contains(s.relatedTarget)||e(s)}}function ys(t){return e=>{const n=e;n.pointerType&&t(n)}}function Es(t){return e=>{const n=e;n.code==="Space"?(n.preventDefault(),t(n)):n.code==="Enter"&&t(n)}}const ws={focusin:(t,e)=>Fe(t,e),focusout:(t,e)=>Fe(t,e),click:(t,e)=>ys(e),keydown:(t,e)=>Es(e)};function bs(t,e,n){const s=ws[t];return s?s(e,n):i=>n(i)}function Ss(t){return typeof t=="object"&&!Array.isArray(t)&&("enter"in t||"leave"in t)}function Ts(t){if(typeof t=="string")return{toggle:[t]};if(Array.isArray(t))return{toggle:[...t]};if(Ss(t)){const e=t.enter?[...t.enter]:[],n=t.leave?[...t.leave]:[];return{enter:e,leave:n}}return{}}function Is(t){return!!(t.enter?.length||t.leave?.length)}function Os(t){return Is(t)?{enter:t.enter??[],leave:t.leave??[]}:void 0}function As(t,e,n,s,{reducedMotion:i,targetController:r,selectorCondition:o,animation:c}){const a=Ts(s.eventConfig),l=n.transition||n.transitionProperties,f=Os(a);let u,d=!1;if(l?u=vs(e,r,n,o,f):(u=gs(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=bs(E,t,g);y.addEventListener(E,S,{...w,signal:p.signal})}const v={source:t,target:e,cleanup:()=>{p.abort()}};if(C(ye,t,v),C(ye,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 Cs(t){B(ye,t)}const j={add:As,remove:Cs},Ee={click:["click"],activate:["click","keydown"],hover:{enter:["mouseenter"],leave:["mouseleave"]},interest:{enter:["mouseenter","focusin"],leave:["mouseleave","focusout"]}},Ne={click:Ee.activate,hover:Ee.interest};function Z(t){const e=Ee[t];return(n,s,i,r,o)=>{const c=o?.allowA11yTriggers&&t in Ne?Ne[t]:e;j.add(n,s,i,{eventConfig:c},o??{})}}const F={viewEnter:kn,hover:{add:Z("hover"),remove:j.remove},click:{add:Z("click"),remove:j.remove},animationEnd:ps,viewProgress:Kn,pointerMove:ds,activate:{add:Z("activate"),remove:j.remove},interest:{add:Z("interest"),remove:j.remove}};function ks(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=_s(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=ks(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&&F.viewProgress.registerOptionsGetter?.(e.scrollOptionsGetter),e.pointerOptionsGetter&&F.pointerMove.registerOptionsGetter?.(e.pointerOptionsGetter),e.viewEnter&&F.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=en;static getSequence(e,n,s,i){const r=b.sequenceCache.get(e);if(r)return r;const o=dn(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=Ue(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 $s=0;function x(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 ze(t){return"sequenceId"in t&&!("effects"in t)}function de(t,e){return t[e]||(t[e]={triggers:[],effects:{},sequences:{},interactionIds:new Set,selectors:new Set}),t[e]}function _s(t,e=!1){const{effects:n={},sequences:s={},conditions:i={}}=t,r={};return t.interactions?.forEach(o=>{const c=o.key,a=++$s,{effects:l,sequences:f,...u}=o;if(!c){console.error(`Interaction ${a} is missing a key for source element.`);return}de(r,c);const d=l?Array.from(l):[];d.reverse();const g=f?.map(h=>{if(ze(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=k()),v}),p={...u,effects:d.length>0?d:void 0,sequences:g};r[c].triggers.push(p),r[c].selectors.add(x(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=k()),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=de(r,v);w.effects[E]||(w.effects[E]=[],w.interactionIds.add(E)),w.effects[E].push({...u,effect:h}),w.selectors.add(x(h,{useFirstChild:e}))}),g?.forEach(h=>{if(!h||ze(h))return;const v=h,y=v.sequenceId||k(),E=v.effects;for(const w of E){w.effectId||(w.effectId=k());let S=w.key;if(!S&&w.effectId){const I=n[w.effectId];I&&(S=I.key)}S=S||c;const T=x(w,{useFirstChild:e});if(T&&r[c].selectors.add(T),S!==c){const I=de(r,S),A=`${S}::seq::${y}::${a}`;I.sequences[A]||(I.sequences[A]=[],I.interactionIds.add(A)),I.sequences[A].push({...u,sequence:v}),I.selectors.add(T)}}})}),{effects:n,sequences:s,conditions:i,interactions:r}}function ce(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 ae(t,e){return e.map(n=>t.selector?n.querySelector(t.selector):n).filter(Boolean)}function it(t,e,n,s,i,r,o,c){return[o?ae(t,o):ce(t,n,s),c?ae(e,c):ce(e,i,r)]}function rt(t,e,n,s,i,r,o,c){const a=Array.isArray(s),l=Array.isArray(i);a?s.forEach((f,u)=>{const d=l?i[u]:i;d&&He(t,f,e.trigger,d,n,e.params,r,o,c)}):(l?i:[i]).forEach(u=>{He(t,s,e.trigger,u,n,e.params,r,o,c)})}function ot(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]=it(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=q(l.conditions||[],n.dataCache.conditions);o.push([v,s,l,m,h,y,p.useFirstChild,t])}}),o.reverse().forEach(c=>{rt(...c)}),Ms(t,e,n,s,i)}function qs(t){return"sequenceId"in t&&!("effects"in t)}function ct(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=ae(p,o.elements),w.length>0&&(f=!0)):w=ce(p,y.element,y.useFirstChild),!w||Array.isArray(w)&&w.length===0)return null;const S=M(p);l.push({target:w,options:S})}return o&&!f?null:l.length>0?l:null}function we(t,e,n){const s=n?ae(t,n):ce(t,e.element,e.useFirstChild);return Array.isArray(s)&&s.length===0?null:s}function be(t,e,n,s,i){(Array.isArray(n)?n:[n]).forEach(o=>{F[t.trigger]?.add(o,o,{triggerType:e.triggerType},t.params||{},{reducedMotion:b.forceReducedMotion,selectorCondition:i,animation:s,allowA11yTriggers:b.allowA11yTriggers})})}function at(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 Ms(t,e,n,s,i){s.sequences?.forEach(r=>{let o;if(qs(r)){const p=n.dataCache.sequences[r.sequenceId];if(!p){console.warn(`Interact: Sequence "${r.sequenceId}" not found in cache`);return}o={...p,...r}}else o=r;const c=o.sequenceId||k(),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=ct(o,a,t,e,n,{updateKey:t,onUpdate:()=>e.update()},l);if(!f)return;if(i&&n.addedInteractions[a]){const p=at(e,s.listContainer,i);b.addToSequence(a,f,p,{reducedMotion:b.forceReducedMotion});const m=b.getSequence(a,o,f,{reducedMotion:b.forceReducedMotion}),h=q(s.conditions||[],n.dataCache.conditions),v=we(s,e,i);v&&be(s,o,v,m,h);return}const u=b.getSequence(a,o,f,{reducedMotion:b.forceReducedMotion}),d=q(s.conditions||[],n.dataCache.conditions),g=we(s,e,i);g&&(n.addedInteractions[a]=!0,be(s,o,g,u,d))})}function Ps(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||k(),m=$(`${d}::seq::${p}`,d);if(n.addedInteractions[m]&&!i)return!0;const v=ct(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 S=at(e,s,i);return b.addToSequence(m,v,S,{reducedMotion:b.forceReducedMotion}),!0}const y=b.getSequence(m,l,v,{reducedMotion:b.forceReducedMotion}),E=q(f.conditions||[],n.dataCache.conditions),w=we(f,g);return w&&(n.addedInteractions[m]=!0,be(f,l,w,y,E)),!0})})}function ft(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]=it(p,v,w.element,w.useFirstChild,e.element,e.useFirstChild,void 0,i);if(!S||!T)return!0;n.addedInteractions[u]=!0;const I=q(v.conditions||[],n.dataCache.conditions);return a.push([t,p,v,S,T,I,e.useFirstChild,E||void 0]),!0}return!1})}),a.reverse().forEach(f=>{rt(...f)}),Ps(t,e,n,s,i);const l=Object.keys(r?.sequences||{}).length>0;return c.length>0||l}function He(t,e,n,s,i,r,o,c,a){let l;if(i.transition||i.transitionProperties){const u={key:t,effectId:i.effectId,transition:i.transition,transitionProperties:i.transitionProperties,childSelector:x(i,{asCombinator:!0,addItemFilter:!0,useFirstChild:c}),selectorCondition:o};if(l=b.getController(t),!l)return;l.renderStyle(yn(u))}let f;if(n==="animationEnd"){const u=r.effectId,g=(a?b.getInstance(a):void 0)?.dataCache.effects[u];g&&(f=M(g))}F[n]?.add(e,s,i,r,{reducedMotion:b.forceReducedMotion,targetController:l,selectorCondition:o,allowA11yTriggers:b.allowA11yTriggers,sourceAnimationOptions:f})}function xs(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),ot(e,t,n,o))});let r=!1;return n&&(r=ft(e,t,n)),i||r}function Ls(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)&&ot(s,t,i,o,n)}),ft(s,t,i,e,n)}}function Rs(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],lt(r),s.deleteController(n,e)}function lt(t){const e=Object.values(F);for(const n of t)for(const s of e)s.remove(n);b.removeFromSequences(t)}const he="interactEffect";class ut{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=xs(this)}disconnect({removeFromCache:e=!1}={}){if((this.key||this.element.dataset.interactKey)&&Rs(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[he]?.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[he]=Array.from(r).join(" ")}getActiveEffects(){const n=(this.element.dataset[he]||"").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)})}),lt(i),s&&Ls(this,e,r)}}function Fs(t,e){new ut(t,e).connect()}function Ns(t){const e=b.getController(t);e&&e.disconnect({removeFromCache:!0})}const dt=new Map([["viewEnter","once"],["animationEnd","once"],["hover","alternate"],["click","alternate"],["activate","alternate"],["interest","alternate"]]);function ht(t,e,n){const{effects:s={},conditions:i={}}=n,{key:r,trigger:o}=e,c=o==="pointerMove";t.effectId||(t.effectId=k());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(mn(f))return null;u=[...new Set((u||[]).filter(w=>i[w]))],d||(d=dt.get(o));const{namedEffect:g,customEffect:p,keyframeEffect:m,transition:h,transitionProperties:v,...y}={...l,key:f,conditions:u,effectId:a,triggerType:d},E=wt(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:k()}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 zs(t,e,n){const{sequences:s={},conditions:i={}}=n;t.sequenceId||(t.sequenceId=k());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=dt.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],ht({...m,triggerType:l},e,n)));typeof d!="function"&&(d=Te(d)||(m=>m)),vn(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 Hs(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 js(t){if(!t.length)return[];const e=t.map(i=>({...i}));e[0].offset===void 0&&(e[0].offset=0),e.length===1?t[0].offset===void 0&&(e[0].offset=1):e[e.length-1].offset===void 0&&(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 Ds(t,e){const n=Object.entries(t).filter(([s,i])=>s!=="offset"&&i!==void 0&&i!==null).map(([s,i])=>`${Hs(s)}: ${i};`).join(`
|
|
9
|
-
`);return`${e}% {
|
|
10
|
-
${n}
|
|
11
|
-
}`}function Gs(t,e){const n=js(e);if(!n.length)return"";let s=n.map(i=>{const r=i.offset,o=hn(r*100);return Ds(i,o)}).join(`
|
|
12
|
-
`);return`@keyframes ${t} {
|
|
13
|
-
${s}
|
|
14
|
-
}`}function Ws(t){const{key:e,childSelector:n,declarations:s,media:i,states:r,selectorCondition:o,dataInteractEnterSelector:c}=t;if(!s.length)return"";let a=`[data-interact-key="${e}"]`;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}`),c&&(a=`${a}${c}`),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 mt(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=fe(n,s||{},"media"),a.selectorCondition=q(n,s||{})),a}const Vs=[{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"],Se=["transition",...se],Ys={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 pt(t,e,n){const s=t.get(e);s?n.forEach(i=>s.add(i)):t.set(e,new Set(n))}function gt(t,e,n,s){const{key:i,childSelector:r}=n,o=s?Se.filter(a=>s.has(a)):Se;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 vt(t,e){return Se.reduce((n,s)=>(n[s]=pn([s,...t,e]),n),{})}function Bs(t,e,n,s,i){return s.has(t)||s.set(t,{key:e,childSelector:i,...vt([n],je(t))}),s.get(t)}function Ks(t,e,n){return vt([e,n],je(t))}function Qs(t,e,n,s=!0){const{key:i,conditions:r}=t,o=fe(r,e,"media"),c=q(r,e),a=x(t,{asCombinator:!0,useFirstChild:s,addItemFilter:!0});return{key:i,media:o,selectorCondition:c,childSelector:a,declarations:[{name:"view-timeline",value:`--${n}`}]}}function Us(t,e,n,s,i){const{key:r,effectId:o,conditions:c,namedEffect:a,keyframeEffect:l,transition:f,transitionProperties:u,initial:d}=t,g=fe(c,e,"media"),p=q(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=M(t),w=an(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,A])=>A!==void 0).map(([I,A])=>({name:I,value:A}))));const S=se.map(T=>({name:n[T],value:w.map(I=>{const A=Ys[T];return I[A]}).join(", ")||ie[T]}));d?(m.push({key:r,media:g,selectorCondition:p,childSelector:i,declarations:Vs,dataInteractEnterSelector:":not([data-interact-enter])"}),m.push({key:r,media:g,selectorCondition:p,childSelector:i,declarations:S,dataInteractEnterSelector:':not([data-interact-enter="done"])'})):v.push(...S)}else if(f||u){y=["transition"];const E=f?.styleProperties||u||[],w=Xe(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 yt(t,e,n,s,i,r,o=!0,c,a){const{key:l}=n,f=a??G(n),u=x(n,{asCombinator:!0,useFirstChild:o,addItemFilter:!0}),g={...Bs(f,l,e,s,u)};c&&Object.assign(g,c);const{rules:p,keyframes:m,usedProperties:h}=Us(n,t,g,r,u);return m.forEach(({name:v,keyframes:y})=>i.set(v,y)),{rules:p,usedProperties:h}}function Xs(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=x(d,{asCombinator:!0,useFirstChild:o,addItemFilter:!0}),h=l.get(g)||0;l.set(g,h+1);const v=Ks(g,e,h),{rules:y,usedProperties:E}=yt(t,e,d,s,i,r,o,v,g);f.push(...y);const w=new Set(E);gt(a,g,{key:p,childSelector:m,...v},w),c&&pt(c,g,E)}const{conditions:u}=n;return a.forEach((d,g)=>{const p=s.get(g);f.push(mt(d,p,u,t))}),f}function Zs(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=>ht(h,e,t)).filter(h=>h!==null),d=[],{trigger:g}=e,p={trigger:gn(g),id:["trigger",n].join("-")};g==="viewProgress"&&d.push(Qs(e,a,p.id,r));for(const h of u){const v=G(h),{rules:y,usedProperties:E}=yt(a,n,h,l,i,p,r);d.push(...y),pt(f,v,E)}const m=c.map(h=>zs(h,e,t)).filter(h=>h!==null);return d.push(...m.flatMap(h=>Xs(a,n,h,l,i,p,r,f))),l.forEach((h,v)=>{gt(s,v,h,f.get(v))}),d}function Js(t,e=!0){const n=new Map,s=new Map,i=t.interactions.flatMap((r,o)=>Zs(t,r,o,n,s,e));return n.forEach(r=>{i.push(mt(r))}),{keyframes:s,cssRules:i}}function ei(t,e=!0){const{cssRules:n,keyframes:s}=Js(t,e);return[...[...s.entries()].map(([r,o])=>Gs(r,o)),...n.map(Ws)].join(`
|
|
20
|
-
`)}exports.I=ut;exports.a=b;exports.b=Fs;exports.g=ei;exports.r=Ns;
|
|
21
|
-
//# sourceMappingURL=index-DdqUOFMC.js.map
|