@wix/interact 2.8.3 → 2.8.5
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-D8zv4Q-3.js +29 -0
- package/dist/index-D8zv4Q-3.js.map +1 -0
- package/dist/{index-CXd-XY1L.mjs → index-DSREj0qw.mjs} +1631 -1432
- package/dist/index-DSREj0qw.mjs.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/core/Interact.d.ts +2 -2
- package/dist/types/core/Interact.d.ts.map +1 -1
- package/dist/types/core/InteractionController.d.ts +6 -1
- package/dist/types/core/InteractionController.d.ts.map +1 -1
- package/dist/types/core/add.d.ts.map +1 -1
- package/dist/types/handlers/animationEnd.d.ts +15 -0
- package/dist/types/handlers/animationEnd.d.ts.map +1 -1
- package/dist/types/handlers/viewEnter.d.ts +8 -0
- package/dist/types/handlers/viewEnter.d.ts.map +1 -1
- package/dist/types/react/Interaction.d.ts +1 -1
- package/dist/types/types/controller.d.ts +15 -2
- package/dist/types/types/controller.d.ts.map +1 -1
- package/dist/types/types/handlers.d.ts +18 -0
- package/dist/types/types/handlers.d.ts.map +1 -1
- package/dist/types/types/internal.d.ts +2 -0
- package/dist/types/types/internal.d.ts.map +1 -1
- package/dist/types/types/plugins.d.ts +12 -4
- package/dist/types/types/plugins.d.ts.map +1 -1
- package/docs/api/interact-class.md +1 -1
- package/docs/api/types.md +3 -1
- package/docs/guides/plugins.md +28 -3
- package/package.json +2 -2
- package/rules/full-lean.md +2 -1
- package/rules/plugins.md +5 -1
- package/dist/index-CXd-XY1L.mjs.map +0 -1
- package/dist/index-CeIuoLxG.js +0 -29
- package/dist/index-CeIuoLxG.js.map +0 -1
package/dist/index-CeIuoLxG.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";function mn(e){return[...e.matchAll(/\[([^\]]+)]/g)].map(([t,n])=>n)}function A(e,t){const n=mn(t);let s=0;return n.length?e.replace(/\[]/g,()=>{const i=n[s++];return i!==void 0?`[${i}]`:"[]"}):e}function pn(e,t){return e.trigger==="viewEnter"&&t.triggerType==="once"&&B(e)===B(t)}function B(e){const{key:t,listContainer:n,listItemSelector:s,selector:i}=e;return`${t}\0${n||""}\0${s||""}\0${i||""}`}const Ke="$";class ie{animations;options;ready;isCSS;longestAnimation;constructor(t,n){this.animations=t,this.options=n,this.ready=n?.measured||Promise.resolve(),this.isCSS=t[0]instanceof CSSAnimation,this.longestAnimation=this._getAnimationWithLongestEndTime()}_getAnimationWithLongestEndTime(){return this.animations.reduce((t,n)=>{const s=t.effect?.getComputedTiming().endTime??0,i=n.effect?.getComputedTiming().endTime??0;return s>i?t:n},this.animations[0])}getProgress(){return this.longestAnimation?.effect?.getComputedTiming().progress||0}async play(t){await this.ready;for(const n of this.animations)n.play();await Promise.all(this.animations.map(n=>n.ready)),t&&t()}pause(){for(const t of this.animations)t.pause()}async reverse(t){await this.ready;for(const n of this.animations)n.reverse();await Promise.all(this.animations.map(n=>n.ready)),t&&t()}progress(t){for(const n of this.animations){const{delay:s,duration:i,iterations:o}=n.effect.getTiming(),r=(Number.isFinite(i)?i:0)*(Number.isFinite(o)?o:1);n.currentTime=((s||0)+r)*t}}cancel(){for(const t of this.animations)t.cancel()}setPlaybackRate(t){for(const n of this.animations)n.playbackRate=t}async onFinish(t){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,o=new CustomEvent("animationend",{detail:{effectId:i}});s.dispatchEvent(o)}}t()}catch(n){console.warn("animation was interrupted - aborting onFinish callback - ",n)}}async onAbort(t){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 o=new Event("animationcancel");i.dispatchEvent(o)}}t()}}}get finished(){return Promise.all(this.animations.map(t=>t.finished))}get playState(){return this.animations.some(t=>t.playState==="running")?"running":this.animations[0]?.playState}hasAnimationName(t){return this.animations.some(n=>n.animationName===t)}hasAnimationId(t){return this.animations.some(n=>n.id===t)}getTimingOptions(){return this.animations.map(t=>{const n=t.effect?.getTiming(),s=n?.delay??0,i=Number(n?.duration)||0,o=n?.iterations??1;return{delay:s,duration:i,iterations:o}})}}const $t=e=>e,gn=e=>1-Math.cos(e*Math.PI/2),vn=e=>Math.sin(e*Math.PI/2),yn=e=>-(Math.cos(Math.PI*e)-1)/2,En=e=>e**2,wn=e=>1-(1-e)**2,$n=e=>e<.5?2*e**2:1-(-2*e+2)**2/2,Sn=e=>e**3,bn=e=>1-(1-e)**3,In=e=>e<.5?4*e**3:1-(-2*e+2)**3/2,Tn=e=>e**4,On=e=>1-(1-e)**4,Cn=e=>e<.5?8*e**4:1-(-2*e+2)**4/2,Mn=e=>e**5,_n=e=>1-(1-e)**5,Pn=e=>e<.5?16*e**5:1-(-2*e+2)**5/2,kn=e=>e===0?0:2**(10*e-10),An=e=>e===1?1:1-2**(-10*e),qn=e=>e===0?0:e===1?1:e<.5?2**(20*e-10)/2:(2-2**(-20*e+10))/2,Rn=e=>1-Math.sqrt(1-e**2),Ln=e=>Math.sqrt(1-(e-1)**2),Fn=e=>e<.5?(1-Math.sqrt(1-4*e**2))/2:(Math.sqrt(-(2*e-3)*(2*e-1))+1)/2,xn=e=>2.70158*e**3-1.70158*e**2,Nn=e=>1+2.70158*(e-1)**3+1.70158*(e-1)**2,Dn=(e,t=1.70158*1.525)=>e<.5?(2*e)**2*((t+1)*2*e-t)/2:((2*e-2)**2*((t+1)*(e*2-2)+t)+2)/2,Je={linear:$t,sineIn:gn,sineOut:vn,sineInOut:yn,quadIn:En,quadOut:wn,quadInOut:$n,cubicIn:Sn,cubicOut:bn,cubicInOut:In,quartIn:Tn,quartOut:On,quartInOut:Cn,quintIn:Mn,quintOut:_n,quintInOut:Pn,expoIn:kn,expoOut:An,expoInOut:qn,circIn:Rn,circOut:Ln,circInOut:Fn,backIn:xn,backOut:Nn,backInOut:Dn},U=(e,t,n,s,i)=>{const o=3*t,r=3*(s-2*t),a=1-3*s+3*t,l=3*n,u=3*(i-2*n),c=1-3*i+3*n;let f;if(a===0)f=r===0?`(${e} / ${o})`:`((sqrt(max(0, ${o*o} + ${4*r} * ${e})) - ${o}) / ${2*r})`;else{const d=r/(3*a),m=2*Math.pow(r,3)-9*o*r*a,p=54*Math.pow(a,3),h=(3*a*o-r*r)/(9*a*a),g=`((${m} - ${27*a*a} * ${e}) / ${p})`;if(h<0){const v=2*Math.sqrt(-h);let y=0;for(const E of[0,1,2])[0,.25,.5,.75,1].every(S=>{const T=Math.min(Math.max(2*(m-27*a*a*S)/(p*h*v),-1),1),I=v*Math.cos((Math.acos(T)-E*2*Math.PI)/3)-d;return I>=-1e-6&&I<=1.000001})&&(y=E);const $=`(acos(clamp(-1, ${2/(h*v)} * ${g}, 1)) - ${360*y}deg) / 3`;f=`(${v} * cos(${$}) - ${d})`}else{const v=`sqrt(pow(${g}, 2) + ${Math.pow(h,3)})`;f=`(pow(${v} - ${g}, 1 / 3) - pow(${v} + ${g}, 1 / 3) - ${d})`}}return`(${c} * pow(${f}, 3) + ${u} * pow(${f}, 2) + ${l} * ${f})`},et={linear:e=>e,ease:e=>U(e,.25,.1,.25,1),easeIn:e=>U(e,.42,0,1,1),easeOut:e=>U(e,0,0,.58,1),easeInOut:e=>U(e,.42,0,.58,1),sineIn:e=>`(1 - cos(${e} * 90deg))`,sineOut:e=>`(sin(${e} * 90deg))`,sineInOut:e=>`((1 - cos(${e} * 180deg)) / 2)`,quadIn:e=>`(${e} * ${e})`,quadOut:e=>`(1 - (1 - ${e}) * (1 - ${e}))`,quadInOut:e=>`(round(${e}) * (1 - (-2 * ${e} + 2) * (-2 * ${e} + 2) / 2) + (1 - round(${e})) * 2 * ${e} * ${e})`,cubicIn:e=>`pow(${e}, 3)`,cubicOut:e=>`(1 - pow(1 - ${e}, 3))`,cubicInOut:e=>`(round(${e}) * (1 - pow(-2 * ${e} + 2, 3) / 2) + (1 - round(${e})) * 4 * pow(${e}, 3))`,quartIn:e=>`pow(${e}, 4)`,quartOut:e=>`(1 - pow(1 - ${e}, 4))`,quartInOut:e=>`(round(${e}) * (1 - pow(-2 * ${e} + 2, 4) / 2) + (1 - round(${e})) * 8 * pow(${e}, 4))`,quintIn:e=>`pow(${e}, 5)`,quintOut:e=>`(1 - pow(1 - ${e}, 5))`,quintInOut:e=>`(round(${e}) * (1 - pow(-2 * ${e} + 2, 5) / 2) + (1 - round(${e})) * 16 * pow(${e}, 5))`,expoIn:e=>`(pow(2, 10 * ${e} - 10) - pow(2, -10) * (1 - ${e}))`,expoOut:e=>`(1 - pow(2, -10 * ${e}) + pow(2, -10) * ${e})`,expoInOut:e=>`((round(${e}) * (2 - pow(2, -20 * ${e} + 10)) + (1 - round(${e})) * pow(2, 20 * ${e} - 10)) / 2)`,circIn:e=>`(1 - sqrt(1 - ${e} * ${e}))`,circOut:e=>`sqrt(1 - (${e} - 1) * (${e} - 1))`,circInOut:e=>`((round(${e}) * (sqrt(max(0, (3 - 2 * ${e}) * (2 * ${e} - 1))) + 1) + (1 - round(${e})) * (1 - sqrt(max(0, 1 - 4 * ${e} * ${e})))) / 2)`,backIn:e=>`(2.70158 * pow(${e}, 3) - 1.70158 * ${e} * ${e})`,backOut:e=>`(1 + 2.70158 * pow(${e} - 1, 3) + 1.70158 * (${e} - 1) * (${e} - 1))`,backInOut:e=>`((round(${e}) * (2 + (2 * ${e} - 2) * (2 * ${e} - 2) * (2.5949095 + 3.5949095 * (2 * ${e} - 2))) + (1 - round(${e})) * 4 * ${e} * ${e} * (3.5949095 * 2 * ${e} - 2.5949095)) / 2)`},tt={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 jn(e){return e==="percentage"?"%":e||"px"}const zn=/^(webkit|moz|ms|o)(?=[A-Z])/,Hn=Object.assign(Object.create(null),{float:"cssFloat","animation-timing-function":"easing","animation-composition":"composite"});function ye(e){return e.startsWith("--")?e:(zn.test(e)?`-${e}`:e).replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`)}function Gn(e){return e.startsWith("--")||!e.includes("-")?e:e.replace(/^-/,"").replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function St(e){return Hn[e]||Gn(e)}function Wn(e){for(const t in e)if(Object.hasOwn(e,t)&&St(t)!==t)return!0;return!1}function bt(e){if(!Array.isArray(e))return e;let t;return e.forEach((n,s)=>{if(!n||typeof n!="object"||!Wn(n))return;t??=e.slice();const i={};for(const o in n)Object.hasOwn(n,o)&&(i[St(o)]=n[o]);t[s]=i}),t||e}function me(e){return e?tt[e]||e:tt.linear}function Vn(e,t,n,s){const i=3*e,o=3*(n-e)-i,r=1-i-o,a=3*t,l=3*(s-t)-a,u=1-a-l,c=p=>((r*p+o)*p+i)*p,f=p=>((u*p+l)*p+a)*p,d=p=>(3*r*p+2*o)*p+i;function m(p){let h=p;for(let y=0;y<8;y++){const $=c(h)-p;if(Math.abs($)<1e-7)return h;const E=d(h);if(Math.abs(E)<1e-6)break;h-=$/E}let g=0,v=1;for(h=(g+v)/2;v-g>1e-7;){const y=c(h);if(Math.abs(y-p)<1e-7)return h;p>y?g=h:v=h,h=(g+v)/2}return h}return p=>p<=0?0:p>=1?1:f(m(p))}function It(e){const t=e.match(/^cubic-bezier\(\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*\)$/);if(!t)return;const n=parseFloat(t[1]),s=parseFloat(t[2]),i=parseFloat(t[3]),o=parseFloat(t[4]);if(![n,s,i,o].some(isNaN))return[n,s,i,o]}function Bn(e){const t=It(e);if(!(!t||t.some(isNaN)))return Vn(...t)}function Yn(e){const t=It(e);if(!(!t||t.some(isNaN)))return n=>U(n,...t)}function Tt(e){const t=e.match(/^linear\((.+)\)$/);if(!t)return;const n=t[1].split(",").map(o=>o.trim()).filter(Boolean);if(n.length===0)return;const s=[];for(const o of n){const r=o.split(/\s+/),a=parseFloat(r[0]);if(isNaN(a))return;const l=[];for(let u=1;u<r.length;u++)if(r[u].endsWith("%")){const c=parseFloat(r[u])/100;if(isNaN(c))return;l.push(c)}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 r=i;for(;r<s.length&&s[r].pos===null;)r++;const a=s[o].pos,l=s[r].pos,u=r-o;for(let c=o+1;c<r;c++)s[c].pos=a+(l-a)*(c-o)/u;i=r+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);return s}function Un(e){const t=Tt(e);if(t)return n=>{if(n<=t[0].pos)return t[0].output;const s=t[t.length-1];if(n>=s.pos)return s.output;let i=0,o=t.length-1;for(;i<o-1;){const l=i+o>>>1;t[l].pos<=n?i=l:o=l}const r=t[i],a=t[o];return a.pos===r.pos?a.output:r.output+(a.output-r.output)*(n-r.pos)/(a.pos-r.pos)}}function Kn(e){const t=Tt(e);if(t)return n=>{const s=[`${t[0].output}`];for(let i=1;i<t.length;i++){const o=t[i].pos-t[i-1].pos,r=t[i].output-t[i-1].output;if(o===0&&t[i-1].pos===0)s.push(`${r}`);else{const a=o===0?`round(${n} / ${2*t[i-1].pos})`:`(${n} - ${t[i-1].pos}) / ${o}`;s.push(`clamp(0, ${a}, 1) * ${r}`)}}return`(${s.join(" + ")})`}}function Xe(e){if(!e)return;const t=Je[e];return t||(Bn(e)??Un(e)??Je.linear)}function Xn(e){if(!e)return;const t=et[e];return t||(Yn(e)??Kn(e)??et.linear)}class Qn extends ie{animationGroups;delay;offset;offsetEasing;sequenceId;timingOptions;constructor(t,n={}){const s=t.flatMap(i=>[...i.animations]);super(s),this.animationGroups=t,this.delay=n.delay??0,this.offset=n.offset??0,this.sequenceId=n.sequenceId,this.offsetEasing=typeof n.offsetEasing=="function"?n.offsetEasing:Xe(n.offsetEasing)??$t,this.timingOptions=this.animationGroups.map(i=>i.getTimingOptions().map(({delay:o,duration:r,iterations:a})=>({delay:o,duration:Number.isFinite(r)?r:0,iterations:Number.isFinite(a)?a:1}))),this.applyOffsets(),this.ready=Promise.all(t.map(i=>i.ready)).then(()=>{})}calculateOffsets(){const t=this.animationGroups.length;if(t<=1)return[0];const n=t-1;return Array.from({length:t},(s,i)=>this.offsetEasing(i/n)*n*this.offset|0)}applyOffsets(){if(this.animationGroups.length===0||this.animations.length===0)return;const t=this.calculateOffsets(),n=this.getSequenceActiveDuration(t),s=this.animationGroups.length-1;this.animationGroups.forEach((i,o)=>{i.animations.forEach((r,a)=>{const l=r.effect;if(!l)return;const{delay:u,duration:c,iterations:f}=this.timingOptions[o][a],d=u+t[o],m=n-(d+c*f);if(i.isCSS&&this.sequenceId){const{target:p}=l;p instanceof HTMLElement&&(p.style.setProperty(`--motion-${this.sequenceId}-index`,`${o}`),p.style.setProperty(`--motion-${this.sequenceId}-last`,`${s}`)),l.updateTiming({endDelay:m})}else l.updateTiming({delay:d+this.delay,endDelay:m})})})}getSequenceActiveDuration(t){const n=[];for(let s=0;s<this.timingOptions.length;s++){const i=this.timingOptions[s].reduce((o,r)=>{if(!r)return o;const{delay:a,duration:l,iterations:u}=r;return Math.max(o,a+l*u)},0);n.push(t[s]+i)}return Math.max(...n)}addGroups(t){if(t.length===0)return;const n=[...t].sort((s,i)=>i.index-s.index);for(const{index:s,group:i}of n){const o=Math.min(s,this.animationGroups.length);this.animationGroups.splice(o,0,i),this.timingOptions.splice(o,0,i.getTimingOptions());const r=[...i.animations],a=this.animationGroups.slice(0,o).reduce((l,u)=>l+u.animations.length,0);this.animations.splice(a,0,...r)}this.applyOffsets(),this.ready=Promise.all(this.animationGroups.map(s=>s.ready)).then(()=>{})}removeGroups(t){const n=[],s=[],i=[];for(let o=0;o<this.animationGroups.length;o++)t(this.animationGroups[o])?n.push(this.animationGroups[o]):(s.push(this.animationGroups[o]),i.push(this.timingOptions[o]));if(n.length===0)return n;for(const o of n)o.cancel();return this.animationGroups=s,this.timingOptions=i,this.animations=s.flatMap(o=>[...o.animations]),this.applyOffsets(),this.ready=Promise.all(this.animationGroups.map(o=>o.ready)).then(()=>{}),n}async onFinish(t){try{await Promise.all(this.animationGroups.map(n=>n.finished)),t()}catch(n){console.warn("animation was interrupted - aborting onFinish callback - ",n)}}}class Zn{_animation;customEffect;progress;_tickCbId;_finishHandler;constructor(t,n,s,i){const o=new KeyframeEffect(n,[],{...s,composite:"add"}),{timeline:r}=i;this._animation=new Animation(o,r),this._tickCbId=null,this.progress=null,this.customEffect=a=>t(o.target,a),this._finishHandler=a=>{this.effect.target?.getAnimations().find(l=>l===this._animation)||this.cancel()},this.addEventListener("finish",this._finishHandler),this.addEventListener("remove",this._finishHandler)}_tick(){try{const t=this.effect?.getComputedTiming().progress??null;t!==this.progress&&(this.customEffect?.(t),this.progress=t),this._tickCbId=requestAnimationFrame(()=>{this._tick()})}catch(t){this._tickCbId=null,console.error(`failed to run customEffect! effectId: ${this.id}, error: ${t instanceof Error?t.message:t}`)}}get currentTime(){return this._animation.currentTime}set currentTime(t){this._animation.currentTime=t}get startTime(){return this._animation.startTime}set startTime(t){this._animation.startTime=t}get playbackRate(){return this._animation.playbackRate}set playbackRate(t){this._animation.playbackRate=t}get id(){return this._animation.id}set id(t){this._animation.id=t}get effect(){return this._animation.effect}set effect(t){this._animation.effect=t}get timeline(){return this._animation.timeline}set timeline(t){this._animation.timeline=t}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(t){this._animation.oncancel=t}get onfinish(){return this._animation.onfinish}set onfinish(t){this._animation.onfinish=t}get onremove(){return this._animation.onremove}set onremove(t){this._animation.onremove=t}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(t){this._animation.updatePlaybackRate(t)}addEventListener(t,n,s){this._animation.addEventListener(t,n,s)}removeEventListener(t,n,s){this._animation.removeEventListener(t,n,s)}dispatchEvent(t){return this._animation.dispatchEvent(t)}}function Jn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var pe={exports:{}},nt=pe.exports,st;function es(){return st||(st=1,(function(e){(function(t){var n=function(){},s=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.msRequestAnimationFrame||function(c){return setTimeout(c,16)};function i(){var c=this;c.reads=[],c.writes=[],c.raf=s.bind(t)}i.prototype={constructor:i,runTasks:function(c){for(var f;f=c.shift();)f()},measure:function(c,f){var d=f?c.bind(f):c;return this.reads.push(d),o(this),d},mutate:function(c,f){var d=f?c.bind(f):c;return this.writes.push(d),o(this),d},clear:function(c){return a(this.reads,c)||a(this.writes,c)},extend:function(c){if(typeof c!="object")throw new Error("expected object");var f=Object.create(this);return l(f,c),f.fastdom=this,f.initialize&&f.initialize(),f},catch:null};function o(c){c.scheduled||(c.scheduled=!0,c.raf(r.bind(null,c)))}function r(c){var f=c.writes,d=c.reads,m;try{n("flushing reads",d.length),c.runTasks(d),n("flushing writes",f.length),c.runTasks(f)}catch(p){m=p}if(c.scheduled=!1,(d.length||f.length)&&o(c),m)if(n("task errored",m.message),c.catch)c.catch(m);else throw m}function a(c,f){var d=c.indexOf(f);return!!~d&&!!c.splice(d,1)}function l(c,f){for(var d in f)f.hasOwnProperty(d)&&(c[d]=f[d])}var u=t.fastdom=t.fastdom||new i;e.exports=u})(typeof window<"u"?window:typeof nt<"u"?nt:globalThis)})(pe)),pe.exports}var ts=es();const _=Jn(ts),Fe={};function ns(e){Object.assign(Fe,e)}function Qe(e,t=!0){return e in Fe?Fe[e]:(t&&console.warn(`${e} not found in registry. Please make sure to import and register the preset.`),null)}function Y(e,t){return e?(t||document).getElementById(e):null}function Ot(e,t){return e?.matches(`[data-motion-part~="${t}"]`)?e:e?.querySelector(`[data-motion-part~="${t}"]`)}function Ct(e,t){const n=typeof e=="string"?Y(e):e;return t?.length?t.map(s=>Ot(n,s)).filter(Boolean):n?[n]:[]}function ss(e){const t=e.alternate?"alternate":"";return e.reversed?`${t?`${t}-`:""}reverse`:t||"normal"}function Ae(e){return`${e.value}${jn(e.unit)}`}function it(e,t,n){return`${e.name||"cover"} ${n&&e.offset.unit!=="percentage"?`calc(100% + ${Ae(e.offset)}${t?` + ${t}`:""})`:t?`calc(${Ae(e.offset)} + ${t})`:Ae(e.offset)}`}function Mt(e){return{start:it(e.startOffset,e.startOffsetAdd),end:it(e.endOffset,e.endOffsetAdd,!0)}}function _t(e){return t=>_.measure(()=>t(e))}function Pt(e){return t=>_.mutate(()=>t(e))}function te(e){if(e.namedEffect){const t=e.namedEffect.type;return typeof t=="string"?Qe(t):null}else if(e.keyframeEffect){const t=s=>{const{name:i,keyframes:o}=s.keyframeEffect;return[{...s,name:i,keyframes:o}]};return{web:t,style:t,getNames:s=>{const{effectId:i}=s,{name:o}=s.keyframeEffect,r=o||i;return r?[r]:[]}}}else if(e.customEffect)return t=>[{...t,keyframes:[]}];return null}function kt(e,t,n,s){return e.map((i,o)=>{const r={fill:i.fill,easing:me(i.easing),iterations:i.iterations===0?1/0:i.iterations||1,composite:i.composite,direction:ss(i)};return Ze(t)?(r.duration=i.duration,r.delay=i.delay||0):t?.trigger==="view-progress"&&(s||window.ViewTimeline)?r.duration="auto":(r.duration=99.99,r.delay=.01),{effect:i,options:r,id:n&&`${n}-${o+1}`,part:i.part}})}function Ze(e){return!e||e.trigger!=="pointer-move"&&e.trigger!=="view-progress"}function ot(e,t,n,s,i){if(e){if(Ze(s)&&(t.duration=t.duration||1,i?.reducedMotion))if(t.iterations===1||t.iterations==null)t={...t,duration:1};else return[];let o;return n instanceof HTMLElement&&(o={measure:_t(n),mutate:Pt(n)}),e.web?e.web(t,o,i):e(t,o,i)}return[]}function At(e,t,n,s,i){const o=typeof e=="string"?Y(e,i):e;if(n?.trigger==="pointer-move"&&!t.keyframeEffect){let d=t;t.customEffect&&(d={...t,namedEffect:{id:"",type:"CustomMouse"}});const m=te(d),p=ot(m,t,o,n,s);return typeof p!="function"?null:p(o)}const r=te(t),a=ot(r,t,o,n,s);if(!a||a.length===0)return null;const l=kt(a,n,t.effectId);let u;const c=n?.trigger==="view-progress";c&&window.ViewTimeline&&(u=new ViewTimeline({subject:n.element||Y(n.componentId)}));const f=l.map(({effect:d,options:m,id:p,part:h})=>{const g=h?Ot(o,h):o,v=new KeyframeEffect(g||null,[],m);_.mutate(()=>{"timing"in d&&v.updateTiming(d.timing),v.setKeyframes(bt(d.keyframes))});const y=c&&u?{timeline:u}:{},$=typeof d.customEffect=="function"?new Zn(d.customEffect,g||null,m,y):new Animation(v,y.timeline);if(c)if(u)_.mutate(()=>{if(g){const{start:E,end:b}=Mt(d);$.rangeStart=E,$.rangeEnd=b}$.play()});else{const{startOffset:E,endOffset:b}=t;_.mutate(()=>{const S=d.startOffset||E,T=d.endOffset||b;Object.assign($,{start:{name:S.name,offset:S.offset?.value,add:d.startOffsetAdd},end:{name:T.name,offset:T.offset?.value,add:d.endOffsetAdd}})})}return p&&($.id=p),$});return f.length>1&&f.forEach(d=>d.persist?.()),new ie(f,{...t,trigger:{...n||{}},measured:new Promise(d=>_.mutate(d))})}function is(e,t,n){const{duration:s,delay:i,iterations:o=1,fill:r,easing:a="linear",direction:l}=e.options,u=e.effect.name,c=s==="auto",{sequenceId:f,delay:d,offset:m,offsetEasing:p="linear"}=n||{};let h=`${i??0}ms`;if(f&&typeof p=="string"){const g=Xn(p);if(g){const v=(i??0)+(d??0);if(m){const y=g(`(var(--motion-${f}-index, 0) / var(--motion-${f}-last, 1))`);h=`calc(${`(${v} + ${y} * ${m} * var(--motion-${f}-last, 1))`} * 1ms)`}else h=`${v}ms`}}return`${u} ${c?"auto":`${s}ms`}${c?" ":` ${h} `}${a}${r&&r!=="none"?` ${r}`:""} ${!o||o===1/0?"infinite":o}${l==="normal"?"":` ${l}`} ${t?"":"paused"}`}function os(e,t,n){return e?.style?(Ze(n)&&(t.duration=t.duration||1),e.style(t)):[]}function rs(e,t,n,s){const i=te(t),o=os(i,t),r=kt(o,n,t.effectId,!0),a=n?.trigger==="view-progress";return r.map((l,u)=>{const{start:c,end:f}=a?Mt(l.effect):{};return{part:l.part,animation:is(l,a,s),composition:l.options.composite,custom:l.effect.custom,name:l.effect.name,keyframes:bt(l.effect.keyframes),id:l.id&&`${l.id}-${u+1}`,animationTimeline:a?`--${n?.id}`:"",animationRange:c||f?`${c} ${f}`:""}})}function as(e,t,n){const s=te(t),i=e instanceof HTMLElement?e:Y(e);if(s&&s.prepare&&i){const o={measure:_t(i),mutate:Pt(i)};s.prepare(t,o)}n&&_.mutate(n)}function qt(e,t){const n=te(t);if(!n)return null;if(!n.style)return t.effectId&&e?cs(e,t.effectId,n.parts):null;const s=n.getNames(t),o=Ct(e,n.parts)?.flatMap(l=>l.getAnimations()),r=o?.map(l=>l.animationName)||[],a=[];return s.forEach(l=>{r.includes(l)&&a.push(o?.find(u=>u.animationName===l))}),a?.length?new ie(a):null}function cs(e,t,n){const i=Ct(e,n)?.flatMap(o=>o.getAnimations()).filter(o=>{const r=o.id||o.animationName;return r?r.startsWith(t):!0});return i?.length?new ie(i):null}function Rt(e,t,n,s={}){const{disabled:i,allowActiveEvent:o,...r}=s,a=At(e,t,n,r);if(!a)return null;let l={};if(n.trigger==="view-progress"&&!window.ViewTimeline){const u=n.element||Y(n.componentId),{ready:c}=a;return a.animations.map(f=>({get start(){return f.start},get end(){return f.end},viewSource:u,ready:c,getProgress(){return a.getProgress()},effect(d,m){const{activeDuration:p}=f.effect.getComputedTiming(),{delay:h}=f.effect.getTiming();f.currentTime=((h||0)+(p||0))*m},disabled:i,destroy(){f.cancel()}}))}else if(n.trigger==="pointer-move"){const u=t,{centeredToTarget:c,transitionDuration:f,transitionEasing:d}=u,m=n.axis;if(u.keyframeEffect){const p=a;return p.animations?.length===0?null:{target:(typeof e=="string"?Y(e):e)??void 0,centeredToTarget:c,ready:p.ready,_currentProgress:0,getProgress(){return this._currentProgress},effect(g,v){const y=m==="x"?v.x:v.y;this._currentProgress=y,p.progress(y)},disabled:i??!1,destroy(){p.cancel()}}}l={centeredToTarget:c,allowActiveEvent:o},t.customEffect&&f&&(l.transitionDuration=f,l.transitionEasing=Xe(d)),l.target=a.target}return{...l,getProgress(){return a.getProgress()},effect(u,c,f,d){a.progress(f?{...c,v:f,active:d}:c)},disabled:i,destroy(){a.cancel()}}}function oe(e,t,n,s=!1){const i=qt(e,t);return i?(i.ready=new Promise(o=>{as(e,t,o)}),i):At(e,t,n,{reducedMotion:s})}function ls(e){return e===null?[null]:typeof e=="string"?Array.from(document.querySelectorAll(e)):Array.isArray(e)?e:[e]}function Lt(e,t){const n=[];for(const{target:s,options:i}of e){const o=ls(s);for(const r of o){const a=oe(r,i,void 0,t?.reducedMotion);a instanceof ie&&n.push(a)}}return n}function us(e,t,n){const s=Lt(t,n);return new Qn(s,e)}function fs(e,t=2){return parseFloat(e.toFixed(t))}function ds(e){return/\[]/g.test(e)}function hs(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function ge(e,t){return t.includes("&")?t.replace(/&/g,e):`${e}${t}`}function ne(){return"wi-12343210".replace(/\d/g,e=>String.fromCharCode((+e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+e/4)+97))}function Ft(e){return!!(e.transition||e.transitionProperties)}function xt(e){const{transition:t,transitionProperties:n}=e;return(t?.styleProperties||n||[]).map(i=>({...i,name:ye(i.name)}))}function Nt(e){let{transition:t,transitionProperties:n}=e,s=[];if(t?.styleProperties){const{duration:i,easing:o,delay:r}=t;(i||r)&&(t.styleProperties.some(l=>l.name.startsWith("--"))?s=[`all ${i||0}ms ${me(o||"ease")}${r?` ${r}ms`:""}`,"visibility 0s"]:s=t.styleProperties.map(l=>`${ye(l.name)} ${i||0}ms ${me(o||"ease")}${r?` ${r}ms`:""}`))}else s=n?.filter(i=>i.duration||i.delay).map(i=>`${ye(i.name)} ${i.duration||0}ms ${me(i.easing)||"ease"}${i.delay?` ${i.delay}ms`:""}`)||[];return s}function ms({key:e,effectId:t,transition:n,transitionProperties:s,childSelector:i="> :first-child",selectorCondition:o}){const r=Nt({transition:n,transitionProperties:s}),a=xt({transition:n,transitionProperties:s}).map(p=>`${p.name}: ${p.value};`),l=e.replace(/"/g,"'"),u=`:is(:state(${t}), :--${t}) ${i}`,c=`[data-interact-effect~="${t}"] ${i}`,f=o?ge(u,o):u,d=o?ge(c,o):c,m=[`${f},
|
|
2
|
-
${d} {
|
|
3
|
-
${a.join(`
|
|
4
|
-
`)}
|
|
5
|
-
}`];if(r.length){const p=`[data-interact-key="${l}"] ${i}`,h=o?ge(p,o):p;m.push(`${h} {
|
|
6
|
-
transition: ${r.join(", ")};
|
|
7
|
-
}`)}return m}function re(e,t,n){const s=(e||[]).filter(i=>t[i]?.type===n&&t[i].predicate).map(i=>t[i].predicate).join(") and (");return s&&`(${s})`}function F(e,t){const n=re(e,t,"media");return n&&window.matchMedia(n)}function x(e,t){return(e||[]).filter(n=>t[n]?.type==="selector"&&t[n].predicate).map(n=>`:is(${t[n].predicate})`).join("")}const Ie="__rm-reduce",Dt="__rm-no-preference",ps={[Ie]:{type:"media",predicate:"prefers-reduced-motion: reduce"},[Dt]:{type:"media",predicate:"prefers-reduced-motion: no-preference"}},gs=new Set(["namedEffect","keyframeEffect","customEffect","transition","transitionProperties","duration","delay","easing","iterations","alternate","fill","reversed","composite","rangeStart","rangeEnd","centeredToTarget","transitionDuration","transitionEasing"]);function jt(e={}){return{...e,...ps}}function Te(...e){return e.find(Boolean)??"collapse"}function xe(e){return Ft(e)?"state":"duration"in e?"time":"scrub"}function rt(e){const t=xe(e);if(t==="state"){const{transition:s,transitionProperties:i}=e;return{...e,...s&&{transition:{...s,duration:0}},...i&&{transitionProperties:i.map(o=>({...o,duration:0}))}}}const{iterations:n=1}=e;return t==="scrub"||!n||n===1/0?null:{...e,duration:0}}function vs(e,t,n){const s=([o])=>gs.has(o),{keyframeEffect:i}=n;return{...Object.fromEntries(Object.entries(e).filter(o=>!s(o))),...Object.fromEntries(Object.entries(n).filter(s)),...i&&{keyframeEffect:{...i,name:i.name||t}}}}function ys(e,t,n){switch(t){case"ignore":return e;case"cancel":return null;case"collapse":return rt(e);default:{const s=n[t];return s&&xe(s)===xe(e)?vs(e,t,s):rt(e)}}}function at(e,t){return{...e,conditions:[...e.conditions||[],t]}}function Es(e){return!!e.conditions?.includes(Ie)}function zt(e,t,{effects:n,force:s,collapsesStagger:i}){const o=ys(e,t,n);if(s)return o?[o]:[];if(o===e&&!i)return[e];const r=at(e,Dt);return o?[r,at(o,Ie)]:[r]}const Ht=new Map([["viewEnter","once"],["animationEnd","once"],["hover","alternate"],["click","alternate"],["activate","alternate"],["interest","alternate"]]);function ws({namedEffect:e,keyframeEffect:t,customEffect:n},s){return e?!s&&!!e.type:!!t||!(n&&s)}function ct(e,t){const{namedEffect:n,customEffect:s,keyframeEffect:i,transition:o,transitionProperties:r,...a}=e;return n?t||!n.type?a:{namedEffect:n,...a}:i?{keyframeEffect:i,...a}:s?a:o?{transition:o,...a}:r?{transitionProperties:r,...a}:a}function Gt(e,t,n,s,i={}){const{effects:o={},conditions:r={}}=n,{key:a,trigger:l,conditions:u=[]}=t,c=l==="pointerMove";e.effectId||(e.effectId=s||ne());const{effectId:f}=e,d={...o[f]||{},...e};let{key:m,conditions:p,triggerType:h}=d;if(!m){if(!a)return null;m=a}if(ds(m))return null;const g=u.filter(S=>r[S].type==="media");p=[...new Set([...p||[],...g].filter(S=>r[S]))],h||(h=Ht.get(l));const{namedEffect:v,keyframeEffect:y}=d;if(!v&&y&&!y.name){const S=f&&!(o[f]&&"keyframeEffect"in e);y.name=S?f:ne()}if(!ws(d,c))return null;const $={...d,key:m,conditions:p,effectId:f,triggerType:h},E={...$,initial:pn(t,$)},b=zt(E,Te(d.reducedMotionPolicy,i.policy,t.reducedMotionPolicy,i.defaultPolicy),{effects:o,force:i.force,collapsesStagger:i.collapsesStagger}).map(S=>ct(S,c));return b.length?{...ct(E,c),variants:b}:null}function $s(e,t,n,s,i,o={}){const{sequences:r={},conditions:a={}}=n,{trigger:l,conditions:u=[]}=t;e.sequenceId||(e.sequenceId=s||ne());const{sequenceId:c}=e,f={...r[c]||{},...e},d=Te(f.reducedMotionPolicy,t.reducedMotionPolicy,o.defaultPolicy);let{effects:m,conditions:p,triggerType:h,delay:g=0,offset:v=0,offsetEasing:y="linear"}=f;if(typeof y=="function"||!m)return null;h||(h=Ht.get(l));const $=u.filter(S=>a[S].type==="media");p=[...new Set([...p||[],...$].filter(S=>a[S]))];const b=m.map((S,T)=>{const I=Gt({...S,triggerType:h,conditions:[...S.conditions||[],...p]},t,n,`${c}-eff-${T}`,{...o,policy:d,collapsesStagger:d!=="ignore"});return I&&Object.assign(I,{slotKey:i?.(T)})}).filter(S=>S!==null);return b.length?{sequenceId:c,triggerType:h,conditions:p,delay:g,offset:v,offsetEasing:y,reducedMotionPolicy:d,effects:b}:null}function Ss(e){return e==="cssFloat"?"float":e==="easing"?"animation-timing-function":e==="cssOffset"?"offset":e==="composite"?"animation-composition":ye(e)}function bs(e){if(!e.length)return[];const t=e.map(i=>({...i}));t[0].offset===void 0&&(t[0].offset=0),t.length===1?e[0].offset===void 0&&(t[0].offset=1):t[t.length-1].offset===void 0&&(t[t.length-1].offset=1);let n=0,s=t[0].offset;for(let i=1;i<t.length;i++)if(t[i].offset!==void 0){const o=t[i].offset;if(o<s)return console.error("Offsets must be monotonically non-decreasing"),[];if(o>1)return console.error("Offsets must be in the range [0,1]"),[];const r=i-n;for(let a=n+1;a<i;a++){const l=(a-n)/r;t[a].offset=s+(o-s)*l}n=i,s=o}return t}function Is(e,t){const n=Object.entries(e).filter(([s,i])=>s!=="offset"&&i!==void 0&&i!==null).map(([s,i])=>`${Ss(s)}: ${i};`).join(`
|
|
8
|
-
`);return`${t}% {
|
|
9
|
-
${n}
|
|
10
|
-
}`}function Ts(e,t){const n=bs(t);if(!n.length)return"";let s=n.map(i=>{const o=i.offset,r=fs(o*100);return Is(i,r)}).join(`
|
|
11
|
-
`);return`@keyframes ${e} {
|
|
12
|
-
${s}
|
|
13
|
-
}`}function Os(e){const{key:t,childSelector:n,declarations:s,media:i,states:o,selectorCondition:r,selectorSuffix:a}=e;if(!s.length)return"";let l=`[data-interact-key="${t}"]`;if(o&&o.length){const f=o.map(d=>`:state(${d}), :--${d}, [data-interact-effect~="${d}"]`).join(", ");l=`${l}:is(${f})`}n&&(l=`${l} ${n}`),a&&(l=`${l}${a}`),r&&(l=ge(l,r));const u=s.map(({name:f,value:d,important:m})=>`${f}: ${d}${m?" !important":""};`).join(`
|
|
14
|
-
`),c=`${l} {
|
|
15
|
-
${u}
|
|
16
|
-
}`;return i?`@media ${i} {
|
|
17
|
-
${c}
|
|
18
|
-
}`:c}const Ne=["animation","animation-composition","animation-timeline","animation-range"],Oe=[...Ne,"transition","view-timeline"],Ce=["animation","transition","timeline"];function L(e){return e==="transition"?"transition":e==="view-timeline"?"timeline":"animation"}const K={transition:"_",animation:"none","animation-composition":"replace","animation-timeline":"auto","animation-range":"normal","view-timeline":"none"};function Wt(e){return e.replace(new RegExp("(?<!(^|-))([aeiou]|tion)","g"),"")}function j(e,t,n=!1,s){const i=s===void 0?"":`-c${s}`;return`--${Wt(e)}${i}${n?"-slot":""}-${t}`}function se(e,t){return`--${Wt(e)}-c${t}`}function Cs(e,t){return Array.from({length:t+1},(n,s)=>`var(${se(e,s)})`).join(", ")}function Ms(e,t,n,s,i=0,o){const r={animation:e,transition:t,timeline:i},a={animation:n,transition:s,timeline:0},l=(u,c)=>`@property ${c} { syntax: "*"; inherits: false; initial-value: ${K[u]}; }`;return Oe.flatMap(u=>[...Array.from({length:r[L(u)]},(c,f)=>l(u,j(u,f,!1,o))),...Array.from({length:a[L(u)]},(c,f)=>l(u,j(u,f,!0,o))),...Array.from({length:o!==void 0&&r[L(u)]?o+1:0},(c,f)=>l(u,se(u,f)))])}function _s(e,t,n,s){const i=Oe.filter(a=>e[L(a)].slotsInSequence>0);if(i.length===0)return null;const o=i.map(a=>{const{listIndex:l,slotCursor:u,slotsInSequence:c}=e[L(a)];return{name:j(a,l,!1,s),value:Array.from({length:c},(f,d)=>`var(${j(a,u+d,!0,s)})`).join(", ")}}),r={key:e.key,childSelector:e.childSelector,declarations:o};return t&&(r.media=re(t,n||{},"media"),r.selectorCondition=x(t,n||{})),r}function Ps(e,t,n,s=0,i){if(e.length===0)return"";const o={animation:t,transition:n,timeline:s},r=Oe.filter(u=>o[L(u)]>0);if(r.length===0)return"";const a=r.flatMap(u=>{const c=Array.from({length:o[L(u)]},(f,d)=>`var(${j(u,d,!1,i)})`).join(", ");return i===void 0?[{name:u,value:c}]:[{name:se(u,i),value:c},{name:u,value:Cs(u,i)}]});return`${e.map(({key:u,childSelector:c})=>`[data-interact-key="${u}"]${c?` ${c}`:""}`).join(", ")} {
|
|
19
|
-
${a.map(({name:u,value:c})=>` ${u}: ${c};`).join(`
|
|
20
|
-
`)}
|
|
21
|
-
}`}function ks(e,t){if(e.length===0)return"";if(t===void 0)return`:root {
|
|
22
|
-
timeline-scope: ${e.join(", ")};
|
|
23
|
-
}`;const n=Array.from({length:t+1},(s,i)=>`var(${se("timeline-scope",i)}, --_)`).join(", ");return`:root {
|
|
24
|
-
${se("timeline-scope",t)}: ${e.join(", ")};
|
|
25
|
-
timeline-scope: ${n};
|
|
26
|
-
}`}const le={rangeStart:{name:"cover",offset:{value:0,unit:"percentage"}},rangeEnd:{name:"cover",offset:{value:100,unit:"percentage"}}};function As(e,t){const n=e?.name??le.rangeStart.name,s=t?.name??e?.name??le.rangeEnd.name,i={name:n,offset:e?.offset||le.rangeStart.offset},o={name:s,offset:t?.offset||le.rangeEnd.offset};return{startOffset:i,endOffset:o}}function N(e){if("keyframeEffect"in e&&!e.keyframeEffect.name&&"effectId"in e&&(e.keyframeEffect.name=e.effectId),"duration"in e)return{id:"",...e};const{rangeStart:t,rangeEnd:n,...s}=e,{startOffset:i,endOffset:o}=As(t,n);return{id:"",startOffset:i,endOffset:o,...s}}function q(e,t,n){let s=e.get(t);s||(s=new Set,e.set(t,s)),s.add(n)}function ae(e,t){e.get(t)?.forEach(s=>{const{source:i,target:o,cleanup:r}=s;r();const a=i===t?o:i;e.get(a)?.delete(s)}),e.delete(t)}const lt=[{name:"visibility",value:"hidden"},{name:"clip-path",value:"none",important:!0},{name:"transform",value:"none",important:!0},{name:"translate",value:"none",important:!0},{name:"scale",value:"none",important:!0},{name:"rotate",value:"none",important:!0}],De={animation:!1,transition:!1,timeline:!1};function Vt(e,t){const n=()=>({listIndex:0,slotCursor:0,slotsInInteraction:0,slotsInSequence:0,touched:!1});return{key:e,childSelector:t,partSelectors:new Set,assigned:new Set,animation:n(),transition:n(),timeline:n(),keyframeEntries:new Map}}function Bt(e,t,n){return Object.fromEntries(Oe.map(s=>{const i=L(s),{listIndex:o,slotCursor:r,slotsInSequence:a}=e[i];return[s,t[i]?j(s,r+a,!0,n):j(s,o,!1,n)]}))}function je(e,t,n){Ce.forEach(s=>{t[s]&&(e[s].touched=!0,n[s]&&(e[s].slotsInSequence+=1))})}function qs(e){const{namedEffect:t,keyframeEffect:n,transition:s,transitionProperties:i}=e;return t||n?"animation":s||i?"transition":null}function Yt(e){return(e.variants||[e]).map(qs).find(Boolean)||null}function Rs(e){const t=new Map;return e.effects.forEach(n=>{const s=Yt(n);if(!s)return;const i=B(n),o=t.get(i)||{animation:0,transition:0,timeline:0};o[s]+=1,t.set(i,o)}),new Map([...t].map(([n,{animation:s,transition:i}])=>[n,{animation:s>1,transition:i>1,timeline:!1}]))}function Ls(e){Ce.forEach(t=>{const n=e[t];n.slotsInInteraction=Math.max(n.slotsInInteraction,n.slotsInSequence),n.slotsInSequence=0})}function Fs(e){Ce.forEach(t=>{const n=e[t];n.listIndex+=n.touched?1:0,n.slotCursor+=n.slotsInInteraction,n.slotsInInteraction=0,n.touched=!1})}const xs={animation:"animation","animation-composition":"composition","animation-timeline":"animationTimeline","animation-range":"animationRange"};function Ns(e,t,n,s){const{key:i,conditions:o}=t,r=re(o,e.configConditions,"media"),a=x(o,e.configConditions),l=V(t,{asCombinator:!0,useFirstChild:e.useFirstChild,addItemFilter:!0}),u=B(t),c=e.targetsMap.get(u)||Vt(i,l),f=Bt(c,De,e.configIndex)["view-timeline"];return je(c,{animation:!1,transition:!1,timeline:!0},De),e.targetsMap.set(u,c),s.add(u),{key:i,media:r,selectorCondition:a,childSelector:l,declarations:[{name:f,value:`--${n}`}]}}function Ut(e,t,n,s,i){const o=[];for(const r of Object.keys(i)){const a=`${Ke}${r}`;a in t&&o.push(...i[r](t[a],{key:n,scope:e,config:t}).map(l=>({...l,key:n,media:s})))}return o}function Ds(e,t,n,s,i,o){const{assigned:r,childSelector:a,partSelectors:l}=n,u={animation:!1,transition:!1,timeline:!1},{key:c,effectId:f,conditions:d,namedEffect:m,keyframeEffect:p,transition:h,transitionProperties:g,initial:v}=t,y=re(d,e.configConditions,"media"),$=x(d,e.configConditions),E=[{key:c,media:y,selectorCondition:$,childSelector:a,declarations:[]}];let b=[];const{declarations:S}=E[0];e.plugins&&E.push(...Ut("effect",t,c,y,e.plugins));const T=v&&t.duration===0;if((m||p)&&!T){const I=N(t),P=rs(null,I,s,o).filter(O=>O.name),k=P.length?{}:{"":[]};P.forEach(O=>{const C=O.part||"";(k[C]||=[]).push(O)}),b=P.map(O=>({name:O.name,keyframes:O.keyframes})),S.push(...P.flatMap(({custom:O})=>Object.entries(O||{}).filter(([C,M])=>M!==void 0).map(([C,M])=>({name:C,value:M})))),Object.entries(k).forEach(([O,C])=>{const M=Ne.map(R=>({_listPropertyName:R,name:i[R],value:C.map(Pe=>{const ke=xs[R];return Pe[ke]||K[R]}).join(", ")})).filter(({_listPropertyName:R,name:Pe,value:ke})=>ke!==K[R]||r.has(Pe));M.forEach(({name:R})=>r.add(R)),u.animation=u.animation||M.length>0;const ce=O?`[data-motion-part~="${O}"]`:a;O&&M.length&&l.add(ce),v?(E.push({key:c,media:y,selectorCondition:$,childSelector:ce,declarations:lt,selectorSuffix:":not([data-interact-enter])"}),E.push({key:c,media:y,selectorCondition:$,childSelector:ce,declarations:M,selectorSuffix:':not([data-interact-enter="done"])'})):O?E.push({key:c,media:y,selectorCondition:$,childSelector:ce,declarations:M}):S.push(...M)})}else if(h||g){const I=xt(t),P=Nt(t);(P.length||r.has(i.transition))&&(S.push({name:i.transition,value:P.join(", ")||K.transition}),r.add(i.transition),u.transition=!0),E.push({key:c,media:y,selectorCondition:$,childSelector:a,states:[f],declarations:I})}else T&&E.push({key:c,media:y,selectorCondition:$,childSelector:a,declarations:lt,selectorSuffix:":not([data-interact-enter])"}),S.push(...Ne.filter(I=>r.has(i[I])).map(I=>({name:i[I],value:K[I]})));return{rules:E.filter(I=>I.declarations.length),keyframes:b,wrote:u}}function js(e,t,n,s){const i=t.namedEffect&&Qe(t.namedEffect.type,!1);if(!i?.getNames)return;const o=a=>i.getNames({...t,suffix:a});if(o("-1").join()===o().join())return;const r=e.keyframeEntries.get(n)||[];e.keyframeEntries.set(n,[...r,{slotKey:s,getNames:o}])}function zs(e,t,n){const s=e.forceReducedMotion||Es(t);return n&&s&&n.reducedMotionPolicy!=="ignore"?{...n,offset:0}:n}function Kt(e,t,n,s,i,o){const r=B(t),a=e.targetsMap.get(r)||Vt(t.key,V(t,{asCombinator:!0,useFirstChild:e.useFirstChild,addItemFilter:!0}));s.add(r);const l=o?.get(r)||De,u=Bt(a,l,e.configIndex),c=t.variants||[t],f=Yt(t);if(e.collectSlots)return c.forEach(h=>js(a,h,u.animation,t.slotKey)),je(a,{animation:f==="animation",transition:f==="transition",timeline:!1},l),e.targetsMap.set(r,a),[];const d=a.assigned,m=c.map(h=>(h.namedEffect&&(h.suffix=e.keyframeSlots.get(t.slotKey)),a.assigned=new Set(d),{...Ds(e,h,a,n,u,zs(e,h,i)),assigned:a.assigned}));a.assigned=new Set(m.flatMap(h=>[...h.assigned])),m.forEach(({keyframes:h})=>h.forEach(({name:g,keyframes:v})=>e.keyframesMap.set(g,v)));const p=Object.fromEntries(Ce.map(h=>[h,m.some(g=>g.wrote[h])]));return je(a,p,l),e.targetsMap.set(r,a),m.flatMap(({rules:h})=>h)}function Hs(e,t,n,s){const i=[],o=new Set,r=Rs(t);i.push(...t.effects.flatMap(l=>Kt(e,l,n,o,t,r)));const{conditions:a}=t;return o.forEach(l=>{s.add(l);const u=e.targetsMap.get(l),c=_s(u,a,e.configConditions,e.configIndex);c&&(c.declarations.forEach(({name:f})=>u.assigned.add(f)),i.push(c)),Ls(u)}),i}function Gs(e,t,n){const{key:s,conditions:i,effects:o=[],sequences:r=[]}=t,a=e.plugins?Ut("interaction",t,s,re(i,e.configConditions,"media"),e.plugins):[],{trigger:l}=t,u={trigger:hs(l),id:J("trigger",[n],e.configIndex)},c=new Set;l==="viewProgress"&&a.push(Ns(e,t,u.id,c));const f=o.map((m,p)=>{const h=Gt(m,t,e.config,J("eff",[n,p],e.configIndex),{force:e.forceReducedMotion,defaultPolicy:e.reducedMotionPolicy});return h&&Object.assign(h,{slotKey:Ee(n,p)})}).filter(m=>m!==null);a.push(...f.flatMap(m=>Kt(e,m,u,c)));const d=r.map((m,p)=>$s(m,t,e.config,J("seq",[n,p],e.configIndex),h=>Ee(n,h,p),{force:e.forceReducedMotion,defaultPolicy:e.reducedMotionPolicy})).filter(m=>m!==null);return a.push(...d.flatMap(m=>Hs(e,m,u,c))),l==="viewProgress"&&c.size>1&&e.scopedTimelines.push(`--${u.id}`),c.forEach(m=>Fs(e.targetsMap.get(m))),a}function Ws(e={}){return typeof e=="boolean"?{useFirstChild:e}:e}function Xt(e,t){const{useFirstChild:n=!0,plugins:s,configIndex:i,collectSlots:o=!1,forceReducedMotion:r=w.forceReducedMotion,reducedMotionPolicy:a=w.reducedMotionPolicy}=t,l={config:e,configConditions:jt(e.conditions),targetsMap:new Map,keyframesMap:new Map,keyframeSlots:o?new Map:Qt(e,{configIndex:i,forceReducedMotion:r,reducedMotionPolicy:a}),scopedTimelines:[],collectSlots:o,useFirstChild:n,forceReducedMotion:r,reducedMotionPolicy:a,plugins:s,configIndex:i},u=e.interactions.flatMap((c,f)=>Gs(l,c,f));return{ctx:l,cssRules:u}}function J(e,t,n){return[e,...n===void 0?[]:[`c${n}`],...t].join("-")}function Ee(e,t,n){return[e,n,t].filter(s=>s!==void 0).join(":")}function Qt(e,t={}){const{ctx:n}=Xt(e,{...t,collectSlots:!0}),s=new Map,i=o=>o?`-${o}`:void 0;return n.targetsMap.forEach(({keyframeEntries:o})=>{const r=new Set;o.forEach(a=>{const l=f=>a.flatMap(({getNames:d})=>d(i(f)));let u=0,c=l(u);for(;c.some(f=>r.has(f));)c=l(++u);c.forEach(f=>r.add(f)),u&&a.forEach(({slotKey:f})=>s.set(f,i(u)))})}),s}function Vs(e,t){const{ctx:n,cssRules:s}=Xt(e,Ws(t)),i=[...n.targetsMap.values()],o=Math.max(0,...i.map(({animation:m})=>m.listIndex)),r=Math.max(0,...i.map(({transition:m})=>m.listIndex)),a=Math.max(0,...i.map(({timeline:m})=>m.listIndex)),l=Ps(i.flatMap(m=>[m,...[...m.partSelectors].map(p=>({key:m.key,childSelector:p}))]),o,r,a,n.configIndex),u=Math.max(0,...i.map(({animation:m})=>m.slotCursor)),c=Math.max(0,...i.map(({transition:m})=>m.slotCursor)),f=Ms(o,r,u,c,a,n.configIndex),d=ks(n.scopedTimelines,n.configIndex);return{keyframes:n.keyframesMap,atProperty:f,cssRules:s,listsRule:l,timelineScopeRule:d}}function Bs(e,t){const{cssRules:n,keyframes:s,atProperty:i,listsRule:o,timelineScopeRule:r}=Vs(e,t);return[...i,...[...s.entries()].map(([l,u])=>Ts(l,u)),...n.map(Os),o,r].filter(l=>l).join(`
|
|
27
|
-
`)}const Ys={root:null,rootMargin:"0px 0px -10% 0px",threshold:[0]},Us={root:null,rootMargin:"0px",threshold:[0]},Ks=.2;function Xs(e){const t=e.trim().split(/\s+/),n=t[0],s=t.length>1?t[1]:t[0],i=o=>o.startsWith("-")?o.slice(1):parseFloat(o)?`-${o}`:o;return`${i(n)} 0px ${i(s)}`}const ee={},D=new WeakMap,we=new WeakSet,X=new WeakMap;let Zt={},Q=null;function Qs(e){Zt=e}function Jt(e,t,n){D.get(e)?.forEach(({source:i,handler:o})=>{i===e&&o(t,n)})}function ut(){return Q||(Q=new IntersectionObserver(e=>{e.forEach(t=>{const n=t.target;t.isIntersecting||Jt(n,!1,!0)})},Us),Q)}function en(e,t=!1){const n=JSON.stringify({...e,isSafeMode:t});if(ee[n])return ee[n];const s=e.threshold??Ks,i=t?Ys:{root:null,rootMargin:e.inset?Xs(e.inset):"0px",threshold:s},o=new IntersectionObserver(r=>{r.forEach(a=>{const l=a.target,u=!we.has(l);if(u&&(we.add(l),e.useSafeViewEnter&&!a.isIntersecting)){_.measure(()=>{const c=a.boundingClientRect.height,f=a.rootBounds?.height;if(!f)return;const d=Array.isArray(e.threshold)?Math.min(...e.threshold):e.threshold;d&&c*d>f&&_.mutate(()=>{o.unobserve(l);const p=en(e,!0);X.set(l,p),p.observe(l)})});return}(a.isIntersecting||!u)&&Jt(l,a.isIntersecting)})},i);return ee[n]=o,o}function Zs(e,t,n,s={},{selectorCondition:i,animation:o}={}){const r={...Zt,...s},a=n.triggerType||"once",l=o||oe(t,N(n));if(!l)return;const u=en(r);a!=="once"&&l.persist?.();let c=!0,f=!1,d;d={source:e,target:t,handler:(h,g)=>{if(!(i&&!t.matches(i)))if(a==="once"){if(h&&!f){f=!0;const v=D.get(e);(!v||v.size===0||v.size===1&&v.has(d))&&((X.get(e)||u).unobserve(e),we.delete(e)),l.onFinish(()=>{D.get(e)?.delete(d),D.get(t)?.delete(d)}),l.play(()=>{const y=()=>{t.dataset.interactEnter="start"},$=()=>{_.mutate(()=>{t.dataset.interactEnter="done"})};l.isCSS?(_.mutate(()=>{requestAnimationFrame(y)}),l.onFinish($),l.onAbort($)):(_.mutate(y),l.onFinish($))})}}else a==="alternate"?c&&h?(c=!1,l.play()):c||l.reverse():a==="repeat"?h?(l.progress(0),l.play()):g&&(l.pause(),l.progress(0)):a==="state"&&(h?l.play():g&&l.pause())},cleanup:()=>{(X.get(e)||u).unobserve(e),(a==="repeat"||a==="state")&&ut().unobserve(e),l.cancel(),we.delete(e),X.delete(e)}},q(D,e,d),q(D,t,d),X.set(e,u),u.observe(e),(a==="repeat"||a==="state")&&ut().observe(e)}function Js(e){ae(D,e)}function ei(){Q=null,Object.keys(ee).forEach(e=>delete ee[e])}const ti={add:Zs,remove:Js,setOptions:Qs,reset:ei};function tn(e,t){return Object.assign(Object.create(t),e)}function ni(e,t,n,s){let i=e*(1-n)+t*n;if(s){const o=i-e;Math.abs(o)<s&&(i=e+s*Math.sign(o));const r=t-i;if(Math.abs(r)<s)return t}return i}function si(e){let t=!1;return function(){t||(t=!0,window.requestAnimationFrame(()=>{t=!1,e()}))}}function ft(e,t){let n=0;return function(){n&&window.clearTimeout(n),n=window.setTimeout(()=>{n=0,e()},t)}}function ii(e,t){const n=e.match(/^calc\s*\(\s*(-?\d+((px)|([lsd]?vh)|([lsd]?vw)))\s*\+\s*(-?\d+((px)|([lsd]?vh)|([lsd]?vw)))\s*\)\s*$/);return $e(n[1],t)+$e(n[6],t)}function $e(e,t){return e?/^-?\d+px$/.test(e)?parseInt(e):/^-?\d+[lsd]?vh$/.test(e)?parseInt(e)*t.viewportHeight/100:/^-?\d+[lsd]?vw$/.test(e)?parseInt(e)*t.viewportWidth/100:/^calc\s*\(\s*-?\d+((px)|([lsd]?vh)|([lsd]?vw))\s*\+\s*-?\d+((px)|([lsd]?vh)|([lsd]?vw))\s*\)\s*$/.test(e)?ii(e,t):parseInt(e)||0:0}function H(e,t,n){const{name:s,offset:i=0}=e,{start:o,end:r}=n,a=r-o,l=i/100;let u,c;return s==="entry"?(u=o-t,c=Math.min(t,a)):s==="entry-crossing"?(u=o-t,c=a):s==="contain"?(u=Math.min(r-t,o),c=Math.abs(t-a)):s==="exit"?(u=Math.max(o,r-t),c=Math.min(t,a)):s==="exit-crossing"?(u=o,c=a):s==="cover"&&(u=o-t,c=a+t),u+l*c|0}function qe(e,t,n,s,i){let o=0;const r={start:t,end:n};return e.forEach((a,l)=>{o+=a.offset;const u=a.sticky;if(u){if("end"in u&&e[l-1]?.element){const d=((i?a.element.offsetWidth:a.element.offsetHeight)||0)+u.end-s,m=o+d-a.offset,p=m<r.start,h=!p&&m<=n;let g=0;(p||h)&&(g=a.offset,r.end+=g),p&&(r.start+=g)}if("start"in u){const c=o-u.start,f=c<r.start,d=!f&&c<=r.end;let m=0;const p=e[l-1]?.element;if(p){if(f||d){const h=(i?p.offsetWidth:p.offsetHeight)||0,g=a.offset,v=(i?a.element.offsetWidth:a.element.offsetHeight)||0;m=h-(g+v),o+=m,r.end+=m}f&&(r.start+=m)}}}}),r}function oi(e,t,n,s,i,o){const{start:r,end:a,duration:l}=e;let u=r,c=a,f=e.startRange,d=e.endRange,m;if(typeof l=="string"){f={name:l,offset:0},d={name:l,offset:100},u=H(f,n,t),c=H(d,n,t),m=c-u;const p=qe(o,u,c,n,s);u=p.start,c=p.end}else{if(f||r?.name){f=f||r;const p=$e(f.add,i),h=H({...f,offset:0},n,t),g=H({...f,offset:100},n,t),v=qe(o,h,g,n,s);u=v.start+f.offset/100*(v.end-v.start)+p}if(d||a?.name){d=d||a;const p=$e(d.add,i),h=H({...d,offset:0},n,t),g=H({...d,offset:100},n,t),v=qe(o,h,g,n,s);c=v.start+d.offset/100*(v.end-v.start)+p}else typeof l=="number"&&(c=u+l)}return!m&&!l&&(m=c-u),{...e,start:u,end:c,startRange:f,endRange:d,duration:m||l}}function ri(e){return e.position==="sticky"}function ai(e,t,n){return e.position==="fixed"&&(!t||t===window.document.body||t===n)}function ci(e,t){return parseInt(t?e.left:e.top)}function li(e,t){return parseInt(t?e.right:e.bottom)}function ui(e,t,n){n&&(e.style.position="static");const s=(t?e.offsetLeft:e.offsetTop)||0;return n&&(e.style.position=null),s}function fi(e,t){let n;const s=ci(e,t),i=li(e,t),o=!isNaN(s),r=!isNaN(i);return(o||r)&&(n={},o&&(n.start=s),r&&(n.end=i)),n}function ue(e,t,n,s,i){const o=e[0].viewSource,r=[];let a=(s?o.offsetWidth:o.offsetHeight)||0,l=0,u=o;for(;u;){const f=window.getComputedStyle(u),d=ri(f),m=d?fi(f,s):void 0,p=ui(u,s,d);if((!m||!("end"in m))&&(l+=p),r.push({element:u,offset:p,sticky:m}),u=u.offsetParent,ai(f,u,t))break;if(u===t){r.push({element:u,offset:0});break}}return r.reverse(),e.map(f=>({...oi(f,{start:l,end:l+a},n,s,i,r)}))}const dt=100,di={horizontal:!1,observeViewportEntry:!0,viewportRootMargin:"7% 7%",observeViewportResize:!1,observeSourcesResize:!1,observeContentResize:!1};function hi(e,t,n,s){let i=0;return e>=t&&e<=n?i=s?(e-t)/s:1:e>n&&(i=1),i}function ht(e,t){return e===window?t?window.document.documentElement.clientWidth:window.document.documentElement.clientHeight:t?e.clientWidth:e.clientHeight}function mi(){return{viewportWidth:window.document.documentElement.clientWidth,viewportHeight:window.document.documentElement.clientHeight}}function pi(e){const t=tn(e,di),n=t.root,s=t.horizontal,i=new WeakMap;let o=ht(n,s),r,a,l,u,c;const f=[],d=mi();if(t.scenes=Object.values(e.scenes.reduce((h,g,v)=>{const y=g.groupId?`group-${g.groupId}`:String(v);return h[y]?h[y].push(g):h[y]=[g],h},{})).flatMap(h=>(h.every(g=>g.viewSource&&(typeof g.duration=="string"||g.start?.name))?(h=ue(h,n,o,s,d),(t.observeSourcesResize||t.observeContentResize)&&f.push(h)):h.forEach(g=>{g.end==null&&(g.end=g.start+g.duration),g.duration==null&&(g.duration=g.end-g.start)}),h)),t.scenes.forEach((h,g)=>{h.index=g}),f.length){const h=new Map;window.ResizeObserver&&(l=new window.ResizeObserver(function(g){g.forEach(v=>{const y=h.get(v.target),$=ue(y,n,o,s,d);$.forEach((E,b)=>{t.scenes[E.index]=$[b]}),f.splice(f.indexOf(y),1,$)})}),f.forEach(g=>{l.observe(g[0].viewSource,{box:"border-box"}),h.set(g[0].viewSource,g)}),t.observeContentResize&&t.contentRoot&&new window.ResizeObserver(ft(()=>{const v=f.map(y=>{const $=ue(y,n,o,s,d);return $.forEach((E,b)=>{t.scenes[E.index]=$[b]}),$});f.length=0,f.push(...v),f.forEach(y=>{h.set(y[0].viewSource,y)})},dt)).observe(t.contentRoot,{box:"border-box"})),t.observeViewportResize&&(u=ft(function(){o=ht(n,s);const g=f.map(v=>{const y=ue(v,n,o,s,d);return y.forEach(($,E)=>{t.scenes[$.index]=y[E]}),y});f.length=0,f.push(...g),f.forEach(v=>{h.set(v[0].viewSource,v)})},dt),n===window?window.addEventListener("resize",u):window.ResizeObserver&&(c=new window.ResizeObserver(u),c.observe(n,{box:"border-box"})))}t.observeViewportEntry&&window.IntersectionObserver&&(a=new window.IntersectionObserver(function(h){h.forEach(g=>{(i.get(g.target)||[]).forEach(v=>{v.disabled=!g.isIntersecting})})},{root:n===window?window.document:n,rootMargin:t.viewportRootMargin,threshold:0}),t.scenes.forEach(h=>{if(h.viewSource){let g=i.get(h.viewSource);g||(g=[],i.set(h.viewSource,g),a.observe(h.viewSource)),g.push(h)}}));function m({p:h,vp:g}){h=+h.toFixed(1);const v=+g.toFixed(4);if(h!==r){for(let y of t.scenes)if(!y.disabled){const{start:$,end:E,duration:b}=y,S=hi(h,$,E,b);y.effect(y,S,v)}r=h}}function p(){t.scenes.forEach(h=>h.destroy?.()),a&&(a.disconnect(),a=null),l&&(l.disconnect(),l=null),u&&(c?(c.disconnect(),c=null):window.removeEventListener("resize",u))}return{tick:m,destroy:p}}const gi={transitionActive:!1,transitionFriction:.9,transitionEpsilon:1,velocityActive:!1,velocityMax:1};class vi{constructor(t={}){this.config=tn(t,gi),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=si(()=>{this._measure?.(),this.tick(!0)})}start(){this.setupEffect(),this.setupEvent(),this.resetProgress(),this.tick()}pause(){this.removeEvent()}resetProgress(t={}){const n=this.config.root,s=t.x||t.x===0?t.x:n.scrollX||n.scrollLeft||0,i=t.y||t.y===0?t.y:n.scrollY||n.scrollTop||0,o=this.config.horizontal?s:i;this.progress.p=o,this.progress.prevP=o,this.progress.vp=0,this.config.transitionActive&&(this.currentProgress.p=o,this.currentProgress.prevP=o,this.currentProgress.vp=0),t&&this.config.root.scrollTo(s,i)}tick(t){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,o=i<0?-1:1;s.vp=Math.min(this.config.velocityMax,Math.abs(i))/this.config.velocityMax*o}this.effect.tick(s),n&&s.p!==this.progress.p&&(t&&this._lerpFrameId&&window.cancelAnimationFrame(this._lerpFrameId),this._lerpFrameId=window.requestAnimationFrame(()=>this.tick())),s.prevP=s.p}lerp(){this.currentProgress.p=ni(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=pi(this.config)}removeEffect(){this.effect&&this.effect.destroy(),this.effect=null}}const ze=new WeakMap;let nn=()=>({});function yi(e){nn=e}function Ei(e,t,n,s,{selectorCondition:i}){if(i&&!t.matches(i))return;const o={trigger:"view-progress",element:e},r=N(n);let a;if("ViewTimeline"in window){const u=oe(t,r,o);u&&!u.isCSS&&(u.play(),a=()=>{u.ready.then(()=>{u.cancel()})})}else{const u=Rt(t,r,o);if(u){const c=Array.isArray(u)?u:[u],f=new vi({viewSource:e,scenes:c,observeViewportEntry:!1,observeViewportResize:!1,observeSourcesResize:!0,root:document.body,...nn()});a=()=>{f.destroy()},Promise.all(c.map(d=>d.ready||Promise.resolve())).then(()=>{f.start()})}}if(!a)return;const l={source:e,target:t,cleanup:a};q(ze,e,l),q(ze,t,l)}function wi(e){ae(ze,e)}const $i={add:Ei,remove:wi,registerOptionsGetter:yi};function mt(e,t,n){return Math.min(Math.max(e,n),t)}function pt(e){let t=!1;return function(){if(!t)return t=!0,window.requestAnimationFrame(()=>{t=!1,e()})}}function Si(e){let t=e,n=0,s=0;if(t.offsetParent)do n+=t.offsetLeft,s+=t.offsetTop,t=t.offsetParent;while(t);return{left:n,top:s,width:e.offsetWidth,height:e.offsetHeight}}function bi(){const e=window.devicePixelRatio;let t=!1;if(e===1)return!1;document.body.addEventListener("pointerdown",s=>{t=s.offsetX!==10},{once:!0});const n=new PointerEvent("pointerdown",{clientX:10});return document.body.dispatchEvent(n),t}function Ii(){return new Promise(e=>{const t=window.scrollY;let n=!1,s;function i(){document.body.addEventListener("pointerdown",a=>{s===void 0?s=a.offsetY:n=a.offsetY===s},{once:!0});const r=new PointerEvent("pointerdown",{clientY:500});document.body.dispatchEvent(r)}function o(){window.scrollY!==t&&(window.removeEventListener("scroll",o),i(),e(n))}i(),window.addEventListener("scroll",o),window.scrollY>0&&window.scrollBy(0,-1)})}function Ti(e){Ii().then(t=>{e.fixRequired=t,t&&(window.addEventListener("scroll",e.scrollHandler),e.scrollHandler())})}let fe=0;const ve=new Set;function Oi(){const e=n=>{for(let s of n.changedTouches)ve.add(s.identifier)},t=n=>{for(let s of n.changedTouches)ve.delete(s.identifier)};return document.addEventListener("touchstart",e,{passive:!0}),document.addEventListener("touchend",t,{passive:!0}),function(){ve.clear(),document.removeEventListener("touchstart",e),document.removeEventListener("touchend",t)}}function Ci(e,t){if("onscrollend"in window)return e.addEventListener("scrollend",t),function(){e.removeEventListener("scrollend",t)};let n=0,s;fe||(s=Oi()),fe+=1;function i(o){clearTimeout(n),n=setTimeout(()=>{ve.size?setTimeout(i,100):(t(o),n=0)},100)}return e.addEventListener("scroll",i),function(){e.removeEventListener("scroll",i),fe-=1,fe||s()}}function Mi(e,t,n){return{x(s){const i=e.left-n.x+e.width/2,o=i>=t.width/2,r=(o?i:t.width-i)*2,a=o?0:i-r/2;return(s-a)/r},y(s){const i=e.top-n.y+e.height/2,o=i>=t.height/2,r=(o?i:t.height-i)*2,a=o?0:i-r/2;return(s-a)/r}}}function _i(e,t){this.x=window.scrollX,this.y=window.scrollY,requestAnimationFrame(()=>e&&e(t))}function Pi(e){e.rect.width=window.document.documentElement.clientWidth,e.rect.height=window.document.documentElement.clientHeight}function ki(e){const t=new ResizeObserver(n=>{n.forEach(s=>{e.rect.width=s.borderBoxSize[0].inlineSize,e.rect.height=s.borderBoxSize[0].blockSize})});return t.observe(e.root,{box:"border-box"}),t}function Ai(e){let t=!1,n={x:e.rect.width/2,y:e.rect.height/2,vx:0,vy:0},s,i,o,r,a;const l={x:0,y:0};e.scenes.forEach(c=>{c.target&&c.centeredToTarget&&(c.transform=Mi(Si(c.target),e.rect,l),t=!0),e.root?i=ki(e):(o=Pi.bind(null,e),window.addEventListener("resize",o))}),s=function(c){for(let f of e.scenes)if(!f.disabled){const d=f.transform?.x(c.x)||c.x/e.rect.width,m=f.transform?.y(c.y)||c.y/e.rect.height,p=+mt(0,1,d).toPrecision(4),h=+mt(0,1,m).toPrecision(4),g={x:c.vx,y:c.vy};e.allowActiveEvent&&(c.active=d<=1&&m<=1&&d>=0&&m>=0),f.effect(f,{x:p,y:h},g,c.active)}Object.assign(n,c)},t&&(r=_i.bind(l,s,n),a=Ci(document,r));function u(){e.scenes.forEach(c=>c.destroy?.()),a?.(),i?(i.disconnect(),i=null):(window.removeEventListener("resize",o),o=null),s=null,n=null}return{tick:s,destroy:u}}const qi=1e3/60*3;let de;function Ri(){G.x=window.scrollX,G.y=window.scrollY}const G={x:0,y:0,scrollHandler:Ri,fixRequired:void 0};class Li{constructor(t={}){this.config={...t},this.effect=null,this._nextTick=null,this._nextTransitionTick=null,this._startTime=0;let n;this.config.transitionDuration?n=this.config.noThrottle?()=>this.transition():pt(()=>this.transition()):n=this.config.noThrottle?()=>(this.tick(),null):pt(()=>{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 o=this.config.root?i.offsetX:i.x,r=this.config.root?i.offsetY:i.y;this.progress.vx=o-this.progress.x,this.progress.vy=r-this.progress.y,this.progress.x=o,this.progress.y=r,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){de=typeof de=="boolean"?de:bi();const i=de?window.devicePixelRatio:1;typeof G.fixRequired>"u"&&Ti(G),this._measure=o=>{if(o.target!==this.config.root){const r=new PointerEvent("pointermove",{bubbles:!0,cancelable:!0,clientX:o.x*i+G.x,clientY:o.y*i+G.y});o.stopPropagation(),this.config.root.dispatchEvent(r)}else s(o)}}else this._measure=s}start(){this.setupEffect(),this.setupEvent()}pause(){this.removeEvent()}tick(){this.effect.tick(this.progress)}transition(){const t=this.config.transitionDuration,n=this.config.transitionEasing||(r=>r),s=performance.now();let i=!1;const o=r=>{const a=(r-this._startTime)/t,l=n(Math.min(1,a));i&&(this.progress.vx=0,this.progress.vy=0,i=!1),this.currentProgress=Object.entries(this.progress).reduce((u,[c,f])=>(c==="active"?u[c]=f:u[c]=this.previousProgress[c]+(f-this.previousProgress[c])*l,u),this.currentProgress||{}),a<1&&(this._nextTransitionTick=requestAnimationFrame(o),i=r-this._startTime>qi),this.effect.tick(this.currentProgress)};return this._startTime?(this._nextTransitionTick&&cancelAnimationFrame(this._nextTransitionTick),Object.assign(this.previousProgress,this.currentProgress),this._startTime=s,o(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 t=this.config.root||window;t.addEventListener("pointermove",this._measure,{passive:!0}),this.config.eventSource&&this.config.eventSource.addEventListener("pointermove",this._measure,{passive:!0}),this.config.allowActiveEvent&&(t.addEventListener("pointerleave",this._pointerLeave,{passive:!0}),t.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 t=this.config.root||window;t.removeEventListener("pointermove",this._measure),this.config.eventSource&&this.config.eventSource.removeEventListener("pointermove",this._measure),this.config.allowActiveEvent&&(t.removeEventListener("pointerleave",this._pointerLeave),t.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=Ai(this.config)}removeEffect(){this.effect&&this.effect.destroy(),this.effect=null}}const He=new WeakMap;let sn=()=>({});function Fi(e){sn=e}function xi(e){return!("keyframeEffect"in e||"customEffect"in e)||!e.transitionDuration?{}:{transitionDuration:e.transitionDuration,transitionEasing:Xe(e.transitionEasing)}}function Ni(e,t,n,s={},{selectorCondition:i}){if(i&&!t.matches(i))return;const o={trigger:"pointer-move",element:e,axis:s.axis??"y"},r=Rt(t,N(n),o);if(r){const a=Array.isArray(r)?r:[r],l=new Li({root:s.hitArea==="self"?e:void 0,scenes:a,...sn(),...xi(n)}),c={source:e,target:t,cleanup:()=>{l.destroy()}};q(He,e,c),q(He,t,c),Promise.all(a.map(f=>f.ready||Promise.resolve())).then(()=>{l.start()})}}function Di(e){ae(He,e)}const ji={add:Ni,remove:Di,registerOptionsGetter:Fi},Ge=new WeakMap;function zi(e,t,n,s,{selectorCondition:i,animation:o,sourceAnimationOptions:r}){const a=o||oe(t,N(n));if(!a)return;const{effectId:l}=s,u=d=>{if(i&&!t.matches(i))return;const m=d.animationName,p=d.detail?.effectId,h=r?qt(e,r):null;if(h){if(h.playState==="running"||m&&!h.hasAnimationName(m))return;if(p&&p!==l&&!h.hasAnimationId(p))return}a.play()},f={source:e,target:t,cleanup:()=>{a.cancel(),e.removeEventListener("animationend",u)}};q(Ge,e,f),q(Ge,t,f),e.addEventListener("animationend",u)}function Hi(e){ae(Ge,e)}const Gi={add:zi,remove:Hi};function Wi(e,t,n,s,i){const o=i||oe(e,N(t));if(!o)return null;let r=!0;const a=t.triggerType||"alternate";return{handler:u=>{if(n&&!e.matches(n))return;const c=!s,f=s?.enter?.includes(u.type),d=s?.leave?.includes(u.type);if(f||c){if(a==="alternate"||a==="state")r?(r=!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 e.dataset.interactEnter,o.isCSS){const m=()=>{_.mutate(()=>{e.dataset.interactEnter="done"})};o.onFinish(m),o.onAbort(m)}o.play()}return}d&&(a==="alternate"?o.reverse():a==="repeat"?(o.cancel(),_.mutate(()=>{delete e.dataset.interactEnter})):a==="state"&&o.playState==="running"&&o.pause())},cleanup:()=>o.cancel()}}function Vi(e,t,{effectId:n,listContainer:s,listItemSelector:i,stateAction:o},r,a){const l=!!s,u=o??"toggle",c=u==="toggle";return f=>{if(r&&!e.matches(r))return;const d=l?e.closest(`${s} > ${i||""}:has(:scope)`):void 0,m=!a,p=a?.enter?.includes(f.type),h=a?.leave?.includes(f.type);m?t.toggleEffect(n,u,d):(p&&t.toggleEffect(n,c?"add":u,d),h&&c&&t.toggleEffect(n,"remove",d))}}const We=new WeakMap;function gt(e,t){return n=>{const s=n;e.contains(s.relatedTarget)||t(s)}}function Bi(e){return t=>{const n=t;(n.pointerType||n.detail>0)&&e(n)}}function Yi(e){return t=>{const n=t;n.code==="Space"?(n.preventDefault(),e(n)):n.code==="Enter"&&e(n)}}const Ui={focusin:(e,t)=>gt(e,t),focusout:(e,t)=>gt(e,t),click:(e,t)=>Bi(t),keydown:(e,t)=>Yi(t)};function Ki(e,t,n){const s=Ui[e];return s?s(t,n):i=>n(i)}function Xi(e){return typeof e=="object"&&!Array.isArray(e)&&("enter"in e||"leave"in e)}function Qi(e){if(typeof e=="string")return{toggle:[e]};if(Array.isArray(e))return{toggle:[...e]};if(Xi(e)){const t=e.enter?[...e.enter]:[],n=e.leave?[...e.leave]:[];return{enter:t,leave:n}}return{}}function Zi(e){return!!(e.enter?.length||e.leave?.length)}function Ji(e){return Zi(e)?{enter:e.enter??[],leave:e.leave??[]}:void 0}function eo(e,t,n,s,{targetController:i,selectorCondition:o,animation:r}){const a=Qi(s.eventConfig),l=n.transition||n.transitionProperties,u=Ji(a);let c,f,d=!1;if(l)c=Vi(t,i,n,o,u);else{const y=Wi(t,n,o,u,r);c=y?.handler??null,f=y?.cleanup,d=n.triggerType==="once"}if(!c)return;const m=c,p=new AbortController;function h(y,$,E){const b=Ki($,e,m);y.addEventListener($,b,{...E,signal:p.signal})}const v={source:e,target:t,cleanup:()=>{p.abort(),f?.()}};if(q(We,e,v),q(We,t,v),u){const y=a.enter,$=a.leave;y.forEach(S=>{S==="focusin"&&(e.tabIndex=0),h(e,S,{passive:!0,once:d})});const E=!n.stateAction||n.stateAction==="toggle";(l?E:n.triggerType!=="once")&&$.forEach(S=>{if(S==="focusout"){h(e,S,{once:d});return}h(e,S,{passive:!0})})}else(a.toggle??[]).forEach($=>{h(e,$,{once:d,passive:$!=="keydown"})})}function to(e){ae(We,e)}const Z={add:eo,remove:to},Ve={click:["click"],activate:["click","keydown"],hover:{enter:["mouseenter"],leave:["mouseleave"]},interest:{enter:["mouseenter","focusin"],leave:["mouseleave","focusout"]}},vt={click:Ve.activate,hover:Ve.interest};function he(e){const t=Ve[e];return(n,s,i,o,r)=>{const a=r?.allowA11yTriggers&&e in vt?vt[e]:t;Z.add(n,s,i,{eventConfig:a},r??{})}}const W={viewEnter:ti,hover:{add:he("hover"),remove:Z.remove},click:{add:he("click"),remove:Z.remove},animationEnd:Gi,viewProgress:$i,pointerMove:ji,activate:{add:he("activate"),remove:Z.remove},interest:{add:he("interest"),remove:Z.remove}};function no(e){return e.replace(/\[[^\]]+]/g,"[]")}class w{static defineInteractElement;dataCache;addedInteractions;mediaQueryListeners;listInteractionsCache;controllers;static forceReducedMotion=!1;static reducedMotionPolicy="collapse";static allowA11yTriggers=!0;static instances=[];static controllerCache=new Map;static sequenceCache=new Map;static elementSequenceMap=new WeakMap;static plugins=new Map;static pluginDefers=new Map;static _released=new Set;constructor(){this.dataCache={effects:{},sequences:{},conditions:{},interactions:{}},this.addedInteractions={},this.mediaQueryListeners=new Map,this.listInteractionsCache={},this.controllers=new Set}init(t,n){if(typeof window>"u"||!window.customElements)return;const s=n?.useCustomElement??!!w.defineInteractElement;this.dataCache=oo(t,s,{configIndex:n?.configIndex,forceReducedMotion:n?.forceReducedMotion??w.forceReducedMotion,reducedMotionPolicy:n?.reducedMotionPolicy??w.reducedMotionPolicy});const i=w.defineInteractElement?.();s&&i===!1?document.querySelectorAll("interact-element").forEach(o=>{o.connect()}):w.controllerCache.forEach((o,r)=>o.connect(r))}destroy({clearCache:t=!1}={}){for(const n of this.controllers)n.disconnect({removeFromCache:t});for(const[,n]of this.mediaQueryListeners.entries())n.mql.removeEventListener("change",n.handler);this.mediaQueryListeners.clear(),this.addedInteractions={},this.listInteractionsCache={},this.controllers.clear(),this.dataCache={effects:{},sequences:{},conditions:{},interactions:{}},w.instances.splice(w.instances.indexOf(this),1)}setController(t,n){this.controllers.add(n),w.setController(t,n)}deleteController(t,n=!1){const s=w.controllerCache.get(t);this.clearInteractionStateForKey(t),this.clearMediaQueryListenersForKey(t),s&&n&&(this.controllers.delete(s),w.deleteController(t))}has(t){return!!this.get(t)}get(t){const n=no(t);return this.dataCache.interactions[n]}clearMediaQueryListenersForKey(t){for(const[n,s]of this.mediaQueryListeners.entries())s.key===t&&(s.mql.removeEventListener("change",s.handler),this.mediaQueryListeners.delete(n))}clearInteractionStateForKey(t){(this.get(t)?.interactionIds||[]).forEach(i=>{const o=A(i,t);delete this.addedInteractions[o]});const s=`${t}::seq::`;for(const i of w.sequenceCache.keys())i.startsWith(s)&&(w.sequenceCache.delete(i),delete this.addedInteractions[i])}setupMediaQueryListener(t,n,s,i){this.mediaQueryListeners.has(t)||(n.addEventListener("change",i),this.mediaQueryListeners.set(t,{mql:n,handler:i,key:s}))}static create(t,n){const s=new w;return w.instances.push(s),s.init(t,n),s}static destroy(){w.controllerCache.forEach(t=>{t.disconnect()}),w.instances.length=0,w.controllerCache.clear(),w.sequenceCache.clear(),w.elementSequenceMap=new WeakMap,w._released.clear()}static setup(t){t.scrollOptionsGetter&&W.viewProgress.registerOptionsGetter?.(t.scrollOptionsGetter),t.pointerOptionsGetter&&W.pointerMove.registerOptionsGetter?.(t.pointerOptionsGetter),t.viewEnter&&W.viewEnter.setOptions(t.viewEnter),t.allowA11yTriggers!==void 0&&(w.allowA11yTriggers=t.allowA11yTriggers),t.forceReducedMotion!==void 0&&(w.forceReducedMotion=t.forceReducedMotion),t.reducedMotionPolicy!==void 0&&(w.reducedMotionPolicy=t.reducedMotionPolicy)}static getInstance(t){const n=w.instances.find(s=>s.has(t));return n||console.warn(`Interact: Instance for key "${t}" not found`),n}static getController(t){const n=t?w.controllerCache.get(t):void 0;return n||console.warn(`Interact: Controller for key "${t}" not found`),n}static setController(t,n){w.controllerCache.set(t,n)}static deleteController(t){w.controllerCache.delete(t)}static registerEffects=ns;static getRegisteredEffect=Qe;static use(t,n,s){w.plugins.set(t,n);const i=s?.defer;i&&i.length?w.pluginDefers.set(t,Array.isArray(i)?i:[i]):w.pluginDefers.delete(t)}static ready(t,n){w._released.add(n?`${t}::${n}`:t),n?w.controllerCache.get(n)?.resume():w.controllerCache.forEach(s=>s.resume())}static _isPluginReleased(t,n){const s=w.pluginDefers.get(t);return s?s.every(i=>w._released.has(i)||w._released.has(`${i}::${n}`)):!0}static getPlugin(t){return w.plugins.get(t)}static getPluginsNames(){return new Set(w.plugins.keys())}static getSequence(t,n,s){const i=w.sequenceCache.get(t);if(i)return i;const o=us(n,s);return w.sequenceCache.set(t,o),w._registerSequenceElements(s,o),o}static addToSequence(t,n,s){const i=w.sequenceCache.get(t);if(!i)return!1;const r=Lt(n).map((a,l)=>({index:s[l]??i.animationGroups.length,group:a}));return i.addGroups(r),w._registerSequenceElements(n,i),!0}static _registerSequenceElements(t,n){for(const{target:s}of t){const i=Array.isArray(s)?s:s instanceof HTMLElement?[s]:[];for(const o of i){let r=w.elementSequenceMap.get(o);r||(r=new Set,w.elementSequenceMap.set(o,r)),r.add(n)}}}static removeFromSequences(t){for(const n of t){const s=w.elementSequenceMap.get(n);if(s){for(const i of s)i.removeGroups(o=>o.animations.some(r=>r.effect?.target===n));w.elementSequenceMap.delete(n)}}}}let so=0;function V(e,{asCombinator:t=!1,addItemFilter:n=!1,useFirstChild:s=!1}={}){if(e.listContainer){const i=`${n&&e.listItemSelector?` > ${e.listItemSelector}`:""}`;return e.selector?`${e.listContainer}${i} ${e.selector}`:`${e.listContainer}${i||" > *"}`}else if(e.selector)return e.selector;return s?t?"> :first-child":":scope > :first-child":""}function yt(e){return"sequenceId"in e&&!("effects"in e)}function Re(e,t){return e[t]||(e[t]={triggers:[],effects:{},sequences:{},interactionIds:new Set,selectors:new Set}),e[t]}function io(e,t,n){const{effects:s=[]}=e;return s.some((i,o)=>n.has(t(o)))?{...e,effects:s.map((i,o)=>{const r=n.get(t(o));return r?{...i,suffix:r}:i})}:e}function oo(e,t,n){const{configIndex:s}=n,{effects:i={},sequences:o={},conditions:r={}}=e,a={},l=e.interactions?Qt(e,n):new Map;return e.interactions?.forEach((u,c)=>{const f=u.key,d=++so,{effects:m,sequences:p,...h}=u;if(!f){console.error(`Interaction ${d} is missing a key for source element.`);return}Re(a,f);const g=m?Array.from(m):[];g.reverse();const v=p?.map((E,b)=>{if(yt(E)){const T=o[E.sequenceId];return T?{...T,...E}:(console.warn(`Interact: Sequence "${E.sequenceId}" not found in config`),E)}const S=E;return S.sequenceId||(S.sequenceId=J("seq",[c,b],s)),S}),y={...h,effects:g.length>0?g:void 0,sequences:v?.map((E,b)=>io(E,S=>Ee(c,S,b),l))};a[f].triggers.push(y),a[f].selectors.add(V(y,{useFirstChild:t}));const $=y.listContainer;g.forEach((E,b)=>{const S=E.effectId?i[E.effectId]:void 0;let T=E.key||S?.key;const I=g.length-1-b;E.effectId||(E.effectId=J("eff",[c,I],s));const P=l.get(Ee(c,I));if(P&&(E.suffix=P),T=T||f,E.key=T,$&&E.listContainer&&(T!==f||E.listContainer!==$))return;const k=B({...S,...E,key:T}),O=`${f}::${k}::${d}`;if(E.interactionId=O,a[f].interactionIds.add(O),T===f)return;const C=Re(a,T);C.effects[O]||(C.effects[O]=[],C.interactionIds.add(O)),C.effects[O].push({...h,effect:E}),C.selectors.add(V(E,{useFirstChild:t}))}),v?.forEach(E=>{if(!E||yt(E))return;const b=E,S=b.sequenceId;b.effects.forEach((I,P)=>{I.effectId||(I.effectId=`eff-${S}-${P}`);let k=I.key;if(!k&&I.effectId){const C=i[I.effectId];C&&(k=C.key)}k=k||f;const O=V(I,{useFirstChild:t});if(O&&a[f].selectors.add(O),k!==f){const C=Re(a,k),M=`${k}::seq::${S}::${d}`;C.sequences[M]||(C.sequences[M]=[],C.interactionIds.add(M)),C.sequences[M].push({...h,sequence:b}),C.selectors.add(O)}})})}),{effects:i,sequences:o,conditions:jt(r),reducedMotionPolicy:n.reducedMotionPolicy,forceReducedMotion:n.forceReducedMotion,interactions:a}}function Me(e,t,n,s,i){const o=w.getPluginsNames();for(const r of o){const a=`${Ke}${r}`;if(!(a in n))continue;const l=n[a];if(l!==null&&typeof l=="object"){if(e._appliedPlugins.has(l))continue;e._appliedPlugins.add(l)}const c=w.getPlugin(r)(l,{root:t,key:s,scope:i,config:n});typeof c=="function"&&e._pluginCleanups.push(c)}}function z(e,t){for(const n of w.getPluginsNames())if(`${Ke}${n}`in t&&!w._isPluginReleased(n,e))return!0;return!1}function Se(e,t,n){if(e.listContainer){const s=t.querySelector(e.listContainer);return s?e.selector?Array.from(s.querySelectorAll(e.selector)):Array.from(s.children):(console.warn(`Interact: No container found for list container "${e.listContainer}"`),[])}if(e.selector){const s=t.querySelectorAll(e.selector);if(s.length>0)return Array.from(s);console.warn(`Interact: No elements found for selector "${e.selector}"`)}return n?t.firstElementChild:t}function be(e,t){return t.map(n=>e.selector?n.querySelector(e.selector):n).filter(Boolean)}function _e(e,t,n,s={}){const{effects:i,conditions:o,reducedMotionPolicy:r,forceReducedMotion:a}=t.dataCache,l=zt(e,Te(e.reducedMotionPolicy,s.policy,r),{effects:i,force:a,collapsesStagger:s.collapsesStagger});let u;return l.forEach((c,f)=>{const d=F(c.conditions||[],o);d&&t.setupMediaQueryListener(f?`${n.id}::rm${f}`:n.id,d,n.key,n.onUpdate),!u&&(!d||d.matches)&&(u=c)}),u}function on(e,t,n,s,i,o,r,a){return[r?be(e,r):Se(e,n,s),a?be(t,a):Se(t,i,o)]}function rn(e,t,n,s,i,o,r,a){const l=Array.isArray(s),u=Array.isArray(i);l?s.forEach((c,f)=>{const d=u?i[f]:i;d&&Et(e,c,t.trigger,d,n,t.params,o,r,a)}):(u?i:[i]).forEach(f=>{Et(e,s,t.trigger,f,n,t.params,o,r,a)})}function an(e,t,n,s,i){const o={},r=[];(s.effects||[]).forEach((a,l)=>{const u=a.effectId,c={...n.dataCache.effects[u]||{},...a,effectId:u},f=c.key,d=A(a.interactionId,e);if(o[d]||n.addedInteractions[d]&&!i)return;const m=_e(c,n,{id:`${d}::${l}`,key:e,onUpdate:()=>{t.update()}},{policy:s.reducedMotionPolicy});if(m){o[d]=!0;const p=f&&A(f,e);let h;if(p){if(h=w.getController(p),!h)return;m.listContainer&&h.watchChildList(m.listContainer)}else h=t;if(z(p||s.key,m))return;Me(h,h.element,m,p||s.key,"effect");const[g,v]=on(s,m,t.element,t.useFirstChild,h.element,h.useFirstChild,i);if(!g||!v)return;n.addedInteractions[d]=!0;const y=p||s.key,$=x(m.conditions||[],n.dataCache.conditions);r.push([y,s,m,g,v,$,h.useFirstChild,e])}}),r.reverse().forEach(a=>{rn(...a)}),ao(e,t,n,s,i)}function cn(e,t,n){return Te(e.reducedMotionPolicy,t.reducedMotionPolicy,n.dataCache.reducedMotionPolicy)}function Be(e,t,n){const{forceReducedMotion:s,conditions:i}=n.dataCache,o=F([Ie],i);return(s||!!(o&&o.matches))&&cn(e,t,n)!=="ignore"?{...e,offset:0}:e}function ro(e){return"sequenceId"in e&&!("effects"in e)}function ln(e,t,n,s,i,o,r,a){const l=F(e.conditions||[],o.dataCache.conditions);if(l&&o.setupMediaQueryListener(n,l,r.updateKey,r.onUpdate),l&&!l.matches)return null;const u=e.effects||[],c=h=>{const g=h.effectId;return{...g?o.dataCache.effects[g]||{}:{},...h}};if(u.some(h=>{const g=c(h),v=F(g.conditions||[],o.dataCache.conditions);if(v&&!v.matches)return!1;const y=g.key&&A(g.key,s);return z(y||s,g)}))return null;const d=[],m=cn(e,t,o);let p=!1;for(const h of u){const g=h.effectId,v=_e(c(h),o,{id:`${n}::${g||"eff"}`,key:r.updateKey,onUpdate:r.onUpdate},{policy:m,collapsesStagger:m!=="ignore"});if(!v)continue;const y=v.key,$=y&&A(y,s);let E;if($){if(E=w.getController($),!E)return null}else E=i;const b=$||s;Me(E,E.element,v,b,"effect");let S;if(a&&b===a.controllerKey&&v.listContainer===a.listContainer?(S=be(v,a.elements),S.length>0&&(p=!0)):S=Se(v,E.element,E.useFirstChild),!S||Array.isArray(S)&&S.length===0)return null;const T=N(v);d.push({target:S,options:T})}return a&&!p?null:d.length>0?d:null}function Ye(e,t,n){const s=n?be(e,n):Se(e,t.element,t.useFirstChild);return Array.isArray(s)&&s.length===0?null:s}function Ue(e,t,n,s,i){(Array.isArray(n)?n:[n]).forEach(r=>{W[e.trigger]?.add(r,r,{triggerType:t.triggerType},e.params||{},{selectorCondition:i,animation:s,allowA11yTriggers:w.allowA11yTriggers})})}function un(e,t,n){const o=(e.useFirstChild?e.element.firstElementChild:e.element)?.querySelector(t);if(!o)return n.map((a,l)=>l);const r=Array.from(o.children);return n.map(a=>{const l=r.indexOf(a);return l>=0?l:r.length})}function ao(e,t,n,s,i){s.sequences?.forEach(o=>{let r;if(ro(o)){const p=n.dataCache.sequences[o.sequenceId];if(!p){console.warn(`Interact: Sequence "${o.sequenceId}" not found in cache`);return}r={...p,...o}}else r=o;const a=r.sequenceId||ne(),l=A(`${e}::seq::${a}`,e);if(n.addedInteractions[l]&&!i)return;const u=i&&s.listContainer?{controllerKey:e,listContainer:s.listContainer,elements:i}:void 0,c=ln(r,s,l,e,t,n,{updateKey:e,onUpdate:()=>t.update()},u);if(!c)return;if(i&&n.addedInteractions[l]){const p=un(t,s.listContainer,i);w.addToSequence(l,c,p);const h=w.getSequence(l,Be(r,s,n),c),g=x(s.conditions||[],n.dataCache.conditions),v=Ye(s,t,i);v&&Ue(s,r,v,h,g);return}const f=w.getSequence(l,Be(r,s,n),c),d=x(s.conditions||[],n.dataCache.conditions),m=Ye(s,t,i);m&&(n.addedInteractions[l]=!0,Ue(s,r,m,f,d))})}function co(e,t,n,s,i){const o=n.get(e)?.sequences||{};Object.keys(o).forEach(a=>{o[a].some(({sequence:u,...c})=>{const f=F(c.conditions||[],n.dataCache.conditions);if(f&&!f.matches)return!1;const d=c.key&&A(c.key,e),m=w.getController(d);if(!m)return!0;const p=u.sequenceId||ne(),h=A(`${d}::seq::${p}`,d);if(n.addedInteractions[h]&&!i||z(d,c))return!0;const v=ln(u,c,h,d,m,n,{updateKey:e,onUpdate:()=>t.update()},i&&s?{controllerKey:e,listContainer:s,elements:i}:void 0);if(!v)return!0;if(i&&n.addedInteractions[h]){const b=un(t,s,i);return w.addToSequence(h,v,b),!0}const y=w.getSequence(h,Be(u,c,n),v),$=x(c.conditions||[],n.dataCache.conditions),E=Ye(c,m);return E&&(n.addedInteractions[h]=!0,Ue(c,u,E,y,$)),!0})})}function fn(e,t,n,s,i){const o=n.get(e),r=o?.effects||{},a=Object.keys(r),l=[];a.forEach(c=>{const f=A(c,e);if(n.addedInteractions[f]&&!i)return;r[c].some(({effect:m,...p},h)=>{const g=F(p.conditions||[],n.dataCache.conditions);if(g&&!g.matches)return!1;const v=m.effectId,y={...n.dataCache.effects[v]||{},...m,effectId:v};if(s&&y.listContainer!==s)return!1;const $=_e(y,n,{id:`${f}::${h}`,key:e,onUpdate:()=>{t.update()}},{policy:p.reducedMotionPolicy});if($){const E=p.key&&A(p.key,e),b=w.getController(E);if(!b||z(E,p)||z(e,$))return!0;Me(t,t.element,$,e,"effect"),$.listContainer&&t.watchChildList($.listContainer);const[S,T]=on(p,$,b.element,b.useFirstChild,t.element,t.useFirstChild,void 0,i);if(!S||!T)return!0;n.addedInteractions[f]=!0;const I=x($.conditions||[],n.dataCache.conditions);return l.push([e,p,$,S,T,I,t.useFirstChild,E||void 0]),!0}return!1})}),l.reverse().forEach(c=>{rn(...c)}),co(e,t,n,s,i);const u=Object.keys(o?.sequences||{}).length>0;return a.length>0||u}function Et(e,t,n,s,i,o,r,a,l){let u;if(Ft(i)){const f={key:e,effectId:i.effectId,transition:i.transition,transitionProperties:i.transitionProperties,childSelector:V(i,{asCombinator:!0,addItemFilter:!0,useFirstChild:a}),selectorCondition:r};if(u=w.getController(e),!u)return;u.renderStyle(ms(f))}let c;if(n==="animationEnd"){const f=o.effectId,d=l?w.getInstance(l):void 0,m=d?.dataCache.effects[f],p=m&&_e(m,d,{id:`${l}::animationEnd::${f}`,key:l,onUpdate:()=>{w.getController(l)?.update()}});p&&(c=N(p))}W[n]?.add(t,s,i,o,{targetController:u,selectorCondition:r,allowA11yTriggers:w.allowA11yTriggers,sourceAnimationOptions:c})}function wt(e){const t=e.key,n=w.getInstance(t);if(!n)return console.warn(`No instance found for key: ${t}`),w.setController(t,e),!1;const{triggers:s=[]}=n?.get(t)||{},i=s.length>0;n.setController(t,e),s.forEach((r,a)=>{const l=F(r.conditions,n.dataCache.conditions);if(l){const u=`${t}::trigger::${a}`;n.setupMediaQueryListener(u,l,t,()=>{e.update()})}if(!l||l.matches){if(z(t,r))return;Me(e,e.element,r,t,"interaction"),r.listContainer&&e.watchChildList(r.listContainer),an(t,e,n,r)}});let o=!1;return n&&(o=fn(t,e,n)),i||o}function lo(e,t,n){const s=e.key,i=w.getInstance(s);if(i){const{triggers:o=[]}=i?.get(s)||{};o.forEach((r,a)=>{if(r.listContainer!==t)return;const l=F(r.conditions,i.dataCache.conditions);if(l){const u=`${s}::listTrigger::${t}::${a}`;i.setupMediaQueryListener(u,l,s,()=>{e.update()})}if(!l||l.matches){if(z(s,r))return;an(s,e,i,r,n)}}),fn(s,e,i,t,n)}}function uo(e,t=!1){const n=e.key,s=w.getInstance(n);if(!s)return;const i=[...s.get(n)?.selectors.values()||[]].filter(Boolean).join(",");let o;i?(o=[...e.element.querySelectorAll(i)],e.useFirstChild||o.push(e.element)):o=[e.element],dn(o),s.deleteController(n,t)}function dn(e){const t=Object.values(W);for(const n of e)for(const s of t)s.remove(n);w.removeFromSequences(e)}const Le="interactEffect";class hn{element;key;connected;sheet;useFirstChild;_observers;_pluginCleanups;_appliedPlugins;constructor(t,n,s){this.element=t,this.key=n,this.connected=!1,this.sheet=null,this._observers=new WeakMap,this._pluginCleanups=[],this._appliedPlugins=new WeakSet,this.useFirstChild=s?.useFirstChild??!1}connect(t){if(this.connected)return;const n=this.element.dataset.interactKey;if(t=t||this.key||n,!t){console.warn("Interact: No key provided");return}n!==t&&(n&&console.warn(`Interact: Key mismatch between element ${n} and parameter ${t}, updating element key`),this.element.dataset.interactKey=t),this.key=t,this.connected=wt(this)}disconnect({removeFromCache:t=!1}={}){if((this.key||this.element.dataset.interactKey)&&uo(this,t),this._pluginCleanups.length){for(const s of this._pluginCleanups)try{s()}catch(i){console.error(i)}this._pluginCleanups.length=0}if(this._appliedPlugins=new WeakSet,this.sheet){const s=this.element?.getRootNode(),i=s.host?s:document;i.adoptedStyleSheets.indexOf(this.sheet)!==-1&&(i.adoptedStyleSheets=i.adoptedStyleSheets.filter(r=>r!==this.sheet))}this._observers=new WeakMap,this.sheet=null,this.connected=!1}update(){this.disconnect(),this.connect()}resume(){this.connected&&wt(this)}renderStyle(t){const n=this.element?.getRootNode(),s=n.host?n:document;if(!this.sheet)this.sheet=new CSSStyleSheet,this.sheet.replaceSync(t.join(`
|
|
28
|
-
`)),s.adoptedStyleSheets=[...s.adoptedStyleSheets||[],this.sheet];else{let i=this.sheet.cssRules.length;for(const o of t)try{this.sheet.insertRule(o,i),i++}catch(r){console.error(r)}}}toggleEffect(t,n,s,i){if(s===null)return;if(!i&&this.element.toggleEffect){this.element.toggleEffect(t,n,s);return}const o=new Set(this.element.dataset[Le]?.split(" ")||[]);n==="toggle"?o.has(t)?o.delete(t):o.add(t):n==="add"?o.add(t):n==="remove"?o.delete(t):n==="clear"&&o.clear(),(s||this.element).dataset[Le]=Array.from(o).join(" ")}getActiveEffects(){const n=(this.element.dataset[Le]||"").trim();return n?n.split(/\s+/):[]}watchChildList(t){const n=this.element.querySelector(t);if(n){let s=this._observers.get(n);s||(s=new MutationObserver(this._childListChangeHandler.bind(this,t)),this._observers.set(n,s),s.observe(n,{childList:!0}))}}_childListChangeHandler(t,n){const s=this.key||this.element.dataset.interactKey,i=[],o=[];n.forEach(r=>{r.removedNodes.forEach(a=>{a instanceof HTMLElement&&i.push(a)}),r.addedNodes.forEach(a=>{a instanceof HTMLElement&&o.push(a)})}),dn(i),s&&lo(this,t,o)}}function fo(e,t){new hn(e,t).connect()}function ho(e){const t=w.getController(e);t&&t.disconnect({removeFromCache:!0})}exports.I=hn;exports.a=w;exports.b=fo;exports.g=Bs;exports.r=ho;
|
|
29
|
-
//# sourceMappingURL=index-CeIuoLxG.js.map
|