@fiddle-digital/string-tune 0.0.63 → 0.0.65

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/index.cjs ADDED
@@ -0,0 +1,40 @@
1
+ "use strict";var vt=Object.defineProperty;var Ct=Object.getOwnPropertyDescriptor;var Lt=Object.getOwnPropertyNames;var Dt=Object.prototype.hasOwnProperty;var Tt=(l,t)=>{for(var e in t)vt(l,e,{get:t[e],enumerable:!0})},Ot=(l,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Lt(t))!Dt.call(l,i)&&i!==e&&vt(l,i,{get:()=>t[i],enumerable:!(r=Ct(t,i))||r.enumerable});return l};var It=l=>Ot(vt({},"__esModule",{value:!0}),l);var _t={};Tt(_t,{StringAnchor:()=>j,StringCursor:()=>N,StringData:()=>q,StringDelayLerpTracker:()=>pt,StringFPSTracker:()=>dt,StringGlide:()=>tt,StringLazy:()=>V,StringLerp:()=>et,StringLerpTracker:()=>ut,StringLoading:()=>F,StringMagnetic:()=>$,StringModule:()=>m,StringObject:()=>k,StringParallax:()=>rt,StringPositionTracker:()=>ct,StringProgress:()=>I,StringResponsive:()=>K,StringSVG:()=>X,StringScrollbar:()=>J,StringSplit:()=>lt,StringTune:()=>St,StringVideoAutoplay:()=>Y,default:()=>St});module.exports=It(_t);var H=class{constructor(){this.stringOffsetStart="0%";this.stringOffsetEnd="0%";this.stringEnterEl="top";this.stringExitEl="bottom";this.stringEnterVp="bottom";this.stringExitVp="top";this.stringInviewTop="0%";this.stringInviewBottom="0%";this.stringKey="--progress";this.stringStrength=.3;this.stringRadius=150;this.stringLerp=.2;this.stringParallaxBias=0;this.stringParallax=.2}};var R=class{parseSingle(t,e,r,i){let n=t.startsWith("-");n&&(t=t.slice(1));let s;return t==="selfHeight"?s=e.offsetHeight:t.endsWith("px")?s=parseFloat(t):t.endsWith("%")?s=parseFloat(t)*r/100:t.endsWith("rem")&&(s=parseFloat(t)*i),n?-s:s}};var m=class{constructor(t,e=null){this.settings=null;this.parser=new R;this.defaultSettings=new H;this.objectsMap=new Map;this.objects=new Array;this.htmlKey="";this._type=1;this.data=t.data,this.lerp=t.lerp,this.attribute=t.attribute,this.boundingClientRect=t.boundingClientRect,this.position=t.position,this.virtualCursor=t.virtualCursor,this.events=t.events,this.loop=t.loop,this.settings=e,this.defaultSettings=t.defaultSettings,this.parser=t.parser}get type(){return this._type}initObject(t,e,r,i){}onScrollStart(){}onScrollStop(){}onChangeDirection(){}destructor(){this.objects=new Array,this.objectsMap=new Map}onChangeScrollParams(){}tryConnect(t){return t.keys.includes(this.htmlKey)}connect(t){t.connect(this),this.onConnect(t)}enterObject(t,e){this.objectsMap.has(t)||(this.objectsMap.set(t,e),this.objects.push(e))}leaveObject(t){let e=this.objectsMap.get(t);if(e){this.objectsMap.delete(t);let r=this.objects.indexOf(e);r!==-1&&this.objects.splice(r,1)}}onStart(){}onUpdate(t){}onResize(){}onConnect(t){}onRebuild(){}onScroll(t){}onMouseMove(t){}onWheel(t){}onChangeDevice(){}onChangeScrollDirection(){}onMutationObserver(t,e){}};var f=class extends m{constructor(e,r=null){super(e,r);this.oldLerp=0}initObject(e,r,i,n){}};var V=class extends f{constructor(e){super(e);this.isStartLoaded=!1;this.imageLoadingCount=0;this.htmlKey="lazy"}onStart(){document.querySelectorAll("img[string-lazy]").forEach(r=>{this.load(r)}),this.isStartLoaded=!0}onConnect(e){if(this.imageLoadingCount++,this.isStartLoaded){let r=e.el;this.load(r)}}load(e){this.getImageSize(e,e.getAttribute("string-lazy")),e.classList.add("lazyLoad"),e.src=e.getAttribute("string-lazy");let r=()=>{e.classList.add("-loaded"),e.removeEventListener("load",r)};e.addEventListener("load",r)}getImageSize(e,r){return new Promise((i,n)=>{let s=new XMLHttpRequest;s.open("GET",r,!0),s.responseType="arraybuffer",s.onload=()=>{if(s.status===206||s.status===200){let a=s.response,o=new Blob([a]),h=new Image;h.onload=()=>{e.style.aspectRatio=`${h.width} / ${h.height}`,i({width:h.width,height:h.height}),URL.revokeObjectURL(h.src),this.imageLoadingCount--,this.imageLoadingCount<=0&&(this.events.emit("all-image-loaded",null),this.imageLoadingCount=0)},h.onerror=()=>{URL.revokeObjectURL(h.src),this.imageLoadingCount--,n(new Error("Failed to load image"))},h.src=URL.createObjectURL(o)}else n(new Error("Failed to load image"))},s.onerror=()=>{n(new Error("Network error"))},s.setRequestHeader("Range","bytes=0-"),s.send()})}};var F=class extends m{constructor(e,r=null){super(e);this.loadingTimeout=0;this._type=2,r!=null&&r.timeout!=null&&(this.loadingTimeout=r.timeout)}onStart(){setTimeout(()=>{document.documentElement.classList.add("-loaded")},this.loadingTimeout)}};var v=class v extends m{constructor(t){super(t),this.htmlKey="autoplay"}initObject(t,e,r,i){super.initObject(t,e,r,i),e.setProperty("high-quality",this.attribute.process(r,"string-high-src",this.attribute.process(r,"string-src",""))),e.setProperty("medium-quality",this.attribute.process(r,"string-medium-src",e.getProperty("high-quality"))),e.setProperty("low-quality",this.attribute.process(r,"string-low-src",e.getProperty("high-quality")))}onStart(){v.isInternetSpeedCheckStarted||this.startGlobalSpeedCheck()}async onConnect(t){let e=t.el,r=this.attribute.process(e,"string-started",null)!==null;if(e.tagName.toLowerCase()==="video"&&!r){e.setAttribute("string-started",""),e.muted=!0,e.setAttribute("muted","muted"),e.setAttribute("playsinline",""),e.setAttribute("loop",""),e.setAttribute("autoplay",""),v.internetSpeed===null&&(v.internetSpeed=await this.testInternetSpeed(t));let i=this.selectQuality(t);e.src=i,e.dataset.qualityLevel=this.getQualityLevel(t,i).toString(),e.load(),e.addEventListener("canplay",()=>this.tryPlay(e))}}selectQuality(t){var r;let e=(r=v.internetSpeed)!=null?r:0;return e>1.5?t.getProperty("high-quality"):e>.3?t.getProperty("medium-quality"):t.getProperty("low-quality")}getQualityLevel(t,e){return e===t.getProperty("high-quality")?3:e===t.getProperty("medium-quality")?2:1}async testInternetSpeed(t){if(t==null)return 0;let e=t.getProperty("low-quality");try{let r=performance.now(),i=await fetch(e,{method:"GET",headers:{Range:"bytes=0-100000"}});if(!i.ok)throw new Error(`Fetch failed: ${i.statusText}`);return .1/((performance.now()-r)/1e3)}catch(r){return console.error("[StringVideoAutoplay] Error testing internet speed:",r),0}}startGlobalSpeedCheck(){if(v.isInternetSpeedCheckStarted)return;v.isInternetSpeedCheckStarted=!0;let t=async()=>{if(this.objects.length===0&&v.intervalId!==null){clearInterval(v.intervalId),v.intervalId=null;return}let e=await this.testInternetSpeed(this.objects[0]);v.internetSpeed=e,this.objects.forEach(async r=>{let i=r.el,n=this.selectQuality(r),s=this.getQualityLevel(r,n),a=parseInt(i.dataset.qualityLevel||"0");if(!(s<a&&i.currentTime>0)&&s!==r.getProperty("quality")&&i.dataset.qualityLevel===s.toString()){r.setProperty("quality",s);let o=r.getProperty("abort-controller");o&&o.abort();let h=new AbortController;r.setProperty("abort-controller",h);let p=await fetch(n,{signal:h.signal});if(!p.ok)throw new Error(`Fetch error: ${p.statusText}`);let d=await p.blob(),u=URL.createObjectURL(d),g=r.getProperty("currentBlobUrl");g&&URL.revokeObjectURL(g),r.setProperty("currentBlobUrl",u);let y=i.currentTime,b=!i.paused;i.src=u,i.load(),i.currentTime=y,b&&i.play().catch(console.warn),i.dataset.qualityLevel=s.toString()}})};t(),v.intervalId=window.setInterval(t,2e3)}tryPlay(t){t.play().catch(e=>console.warn("[StringVideoAutoplay] Autoplay failed:",e))}};v.isInternetSpeedCheckStarted=!1,v.internetSpeed=null,v.intervalId=null;var Y=v;var L="top",D="bottom",T="left",O="right",I=class extends f{constructor(t){super(t),this.htmlKey="progress"}initObject(t,e,r,i){var h,p,d,u;super.initObject(t,e,r,i);let n=(h=i["string-enter-el"])!=null?h:this.defaultSettings.stringEnterEl,s=(p=i["string-enter-vp"])!=null?p:this.defaultSettings.stringEnterVp,a=(d=i["string-exit-el"])!=null?d:this.defaultSettings.stringExitEl,o=(u=i["string-exit-vp"])!=null?u:this.defaultSettings.stringExitVp;e.setProperty("start-element",n),e.setProperty("start-source",s),e.setProperty("end-element",a),e.setProperty("end-source",o),this.calculatePositions(e,this.data.wS)}onScroll(t){super.onScroll(t),this.objects.forEach(e=>{this.setUpObject(e)})}onConnect(t){super.onConnect(t),t.onEnter=()=>{this.setUpObject(t)}}setUpObject(t){let e=Math.min(1,Math.max(0,(this.data.c-t.getProperty("start-position"))/t.getProperty("difference-position")));t.getProperty("progress")!==e&&(t.setProperty("progress",e),this.applyProgress(t,e))}applyProgress(t,e){let r=e.toString();this.events.emit(`progress_${t.id}`,e),t.el.style.setProperty(t.key,r),t.connects.length>0&&t.connects.forEach(i=>{i.style.setProperty(t.key,r)})}calculatePositions(t,e){t.getProperty("start-element")===L&&t.getProperty("start-source")===L||t.getProperty("start-element")===T&&t.getProperty("start-source")===T?t.setProperty("start-position",t.getProperty("start")-t.getProperty("offset-start")):t.getProperty("start-element")===L&&t.getProperty("start-source")===D||t.getProperty("start-element")===T&&t.getProperty("start-source")===O?t.setProperty("start-position",t.getProperty("start")-e-t.getProperty("offset-start")):t.getProperty("start-element")===D&&t.getProperty("start-source")===L||t.getProperty("start-element")===O&&t.getProperty("start-source")===T?t.setProperty("start-position",t.getProperty("start")+t.getProperty("size")-t.getProperty("offset-start")):(t.getProperty("start-element")===D&&t.getProperty("start-source")===D||t.getProperty("start-element")===O&&t.getProperty("start-source")===O)&&t.setProperty("start-position",t.getProperty("start")-e-t.getProperty("offset-start")+t.getProperty("size")),t.getProperty("end-element")===L&&t.getProperty("end-source")===L||t.getProperty("end-element")===T&&t.getProperty("end-source")===T?t.setProperty("end-position",t.getProperty("start")+t.getProperty("offset-end")):t.getProperty("end-element")===L&&t.getProperty("end-source")===D||t.getProperty("end-element")===T&&t.getProperty("end-source")===O?t.setProperty("end-position",t.getProperty("start")-e+t.getProperty("offset-end")):t.getProperty("end-element")===D&&t.getProperty("end-source")===L||t.getProperty("end-element")===O&&t.getProperty("end-source")===T?t.setProperty("end-position",t.getProperty("start")+t.getProperty("size")+t.getProperty("offset-end")):(t.getProperty("end-element")===D&&t.getProperty("end-source")===D||t.getProperty("end-element")===O&&t.getProperty("end-source")===O)&&t.setProperty("end-position",t.getProperty("start")-e+t.getProperty("size")+t.getProperty("offset-end")),t.setProperty("difference-position",t.getProperty("end-position")-t.getProperty("start-position"))}};var X=class extends I{constructor(t){super(t),this.htmlKey="svg-morph"}async initObject(t,e,r,i){var b;let n=i["string-svg-start"],s=i["string-svg-end"],[a,o]=await Promise.all([this.loadSVG(n),this.loadSVG(s)]),h=a.querySelector("path"),p=o.querySelector("path"),d=h.getAttribute("d")||"",u=p.getAttribute("d")||"";e.setProperty("points-start",d),e.setProperty("points-end",u);let g=document.createElementNS("http://www.w3.org/2000/svg","path");g.setAttribute("d",d),g.setAttribute("fill",(b=i["string-fill"])!=null?b:"black");let y=document.createElementNS("http://www.w3.org/2000/svg","svg");y.setAttribute("viewBox",a.getAttribute("viewBox")||"0 0 100 100"),y.appendChild(g),r.innerHTML="",r.appendChild(y),e.setProperty("svg-path",g),super.initObject(t,e,r,i)}onScroll(t){super.onScroll(t),this.objects.forEach(e=>{this.morphPath(e,e.getProperty("progress"))})}async loadSVG(t){try{let r=await(await fetch(t)).text();return new DOMParser().parseFromString(r,"image/svg+xml").querySelector("svg")}catch(e){return console.error(`StringSVG: \u043F\u043E\u043C\u0438\u043B\u043A\u0430 \u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F ${t}`,e),null}}morphPath(t,e){let r=this.interpolatePaths(t.getProperty("points-start"),t.getProperty("points-end"),e);t.getProperty("svg-path").setAttribute("d",r)}interpolatePaths(t,e,r){let i=this.parsePathCommands(t),n=this.parsePathCommands(e);if(i.length!==n.length)return console.warn("StringSVG: \u041A\u0456\u043B\u044C\u043A\u0456\u0441\u0442\u044C \u043A\u043E\u043C\u0430\u043D\u0434 \u0432 \u0448\u043B\u044F\u0445\u0430\u0445 \u0440\u0456\u0437\u043D\u0430, \u0432\u0456\u0434\u043E\u0431\u0440\u0430\u0436\u0430\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u0438\u043D \u0456\u0437 \u0448\u043B\u044F\u0445\u0456\u0432 \u0431\u0435\u0437 \u0456\u043D\u0442\u0435\u0440\u043F\u043E\u043B\u044F\u0446\u0456\u0457."),r<.5?t:e;let s="";for(let a=0;a<i.length;a++){let o=i[a].match(/([a-zA-Z])|(-?\d*\.?\d+)/g)||[],h=n[a].match(/([a-zA-Z])|(-?\d*\.?\d+)/g)||[];if(o.length!==h.length){console.warn(`StringSVG: \u0420\u0456\u0437\u043D\u0430 \u043A\u0456\u043B\u044C\u043A\u0456\u0441\u0442\u044C \u0430\u0440\u0433\u0443\u043C\u0435\u043D\u0442\u0456\u0432 \u0443 \u043A\u043E\u043C\u0430\u043D\u0434\u0456 ${o[0]}, \u043F\u0440\u043E\u043F\u0443\u0441\u043A\u0430\u0454\u043C\u043E.`),s+=(r<.5?i[a]:n[a])+" ";continue}s+=o[0];for(let p=1;p<o.length;p++){let d=parseFloat(o[p]),u=parseFloat(h[p]);if(isNaN(d)||isNaN(u))s+=` ${o[p]}`;else{let g=d+(u-d)*r;s+=` ${g.toFixed(3)}`}}}return s}parsePathCommands(t){return t.match(/[a-df-z][^a-df-z]*/gi)||[]}};function bt(l,t=.1,e=1,r=.05,i=.65){if(l<t)return 1;if(l>1&&(l=1),l<=e){let n=(l-t)/(e-t);return i-n*(i-r)}return r}var N=class extends f{constructor(e,r=null){super(e,r);this.oldX=0;this.oldY=0;this.enterObjectsMap=new Map;this.enterObjects=new Array;this.overCount=0;this.htmlKey="cursor",this.cursor=document.querySelector("[string-cursor]"),this.cursorContent=document.querySelector("[string-cursor-content]")}onStart(){this.settings!=null?this.settings["string-lerp-cursor"]!=null&&(this.virtualCursor.mouseLerp=bt(this.settings["string-lerp-cursor"])):this.virtualCursor.mouseLerp=bt(.5)}initObject(e,r,i,n){var o;super.initObject(e,r,i,n);let s=this.attribute.process(i,"string-lerp",.5);this.settings!=null&&this.settings["string-lerp-target"]!=null&&(s=this.attribute.process(i,"string-lerp",this.settings["string-lerp-target"])),r.setProperty("alignment",(o=n["string-alignment"])!=null?o:"center"),r.setProperty("mouse-x",0),r.setProperty("mouse-y",0),r.setProperty("mouse-pixel-x",0),r.setProperty("mouse-pixel-y",0),r.setProperty("is-mouse-over",!1),r.setProperty("is-mouse-move",!1),r.setProperty("lerp",bt(s)),r.setProperty("cursor-target-disable",n["string-cursor-target-disable"]!==void 0),r.setProperty("cursor-target-style-disable",n["string-cursor-target-style-disable"]!==void 0);let a=n["string-cursor-class"];r.setProperty("cursor-target-class",""),a&&r.setProperty("cursor-target-class",a)}onUpdate(e){requestAnimationFrame(()=>{if(this.objects.forEach(r=>{if(r.getProperty("is-mouse-over")&&!r.getProperty("cursor-target-disable")){let i=r.el.getBoundingClientRect(),n=this.virtualCursor.x-i.left,s=this.virtualCursor.y-i.top,a=r.getProperty("mouse-pixel-x")-n,o=r.getProperty("mouse-pixel-y")-s;if(a*a+o*o>1e-4){r.getProperty("is-mouse-move")==!1&&(r.setProperty("is-mouse-move",!0),r.setProperty("mouse-pixel-x",n),r.setProperty("mouse-pixel-y",s),this.events.emit(`mousemove_start_${r.id}`,null));let p=this.lerp.process(r.getProperty("mouse-pixel-x"),n,r.getProperty("lerp")),d=this.lerp.process(r.getProperty("mouse-pixel-y"),s,r.getProperty("lerp"));r.setProperty("mouse-pixel-x",r.getProperty("mouse-pixel-x")+p),r.setProperty("mouse-pixel-y",r.getProperty("mouse-pixel-y")+d);let u=this.calculateOffset(r.getProperty("alignment"),r.getProperty("mouse-pixel-x"),i.width),g=this.calculateOffset(r.getProperty("alignment"),r.getProperty("mouse-pixel-y"),i.height);r.setProperty("mouse-x",u),r.setProperty("mouse-y",g),this.setMouseCoordinates(r,r.getProperty("mouse-x"),r.getProperty("mouse-y")),this.events.emit(`mousemove_${r.id}`,{x:r.getProperty("mouse-x"),y:r.getProperty("mouse-y")}),this.events.emit(`mousemove_pixel_${r.id}`,{x:r.getProperty("mouse-pixel-x"),y:r.getProperty("mouse-pixel-y")})}else r.setProperty("mouse-pixel-x",n),r.setProperty("mouse-pixel-y",s),this.events.emit(`mousemove_end_${r.id}`,null)}else if(r.getProperty("mouse-x")!=0||r.getProperty("mouse-y")!=0){r.setProperty("is-mouse-move",!1);let i=r.el.getBoundingClientRect(),n=this.calculateOffset("center",r.getProperty("half-width"),i.width),s=this.calculateOffset("center",r.getProperty("half-height"),i.height);r.setProperty("mouse-x",r.getProperty("mouse-x")+this.lerp.process(r.getProperty("mouse-x"),n,r.getProperty("lerp"))),r.setProperty("mouse-y",r.getProperty("mouse-y")+this.lerp.process(r.getProperty("mouse-y"),s,r.getProperty("lerp"))),Math.abs(r.getProperty("mouse-x"))<.001&&Math.abs(r.getProperty("mouse-y"))<.001&&(r.setProperty("mouse-x",0),r.setProperty("mouse-y",0),r.setProperty("mouse-pixel-x",0),r.setProperty("mouse-pixel-y",0)),this.setMouseCoordinates(r,r.getProperty("mouse-x"),r.getProperty("mouse-y"))}}),this.virtualCursor.lerpX!=0||this.virtualCursor.lerpY!=0){let r={lerpX:this.virtualCursor.lerpX,lerpY:this.virtualCursor.lerpY,x:this.virtualCursor.smoothX,y:this.virtualCursor.smoothY};this.events.emit("cursor",r),this.oldX=this.virtualCursor.smoothX,this.oldY=this.virtualCursor.smoothY,this.cursor.style.setProperty("--x",this.virtualCursor.smoothX),this.cursor.style.setProperty("--y",this.virtualCursor.smoothY),this.cursor.style.setProperty("--x-lerp",this.virtualCursor.lerpX),this.cursor.style.setProperty("--y-lerp",this.virtualCursor.lerpY)}})}onConnect(e){let r=e.el,i=null,n=()=>{this.overCount++,r.addEventListener("mouseleave",s),e.setProperty("is-mouse-over",!0),e.getProperty("cursor-target-class")!=null&&e.getProperty("cursor-target-class").length>0&&this.cursor.classList.add(e.getProperty("cursor-target-class")),this.cursor.classList.add("-showing"),i=setTimeout(()=>{this.cursor.classList.remove("-showing"),this.cursor.classList.add("-show")},1200)},s=()=>{this.overCount--,i!=null&&clearTimeout(i),r.removeEventListener("mouseleave",s),e.setProperty("is-mouse-over",!1),e.getProperty("cursor-target-class")!=null&&e.getProperty("cursor-target-class").length>0&&this.cursor.classList.remove(e.getProperty("cursor-target-class")),this.cursor.classList.remove("-showing"),this.cursor.classList.remove("-show")};e.onEnter=()=>{r.addEventListener("mouseenter",n)},e.onLeave=()=>{r.removeEventListener("mouseenter",n),r.removeEventListener("mouseleave",s)}}setMouseCoordinates(e,r,i){e.getProperty("cursor-target-style-disable")||(e.getProperty("self-disable")==!1&&(e.el.style.setProperty("--x",r.toFixed(2)),e.el.style.setProperty("--y",i.toFixed(2))),e.connects.forEach(n=>{n.style.setProperty("--x",r.toFixed(2)),n.style.setProperty("--y",i.toFixed(2))}))}calculateOffset(e,r,i){switch(e){case"start":return r/i;case"end":return(r-i)/i;case"center":default:return(r-i/2)/(i/2)}}};var $=class extends f{constructor(t){super(t),this.htmlKey="magnetic"}initObject(t,e,r,i){var n,s;super.initObject(t,e,r,i),e.setProperty("is-magneting",!1),e.setProperty("magnetic-target-x",0),e.setProperty("magnetic-target-y",0),e.setProperty("magnetic-x",0),e.setProperty("magnetic-y",0),e.setProperty("strength",(n=i["string-strength"])!=null?n:this.defaultSettings.stringStrength),e.setProperty("radius",(s=i["string-radius"])!=null?s:this.defaultSettings.stringRadius),e.setProperty("lerp",.1)}onConnect(t){let e=t.el;this.settings!=null&&(this.settings["string-strength"]!=null&&t.setProperty("strength",this.settings["string-strength"]),this.settings["string-radius"]!=null&&t.setProperty("radius",this.settings["string-radius"]),this.settings["string-lerp"]!=null&&t.setProperty("lerp",this.settings["string-lerp"]))}onMouseMove(t){this.objects.forEach(e=>{let i=e.el.getBoundingClientRect(),n=i.left+e.getProperty("half-width"),s=i.top+e.getProperty("half-height"),a=t.clientX-n,o=t.clientY-s,h=Math.sqrt(a**2+o**2),p=e.getProperty("radius"),d=e.getProperty("strength");h<p?(e.setProperty("magnetic-target-x",a*d*((p-h)/p)),e.setProperty("magnetic-target-y",o*d*((p-h)/p)),e.setProperty("is-magneting",!0)):(e.setProperty("magnetic-target-x",0),e.setProperty("magnetic-target-y",0))})}onUpdate(t){this.objects.forEach(e=>{if(e.getProperty("is-magneting")){let r=e.getProperty("magnetic-x"),i=e.getProperty("magnetic-y"),n=this.lerp.process(r,e.getProperty("magnetic-target-x"),e.getProperty("lerp")),s=this.lerp.process(i,e.getProperty("magnetic-target-y"),e.getProperty("lerp"));n>-.01&&n<.01&&(n=0,e.setProperty("magnetic-x",e.getProperty("magnetic-target-x"))),s>-.01&&s<.01&&(s=0,e.setProperty("magnetic-y",e.getProperty("magnetic-target-y"))),r+=n,i+=s,e.setProperty("magnetic-x",r),e.setProperty("magnetic-y",i),e.el.style.setProperty("--magnetic-x",r.toString()),e.el.style.setProperty("--magnetic-y",i.toString()),(e.getProperty("magnetic-target-x")==r||e.getProperty("magnetic-target-y")==i)&&e.setProperty("is-magneting",!1)}})}};var B=class{process(t,e,r){return(e-t)*r}};var Q=class{constructor(t=.1){this._lF=.1;this.lerp=new B;this._x=0;this._y=0;this._lerpX=0;this._lerpY=0;this.targetX=0;this.targetY=0;this._lF=t}get x(){return this.targetX}get y(){return this.targetY}get smoothX(){return this._x}get smoothY(){return this._y}get lerpX(){return this._lerpX}get lerpY(){return this._lerpY}set mouseLerp(t){this._lF=t}onMouseMove(t){this.targetX=t.clientX,this.targetY=t.clientY}onUpdate(){this._lerpX=this.lerp.process(this._x,this.targetX,this._lF),this._lerpY=this.lerp.process(this._y,this.targetY,this._lF),Math.sqrt(Math.pow(this._lerpX,2)+Math.pow(this._lerpY,2))<.1?(this._lerpX=0,this._lerpY=0,this._x=this.targetX,this._y=this.targetY):(this._x=this._x+this._lerpX,this._y=this._y+this._lerpY)}};var k=class{constructor(t){this.id="";this.key="--progress";this.keys="";this.connects=new Array;this.properties=new Map;this.modules=new Array;this.onEnter=()=>{};this.onLeave=()=>{};this.el=t}setProperty(t,e){this.properties.set(t,e)}getProperty(t){var e;return(e=this.properties.get(t))!=null?e:null}enter(){this.setProperty("active",!0)}leave(){this.setProperty("active",!1)}show(){this.onEnter(),this.el.classList.add("-inview"),this.modules.forEach(t=>{t.enterObject(this.id,this)})}hide(){this.onLeave(),this.getProperty("repeat")&&this.el.classList.remove("-inview"),this.modules.forEach(t=>{t.leaveObject(this.id)})}connect(t){this.modules.includes(t)||this.modules.push(t)}};var W=class{constructor(t){this.min=void 0;this.max=void 0;this.enable=!0;var e;this.min=t==null?void 0:t.min,this.max=t==null?void 0:t.max,this.enable=(e=t==null?void 0:t.enable)!=null?e:!0}setEnable(t=!0){this.enable=t}setRange(t,e){this.min=t!=null?t:void 0,this.max=e!=null?e:void 0}get mediaQuery(){let t="screen";return this.min&&(t+=` and (min-width: ${this.min}px)`),this.max&&(t+=` and (max-width: ${this.max}px)`),t}},K=class extends m{constructor(e,r){super(e,r);this.queries={0:new W({max:359}),1:new W({min:360,max:1079}),2:new W({min:1080,max:1365}),3:new W({min:1366})};this.matchMedias={0:window.matchMedia(this.queries[0].mediaQuery),1:window.matchMedia(this.queries[1].mediaQuery),2:window.matchMedia(this.queries[2].mediaQuery),3:window.matchMedia(this.queries[3].mediaQuery)};this._type=2}onConnect(){}onStart(){var e,r,i,n;if(this.settings!=null&&this.settings.settings!=null){let s=this.settings.settings;s.mobile?(this.queries[0].enable=!0,this.queries[0].setRange(s.mobile.min==null?null:s.mobile.min,(e=s.mobile.max)!=null?e:null),this.matchMedias[0]=window.matchMedia(this.queries[0].mediaQuery)):this.queries[0].enable=!1,s.tablet?(this.queries[1].enable=!0,this.queries[1].setRange(s.mobile.min==null?null:s.mobile.min,(r=s.mobile.max)!=null?r:null),this.matchMedias[1]=window.matchMedia(this.queries[0].mediaQuery)):this.queries[1].enable=!1,s.laptop?(this.queries[2].enable=!0,this.queries[2].setRange(s.mobile.min==null?null:s.mobile.min,(i=s.mobile.max)!=null?i:null),this.matchMedias[2]=window.matchMedia(this.queries[0].mediaQuery)):this.queries[2].enable=!1,s.desktop?(this.queries[3].enable=!0,this.queries[3].setRange(s.mobile.min==null?null:s.mobile.min,(n=s.mobile.max)!=null?n:null),this.matchMedias[3]=window.matchMedia(this.queries[0].mediaQuery)):this.queries[3].enable=!1}this.updateElements()}onResize(){this.updateElements()}updateElements(){let e=this.matchMedias[0].matches&&this.queries[0].enable,r=this.matchMedias[1].matches&&this.queries[1].enable,i=this.matchMedias[2].matches&&this.queries[2].enable,n=this.matchMedias[3].matches&&this.queries[3].enable;document.querySelectorAll("[string-mobile], [string-tablet], [string-laptop], [string-desktop]").forEach(a=>{let o=!1;a.hasAttribute("string-mobile")&&e&&(o=!0),a.hasAttribute("string-tablet")&&r&&(o=!0),a.hasAttribute("string-laptop")&&i&&(o=!0),a.hasAttribute("string-desktop")&&n&&(o=!0),o?a.style.display=null:a.style.display="none"})}};var G=class{constructor(t,e,r){this.isDragging=!1;this.startY=0;this.startScrollPosition=0;this.data=t,this.scrollbar=e,this.thumb=r}onResize(){let t=this.data.psH,e=this.data.wS,r=e/t*e;this.thumb.style.setProperty("--size",r+"px"),t<=e?this.scrollbar.classList.add("-hide"):this.scrollbar.classList.remove("-hide")}updateThumb(){let t=this.data.psH,e=this.data.wS;this.thumb.style.setProperty("--position",`${this.data.c/t*e+"px"}`)}mouseDownEvent(t){this.startY=t.clientY,this.startScrollPosition=this.data.c}mouseMoveEvent(t){let e=t.clientY-this.startY,r=this.startScrollPosition+e/this.data.wS*this.data.psH;this.data.c=r,this.data.t=r,window.scrollTo(0,r),this.updateThumb()}};var Z=class{constructor(t,e,r){this.isDragging=!1;this.startCoordinate=0;this.startScrollPosition=0;this.data=t,this.scrollbar=e,this.thumb=r}onResize(){let t=this.data.psW,e=this.data.wS,r=e/t*e;this.thumb.style.setProperty("--size",r+"px"),t<=e?this.scrollbar.classList.add("-hide"):this.scrollbar.classList.remove("-hide")}updateThumb(){let t=this.data.psW,e=this.data.wS;this.thumb.style.setProperty("--position",`${this.data.c/t*e+"px"}`)}mouseDownEvent(t){this.startCoordinate=t.clientX,this.startScrollPosition=this.data.c}mouseMoveEvent(t){let e=t.clientX-this.startCoordinate,r=this.startScrollPosition+e/this.data.wS*this.data.psW;this.data.c=r,this.data.t=r,window.scrollTo(0,r),this.updateThumb()}};var J=class extends m{constructor(e){super(e);this.isDragging=!1;this.scrollMode="smooth";this.mouseUpEventBind=this.mouseUpEvent.bind(this),this.mouseDownEventBind=this.mouseDownEvent.bind(this),this.mouseMoveEventBind=this.mouseMoveEvent.bind(this)}destructor(){document.removeEventListener("mouseup",this.mouseUpEventBind),this.thumb.removeEventListener("mousedown",this.mouseDownEventBind),document.removeEventListener("mousemove",this.mouseMoveEventBind)}onStart(){this.createScrollbar(),this.updateThumb(),this.addCustomStyles(),document.addEventListener("mouseup",this.mouseUpEventBind),this.thumb.addEventListener("mousedown",this.mouseDownEventBind),document.addEventListener("mousemove",this.mouseMoveEventBind),document.documentElement.classList.add("-no-scrollbar")}onScroll(e){this.updateThumb(),this.showScrollbar(),this.hideScrollbar()}onResize(){this.scrollbarState.onResize()}onChangeScrollParams(){this.data.sM=="disable"&&this.scrollMode!="disable"&&this.scrollbar.classList.add("-hide"),(this.data.sM=="smooth"&&this.scrollMode=="disable"||this.data.sM=="default"&&this.scrollMode=="disable")&&this.scrollbar.classList.remove("-hide"),this.scrollMode=this.data.sM}onChangeScrollDirection(){this.data.sD=="horizontal"?this.scrollbarState=this.scrollbarStateVertical:this.scrollbarState=this.scrollbarStateHorizontal,this.scrollbarState.onResize()}addCustomStyles(){let e=document.createElement("style");e.textContent=`
2
+ ::-webkit-scrollbar {
3
+ display: none;
4
+ width: 0;
5
+ height: 0;
6
+ -webkit-appearance: none;
7
+ }
8
+ body {
9
+ -ms-overflow-style: none; /* IE and Edge */
10
+ scrollbar-width: none; /* Firefox */
11
+ }
12
+ .-without-scrollbar::-webkit-scrollbar {
13
+ display: none;
14
+ }
15
+ .-without-scrollbar {
16
+ -ms-overflow-style: none; /* IE and Edge */
17
+ scrollbar-width: none; /* Firefox */
18
+ }
19
+ `,document.head.appendChild(e)}createScrollbar(){this.scrollbar=document.createElement("div"),this.scrollbar.classList.add("scrollbar"),this.thumb=document.createElement("div"),this.thumb.classList.add("thumb"),this.scrollbar.appendChild(this.thumb),document.body.appendChild(this.scrollbar),this.scrollbarStateHorizontal=new G(this.data,this.scrollbar,this.thumb),this.scrollbarStateVertical=new Z(this.data,this.scrollbar,this.thumb),this.scrollbarState=this.scrollbarStateHorizontal}updateThumb(){this.scrollbarState.updateThumb()}mouseDownEvent(e){this.isDragging=!0,this.scrollbarState.mouseDownEvent(e),document.body.style.userSelect="none",this.scrollbar.classList.add("-touch")}mouseMoveEvent(e){this.isDragging&&this.scrollbarState.mouseMoveEvent(e)}mouseUpEvent(){this.isDragging=!1,document.body.style.userSelect="",this.hideScrollbar(),this.scrollbar.classList.remove("-touch")}showScrollbar(){this.scrollbar.classList.add("-scroll")}hideScrollbar(){this.scrollTimeout&&clearTimeout(this.scrollTimeout),this.scrollTimeout=setTimeout(()=>{this.scrollbar.classList.remove("-scroll")},1e3)}};var j=class extends f{constructor(t){super(t),this.htmlKey="anchor"}initObject(t,e,r,i){super.initObject(t,e,r,i),e.setProperty("anchor",this.attribute.process(r,"string-anchor","center center"))}onConnect(t){super.onConnect(t),(t.getProperty("anchor")==null||t.getProperty("anchor")=="")&&t.setProperty("anchor","center center");let e=t.getProperty("anchor").split(" "),r=this.parseOrig(e[0]),i=this.parseOrig(e[1]||e[0]);t.el.style.transformOrigin=`${r} ${i}`}parseOrig(t){if(t=t.trim(),t.startsWith("random")){let e=t.slice(7,-1).split(",").map(i=>i.trim()),r=Math.floor(Math.random()*e.length);return e[r]}else return t}};var tt=class extends f{constructor(e,r=null){super(e);this.previousLerp=0;this.displacement=0;this.acceleration=0;this.velocityMultiplier=.00125;this.isInitialScroll=!0;this.baseVelocityMultiplier=.00125;this.reducedVelocityMultiplier=this.baseVelocityMultiplier/20;this.negativeVelocityMultiplier=-1e-4;this.ACCELERATION_STEP=.05;this.MIN_DISPLACEMENT=.01;this.MAX_DISPLACEMENT=1;this.MIN_VELOCITY=-1;this.MAX_VELOCITY=1;this.maxDisplacementValue=0;this.setupItem=e=>{let r=`translate3d(0, ${-this.data.dV*this.maxDisplacementValue*e.getProperty("glide")}px, 0)`;e.el.style.transform=r};this.onUpdateDesktopEvent=()=>{for(let e=0;e<this.objects.length;e++){let r=this.objects[e];this.setupItem(r)}};this.onUpdateMobileEvent=()=>{};this.onUpdateEvent=this.onUpdateDesktopEvent;if(this.htmlKey="glide",r){let{baseVelocityMultiplier:i,reducedVelocityMultiplier:n,negativeVelocityMultiplier:s}=r;this.baseVelocityMultiplier=i!=null?i:this.baseVelocityMultiplier,this.reducedVelocityMultiplier=n!=null?n:this.reducedVelocityMultiplier,this.negativeVelocityMultiplier=s!=null?s:this.negativeVelocityMultiplier}}initObject(e,r,i,n){var s;super.initObject(e,r,i,n),r.setProperty("glide",parseFloat((s=n["string-glide"])!=null?s:"1"))}calcExpanderFactor(e){let r=e?this.data.v<this.previousLerp:this.data.v>this.previousLerp;this.velocityMultiplier=r?this.isInitialScroll?this.baseVelocityMultiplier:this.reducedVelocityMultiplier:this.negativeVelocityMultiplier,r||(this.isInitialScroll=!1)}onStart(){this.maxDisplacementValue=this.data.wS*.1}onResize(){window.innerWidth>1080?(this.maxDisplacementValue=this.data.wS*.1,this.onUpdateEvent=this.onUpdateDesktopEvent):(this.onUpdateEvent=this.onUpdateMobileEvent,this.resetState(),this.objects.forEach(e=>{this.setupItem(e)}))}resetState(){this.displacement=0,this.acceleration=0,this.isInitialScroll=!0,this.velocityMultiplier=this.baseVelocityMultiplier}onScrollStart(){this.resetState()}onScrollStop(){this.resetState(),this.previousLerp=0;for(let e=0;e<this.objects.length;e++){let r=this.objects[e],i="translate3d(0, 0px, 0)";r.el.style.transform=i,r.el.style.setProperty("--glide",this.data.dV.toString())}}onUpdate(e){this.calcExpanderFactor(this.data.sDB===!1),this.acceleration=Math.min(this.MAX_DISPLACEMENT,this.acceleration+this.ACCELERATION_STEP),this.displacement=Math.max(this.MIN_DISPLACEMENT,Math.min(this.MAX_DISPLACEMENT,this.displacement+this.velocityMultiplier)),this.data.dV=Math.min(this.MAX_VELOCITY,Math.max(this.MIN_VELOCITY,this.data.v*this.displacement*this.acceleration)),this.objects.forEach(r=>{r.el.style.setProperty("--glide",this.data.dV.toString())}),this.previousLerp=this.data.v,this.onUpdateEvent()}};var et=class extends f{constructor(t){super(t),this.htmlKey="lerp"}onScrollStop(){this.objects.forEach(t=>{t.el.style.setProperty("--lerp","0")})}onScroll(t){this.objects.forEach(e=>{e.el.style.setProperty("--lerp",this.data.v.toString())})}};var rt=class extends I{constructor(e){super(e);this.setupParallax=(e,r)=>{let i=`translate3d(0, ${e.getProperty("parallax-factor")*this.data.wS*e.getProperty("parallax-position-start")+r*e.getProperty("parallax-factor")*this.data.wS*e.getProperty("parallax-position-end")}px, 0)`;e.el.style.transform=i,e.connects.forEach(n=>{n.style.transform=i})};this.onScrollDesktopEvent=()=>{this.objects.forEach(e=>{this.setupParallax(e,e.getProperty("progress"))})};this.onScrollMobileEvent=()=>{};this.onScrollEvent=this.onScrollDesktopEvent;this.htmlKey="parallax"}initObject(e,r,i,n){var a,o;let s=parseFloat((a=n["string-parallax-bias"])!=null?a:this.defaultSettings.stringParallaxBias);r.setProperty("parallax-position-start",-.5+.5*s),r.setProperty("parallax-position-end",.5+.5*(1-s)),r.setProperty("parallax-factor",parseFloat((o=n["string-parallax"])!=null?o:this.defaultSettings.stringParallax)),r.setProperty("offset-start",r.getProperty("parallax-factor")*this.data.wS),r.setProperty("offset-end",r.getProperty("parallax-factor")*this.data.wS),super.initObject(e,r,i,n)}onScroll(e){super.onScroll(e),this.onScrollEvent()}onResize(){window.innerWidth>1080?this.onScrollEvent=this.onScrollDesktopEvent:(this.onScrollEvent=this.onScrollMobileEvent,this.objects.forEach(e=>{this.setupParallax(e,.5)}))}};var A=class{constructor(t,e,r){this.isProg=!1;this.isParallaxEnabled=!1;this.name="";this.v=0;this.vT=0;this.onScrollStart=()=>{};this.onScrollStop=()=>{};this.onChangeDirection=()=>{};this.onCalcUpdate=()=>{this.scrollContainer.scrollTo(0,this.data.c)};this._scrollDirection="vertical";this.d=t,this.settings=e,this.data=r,this.scrollContainer=window}onUpdate(){}onWheel(t){}onScroll(t){}set scrollDirection(t){this._scrollDirection=t,this._scrollDirection=="vertical"?this.onCalcUpdate=()=>{this.scrollContainer.scrollTo(0,this.data.c)}:this._scrollDirection=="horizontal"&&(this.onCalcUpdate=()=>{this.scrollContainer.scrollTo(this.data.c,0)})}};var it=class extends A{constructor(t,e,r){super(t,e,r),this.name="mobile"}onUpdate(){if(this.data.d!=0){let t=this.data.d*this.settings.speedAccelerate;this.data.d-=t,this.data.v=t,Math.abs(this.data.v)<.1&&(this.data.d=0,this.data.v=0,this.onScrollStop())}}onScroll(t){this.data.c=this.d.documentElement.scrollTop,this.data.t=this.d.documentElement.scrollTop}onWheel(t){if(t.deltaY!=0){this.data.d==0&&this.onScrollStart();let e=t.deltaY;this.data.t==0&&(this.data.d+=Math.max(0,t.deltaY)),this.data.d+=e}}};var st=class extends A{constructor(t,e,r){super(t,e,r),this.name="disable"}onUpdate(){}onWheel(t){t.preventDefault()}onScroll(t){t.preventDefault()}};var nt={SCROLL_FORWARD:"-scroll-forward",SCROLL_BACK:"-scroll-back"},at=class extends A{constructor(e,r,i){super(e,r,i);this.name="desktop";this.isScrollbarManipulation=!1;this.isBottomScrollDirection=!1;this.velocityThreshold=.1;this.plusDelta=0;this.previousCurrent=0;this.delta=0}updateScrollDirection(e){if(this.isBottomScrollDirection===null){this.isBottomScrollDirection=e;return}this.data.sDB=e,this.onChangeDirection(),document.documentElement.classList.toggle(nt.SCROLL_FORWARD,e),document.documentElement.classList.toggle(nt.SCROLL_BACK,!e)}stopScroll(){this.data.v=0,this.data.d=0,this.data.t=this.data.c,this.isProg=!1,this.onCalcUpdate(),document.documentElement.classList.remove(nt.SCROLL_BACK,nt.SCROLL_FORWARD),this.isBottomScrollDirection=null}onUpdate(){var e,r;if(this.isScrollbarManipulation){this.isScrollbarManipulation=!1,this.data.t=(r=(e=this.scrollContainer)==null?void 0:e.scrollTop)!=null?r:document.documentElement.scrollTop,this.data.c=this.data.t;return}if(this.data.d!=0){this.delta=this.data.d*this.settings.speedAccelerate,this.data.t=Math.min(Math.max(0,this.data.t+this.delta),this.data.bS),this.data.d-=this.delta,this.data.v=(this.data.t-this.data.c)*this.settings.speed;let i=Math.abs(this.data.v);this.data.v>0?this.data.c=Math.ceil(this.data.c+this.data.v):this.data.c=Math.floor(this.data.c+this.data.v),this.updateScrollDirection(this.data.v>0),i<this.velocityThreshold?(this.stopScroll(),this.onScrollStop()):(this.isProg=!0,this.previousCurrent!=this.data.c&&(this.previousCurrent=this.data.c,this.onCalcUpdate()))}}onWheel(e){if(e.deltaY!=0&&e.preventDefault(),this.plusDelta=e.deltaY,this.plusDelta===0)return;this.data.d===0&&this.onScrollStart();let r=Math.sign(this.plusDelta);this.data.t===0&&r<0||this.data.t===this.data.bS&&r>0||(this.data.d+=this.plusDelta)}onScroll(e){this.isProg||(this.isScrollbarManipulation=!0)}};var ot=class{constructor(){this.sC=.1;this.sA=.25}get speed(){return this.sC}get speedAccelerate(){return this.sA}set speedAccelerate(t){this.sA=t}set speed(t){this.sC=t}};var lt=class extends f{constructor(t){super(t),this.htmlKey="split"}onStart(){}onResize(){document.querySelectorAll('[string="split"].-splited').forEach(t=>{let e=this.parseSplitOptions(t.getAttribute("string-split"));t.innerHTML!=this.split(e,t).html&&(t.innerHTML=this.split(e,t).html)})}onConnect(t){let e=t.el;if(!e.classList.contains("-splited")){e.classList.add("-splited"),e.setAttribute("string-split-original",e.innerHTML);let r=this.parseSplitOptions(e.getAttribute("string-split"));e.innerHTML!=this.split(r,e).html&&(e.innerHTML=this.split(r,e).html)}}parseSplitOptions(t){let e={line:[],word:[],char:[],charLine:[],charWord:[],wordLine:[]};return t&&t.split("|").forEach(i=>{let n=i.match(/^(\w+-)?(\w+)(\[(.*?)\])?$/);if(n){let s=n[1]||"",a=n[2],o=n[4]?n[4].split(","):[];switch(s+a){case"char-line":e.charLine.push(this.parseParam(o));break;case"char-word":e.charWord.push(this.parseParam(o));break;case"word-line":e.wordLine.push(this.parseParam(o));break;case"line":e.line.push(this.parseParam(o));break;case"word":e.word.push(this.parseParam(o));break;case"char":e.char.push(this.parseParam(o));break}}}),e}parseParam(t){let e={align:"start"};return t.forEach(r=>{if(r==="abs")e.abs=!0;else if(r.startsWith("random")){let i=r.match(/random\((\d+),(\d+)\)/);i&&(e.random={min:parseInt(i[1]),max:parseInt(i[2])}),e.align="random"}else["start","center","end"].includes(r)?e.align=r:e.align="start"}),e}split(t,e){let r=e.getAttribute("string-split-original");if(r.length===0)return"";r=this.decodeHtmlEntity(r);let i=document.createElement("span"),n=r.split(/\s+/),s=0,a=0,o=r.replace(/\s/g,"").length,h=document.createElement("span"),p=window.getComputedStyle(e);h.style.fontFamily=p.fontFamily,h.style.fontSize=p.fontSize,h.style.letterSpacing=p.letterSpacing,h.style.lineHeight=p.lineHeight,h.style.fontWeight=p.fontWeight,h.classList.add("-s-char"),document.body.appendChild(h);let d=[],u=[],g=0;n.forEach((c,w)=>{h.textContent=c,c.length>0&&(h.textContent+="\xA0");let E=h.offsetWidth,S={text:c,width:E,chars:new Array};Array.from(c).forEach((x,U)=>{let M={text:x};S.chars.push(M)}),g+E>e.offsetWidth&&(d.push(u),u=[],g=0,s+=u.length),u.push(S),g+=E}),d.push(u);let y=!1;t.line!=null&&t.line.length>0&&(y=!0),t.wordLine!=null&&t.wordLine.length>0&&(y=!0),t.charLine!=null&&t.charLine.length>0&&(y=!0);let b=0;if(y)for(let c=0;c<d.length;c++)this.appendVirtualLineToDOM(c,d.length,n.length,i,d[c],t,s,o,b),b+=d[c].length;else for(let c=0;c<d.length;c++)d[c].forEach((w,E)=>{var S,_;if(w.chars.length>0){let x=document.createElement("span");x.classList.add("-s-word"),t.char!=null&&((S=t.char)==null?void 0:S.length)>0||t.charWord!=null&&((_=t.charWord)==null?void 0:_.length)>0?w.chars.forEach((U,M)=>{let C=document.createElement("span");C.classList.add("-s-char"),C.textContent=U.text,this.applyOptions(C,t.char,s,"char",M,o),this.applyOptions(C,t.charWord,M,"char-word",M,w.text.length),x.appendChild(C),s++}):x.textContent=w.text,this.applyOptions(x,t.word,a,"word",E,n.length),w.chars.length>0&&(x.innerHTML+="\xA0"),i.appendChild(x),a++}});return document.body.removeChild(h),{html:i.innerHTML}}appendVirtualLineToDOM(t,e,r,i,n,s,a,o,h){let p=document.createElement("span");p.classList.add("-s-line"),this.applyOptions(p,s.line,t,"line",0,e);let d=0,u=0,g=0;n.forEach((y,b)=>{g+=y.text.length}),n.forEach((y,b)=>{if(y.chars.length>0){let c=document.createElement("span");c.classList.add("-s-word"),y.chars.forEach((w,E)=>{let S=document.createElement("span");S.classList.add("-s-char"),S.textContent=w.text,this.applyOptions(S,s.char,a,"char",E,o),this.applyOptions(S,s.charLine,d,"char-line",E,g),this.applyOptions(S,s.charWord,E,"char-word",E,y.text.length),c.appendChild(S),a++,d++}),this.applyOptions(c,s.word,h+u,"word",h+u,r-1),this.applyOptions(c,s.wordLine,b,"word-line",b,n.length),b<n.length-1&&(c.innerHTML+="\xA0"),p.appendChild(c),u++}}),i.appendChild(p)}applyOptions(t,e,r,i,n,s){e&&e.forEach((a,o)=>{let h=this.calculateIndex(a,r,n,s),p=this.generateVariableName(i,a,o);t.style.setProperty(p,String(h))})}createSpaceSpan(){let t=document.createElement("span");return t.innerHTML="\xA0",t}decodeHtmlEntity(t){return t.replace(/&amp;/g,"&")}calculateIndex(t,e,r,i){let n=e;if(t.align==="random"){t.random===void 0&&(t.random={min:0,max:i});let s=t.random.min||0,a=t.random.max||i;n=Math.floor(Math.random()*(a-s+1))+s}return t.align==="end"?n=i-n-1:t.align==="center"&&(n=n-Math.floor(i/2)),t.abs&&(n=Math.abs(n)),n}generateVariableName(t,e,r){let i=`--${t}`;return e.align&&(i+=`-${e.align}`),i}};var ht=class{constructor(){this.isAnimationStarted=!1;this.fpsInterval=0;this.then=0;this.requestAnimationId=0;this.onFrameCallback=()=>{};this.animate=()=>{}}start(t){this.isAnimationStarted||(this.fpsInterval=1e3/t,this.then=performance.now(),this.isAnimationStarted=!0,t==0?this.animate=()=>{this.requestAnimationId=requestAnimationFrame(()=>this.animate()),this.onFrameCallback()}:this.animate=()=>{let e=performance.now(),r=e-this.then;r>this.fpsInterval&&(this.then=e-r%this.fpsInterval,this.onFrameCallback()),this.requestAnimationId=requestAnimationFrame(()=>this.animate())},this.animate())}stop(){this.isAnimationStarted&&(cancelAnimationFrame(this.requestAnimationId),this.requestAnimationId=0,this.isAnimationStarted=!1)}setOnFrame(t){this.onFrameCallback=t}};var pt=class extends m{constructor(e){super(e);this.canvasHeight=0;this._type=2}onStart(){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.canvas.width=window.innerWidth*.5,this.canvas.height=window.innerHeight/15-20,this.canvasHeight=window.innerHeight/15-20,this.canvas.style.position="fixed",this.canvas.style.bottom=`${window.innerHeight/20+10}px`,this.canvas.style.left="50%",this.canvas.style.transform="translateX(-50%)",this.canvas.style.backgroundColor="#000000",this.canvas.style.border="1px solid rgba(255, 255, 255, 0.2)",this.canvas.style.zIndex="1000",document.body.appendChild(this.canvas),this.positionHistory=[],this.maxHistory=this.canvas.width,this.currentPosition=0,this.targetPosition=0}onScroll(e){this.currentPosition=Math.abs(this.data.dV),this.positionHistory.push(this.currentPosition),this.positionHistory.length>this.maxHistory&&this.positionHistory.shift(),this.drawGraph()}drawGraph(){let e=this.context;e.clearRect(0,0,this.canvas.width,this.canvas.height),e.strokeStyle="#e0e0e0",e.lineWidth=1,e.strokeStyle="red",e.lineWidth=2,e.beginPath(),this.positionHistory.forEach((r,i)=>{let n=i,s=this.canvas.height-r*this.canvasHeight;i===0?e.moveTo(n,s):e.lineTo(n,s)}),e.stroke()}setTargetPosition(e){this.targetPosition=e}};var dt=class extends m{constructor(e){super(e);this.callCount=0;this._type=2}createDisplayElement(){this.displayElement=document.createElement("div"),this.displayElement.style.position="fixed",this.displayElement.style.bottom="10px",this.displayElement.style.right="10px",this.displayElement.style.backgroundColor="#000000",this.displayElement.style.border="1px solid rgba(255, 255, 255, 0.2)",this.displayElement.style.zIndex="9999",this.displayElement.setAttribute("data-fps","0"),document.body.appendChild(this.displayElement);let e=document.createElement("style");e.innerHTML=`
20
+ [data-fps]::after {
21
+ content: 'FPS: ' attr(fps);
22
+ position: relative;
23
+ display: block;
24
+ color: #ffffff;
25
+ padding: 5px 8px;
26
+ font-family: Arial, sans-serif;
27
+ font-size: 12px;
28
+ }
29
+ `,document.head.appendChild(e)}onStart(){this.createDisplayElement(),this.intervalId=setInterval(()=>{this.displayElement.setAttribute("fps",`${this.callCount}`),this.callCount=0},1e3)}onUpdate(e){this.callCount++}destructor(){clearInterval(this.intervalId),document.body.removeChild(this.displayElement)}};var ut=class extends m{constructor(t){super(t),this._type=2}onStart(){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.canvas.width=window.innerWidth*.5,this.canvas.height=window.innerHeight/15-20,this.canvas.style.position="fixed",this.canvas.style.bottom="10px",this.canvas.style.left="50%",this.canvas.style.transform="translateX(-50%)",this.canvas.style.backgroundColor="#000000",this.canvas.style.border="1px solid rgba(255, 255, 255, 0.2)",this.canvas.style.zIndex="1000",document.body.appendChild(this.canvas),this.positionHistory=[],this.maxHistory=this.canvas.width,this.currentPosition=0,this.targetPosition=0}onScroll(t){this.currentPosition=Math.abs(this.data.v),this.positionHistory.push(this.currentPosition),this.positionHistory.length>this.maxHistory&&this.positionHistory.shift(),this.drawGraph()}drawGraph(){let t=this.context;t.clearRect(0,0,this.canvas.width,this.canvas.height),t.strokeStyle="#e0e0e0",t.lineWidth=1,t.strokeStyle="#007bff",t.lineWidth=2,t.beginPath(),this.positionHistory.forEach((e,r)=>{let i=r,n=this.canvas.height-e/2;r===0?t.moveTo(i,n):t.lineTo(i,n)}),t.stroke()}setTargetPosition(t){this.targetPosition=t}};var ct=class extends m{constructor(e){super(e);this.callCount=0;this._type=2}createDisplayElement(){this.displayElement=document.createElement("div"),this.displayElement.style.position="fixed",this.displayElement.style.bottom="10px",this.displayElement.style.left="10px",this.displayElement.style.backgroundColor="#000000",this.displayElement.style.border="1px solid rgba(255, 255, 255, 0.2)",this.displayElement.style.zIndex="9999",this.displayElement.setAttribute("data-position","0"),document.body.appendChild(this.displayElement);let e=document.createElement("style");e.innerHTML=`
30
+ [data-position]::after {
31
+ content: attr(direction) 'Top: ' attr(value) 'px';
32
+ position: relative;
33
+ display: block;
34
+ color: #ffffff;
35
+ padding: 5px 8px;
36
+ font-family: Arial, sans-serif;
37
+ font-size: 12px;
38
+ }
39
+ `,document.head.appendChild(e)}onStart(){this.createDisplayElement()}onScroll(e){let r="";e.c<e.t&&(r="\u2193"),e.c>e.t&&(r="\u2191"),this.displayElement.setAttribute("direction",r),this.displayElement.setAttribute("value",`${this.data.c}`)}onUpdate(e){this.callCount++}destructor(){document.body.removeChild(this.displayElement)}};var mt=class{process(t,e,r=null){return t.getAttribute(e)==null?t.getAttribute(`data-${e}`)==null?r:t.getAttribute(`data-${e}`):t.getAttribute(e)}};var gt=class{process(t){return t.getBoundingClientRect()}};var q=class{constructor(){this.three=null;this.t=0;this.c=0;this.d=0;this.v=0;this.dV=0;this.sDB=!1;this.bS=0;this.cF=1;this.wS=0;this.hnwS=0;this.psW=0;this.psH=0;this.cL={x:0,y:0};this.scsW=1;this.scsH=1;this.sD="vertical";this.sM="smooth"}};var z=class{constructor(){this.eventsByKey=new Map;this.events=new Array}on(t,e){var r;this.eventsByKey.has(t)==!1&&this.eventsByKey.set(t,[]),(r=this.eventsByKey.get(t))==null||r.push(e),this.updateAllEvents()}has(t){return this.eventsByKey.has(t)}emit(t,e){var r;this.eventsByKey.has(t)&&((r=this.eventsByKey.get(t))==null||r.forEach(i=>{i(e)}))}off(t,e){let r=this.eventsByKey.get(t);r!=null&&this.eventsByKey.set(t,r.filter(i=>i!==e)),this.updateAllEvents()}all(t){this.events.forEach(e=>{e(t)})}updateAllEvents(){this.events=[],Array.from(this.eventsByKey.values()).forEach(t=>{t.forEach(e=>{this.events.push(e)})})}};function At(l){let{top:t,left:e,width:r,height:i}=l.getBoundingClientRect(),n=a(l);if(n.length==6){var s=n;let o=s[0]*s[3]-s[1]*s[2];return{width:r/s[0]==0?1:s[0],height:i/s[3]==0?1:s[3],left:(e*s[3]-t*s[2]+s[2]*s[5]-s[4]*s[3])/o,top:(-e*s[1]+t*s[0]+s[4]*s[1]-s[0]*s[5])/o}}else return{top:t,left:e,width:r,height:i};function a(o){return window.getComputedStyle(o).transform.split(/\(|,|\)/).slice(1,-1).map(function(p){return parseFloat(p)})}}var yt=class{process(t,e=document.body){let r;try{r=e.getBoundingClientRect()}catch(a){r=document.body.getBoundingClientRect()}let i=At(t),n=i.top-r.top,s=i.left-r.left;return{top:n,left:s}}};function Mt(){return"ontouchstart"in window||navigator.maxTouchPoints>0}var St=class l{constructor(){this.modules=new Array;this.modulesUI=new Array;this.events=new z;this.loop=new ht;this.wW=0;this.wH=0;this._virtualCursor=new Q;this._lerp=new B;this._attribute=new mt;this._boundingClientRect=new gt;this._position=new yt;this._defaultSettings=new H;this.objects=new Map;this.connectQueue=new Array;this.globalId=1;this._parser=new R;this.isStarted=!1;this.fps=0;this.scrollMode="smooth";this.mMode="default";this.dMode="smooth";this.eventMap={scroll:"scroll",progress:"progress_",lerp:"lerp",inview:"inview_",cursor:"cursor","lazy-loaded":"all-image-loaded",update:"update",start:"start","mousemove-pixel":"mousemove_pixel_","mousemove-start":"mousemove_start_","mousemove-end":"mousemove_end_"};this.root=document.body,this.window=window,this.settings=new ot,this.data=new q,this.sEnSmooth=new at(document,this.settings,this.data),this.sEnDefault=new it(document,this.settings,this.data),this.sEnDisable=new st(document,this.settings,this.data),this.sEnSmooth.onScrollStop=this.onScrollStop.bind(this),this.sEnDefault.onScrollStop=this.onScrollStop.bind(this),this.sEnDisable.onScrollStop=this.onScrollStop.bind(this),this.sEnSmooth.onChangeDirection=this.onChangeDirection.bind(this),this.sEnDefault.onChangeDirection=this.onChangeDirection.bind(this),this.sEnDisable.onChangeDirection=this.onChangeDirection.bind(this),this.sEnSmooth.onScrollStart=this.onScrollStart.bind(this),this.sEnDefault.onScrollStart=this.onScrollStart.bind(this),this.sEnDisable.onScrollStart=this.onScrollStart.bind(this),this.sEn=this.sEnSmooth,this.scrollContainer=window,this.data.sC=this.window,this.data.sD="vertical",document.documentElement.classList.add("-vertical"),this.onWheelBind=this.onWheelEvent.bind(this),this.onScrollBind=this.onScrollEvent.bind(this),this.onResizeBind=this.onResize.bind(this),this.onMouseMoveBind=this.onMouseMoveEvent.bind(this),new ResizeObserver(()=>{Array.from(this.objects.values()).forEach(e=>{this.setupObject(e.el,e)}),this.onResize()}).observe(document.documentElement),this.loop.setOnFrame(()=>{this.onUpdateEvent()}),this.rebuild(),this.on("lazy-loaded",()=>{this.rebuild()}),document.addEventListener("visibilitychange",()=>{document.hidden?this.loop.stop():this.loop.start(this.fps)})}get scrollDirection(){return this.data.sD}set scrollDirection(t){this.data.sD=t,this.sEn.scrollDirection=t,this.sEnSmooth.scrollDirection=t,this.sEnDefault.scrollDirection=t,this.sEnDisable.scrollDirection=t,t=="horizontal"?(document.documentElement.classList.add("-horizontal"),document.documentElement.classList.remove("-vertical")):(document.documentElement.classList.add("-vertical"),document.documentElement.classList.remove("-horizontal")),this.rebuild(),this.initObjects(),this.modules.forEach(e=>{e.onChangeScrollDirection()})}get speedAccelerate(){return this.settings.speedAccelerate}set speedAccelerate(t){this.settings.speedAccelerate=.1+(.5-.1)*t}get speed(){return this.settings.speed}set speed(t){this.settings.speed=t}get scrollPosition(){return this.data.c}set scrollPosition(t){this.data.c=t,this.data.t=t,window.scrollTo(0,this.data.c);for(let e=0;e<this.modules.length;e++)this.modules[e].onScroll(this.data)}set scrollContainer(t){let e=this.data.sC!=null;e&&(this.data.sC.removeEventListener("scroll",this.onScrollBind),this.data.sC.removeEventListener("resize",this.onResizeBind)),this.sEn.scrollContainer=t,this.sEnSmooth.scrollContainer=t,this.sEnDefault.scrollContainer=t,this.sEnDisable.scrollContainer=t,this.data.sC=t,e&&(this.data.sC.addEventListener("scroll",this.onScrollBind),this.data.sC.addEventListener("resize",this.onResizeBind)),this.rebuild(),this.initObjects()}set scrollMobileMode(t){this.mMode=t,this.updateModeParams()}set scrollDesktopMode(t){this.dMode=t,this.updateModeParams()}updateModeParams(){switch(this.window.innerWidth<1024||Mt()?this.scrollMode=this.mMode:this.scrollMode=this.dMode,this.scrollMode){case"disable":this.data.sM="disable",this.sEn=this.sEnDisable,this.onChangeScrollParams(),document.documentElement.style.overflow="hidden";break;case"default":this.data.sM="default",this.sEn=this.sEnDefault,this.onChangeScrollParams(),document.documentElement.style.overflow="auto";break;case"smooth":this.data.sM="smooth",this.sEn=this.sEnSmooth,this.onChangeScrollParams(),document.documentElement.style.overflow="auto";break;default:this.data.sM="smooth",this.sEn=this.sEnSmooth,this.onChangeScrollParams(),document.documentElement.style.overflow="auto";break}}static getInstance(){return l.i||(l.i=new l),l.i}reuse(t){return this.modules.find(r=>r instanceof t)}use(t,e=null){let r=new t({data:this.data,lerp:this._lerp,attribute:this._attribute,boundingClientRect:this._boundingClientRect,position:this._position,virtualCursor:this._virtualCursor,events:this.events,loop:this.loop,defaultSettings:this._defaultSettings,parser:this._parser},e);r.type==1&&this.modules.push(r),r.type==2&&this.modulesUI.push(r)}start(t){this.fps=t,this.data.sC.addEventListener("scroll",this.onScrollBind),this.data.sC.addEventListener("resize",this.onResizeBind),this.root.addEventListener("wheel",this.onWheelBind,{passive:!1}),this.root.addEventListener("mousemove",this.onMouseMoveBind),this.loop.start(t),document.documentElement.classList.add("-string");for(let e=0;e<this.modules.length;e++)this.modules[e].onStart();for(let e=0;e<this.modulesUI.length;e++)this.modulesUI[e].onStart();this.initObjects(),this.initMutationObserver(),this.isStarted=!0,this.events.emit("start",null)}onChangeScrollParams(){for(let t=0;t<this.modules.length;t++)this.modules[t].onChangeScrollParams();for(let t=0;t<this.modulesUI.length;t++)this.modulesUI[t].onChangeScrollParams()}initObjects(){document.querySelectorAll("[string]").forEach(t=>{this.addObject(t)}),document.querySelectorAll("[string-copy-from]").forEach(t=>{let e=this._attribute.process(t,"string-copy-from");if(e!=null&&this.objects.has(e)){let r=this.objects.get(e);r!=null&&r.connects.push(t)}}),this.modules.forEach(t=>{t.onResize(),t.onScroll(this.data),t.onUpdate(this.data)})}destroy(){this.window.removeEventListener("scroll",this.onScrollBind),this.root.removeEventListener("wheel",this.onScrollBind),this.window.removeEventListener("resize",this.onResizeBind),this.root.removeEventListener("mousemove",this.onMouseMoveBind),this.loop.stop(),this.modules.forEach(t=>{t.destructor()}),this.modulesUI.forEach(t=>{t.destructor()}),this.modules=new Array,this.modulesUI=new Array,this.events=new z}on(t,e,r=""){let i=this.eventMap[t]+r;t==="start"&&this.isStarted&&e(),this.events.on(i,e)}off(t,e,r=""){let i=this.eventMap[t]+r;this.events.off(i,e)}setupSettings(t){t["string-offset-bottom"]!=null&&(this._defaultSettings.stringOffsetStart=t["string-offset-bottom"]),t["string-offset-top"]!=null&&(this._defaultSettings.stringOffsetEnd=t["string-offset-top"]),t["string-offset-right"]!=null&&(this._defaultSettings.stringOffsetStart=t["string-offset-right"]),t["string-offset-left"]!=null&&(this._defaultSettings.stringOffsetEnd=t["string-offset-left"]),t["string-inview-top"]!=null&&(this._defaultSettings.stringInviewTop=t["string-inview-top"]),t["string-inview-left"]!=null&&(this._defaultSettings.stringInviewTop=t["string-inview-left"]),t["string-inview-bottom"]!=null&&(this._defaultSettings.stringInviewBottom=t["string-inview-bottom"]),t["string-inview-right"]!=null&&(this._defaultSettings.stringInviewBottom=t["string-inview-right"]),t["string-enter-el"]!=null&&(this._defaultSettings.stringEnterEl=t["string-enter-el"]),t["string-enter-vp"]!=null&&(this._defaultSettings.stringEnterVp=t["string-enter-vp"]),t["string-exit-el"]!=null&&(this._defaultSettings.stringExitEl=t["string-exit-el"]),t["string-exit-vp"]!=null&&(this._defaultSettings.stringExitVp=t["string-exit-vp"]),t["string-key"]!=null&&(this._defaultSettings.stringKey=t["string-key"]),t["string-strength"]!=null&&(this._defaultSettings.stringStrength=t["string-strength"]),t["string-radius"]!=null&&(this._defaultSettings.stringRadius=t["string-radius"]),t["string-lerp"]!=null&&(this._defaultSettings.stringLerp=t["string-lerp"]),t["string-parallax-bias"]!=null&&(this._defaultSettings.stringParallaxBias=t["string-parallax-bias"]),t["string-parallax"]!=null&&(this._defaultSettings.stringParallax=t["string-parallax"])}setupObject(t,e){var w,E,S,_,x,U,M,C,Et,Pt,wt,xt;let r=this.getAllAttributes(t);(e==null?void 0:e.getProperty("observer-progress"))!=null&&(e==null||e.getProperty("observer-progress").disconnect()),(e==null?void 0:e.getProperty("observer-inview"))!=null&&(e==null||e.getProperty("observer-inview").disconnect()),e.id=(w=r["string-id"])!=null?w:`string-${this.globalId}`,e.keys=((E=r.string)!=null?E:"").split("|"),e.key=(S=r["string-key"])!=null?S:this._defaultSettings.stringKey,t.setAttribute("string-id",e.id);let i=this._boundingClientRect.process(t),n=i.width/this.data.scsW,s=i.height/this.data.scsH;e.setProperty("active",!0),e.setProperty("offset-end",this._parser.parseSingle((x=(_=r["string-offset-top"])!=null?_:r["string-offset-right"])!=null?x:this._defaultSettings.stringOffsetStart,t,this.data.wS,16)),e.setProperty("offset-start",this._parser.parseSingle((M=(U=r["string-offset-bottom"])!=null?U:r["string-offset-left"])!=null?M:this._defaultSettings.stringOffsetEnd,t,this.data.wS,16)),e.setProperty("inview-top",this._parser.parseSingle((Et=(C=r["string-inview-top"])!=null?C:r["string-inview-left"])!=null?Et:this._defaultSettings.stringInviewTop,t,this.data.sD=="vertical"?s:n,16)*-1),e.setProperty("inview-bottom",this._parser.parseSingle((xt=(wt=(Pt=r["string-inview"])!=null?Pt:r["string-inview-bottom"])!=null?wt:r["string-inview-right"])!=null?xt:this._defaultSettings.stringInviewBottom,t,this.data.sD=="vertical"?s:n,16)*-1);let a=this.data.sD=="vertical"?this._position.process(t,this.data.sC).top/this.data.scsH:this._position.process(t,this.data.sC).left/this.data.scsW;e.setProperty("start",a),e.setProperty("end",a+(this.data.sD=="vertical"?s:n)),e.setProperty("size",this.data.sD=="vertical"?s:n),e.setProperty("repeat",r["string-repeat"]!==void 0),e.setProperty("self-disable",r["string-self-disable"]!==void 0),e.setProperty("abs",r["string-abs"]!==void 0),e.setProperty("half-width",n/2),e.setProperty("half-height",s/2);let o=this.connectQueue.filter(P=>P.id==e.id);this.connectQueue=this.connectQueue.filter(P=>P.id!=e.id),o.forEach(P=>e.connects.push(P.element)),this.modules.forEach(P=>{P.tryConnect(e)&&(P.initObject(this.globalId,e,t,r),P.connect(e))});let h=e.getProperty("offset-start"),p=e.getProperty("offset-end"),d=P=>{P.forEach(ft=>{ft.isIntersecting?(this.events.emit(`activate_object_${e.id}`,!0),e.enter()):(this.events.emit(`activate_object_${e.id}`,!1),e.leave())})},u=P=>{P.forEach(ft=>{ft.isIntersecting?(this.events.emit(`inview_${e.id}`,!0),e.show()):(this.events.emit(`inview_${e.id}`,!1),e.hide())})},g={root:null,rootMargin:`${p+this.data.wS}px 0px ${h+this.data.wS}px 0px`,threshold:.001},y={root:null,rootMargin:`${p+e.getProperty("inview-top")}px 0px ${h+e.getProperty("inview-bottom")}px 0px`,threshold:.001},b=new IntersectionObserver(d,g),c=new IntersectionObserver(u,y);b.observe(t),c.observe(t),e.setProperty("observer-progress",b),e.setProperty("observer-inview",c)}getAllAttributes(t){let e={};return Array.from(t.attributes).forEach(r=>{e[r.name]=r.value}),e}addObject(t){let e=this._attribute.process(t,"string-inited"),r;e==null?r=new k(t):this.objects.has(this._attribute.process(t,"string-id"))?r=this.objects.get(this._attribute.process(t,"string-id")):r=new k(t),t.setAttribute("string-inited",""),this.setupObject(t,r),this.objects.set(r.id,r),this.globalId++}removeObject(t){let e=this.objects.get(t);(e==null?void 0:e.getProperty("observer-progress"))!=null&&(e==null||e.getProperty("observer-progress").disconnect()),(e==null?void 0:e.getProperty("observer-inview"))!=null&&(e==null||e.getProperty("observer-inview").disconnect()),this.objects.delete(t),e==null||e.el.removeAttribute("string-inited"),e==null||e.leave(),e=void 0}onMouseMoveEvent(t){this._virtualCursor.onMouseMove(t);for(let e=0;e<this.modules.length;e++)this.modules[e].onMouseMove(t);for(let e=0;e<this.modulesUI.length;e++)this.modulesUI[e].onMouseMove(t)}onWheelEvent(t){this.sEn.onWheel(t);for(let e=0;e<this.modules.length;e++)this.modules[e].onWheel(t);for(let e=0;e<this.modulesUI.length;e++)this.modulesUI[e].onWheel(t)}onScrollStart(){for(let t=0;t<this.modules.length;t++)this.modules[t].onScrollStart();for(let t=0;t<this.modulesUI.length;t++)this.modulesUI[t].onScrollStart()}onScrollStop(){for(let t=0;t<this.modules.length;t++)this.modules[t].onScrollStop();for(let t=0;t<this.modulesUI.length;t++)this.modulesUI[t].onScrollStop()}onChangeDirection(){for(let t=0;t<this.modules.length;t++)this.modules[t].onChangeDirection();for(let t=0;t<this.modulesUI.length;t++)this.modulesUI[t].onChangeDirection()}onScrollEvent(t){t.preventDefault(),this.sEn.onScroll(t);for(let e=0;e<this.modules.length;e++)this.modules[e].onScroll(this.data);for(let e=0;e<this.modulesUI.length;e++)this.modulesUI[e].onScroll(this.data);return this.events.emit("lerp",this.data.v),this.events.emit("scroll",this.data.c),!1}onUpdateEvent(){this._virtualCursor.onUpdate(),this.sEn.onUpdate();for(let t=0;t<this.modules.length;t++)this.modules[t].onUpdate(this.data);for(let t=0;t<this.modulesUI.length;t++)this.modulesUI[t].onUpdate(this.data);this.events.emit("update",null)}onResize(){let t=0,e=0;try{let r=this.sEn.scrollContainer.getBoundingClientRect();t=r.width,e=r.height}catch(r){t=this.sEn.scrollContainer.innerWidth,e=this.sEn.scrollContainer.innerHeight}this.data.sD=="vertical"?(this.data.bS=this.data.psH-e,this.data.wS=e):(this.data.bS=this.data.psW-t,this.data.wS=t),(this.wW!=t||this.window.innerWidth>1024)&&(this.rebuild(),this.modules.forEach(r=>{r.onResize()}),this.modulesUI.forEach(r=>{r.onResize()})),this.wW=t,this.wH=e}initMutationObserver(){let t=n=>{if(this._attribute.process(n,"string-fixed")!=null)return;let s=n.getAttribute("string-id"),a=this._attribute.process(n,"string-copy-from");a!=null&&(this.connectQueue=this.connectQueue.filter(o=>o.id!=a)),s!=null&&this.removeObject(s)},e=n=>{if(this._attribute.process(n,"string-fixed")!=null)return;this.addObject(n);let s=this._attribute.process(n,"string-copy-from");if(s!=null)if(this.objects.has(s)){let a=this.objects.get(s);a!=null&&a.connects.push(n)}else this.connectQueue.push({id:s,element:n})},r=new MutationObserver(n=>{n.forEach(s=>{s.type==="childList"&&(s.removedNodes.length>0&&s.removedNodes.forEach(a=>{if(a.nodeType===Node.ELEMENT_NODE){let o=a;o.hasAttribute("string")&&t(o),o.querySelectorAll("[string]").forEach(h=>{t(h)})}}),s.addedNodes.length>0&&s.addedNodes.forEach(a=>{if(a.nodeType===Node.ELEMENT_NODE){let o=a;o.hasAttribute("string")&&!o.hasAttribute("string-inited")&&e(o),o.querySelectorAll("[string]:not([string-inited])").forEach(h=>{e(h)})}}),(s.addedNodes.length>0||s.removedNodes.length>0)&&this.modules.forEach(a=>{a.onRebuild()}))})}),i={attributes:!1,childList:!0,subtree:!0};r.observe(document.body,i)}rebuild(){function t(i){return window.getComputedStyle(i).transform.split(/\(|,|\)/).slice(1,-1).map(function(s){return parseFloat(s)})}try{let i=t(this.data.sC);this.data.scsW=i[0],this.data.scsH=i[3]}catch(i){this.data.scsW=1,this.data.scsH=1}try{let i=this.data.sC.getBoundingClientRect();this.wW=i.width/this.data.scsW,this.wH=i.height/this.data.scsH}catch(i){this.wW=this.data.sC.innerWidth,this.wH=this.data.sC.innerHeight}this.wW<1024||Mt()?this.scrollMode=this.mMode:this.scrollMode=this.dMode;let e=document.body,r=document.documentElement;this.data.psW=this.data.sC.scrollWidth,this.data.psH=this.data.sC.scrollHeight,this.data.psW==null&&(this.data.psW=Math.max(e.scrollWidth,e.offsetWidth,r.clientWidth,r.scrollWidth,r.offsetWidth)),this.data.psH==null&&(this.data.psH=Math.max(e.scrollHeight,e.offsetHeight,r.clientHeight,r.scrollHeight,r.offsetHeight)),this.data.sD=="vertical"?(this.data.bS=this.data.psH-this.wH,this.data.wS=this.wH):(this.data.bS=this.data.psW-this.wW,this.data.wS=this.wW),this.data.hnwS=this.data.wS*-.5,this.updateModeParams()}};0&&(module.exports={StringAnchor,StringCursor,StringData,StringDelayLerpTracker,StringFPSTracker,StringGlide,StringLazy,StringLerp,StringLerpTracker,StringLoading,StringMagnetic,StringModule,StringObject,StringParallax,StringPositionTracker,StringProgress,StringResponsive,StringSVG,StringScrollbar,StringSplit,StringTune,StringVideoAutoplay});
40
+ //# sourceMappingURL=index.cjs.map