@wix/interact 2.0.3 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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-BZL18ynN.mjs +2750 -0
- package/dist/index-BZL18ynN.mjs.map +1 -0
- package/dist/index-IaOsZpFD.js +18 -0
- package/dist/index-IaOsZpFD.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/core/Interact.d.ts +9 -1
- package/dist/types/core/Interact.d.ts.map +1 -1
- package/dist/types/core/add.d.ts.map +1 -1
- package/dist/types/handlers/animationEnd.d.ts +1 -1
- package/dist/types/handlers/animationEnd.d.ts.map +1 -1
- package/dist/types/handlers/effectHandlers.d.ts +2 -1
- package/dist/types/handlers/effectHandlers.d.ts.map +1 -1
- package/dist/types/handlers/eventTrigger.d.ts +1 -1
- package/dist/types/handlers/eventTrigger.d.ts.map +1 -1
- package/dist/types/handlers/viewEnter.d.ts +1 -1
- package/dist/types/handlers/viewEnter.d.ts.map +1 -1
- package/dist/types/types.d.ts +29 -2
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/rules/MASTER-CLEANUP-PLAN.md +286 -0
- package/rules/click.md +12 -31
- package/rules/full-lean.md +26 -4
- package/rules/hover.md +68 -153
- package/rules/integration.md +17 -85
- package/rules/pointermove.md +32 -57
- package/rules/scroll-list.md +82 -280
- package/rules/viewenter.md +65 -90
- package/rules/viewprogress.md +139 -845
- package/dist/index-BfcN_rkn.mjs +0 -2338
- package/dist/index-BfcN_rkn.mjs.map +0 -1
- package/dist/index-HXLBEIjG.js +0 -18
- package/dist/index-HXLBEIjG.js.map +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";function it(e){return[...e.matchAll(/\[([-\w]+)]/g)].map(([t,n])=>n)}function C(e,t){const n=it(t);let s=0;return n.length?e.replace(/\[]/g,()=>{const i=n[s++];return i!==void 0?`[${i}]`:"[]"}):e}class N{animations;options;ready;isCSS;constructor(t,n){this.animations=t,this.options=n,this.ready=n?.measured||Promise.resolve(),this.isCSS=t[0]instanceof CSSAnimation}getProgress(){return this.animations[0]?.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:r}=n.effect.getTiming(),o=(Number.isFinite(i)?i:0)*(Number.isFinite(r)?r:1);n.currentTime=((s||0)+o)*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=new Event("animationend");s.dispatchEvent(i)}}t()}catch(n){console.warn("animation was interrupted - aborting onFinish callback - ",n)}}get finished(){return Promise.all(this.animations.map(t=>t.finished))}get playState(){return this.animations[0]?.playState}getTimingOptions(){return this.animations.map(t=>{const n=t.effect?.getTiming(),s=n?.delay??0,i=Number(n?.duration)||0,r=n?.iterations??1;return{delay:s,duration:i,iterations:r}})}}const Re=e=>e,rt=e=>1-Math.cos(e*Math.PI/2),ot=e=>Math.sin(e*Math.PI/2),ct=e=>-(Math.cos(Math.PI*e)-1)/2,at=e=>e**2,ft=e=>1-(1-e)**2,lt=e=>e<.5?2*e**2:1-(-2*e+2)**2/2,ut=e=>e**3,dt=e=>1-(1-e)**3,ht=e=>e<.5?4*e**3:1-(-2*e+2)**3/2,mt=e=>e**4,pt=e=>1-(1-e)**4,gt=e=>e<.5?8*e**4:1-(-2*e+2)**4/2,vt=e=>e**5,yt=e=>1-(1-e)**5,Et=e=>e<.5?16*e**5:1-(-2*e+2)**5/2,wt=e=>e===0?0:2**(10*e-10),bt=e=>e===1?1:1-2**(-10*e),St=e=>e===0?0:e===1?1:e<.5?2**(20*e-10)/2:(2-2**(-20*e+10))/2,It=e=>1-Math.sqrt(1-e**2),Tt=e=>Math.sqrt(1-(e-1)**2),Ot=e=>e<.5?(1-Math.sqrt(1-4*e**2))/2:(Math.sqrt(-(2*e-3)*(2*e-1))+1)/2,Ct=e=>2.70158*e**3-1.70158*e**2,_t=e=>1+2.70158*(e-1)**3+1.70158*(e-1)**2,kt=(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,we={linear:Re,sineIn:rt,sineOut:ot,sineInOut:ct,quadIn:at,quadOut:ft,quadInOut:lt,cubicIn:ut,cubicOut:dt,cubicInOut:ht,quartIn:mt,quartOut:pt,quartInOut:gt,quintIn:vt,quintOut:yt,quintInOut:Et,expoIn:wt,expoOut:bt,expoInOut:St,circIn:It,circOut:Tt,circInOut:Ot,backIn:Ct,backOut:_t,backInOut:kt},be={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 At(e){return e==="percentage"?"%":e||"px"}function B(e){return e?be[e]||e:be.linear}function xt(e,t,n,s){const i=3*e,r=3*(n-e)-i,o=1-i-r,c=3*t,u=3*(s-t)-c,f=1-c-u,a=d=>((o*d+r)*d+i)*d,l=d=>((f*d+u)*d+c)*d,m=d=>(3*o*d+2*r)*d+i;function g(d){let h=d;for(let v=0;v<8;v++){const w=a(h)-d;if(Math.abs(w)<1e-7)return h;const b=m(h);if(Math.abs(b)<1e-6)break;h-=w/b}let p=0,y=1;for(h=(p+y)/2;y-p>1e-7;){const v=a(h);if(Math.abs(v-d)<1e-7)return h;d>v?p=h:y=h,h=(p+y)/2}return h}return d=>d<=0?0:d>=1?1:l(g(d))}function qt(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]),r=parseFloat(t[4]);if(![n,s,i,r].some(isNaN))return xt(n,s,i,r)}function Lt(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 c=o.split(/\s+/),u=parseFloat(c[0]);if(isNaN(u))return;const f=[];for(let a=1;a<c.length;a++)if(c[a].endsWith("%")){const l=parseFloat(c[a])/100;if(isNaN(l))return;f.push(l)}f.length===0?s.push({output:u,pos:null}):f.length===1?s.push({output:u,pos:f[0]}):(s.push({output:u,pos:f[0]}),s.push({output:u,pos:f[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 u=s[o].pos,f=s[c].pos,a=c-o;for(let l=o+1;l<c;l++)s[l].pos=u+(f-u)*(l-o)/a;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 u=0,f=r.length-1;for(;u<f-1;){const m=u+f>>>1;r[m].pos<=o?u=m:f=m}const a=r[u],l=r[f];return l.pos===a.pos?l.output:a.output+(l.output-a.output)*(o-a.pos)/(l.pos-a.pos)}}function ze(e){if(!e)return;const t=we[e];return t||(qt(e)??Lt(e)??we.linear)}class Mt extends N{animationGroups;delay;offset;offsetEasing;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.offsetEasing=typeof n.offsetEasing=="function"?n.offsetEasing:ze(n.offsetEasing)??Re,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(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(){const t=this.calculateOffsets(),n=this.getSequenceActiveDuration(t);this.animationGroups.forEach((s,i)=>{s.animations.forEach((r,o)=>{const c=r.effect;if(!c)return;const{delay:u,duration:f,iterations:a}=this.timingOptions[i][o],l=u+t[i],m=n-(l+f*a);c.updateTiming({delay:l+this.delay,endDelay:m})})})}getSequenceActiveDuration(t){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:u,iterations:f}=o;return Math.max(r,c+u*f)},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 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((u,f)=>u+f.animations.length,0);this.animations.splice(c,0,...o)}this.applyOffsets(),this.ready=Promise.all(this.animationGroups.map(s=>s.ready)).then(()=>{})}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 $t{_animation;customEffect;progress;_tickCbId;_finishHandler;constructor(t,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=>t(r.target,c),this._finishHandler=c=>{this.effect.target?.getAnimations().find(u=>u===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 Pt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var K={exports:{}},Se=K.exports,Ie;function Ft(){return Ie||(Ie=1,(function(e){(function(t){var n=function(){},s=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.msRequestAnimationFrame||function(a){return setTimeout(a,16)};function i(){var a=this;a.reads=[],a.writes=[],a.raf=s.bind(t)}i.prototype={constructor:i,runTasks:function(a){for(var l;l=a.shift();)l()},measure:function(a,l){var m=l?a.bind(l):a;return this.reads.push(m),r(this),m},mutate:function(a,l){var m=l?a.bind(l):a;return this.writes.push(m),r(this),m},clear:function(a){return c(this.reads,a)||c(this.writes,a)},extend:function(a){if(typeof a!="object")throw new Error("expected object");var l=Object.create(this);return u(l,a),l.fastdom=this,l.initialize&&l.initialize(),l},catch:null};function r(a){a.scheduled||(a.scheduled=!0,a.raf(o.bind(null,a)))}function o(a){var l=a.writes,m=a.reads,g;try{n("flushing reads",m.length),a.runTasks(m),n("flushing writes",l.length),a.runTasks(l)}catch(d){g=d}if(a.scheduled=!1,(m.length||l.length)&&r(a),g)if(n("task errored",g.message),a.catch)a.catch(g);else throw g}function c(a,l){var m=a.indexOf(l);return!!~m&&!!a.splice(m,1)}function u(a,l){for(var m in l)l.hasOwnProperty(m)&&(a[m]=l[m])}var f=t.fastdom=t.fastdom||new i;e.exports=f})(typeof window<"u"?window:typeof Se<"u"?Se:globalThis)})(K)),K.exports}var Rt=Ft();const I=Pt(Rt),fe={};function zt(e){Object.assign(fe,e)}function Ht(e){return e in fe?fe[e]:(console.warn(`${e} not found in registry. Please make sure to import and register the preset.`),null)}function L(e,t){return e?document.getElementById(e):null}function Nt(e,t){return e?.matches(`[data-motion-part~="${t}"]`)?e:e?.querySelector(`[data-motion-part~="${t}"]`)}function Dt(e){const t=e.alternate?"alternate":"";return e.reversed?`${t?`${t}-`:""}reverse`:t||"normal"}function re(e){return`${e.value}${At(e.unit)}`}function Te(e,t,n){return`${e.name||"cover"} ${n&&e.offset.unit!=="percentage"?`calc(100% + ${re(e.offset)}${t?` + ${t}`:""})`:t?`calc(${re(e.offset)} + ${t})`:re(e.offset)}`}function Gt(e){return{start:Te(e.startOffset,e.startOffsetAdd),end:Te(e.endOffset,e.endOffsetAdd,!0)}}function He(e){return t=>I.measure(()=>t(e))}function Ne(e){return t=>I.mutate(()=>t(e))}function Z(e){if(e.namedEffect){const t=e.namedEffect.type;return typeof t=="string"?Ht(t):null}else if(e.keyframeEffect){const t=s=>{const{name:i,keyframes:r}=s.keyframeEffect;return[{...s,name:i,keyframes:r}]};return{web:t,style:t,getNames:s=>{const{effectId:i}=s,{name:r}=s.keyframeEffect,o=r||i;return o?[o]:[]}}}else if(e.customEffect)return t=>[{...t,keyframes:[]}];return null}function Vt(e,t,n){return e.map((s,i)=>{const r={fill:s.fill,easing:B(s.easing),iterations:s.iterations===0?1/0:s.iterations||1,composite:s.composite,direction:Dt(s)};return De(t)?(r.duration=s.duration,r.delay=s.delay||0):window.ViewTimeline&&t?.trigger==="view-progress"?r.duration="auto":(r.duration=99.99,r.delay=.01),{effect:s,options:r,id:n&&`${n}-${i+1}`,part:s.part}})}function De(e){return!e||e.trigger!=="pointer-move"&&e.trigger!=="view-progress"}function Oe(e,t,n,s,i){if(e){if(De(s)&&(t.duration=t.duration||1,i?.reducedMotion))if(t.iterations===1||t.iterations==null)t={...t,duration:1};else return[];let r;return n instanceof HTMLElement&&(r={measure:He(n),mutate:Ne(n)}),e.web?e.web(t,r,i):e(t,r,i)}return[]}function ve(e,t,n,s,i){const r=e instanceof HTMLElement?e:L(e);if(n?.trigger==="pointer-move"&&!t.keyframeEffect){let m=t;t.customEffect&&(m={...t,namedEffect:{id:"",type:"CustomMouse"}});const g=Z(m),d=Oe(g,t,r,n,s);return typeof d!="function"?null:d(r)}const o=Z(t),c=Oe(o,t,r,n,s);if(!c||c.length===0)return null;const u=Vt(c,n,t.effectId);let f;const a=n?.trigger==="view-progress";a&&window.ViewTimeline&&(f=new ViewTimeline({subject:n.element||L(n.componentId)}));const l=u.map(({effect:m,options:g,id:d,part:h})=>{const p=h?Nt(r,h):r,y=new KeyframeEffect(p||null,[],g);I.mutate(()=>{"timing"in m&&y.updateTiming(m.timing),y.setKeyframes(m.keyframes)});const v=a&&f?{timeline:f}:{},w=typeof m.customEffect=="function"?new $t(m.customEffect,p||null,g,v):new Animation(y,v.timeline);if(a)if(f)I.mutate(()=>{const{start:b,end:S}=Gt(m);w.rangeStart=b,w.rangeEnd=S,w.play()});else{const{startOffset:b,endOffset:S}=t;I.mutate(()=>{const T=m.startOffset||b,P=m.endOffset||S;Object.assign(w,{start:{name:T.name,offset:T.offset?.value,add:m.startOffsetAdd},end:{name:P.name,offset:P.offset?.value,add:m.endOffsetAdd}})})}return d&&(w.id=d),w});return new N(l,{...t,trigger:{...n||{}},measured:new Promise(m=>I.mutate(m))})}function jt(e,t,n){const s=Z(t),i=e instanceof HTMLElement?e:L(e);if(s&&s.prepare&&i){const r={measure:He(i),mutate:Ne(i)};s.prepare(t,r)}n&&I.mutate(n)}function Wt(e,t){const n=Z(t);if(!n)return null;if(!n.style)return t.effectId&&e?Yt(e,t.effectId):null;const s=n.getNames(t),r=(typeof e=="string"?L(e):e)?.getAnimations(),o=r?.map(u=>u.animationName)||[],c=[];return s.forEach(u=>{o.includes(u)&&c.push(r?.find(f=>f.animationName===u))}),c?.length?new N(c):null}function Yt(e,t){const s=(typeof e=="string"?L(e):e)?.getAnimations().filter(i=>{const r=i.id||i.animationName;return r?r.startsWith(t):!0});return s?.length?new N(s):null}function Ge(e,t,n,s={}){const{disabled:i,allowActiveEvent:r,...o}=s,c=ve(e,t,n,o);if(!c)return null;let u={};if(n.trigger==="view-progress"&&!window.ViewTimeline){const f=n.element||L(n.componentId),{ready:a}=c;return c.animations.map(l=>({get start(){return l.start},get end(){return l.end},viewSource:f,ready:a,getProgress(){return c.getProgress()},effect(m,g){const{activeDuration:d}=l.effect.getComputedTiming(),{delay:h}=l.effect.getTiming();l.currentTime=((h||0)+(d||0))*g},disabled:i,destroy(){l.cancel()}}))}else if(n.trigger==="pointer-move"){const f=t,{centeredToTarget:a,transitionDuration:l,transitionEasing:m}=f,g=n.axis;if(f.keyframeEffect){const d=c;return d.animations?.length===0?null:{target:void 0,centeredToTarget:a,ready:d.ready,_currentProgress:0,getProgress(){return this._currentProgress},effect(p,y){const v=g==="x"?y.x:y.y;this._currentProgress=v,d.progress(v)},disabled:i??!1,destroy(){d.cancel()}}}u={centeredToTarget:a,allowActiveEvent:r},t.customEffect&&l&&(u.transitionDuration=l,u.transitionEasing=ze(m)),u.target=c.target}return{...u,getProgress(){return c.getProgress()},effect(f,a,l,m){c.progress(l?{...a,v:l,active:m}:a)},disabled:i,destroy(){c.cancel()}}}function ne(e,t,n,s=!1){const i=Wt(e,t);return i?(i.ready=new Promise(r=>{jt(e,t,r)}),i):ve(e,t,n,{reducedMotion:s})}function Bt(e){return e===null?[null]:typeof e=="string"?Array.from(document.querySelectorAll(e)):Array.isArray(e)?e:[e]}function Ve(e,t){const n=[];for(const{target:s,options:i}of e){const r=Bt(s);for(const o of r){const c=ne(o,i,void 0,t?.reducedMotion);c instanceof N&&n.push(c)}}return n}function Kt(e,t,n){const s=Ve(t,n);return new Mt(s,e)}function Q(e,t){return t.includes("&")?t.replace(/&/g,e):`${e}${t}`}function x(){return"wi-12343210".replace(/\d/g,e=>String.fromCharCode((+e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+e/4)+97))}function Qt({key:e,effectId:t,transition:n,properties:s,childSelector:i="> :first-child",selectorCondition:r}){let o=[];if(n?.styleProperties){const{duration:d,easing:h,delay:p}=n;d&&(n.styleProperties.some(v=>v.name.startsWith("--"))?o=[`all ${d}ms ${B(h||"ease")}${p?` ${p}ms`:""}`,"visibility 0s"]:o=n.styleProperties.map(v=>`${v.name} ${d}ms ${B(h||"ease")}${p?` ${p}ms`:""}`)),s=n.styleProperties}else o=s?.filter(d=>d.duration).map(d=>`${d.name} ${d.duration}ms ${B(d.easing)||"ease"}${d.delay?` ${d.delay}ms`:""}`)||[];const c=s?.map(d=>`${d.name}: ${d.value};`)||[],u=e.replace(/"/g,"'"),f=`:is(:state(${t}), :--${t}) ${i}`,a=`[data-interact-effect~="${t}"] ${i}`,l=r?Q(f,r):f,m=r?Q(a,r):a,g=[`${l},
|
|
2
|
+
${m} {
|
|
3
|
+
${c.join(`
|
|
4
|
+
`)}
|
|
5
|
+
}`];if(o.length){const d=`[data-interact-key="${u}"] ${i}`,h=r?Q(d,r):d;g.push(`@media (prefers-reduced-motion: no-preference) { ${h} {
|
|
6
|
+
transition: ${o.join(", ")};
|
|
7
|
+
} }`)}return g}function _(e,t){const n=(e||[]).filter(r=>t[r]?.type==="media"&&t[r].predicate).map(r=>t[r].predicate).join(") and ("),s=n&&`(${n})`;return s&&window.matchMedia(s)}function M(e,t){for(const n of e||[]){const s=t[n];if(s?.type==="selector"&&s.predicate)return s.predicate}}const G={rangeStart:{name:"cover",offset:{value:0,unit:"percentage"}},rangeEnd:{name:"cover",offset:{value:100,unit:"percentage"}}};function Xt(e,t){const n=e?.name??G.rangeStart.name,s=t?.name??e?.name??G.rangeEnd.name,i={name:n,offset:e?.offset||G.rangeStart.offset},r={name:s,offset:t?.offset||G.rangeEnd.offset};return{startOffset:i,endOffset:r}}function $(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:r}=Xt(t,n);return{id:"",startOffset:i,endOffset:r,...s}}function O(e,t,n){let s=e.get(t);s||(s=new Set,e.set(t,s)),s.add(n)}function D(e,t){e.get(t)?.forEach(s=>{const{source:i,target:r,cleanup:o}=s;o();const c=i===t?r:i;e.get(c)?.delete(s)}),e.delete(t)}const Ut={root:null,rootMargin:"0px 0px -10% 0px",threshold:[0]},Jt={root:null,rootMargin:"0px",threshold:[0]},z={},ee=new WeakMap,X=new WeakSet,U=new WeakMap;let je={},F=null;function Zt(e){je=e}function We(e,t){ee.get(e)?.forEach(({source:s,handler:i})=>{s===e&&i(t)})}function Ce(){return F||(F=new IntersectionObserver(e=>{e.forEach(t=>{const n=t.target;t.isIntersecting||We(n,!1)})},Jt),F)}function Ye(e,t=!1){const n=JSON.stringify({...e,isSafeMode:t});if(z[n])return z[n];const s=t?Ut:{root:null,rootMargin:e.inset?`${e.inset} 0px ${e.inset}`:"0px",threshold:e.threshold},i=new IntersectionObserver(r=>{r.forEach(o=>{const c=o.target,u=!X.has(c);if(u&&(X.add(c),e.useSafeViewEnter&&!o.isIntersecting)){I.measure(()=>{const a=o.boundingClientRect.height,l=o.rootBounds?.height;if(!l)return;const m=Array.isArray(e.threshold)?Math.min(...e.threshold):e.threshold;m&&a*m>l&&I.mutate(()=>{i.unobserve(c);const d=Ye(e,!0);U.set(c,d),d.observe(c)})});return}const f=e.type||"once";(o.isIntersecting||f==="alternate"&&!u)&&(We(c,o.isIntersecting),f==="once"&&(i.unobserve(o.target),X.delete(c)))})},s);return z[n]=i,i}function en(e,t,n,s={},{reducedMotion:i,selectorCondition:r,animation:o}={}){const c={...je,...s},u=c.type||"once",f=o||ne(t,$(n),void 0,i);if(!f)return;const a=Ye(c);u!=="once"&&f.persist?.();let l=!0;const d={source:e,target:t,handler:h=>{r&&!t.matches(r)||(u==="once"?h&&f.play(()=>{const p=()=>{t.dataset.interactEnter="start"};f.isCSS?(I.mutate(()=>{requestAnimationFrame(p)}),f.onFinish(()=>{I.mutate(()=>{t.dataset.interactEnter="done"})})):I.mutate(p)}):u==="alternate"?l&&h?(l=!1,f.play()):l||f.reverse():u==="repeat"?h?(f.progress(0),f.play()):(f.pause(),f.progress(0)):u==="state"&&(h?f.play():f.pause()))},cleanup:()=>{(U.get(e)||a).unobserve(e),(u==="repeat"||u==="state")&&Ce().unobserve(e),f.cancel(),X.delete(e),U.delete(e)}};O(ee,e,d),O(ee,t,d),U.set(e,a),a.observe(e),(u==="repeat"||u==="state")&&Ce().observe(e)}function tn(e){D(ee,e)}function nn(){F=null,Object.keys(z).forEach(e=>delete z[e])}const _e={add:en,remove:tn,setOptions:Zt,reset:nn};function Be(e,t){return Object.assign(Object.create(t),e)}function sn(e,t,n,s){let i=e*(1-n)+t*n;if(s){const r=i-e;Math.abs(r)<s&&(i=e+s*Math.sign(r));const o=t-i;if(Math.abs(o)<s)return t}return i}function rn(e){let t=!1;return function(){t||(t=!0,window.requestAnimationFrame(()=>{t=!1,e()}))}}function ke(e,t){let n=0;return function(){n&&window.clearTimeout(n),n=window.setTimeout(()=>{n=0,e()},t)}}function on(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 te(n[1],t)+te(n[6],t)}function te(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)?on(e,t):parseInt(e)||0:0}function A(e,t,n){const{name:s,offset:i=0}=e,{start:r,end:o}=n,c=o-r,u=i/100;let f,a;return s==="entry"?(f=r-t,a=Math.min(t,c)):s==="entry-crossing"?(f=r-t,a=c):s==="contain"?(f=Math.min(o-t,r),a=Math.abs(t-c)):s==="exit"?(f=Math.max(r,o-t),a=Math.min(t,c)):s==="exit-crossing"?(f=r,a=c):s==="cover"&&(f=r-t,a=c+t),f+u*a|0}function oe(e,t,n,s,i){let r=0;const o={start:t,end:n};return e.forEach((c,u)=>{r+=c.offset;const f=c.sticky;if(f){if("end"in f&&e[u-1]?.element){const m=((i?c.element.offsetWidth:c.element.offsetHeight)||0)+f.end-s,g=r+m-c.offset,d=g<o.start,h=!d&&g<=n;let p=0;(d||h)&&(p=c.offset,o.end+=p),d&&(o.start+=p)}if("start"in f){const a=r-f.start,l=a<o.start,m=!l&&a<=o.end;let g=0;const d=e[u-1]?.element;if(d){if(l||m){const h=(i?d.offsetWidth:d.offsetHeight)||0,p=c.offset,y=(i?c.element.offsetWidth:c.element.offsetHeight)||0;g=h-(p+y),r+=g,o.end+=g}l&&(o.start+=g)}}}}),o}function cn(e,t,n,s,i,r){const{start:o,end:c,duration:u}=e;let f=o,a=c,l=e.startRange,m=e.endRange,g;if(typeof u=="string"){l={name:u,offset:0},m={name:u,offset:100},f=A(l,n,t),a=A(m,n,t),g=a-f;const d=oe(r,f,a,n,s);f=d.start,a=d.end}else{if(l||o?.name){l=l||o;const d=te(l.add,i),h=A({...l,offset:0},n,t),p=A({...l,offset:100},n,t),y=oe(r,h,p,n,s);f=y.start+l.offset/100*(y.end-y.start)+d}if(m||c?.name){m=m||c;const d=te(m.add,i),h=A({...m,offset:0},n,t),p=A({...m,offset:100},n,t),y=oe(r,h,p,n,s);a=y.start+m.offset/100*(y.end-y.start)+d}else typeof u=="number"&&(a=f+u)}return!g&&!u&&(g=a-f),{...e,start:f,end:a,startRange:l,endRange:m,duration:g||u}}function an(e){return e.position==="sticky"}function fn(e,t,n){return e.position==="fixed"&&(!t||t===window.document.body||t===n)}function ln(e,t){return parseInt(t?e.left:e.top)}function un(e,t){return parseInt(t?e.right:e.bottom)}function dn(e,t,n){n&&(e.style.position="static");const s=(t?e.offsetLeft:e.offsetTop)||0;return n&&(e.style.position=null),s}function hn(e,t){let n;const s=ln(e,t),i=un(e,t),r=!isNaN(s),o=!isNaN(i);return(r||o)&&(n={},r&&(n.start=s),o&&(n.end=i)),n}function V(e,t,n,s,i){const r=e[0].viewSource,o=[];let c=(s?r.offsetWidth:r.offsetHeight)||0,u=0,f=r;for(;f;){const l=window.getComputedStyle(f),m=an(l),g=m?hn(l,s):void 0,d=dn(f,s,m);if((!g||!("end"in g))&&(u+=d),o.push({element:f,offset:d,sticky:g}),f=f.offsetParent,fn(l,f,t))break;if(f===t){o.push({element:f,offset:0});break}}return o.reverse(),e.map(l=>({...cn(l,{start:u,end:u+c},n,s,i,o)}))}const Ae=100,mn={horizontal:!1,observeViewportEntry:!0,viewportRootMargin:"7% 7%",observeViewportResize:!1,observeSourcesResize:!1,observeContentResize:!1};function pn(e,t,n,s){let i=0;return e>=t&&e<=n?i=s?(e-t)/s:1:e>n&&(i=1),i}function xe(e,t){return e===window?t?window.document.documentElement.clientWidth:window.document.documentElement.clientHeight:t?e.clientWidth:e.clientHeight}function gn(){return{viewportWidth:window.document.documentElement.clientWidth,viewportHeight:window.document.documentElement.clientHeight}}function vn(e){const t=Be(e,mn),n=t.root,s=t.horizontal,i=new WeakMap;let r=xe(n,s),o,c,u,f,a;const l=[],m=gn();if(t.scenes=Object.values(e.scenes.reduce((h,p,y)=>{const v=p.groupId?`group-${p.groupId}`:String(y);return h[v]?h[v].push(p):h[v]=[p],h},{})).flatMap(h=>(h.every(p=>p.viewSource&&(typeof p.duration=="string"||p.start?.name))?(h=V(h,n,r,s,m),(t.observeSourcesResize||t.observeContentResize)&&l.push(h)):h.forEach(p=>{p.end==null&&(p.end=p.start+p.duration),p.duration==null&&(p.duration=p.end-p.start)}),h)),t.scenes.forEach((h,p)=>{h.index=p}),l.length){const h=new Map;window.ResizeObserver&&(u=new window.ResizeObserver(function(p){p.forEach(y=>{const v=h.get(y.target),w=V(v,n,r,s,m);w.forEach((b,S)=>{t.scenes[b.index]=w[S]}),l.splice(l.indexOf(v),1,w)})}),l.forEach(p=>{u.observe(p[0].viewSource,{box:"border-box"}),h.set(p[0].viewSource,p)}),t.observeContentResize&&t.contentRoot&&new window.ResizeObserver(ke(()=>{const y=l.map(v=>{const w=V(v,n,r,s,m);return w.forEach((b,S)=>{t.scenes[b.index]=w[S]}),w});l.length=0,l.push(...y),l.forEach(v=>{h.set(v[0].viewSource,v)})},Ae)).observe(t.contentRoot,{box:"border-box"})),t.observeViewportResize&&(f=ke(function(){r=xe(n,s);const p=l.map(y=>{const v=V(y,n,r,s,m);return v.forEach((w,b)=>{t.scenes[w.index]=v[b]}),v});l.length=0,l.push(...p),l.forEach(y=>{h.set(y[0].viewSource,y)})},Ae),n===window?window.addEventListener("resize",f):window.ResizeObserver&&(a=new window.ResizeObserver(f),a.observe(n,{box:"border-box"})))}t.observeViewportEntry&&window.IntersectionObserver&&(c=new window.IntersectionObserver(function(h){h.forEach(p=>{(i.get(p.target)||[]).forEach(y=>{y.disabled=!p.isIntersecting})})},{root:n===window?window.document:n,rootMargin:t.viewportRootMargin,threshold:0}),t.scenes.forEach(h=>{if(h.viewSource){let p=i.get(h.viewSource);p||(p=[],i.set(h.viewSource,p),c.observe(h.viewSource)),p.push(h)}}));function g({p:h,vp:p}){h=+h.toFixed(1);const y=+p.toFixed(4);if(h!==o){for(let v of t.scenes)if(!v.disabled){const{start:w,end:b,duration:S}=v,T=pn(h,w,b,S);v.effect(v,T,y)}o=h}}function d(){t.scenes.forEach(h=>h.destroy?.()),c&&(c.disconnect(),c=null),u&&(u.disconnect(),u=null),f&&(a?(a.disconnect(),a=null):window.removeEventListener("resize",f))}return{tick:g,destroy:d}}const yn={transitionActive:!1,transitionFriction:.9,transitionEpsilon:1,velocityActive:!1,velocityMax:1};class En{constructor(t={}){this.config=Be(t,yn),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=rn(()=>{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,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),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,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&&(t&&this._lerpFrameId&&window.cancelAnimationFrame(this._lerpFrameId),this._lerpFrameId=window.requestAnimationFrame(()=>this.tick())),s.prevP=s.p}lerp(){this.currentProgress.p=sn(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=vn(this.config)}removeEffect(){this.effect&&this.effect.destroy(),this.effect=null}}const le=new WeakMap;let Ke=()=>({});function wn(e){Ke=e}function bn(e,t,n,s,{reducedMotion:i}){if(i)return;const r={trigger:"view-progress",element:e},o=$(n);let c;if("ViewTimeline"in window){const f=ve(t,o,r);f&&(f.play(),c=()=>{f.ready.then(()=>{f.cancel()})})}else{const f=Ge(t,o,r);if(f){const a=Array.isArray(f)?f:[f],l=new En({viewSource:e,scenes:a,observeViewportEntry:!1,observeViewportResize:!1,observeSourcesResize:!0,root:document.body,...Ke()});c=()=>{l.destroy()},Promise.all(a.map(m=>m.ready||Promise.resolve())).then(()=>{l.start()})}}if(!c)return;const u={source:e,target:t,cleanup:c};O(le,e,u),O(le,t,u)}function Sn(e){D(le,e)}const In={add:bn,remove:Sn,registerOptionsGetter:wn};function qe(e,t,n){return Math.min(Math.max(e,n),t)}function Le(e){let t=!1;return function(){if(!t)return t=!0,window.requestAnimationFrame(()=>{t=!1,e()})}}function Tn(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 On(){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 Cn(){return new Promise(e=>{const t=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!==t&&(window.removeEventListener("scroll",r),i(),e(n))}i(),window.addEventListener("scroll",r),window.scrollY>0&&window.scrollBy(0,-1)})}function _n(e){Cn().then(t=>{e.fixRequired=t,t&&(window.addEventListener("scroll",e.scrollHandler),e.scrollHandler())})}let j=0;const J=new Set;function kn(){const e=n=>{for(let s of n.changedTouches)J.add(s.identifier)},t=n=>{for(let s of n.changedTouches)J.delete(s.identifier)};return document.addEventListener("touchstart",e,{passive:!0}),document.addEventListener("touchend",t,{passive:!0}),function(){J.clear(),document.removeEventListener("touchstart",e),document.removeEventListener("touchend",t)}}function An(e,t){if("onscrollend"in window)return e.addEventListener("scrollend",t),function(){e.removeEventListener("scrollend",t)};let n=0,s;j||(s=kn()),j+=1;function i(r){clearTimeout(n),n=setTimeout(()=>{J.size?setTimeout(i,100):(t(r),n=0)},100)}return e.addEventListener("scroll",i),function(){e.removeEventListener("scroll",i),j-=1,j||s()}}function xn(e,t,n){return{x(s){const i=e.left-n.x+e.width/2,r=i>=t.width/2,o=(r?i:t.width-i)*2,c=r?0:i-o/2;return(s-c)/o},y(s){const i=e.top-n.y+e.height/2,r=i>=t.height/2,o=(r?i:t.height-i)*2,c=r?0:i-o/2;return(s-c)/o}}}function qn(e,t){this.x=window.scrollX,this.y=window.scrollY,requestAnimationFrame(()=>e&&e(t))}function Ln(e){e.rect.width=window.document.documentElement.clientWidth,e.rect.height=window.document.documentElement.clientHeight}function Mn(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 $n(e){let t=!1,n={x:e.rect.width/2,y:e.rect.height/2,vx:0,vy:0},s,i,r,o,c;const u={x:0,y:0};e.scenes.forEach(a=>{a.target&&a.centeredToTarget&&(a.transform=xn(Tn(a.target),e.rect,u),t=!0),e.root?i=Mn(e):(r=Ln.bind(null,e),window.addEventListener("resize",r))}),s=function(a){for(let l of e.scenes)if(!l.disabled){const m=l.transform?.x(a.x)||a.x/e.rect.width,g=l.transform?.y(a.y)||a.y/e.rect.height,d=+qe(0,1,m).toPrecision(4),h=+qe(0,1,g).toPrecision(4),p={x:a.vx,y:a.vy};e.allowActiveEvent&&(a.active=m<=1&&g<=1&&m>=0&&g>=0),l.effect(l,{x:d,y:h},p,a.active)}Object.assign(n,a)},t&&(o=qn.bind(u,s,n),c=An(document,o));function f(){e.scenes.forEach(a=>a.destroy?.()),c?.(),i?(i.disconnect(),i=null):(window.removeEventListener("resize",r),r=null),s=null,n=null}return{tick:s,destroy:f}}const Pn=1e3/60*3;let W;function Fn(){q.x=window.scrollX,q.y=window.scrollY}const q={x:0,y:0,scrollHandler:Fn,fixRequired:void 0};class Rn{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():Le(()=>this.transition()):n=this.config.noThrottle?()=>(this.tick(),null):Le(()=>{this.tick()}),this.config.rect=this.config.root?{width:this.config.root.offsetWidth,height:this.config.root.offsetHeight}:{width:window.document.documentElement.clientWidth,height:window.document.documentElement.clientHeight},this.progress={x:this.config.rect.width/2,y:this.config.rect.height/2,vx:0,vy:0},this.previousProgress={...this.progress},this.currentProgress=null;const s=i=>{const r=this.config.root?i.offsetX:i.x,o=this.config.root?i.offsetY:i.y;this.progress.vx=r-this.progress.x,this.progress.vy=o-this.progress.y,this.progress.x=r,this.progress.y=o,this._nextTick=n()};if(this._pointerLeave=()=>{this.progress.active=!1,this.progress.vx=0,this.progress.vy=0,this._nextTick=n()},this._pointerEnter=()=>{this.progress.active=!0,this._nextTick=n()},this.config.root){W=typeof W=="boolean"?W:On();const i=W?window.devicePixelRatio:1;typeof q.fixRequired>"u"&&_n(q),this._measure=r=>{if(r.target!==this.config.root){const o=new PointerEvent("pointermove",{bubbles:!0,cancelable:!0,clientX:r.x*i+q.x,clientY:r.y*i+q.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 t=this.config.transitionDuration,n=this.config.transitionEasing||(o=>o),s=performance.now();let i=!1;const r=o=>{const c=(o-this._startTime)/t,u=n(Math.min(1,c));i&&(this.progress.vx=0,this.progress.vy=0,i=!1),this.currentProgress=Object.entries(this.progress).reduce((f,[a,l])=>(a==="active"?f[a]=l:f[a]=this.previousProgress[a]+(l-this.previousProgress[a])*u,f),this.currentProgress||{}),c<1&&(this._nextTransitionTick=requestAnimationFrame(r),i=o-this._startTime>Pn),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 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=$n(this.config)}removeEffect(){this.effect&&this.effect.destroy(),this.effect=null}}const ue=new WeakMap;let Qe=()=>({});function zn(e){Qe=e}function Hn(e,t,n,s={},{reducedMotion:i}){if(i)return;const r={trigger:"pointer-move",element:e,axis:s.axis??"y"},o=Ge(t,$(n),r);if(o){const c=Array.isArray(o)?o:[o],u=new Rn({root:s.hitArea==="self"?e:void 0,scenes:c,...Qe()}),a={source:e,target:t,cleanup:()=>{u.destroy()}};O(ue,e,a),O(ue,t,a),Promise.all(c.map(l=>l.ready||Promise.resolve())).then(()=>{u.start()})}}function Nn(e){D(ue,e)}const Dn={add:Hn,remove:Nn,registerOptionsGetter:zn},de=new WeakMap;function Gn(e,t,n,s,{reducedMotion:i,selectorCondition:r,animation:o}){const c=o||ne(t,$(n),void 0,i);if(!c)return;const u=()=>{r&&!t.matches(r)||c.play()},a={source:e,target:t,cleanup:()=>{c.cancel(),e.removeEventListener("animationend",u)}};O(de,e,a),O(de,t,a),e.addEventListener("animationend",u)}function Vn(e){D(de,e)}const jn={add:Gn,remove:Vn};function Wn(e,t,n,s=!1,i,r,o){const c=o||ne(e,$(t),void 0,s);if(!c)return null;let u=!0;const f=n.type||"alternate";return a=>{if(i&&!e.matches(i))return;const l=!r,m=r?.enter?.includes(a.type),g=r?.leave?.includes(a.type);if(m||l){f==="alternate"||f==="state"?u?(u=!1,c.play()):f==="alternate"?c.reverse():f==="state"&&(c.playState==="running"?c.pause():c.playState!=="finished"&&c.play()):(c.progress(0),delete e.dataset.interactEnter,c.isCSS&&c.onFinish(()=>{I.mutate(()=>{e.dataset.interactEnter="done"})}),c.play());return}g&&(f==="alternate"?c.reverse():f==="repeat"?(c.cancel(),I.mutate(()=>{delete e.dataset.interactEnter})):f==="state"&&c.playState==="running"&&c.pause())}}function Yn(e,t,{effectId:n,listContainer:s,listItemSelector:i},r,o,c){const u=!!s,f=r.method||"toggle",a=f==="toggle";return l=>{if(o&&!e.matches(o))return;const m=u?e.closest(`${s} > ${i||""}:has(:scope)`):void 0,g=!c,d=c?.enter?.includes(l.type),h=c?.leave?.includes(l.type);g?t.toggleEffect(n,f,m):(d&&t.toggleEffect(n,a?"add":f,m),h&&a&&t.toggleEffect(n,"remove",m))}}const he=new WeakMap;function Me(e,t){return n=>{const s=n;e.contains(s.relatedTarget)||t(s)}}function Bn(e){return t=>{const n=t;n.pointerType&&e(n)}}function Kn(e){return t=>{const n=t;n.code==="Space"?(n.preventDefault(),e(n)):n.code==="Enter"&&e(n)}}const Qn={focusin:(e,t)=>Me(e,t),focusout:(e,t)=>Me(e,t),click:(e,t)=>Bn(t),keydown:(e,t)=>Kn(t)};function Xn(e,t,n){const s=Qn[e];return s?s(t,n):i=>n(i)}function Un(e){return typeof e=="object"&&!Array.isArray(e)&&("enter"in e||"leave"in e)}function Jn(e){if(typeof e=="string")return{toggle:[e]};if(Array.isArray(e))return{toggle:[...e]};if(Un(e)){const t=e.enter?[...e.enter]:[],n=e.leave?[...e.leave]:[];return{enter:t,leave:n}}return{}}function Zn(e){return!!(e.enter?.length||e.leave?.length)}function es(e){return Zn(e)?{enter:e.enter??[],leave:e.leave??[]}:void 0}function ts(e,t,n,s,{reducedMotion:i,targetController:r,selectorCondition:o,animation:c}){const u=Jn(s.eventConfig),f=n.transition||n.transitionProperties,a=es(u);let l,m=!1;if(f?l=Yn(t,r,n,s,o,a):(l=Wn(t,n,s,i,o,a,c),m=s.type==="once"),!l)return;const g=l,d=new AbortController;function h(v,w,b){const S=Xn(w,e,g);v.addEventListener(w,S,{...b,signal:d.signal})}const y={source:e,target:t,cleanup:()=>{d.abort()}};if(O(he,e,y),O(he,t,y),a){const v=u.enter,w=u.leave;v.forEach(S=>{S==="focusin"&&(e.tabIndex=0),h(e,S,{passive:!0,once:m})}),(f?s.method==="toggle":s.type!=="once")&&w.forEach(S=>{if(S==="focusout"){h(e,S,{once:m});return}h(e,S,{passive:!0})})}else(u.toggle??[]).forEach(w=>{h(e,w,{once:m,passive:w!=="keydown"})})}function ns(e){D(he,e)}const R={add:ts,remove:ns},me={click:["click"],activate:["click","keydown"],hover:{enter:["mouseenter"],leave:["mouseleave"]},interest:{enter:["mouseenter","focusin"],leave:["mouseleave","focusout"]}},$e={click:me.activate,hover:me.interest};function Y(e){const t=me[e];return(n,s,i,r,o)=>{const c=o?.allowA11yTriggers&&e in $e?$e[e]:t;R.add(n,s,i,{...r,eventConfig:c},o??{})}}const k={viewEnter:_e,hover:{add:Y("hover"),remove:R.remove},click:{add:Y("click"),remove:R.remove},pageVisible:_e,animationEnd:jn,viewProgress:In,pointerMove:Dn,activate:{add:Y("activate"),remove:R.remove},interest:{add:Y("interest"),remove:R.remove}};function ss(e){return e.replace(/\[([-\w]+)]/g,"[]")}class E{static defineInteractElement;dataCache;addedInteractions;mediaQueryListeners;listInteractionsCache;controllers;static forceReducedMotion=!1;static allowA11yTriggers=!0;static instances=[];static controllerCache=new Map;static sequenceCache=new Map;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?.useCutsomElement??!!E.defineInteractElement;this.dataCache=rs(t,s);const i=E.defineInteractElement?.();s&&i===!1?document.querySelectorAll("interact-element").forEach(r=>{r.connect()}):E.controllerCache.forEach((r,o)=>r.connect(o))}destroy(){for(const t of this.controllers)t.disconnect();for(const[,t]of this.mediaQueryListeners.entries())t.mql.removeEventListener("change",t.handler);this.mediaQueryListeners.clear(),this.addedInteractions={},this.listInteractionsCache={},this.controllers.clear(),this.dataCache={effects:{},sequences:{},conditions:{},interactions:{}},E.instances.splice(E.instances.indexOf(this),1)}setController(t,n){this.controllers.add(n),E.setController(t,n)}deleteController(t,n=!1){const s=E.controllerCache.get(t);this.clearInteractionStateForKey(t),this.clearMediaQueryListenersForKey(t),s&&n&&(this.controllers.delete(s),E.deleteController(t))}has(t){return!!this.get(t)}get(t){const n=ss(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 r=C(i,t);delete this.addedInteractions[r]});const s=`${t}::seq::`;for(const i of E.sequenceCache.keys())i.startsWith(s)&&(E.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 E;return E.instances.push(s),s.init(t,n),s}static destroy(){E.controllerCache.forEach(t=>{t.disconnect()}),E.instances.length=0,E.controllerCache.clear(),E.sequenceCache.clear()}static setup(t){t.scrollOptionsGetter&&k.viewProgress.registerOptionsGetter?.(t.scrollOptionsGetter),t.pointerOptionsGetter&&k.pointerMove.registerOptionsGetter?.(t.pointerOptionsGetter),t.viewEnter&&k.viewEnter.setOptions(t.viewEnter),t.allowA11yTriggers!==void 0&&(E.allowA11yTriggers=t.allowA11yTriggers)}static getInstance(t){return E.instances.find(n=>n.has(t))}static getController(t){return t?E.controllerCache.get(t):void 0}static setController(t,n){E.controllerCache.set(t,n)}static deleteController(t){E.controllerCache.delete(t)}static registerEffects=zt;static getSequence(t,n,s,i){const r=E.sequenceCache.get(t);if(r)return r;const o=Kt(n,s,i);return E.sequenceCache.set(t,o),o}static addToSequence(t,n,s,i){const r=E.sequenceCache.get(t);if(!r)return!1;const c=Ve(n,i).map((u,f)=>({index:s[f]??r.animationGroups.length,group:u}));return r.addGroups(c),!0}}let is=0;function H(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 Pe(e){return"sequenceId"in e&&!("effects"in e)}function ce(e,t){return e[t]||(e[t]={triggers:[],effects:{},sequences:{},interactionIds:new Set,selectors:new Set}),e[t]}function rs(e,t=!1){const n=e.conditions||{},s={};return e.interactions?.forEach(i=>{const r=i.key,o=++is,{effects:c,sequences:u,...f}=i;if(!r){console.error(`Interaction ${o} is missing a key for source element.`);return}ce(s,r);const a=c?Array.from(c):[];a.reverse();const l=u?.map(d=>{if(Pe(d)){const p=e.sequences?.[d.sequenceId];return p?{...p,...d}:(console.warn(`Interact: Sequence "${d.sequenceId}" not found in config`),d)}const h=d;return h.sequenceId||(h.sequenceId=x()),h}),m={...f,effects:a.length>0?a:void 0,sequences:l};s[r].triggers.push(m),s[r].selectors.add(H(m,{useFirstChild:t}));const g=m.listContainer;a.forEach(d=>{let h=d.key;if(!h&&d.effectId){const w=e.effects[d.effectId];w&&(h=w.key)}d.effectId||(d.effectId=x()),h=h||r,d.key=h;const p=d.effectId;if(g&&d.listContainer&&(h!==r||d.listContainer!==g))return;const y=`${r}::${h}::${p}::${o}`;if(d.interactionId=y,s[r].interactionIds.add(y),h===r)return;const v=ce(s,h);v.effects[y]||(v.effects[y]=[],v.interactionIds.add(y)),v.effects[y].push({...f,effect:d}),v.selectors.add(H(d,{useFirstChild:t}))}),l?.forEach(d=>{if(!d||Pe(d))return;const h=d,p=h.sequenceId||x(),y=h.effects;for(const v of y){v.effectId||(v.effectId=x());let w=v.key;if(!w&&v.effectId){const b=e.effects[v.effectId];b&&(w=b.key)}if(w=w||r,w!==r){const b=ce(s,w),S=`${w}::seq::${p}::${o}`;b.sequences[S]||(b.sequences[S]=[],b.interactionIds.add(S)),b.sequences[S].push({...f,sequence:h}),b.selectors.add(H(v,{useFirstChild:t}))}}})}),{effects:e.effects||{},sequences:e.sequences||{},conditions:n,interactions:s}}function pe(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 ge(e,t){return t.map(n=>e.selector?n.querySelector(e.selector):n).filter(Boolean)}function Xe(e,t,n,s,i,r,o,c){return[o?ge(e,o):pe(e,n,s),c?ge(t,c):pe(t,i,r)]}function Ue(e,t,n,s,i,r,o){const c=Array.isArray(s),u=Array.isArray(i);c?s.forEach((f,a)=>{const l=u?i[a]:i;l&&Fe(e,f,t.trigger,l,n,t.params,r,o)}):(u?i:[i]).forEach(a=>{Fe(e,s,t.trigger,a,n,t.params,r,o)})}function Je(e,t,n,s,i){const r={},o=[];(s.effects||[]).forEach(c=>{const u=c.effectId,f={...n.dataCache.effects[u]||{},...c,effectId:u},a=f.key,l=C(c.interactionId,e);if(r[l]||n.addedInteractions[l]&&!i)return;const m=_(f.conditions||[],n.dataCache.conditions);if(m&&n.setupMediaQueryListener(l,m,e,()=>{t.update()}),!m||m.matches){r[l]=!0;const g=a&&C(a,e);let d;if(g){if(d=E.getController(g),!d)return;f.listContainer&&d.watchChildList(f.listContainer)}else d=t;const[h,p]=Xe(s,f,t.element,t.useFirstChild,d.element,d.useFirstChild,i);if(!h||!p)return;n.addedInteractions[l]=!0;const y=g||s.key,v=M(f.conditions||[],n.dataCache.conditions);o.push([y,s,f,h,p,v,d.useFirstChild])}}),o.reverse().forEach(c=>{Ue(...c)}),cs(e,t,n,s,i)}function os(e){return"sequenceId"in e&&!("effects"in e)}function Ze(e,t,n,s,i,r,o){const c=_(e.conditions||[],i.dataCache.conditions);if(c&&i.setupMediaQueryListener(t,c,r.updateKey,r.onUpdate),c&&!c.matches)return null;const u=e.effects||[],f=[];let a=!1;for(const l of u){const m=l.effectId,d={...m?i.dataCache.effects[m]||{}:{},...l},h=_(d.conditions||[],i.dataCache.conditions);if(h){const T=`${t}::${m||"eff"}`;i.setupMediaQueryListener(T,h,r.updateKey,r.onUpdate)}if(h&&!h.matches)continue;const p=d.key,y=p&&C(p,n);let v;if(y){if(v=E.getController(y),!v)return null}else v=s;const w=y||n;let b;if(o&&w===o.controllerKey&&d.listContainer===o.listContainer?(b=ge(d,o.elements),b.length>0&&(a=!0)):b=pe(d,v.element,v.useFirstChild),!b||Array.isArray(b)&&b.length===0)return null;const S=$(d);f.push({target:b,options:S})}return o&&!a?null:f.length>0?f:null}function et(e,t,n){const r=(e.useFirstChild?e.element.firstElementChild:e.element)?.querySelector(t);if(!r)return n.map((c,u)=>u);const o=Array.from(r.children);return n.map(c=>{const u=o.indexOf(c);return u>=0?u:o.length})}function cs(e,t,n,s,i){s.sequences?.forEach(r=>{let o;if(os(r)){const g=n.dataCache.sequences[r.sequenceId];if(!g){console.warn(`Interact: Sequence "${r.sequenceId}" not found in cache`);return}o={...g,...r}}else o=r;const c=o.sequenceId||x(),u=C(`${e}::seq::${c}`,e);if(n.addedInteractions[u]&&!i)return;const f=i&&s.listContainer?{controllerKey:e,listContainer:s.listContainer,elements:i}:void 0,a=Ze(o,u,e,t,n,{updateKey:e,onUpdate:()=>t.update()},f);if(!a)return;if(i&&n.addedInteractions[u]){const g=et(t,s.listContainer,i);E.addToSequence(u,a,g,{reducedMotion:E.forceReducedMotion});return}const l=E.getSequence(u,o,a,{reducedMotion:E.forceReducedMotion});n.addedInteractions[u]=!0;const m=M(s.conditions||[],n.dataCache.conditions);k[s.trigger]?.add(t.element,t.element,{},s.params||{},{reducedMotion:E.forceReducedMotion,selectorCondition:m,animation:l,allowA11yTriggers:E.allowA11yTriggers})})}function as(e,t,n,s,i){const r=n.get(e)?.sequences||{};Object.keys(r).forEach(c=>{r[c].some(({sequence:f,...a})=>{const l=_(a.conditions||[],n.dataCache.conditions);if(l&&!l.matches)return!1;const m=a.key&&C(a.key,e),g=E.getController(m);if(!g)return!0;const d=f.sequenceId||x(),h=C(`${m}::seq::${d}`,m);if(n.addedInteractions[h]&&!i)return!0;const y=Ze(f,h,m,g,n,{updateKey:e,onUpdate:()=>t.update()},i&&s?{controllerKey:e,listContainer:s,elements:i}:void 0);if(!y)return!0;if(i&&n.addedInteractions[h]){const b=et(t,s,i);return E.addToSequence(h,y,b,{reducedMotion:E.forceReducedMotion}),!0}const v=E.getSequence(h,f,y,{reducedMotion:E.forceReducedMotion});n.addedInteractions[h]=!0;const w=M(a.conditions||[],n.dataCache.conditions);return k[a.trigger]?.add(g.element,g.element,{},a.params||{},{reducedMotion:E.forceReducedMotion,selectorCondition:w,animation:v,allowA11yTriggers:E.allowA11yTriggers}),!0})})}function tt(e,t,n,s,i){const r=n.get(e),o=r?.effects||{},c=Object.keys(o),u=[];c.forEach(a=>{const l=C(a,e);if(n.addedInteractions[l]&&!i)return;o[a].some(({effect:g,...d})=>{const h=_(d.conditions||[],n.dataCache.conditions);if(h&&!h.matches)return!1;const p=g.effectId,y={...n.dataCache.effects[p]||{},...g,effectId:p};if(s&&y.listContainer!==s)return!1;const v=_(y.conditions||[],n.dataCache.conditions);if(v&&n.setupMediaQueryListener(l,v,e,()=>{t.update()}),!v||v.matches){const w=d.key&&C(d.key,e),b=E.getController(w);if(!b)return!0;y.listContainer&&t.watchChildList(y.listContainer);const[S,T]=Xe(d,y,b.element,b.useFirstChild,t.element,t.useFirstChild,void 0,i);if(!S||!T)return!0;n.addedInteractions[l]=!0;const P=M(y.conditions||[],n.dataCache.conditions);return u.push([e,d,y,S,T,P,t.useFirstChild]),!0}return!1})}),u.reverse().forEach(a=>{Ue(...a)}),as(e,t,n,s,i);const f=Object.keys(r?.sequences||{}).length>0;return c.length>0||f}function Fe(e,t,n,s,i,r,o,c){let u;if(i.transition||i.transitionProperties){const f={key:e,effectId:i.effectId,transition:i.transition,properties:i.transitionProperties,childSelector:H(i,{asCombinator:!0,addItemFilter:!0,useFirstChild:c}),selectorCondition:o};if(u=E.getController(e),!u)return;u.renderStyle(Qt(f))}k[n]?.add(t,s,i,r,{reducedMotion:E.forceReducedMotion,targetController:u,selectorCondition:o,allowA11yTriggers:E.allowA11yTriggers})}function fs(e){const t=e.key,n=E.getInstance(t);if(!n)return console.warn(`No instance found for key: ${t}`),E.setController(t,e),!1;const{triggers:s=[]}=n?.get(t)||{},i=s.length>0;n.setController(t,e),s.forEach((o,c)=>{const u=_(o.conditions,n.dataCache.conditions);if(u){const f=`${t}::trigger::${c}`;n.setupMediaQueryListener(f,u,t,()=>{e.update()})}(!u||u.matches)&&(o.listContainer&&e.watchChildList(o.listContainer),Je(t,e,n,o))});let r=!1;return n&&(r=tt(t,e,n)),i||r}function ls(e,t,n){const s=e.key,i=E.getInstance(s);if(i){const{triggers:r=[]}=i?.get(s)||{};r.forEach((o,c)=>{if(o.listContainer!==t)return;const u=_(o.conditions,i.dataCache.conditions);if(u){const f=`${s}::listTrigger::${t}::${c}`;i.setupMediaQueryListener(f,u,s,()=>{e.update()})}(!u||u.matches)&&Je(s,e,i,o,n)}),tt(s,e,i,t,n)}}function us(e,t=!1){const n=e.key,s=E.getInstance(n);if(!s)return;const i=[...s.get(n)?.selectors.values()||[]].filter(Boolean).join(",");let r;i?(r=[...e.element.querySelectorAll(i)],e.useFirstChild||r.push(e.element)):r=[e.element],nt(r),s.deleteController(n,t)}function nt(e){const t=Object.values(k);for(const n of e)for(const s of t)s.remove(n)}const ae="interactEffect";class st{element;key;connected;sheet;useFirstChild;_observers;constructor(t,n,s){this.element=t,this.key=n,this.connected=!1,this.sheet=null,this._observers=new WeakMap,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=fs(this)}disconnect({removeFromCache:t=!1}={}){if((this.key||this.element.dataset.interactKey)&&us(this,t),this.sheet){const s=document.adoptedStyleSheets.indexOf(this.sheet);document.adoptedStyleSheets.splice(s,1)}this._observers=new WeakMap,this.sheet=null,this.connected=!1}update(){this.disconnect(),this.connect()}renderStyle(t){if(!this.sheet)this.sheet=new CSSStyleSheet,this.sheet.replaceSync(t.join(`
|
|
8
|
+
`)),document.adoptedStyleSheets.push(this.sheet);else{let n=this.sheet.cssRules.length;for(const s of t)try{this.sheet.insertRule(s,n),n++}catch(i){console.error(i)}}}toggleEffect(t,n,s,i){if(s===null)return;if(!i&&this.element.toggleEffect){this.element.toggleEffect(t,n,s);return}const r=new Set(this.element.dataset[ae]?.split(" ")||[]);n==="toggle"?r.has(t)?r.delete(t):r.add(t):n==="add"?r.add(t):n==="remove"?r.delete(t):n==="clear"&&r.clear(),(s||this.element).dataset[ae]=Array.from(r).join(" ")}getActiveEffects(){const n=(this.element.dataset[ae]||"").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=[],r=[];n.forEach(o=>{o.removedNodes.forEach(c=>{c instanceof HTMLElement&&i.push(c)}),o.addedNodes.forEach(c=>{c instanceof HTMLElement&&r.push(c)})}),nt(i),s&&ls(this,t,r)}}function ds(e,t){new st(e,t).connect()}function hs(e){const t=E.getController(e);t&&t.disconnect({removeFromCache:!0})}const ms=(e,t,n,s)=>{let r=`[data-interact-key="${e.replace(/"/g,"'")}"]`;const o=H(t,{asCombinator:!0,useFirstChild:s});return o&&(r=`${r} ${o}`),n&&(r=Q(r,n)),r};function ps(e,t=!1){const n=[],s=new Set;return e.interactions.forEach(({key:i,selector:r,listContainer:o,listItemSelector:c,trigger:u,params:f,effects:a,conditions:l})=>{if(u==="viewEnter"){const g=f;(!g?.type||g.type==="once")&&a?.forEach(h=>{const p=h?.effectId&&e.effects[h.effectId]||h,{key:y,selector:v,listContainer:w,listItemSelector:b,conditions:S}=p;if(!(!y||y===i)||!(!v&&!r||v===r)||!(!w&&!o||w===o)||!(!b&&!c||b===c))return;const ye=e.conditions||{},Ee=M(S,ye),se=M(l,ye);if(!(!Ee&&!se||Ee===se))return;const ie=ms(i,p,se,t);s.has(ie)||(s.add(ie),n.push(`@media (prefers-reduced-motion: no-preference) {
|
|
9
|
+
${ie}:not([data-interact-enter]) {
|
|
10
|
+
visibility: hidden;
|
|
11
|
+
transform: none;
|
|
12
|
+
translate: none;
|
|
13
|
+
scale: none;
|
|
14
|
+
rotate: none;
|
|
15
|
+
}
|
|
16
|
+
}`))})}}),n.join(`
|
|
17
|
+
`)}exports.I=st;exports.a=E;exports.b=ds;exports.g=ps;exports.r=hs;
|
|
18
|
+
//# sourceMappingURL=index-IaOsZpFD.js.map
|