@fiddle-digital/string-tune 1.0.2 → 1.0.3

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 CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var At=Object.defineProperty;var qt=Object.getOwnPropertyDescriptor;var Nt=Object.getOwnPropertyNames;var $t=Object.prototype.hasOwnProperty;var Yt=(l,t)=>{for(var e in t)At(l,e,{get:t[e],enumerable:!0})},Ut=(l,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Nt(t))!$t.call(l,i)&&i!==e&&At(l,i,{get:()=>t[i],enumerable:!(r=qt(t,i))||r.enumerable});return l};var Xt=l=>Ut(At({},"__esModule",{value:!0}),l);var Gt={};Yt(Gt,{StringAnchor:()=>bt,StringCursor:()=>dt,StringData:()=>L,StringDelayLerpTracker:()=>Ct,StringFPSTracker:()=>Tt,StringGlide:()=>ft,StringLazy:()=>ut,StringLerp:()=>yt,StringLerpTracker:()=>It,StringLoading:()=>ht,StringMagnetic:()=>mt,StringModule:()=>h,StringObject:()=>C,StringParallax:()=>St,StringPositionTracker:()=>Pt,StringProgress:()=>I,StringResponsive:()=>vt,StringScrollbar:()=>Et,StringSplit:()=>wt,StringTune:()=>Ft,StringVideoAutoplay:()=>Ot,default:()=>Ft});module.exports=Xt(Gt);var X=class{constructor(t=.1,e){this.SETTLE_THRESHOLD=.1;this.smoothingFactor=t,this.context=e,this.onSettingsChange()}onMouseMove(t){this.context.data.cursor.targetX=t.clientX,this.context.data.cursor.targetY=t.clientY}onFrame(){let{targetX:t,targetY:e,smoothedX:r,smoothedY:i}=this.context.data.cursor,o=this.context.tools.lerp.process({from:r,to:t,progress:this.smoothingFactor}),s=this.context.tools.lerp.process({from:i,to:e,progress:this.smoothingFactor}),n=this.getStepDistance(o,s);this.isSettled(n)?this.snapToTarget():this.applyStep(o,s)}onSettingsChange(){let t=Number(this.context.settings.lerp);this.setLerpFactor(t)}setLerpFactor(t){this.smoothingFactor=this.context.tools.adaptiveLerp.process({value:t,inMin:.1,inMax:1,outMin:.05,outMax:.65})}getStepDistance(t,e){return Math.hypot(t,e)}isSettled(t){return t<this.SETTLE_THRESHOLD}snapToTarget(){this.context.data.cursor.smoothedX=this.context.data.cursor.targetX,this.context.data.cursor.smoothedY=this.context.data.cursor.targetY,this.context.data.cursor.stepX=0,this.context.data.cursor.stepY=0}applyStep(t,e){this.context.data.cursor.smoothedX+=t,this.context.data.cursor.smoothedY+=e,this.context.data.cursor.stepX=t,this.context.data.cursor.stepY=e}};var w=class{constructor(){this.listeners={}}on(t,e,r){let i=r?`${t}_${r}`:t;this.listeners[i]||(this.listeners[i]=new Set),this.listeners[i].add(e)}off(t,e,r){let i=r?`${t}_${r}`:t;this.listeners[i]&&this.listeners[i].delete(e)}emit(t,e){let r=this.listeners[t];if(r)for(let i of r)i(e)}onProgress(t,e){this.on(`progress:${t}`,e)}emitProgress(t,e){this.emit(`progress:${t}`,e)}onInview(t,e){this.on(`object:inview:${t}`,e)}emitInview(t,e){this.emit(`object:inview${t}`,e)}onScroll(t){this.on("scroll",t)}emitScroll(t){this.emit("scroll",t)}onUpdate(t){this.on("update",t)}emitUpdate(){this.emit("update")}clear(t){delete this.listeners[t]}clearAll(){this.listeners={}}};var _=class{constructor(t){this.data=t;this.modules=[];this.uiModules=[]}register(t){t.type===1&&this.modules.push(t),t.type===2&&this.uiModules.push(t)}find(t){return this.modules.find(e=>e instanceof t)}onInit(){[...this.modules,...this.uiModules].forEach(t=>t.onInit())}onFrame(){[...this.modules,...this.uiModules].forEach(t=>t.onFrame(this.data))}onScroll(){[...this.modules,...this.uiModules].forEach(t=>t.onScroll(this.data))}onResize(){[...this.modules,...this.uiModules].forEach(t=>t.onResize())}onMouseMove(t){[...this.modules,...this.uiModules].forEach(e=>e.onMouseMove(t))}onWheel(t){[...this.modules,...this.uiModules].forEach(e=>e.onWheel(t))}onDirectionChange(){[...this.modules,...this.uiModules].forEach(t=>t.onDirectionChange())}onScrollStart(){[...this.modules,...this.uiModules].forEach(t=>t.onScrollStart())}onScrollStop(){[...this.modules,...this.uiModules].forEach(t=>t.onScrollStop())}onAxisChange(){[...this.modules,...this.uiModules].forEach(t=>t.onAxisChange())}onDeviceChange(){[...this.modules,...this.uiModules].forEach(t=>t.onDeviceChange())}onScrollConfigChange(){[...this.modules,...this.uiModules].forEach(t=>t.onScrollConfigChange())}onSettingsChange(){[...this.modules,...this.uiModules].forEach(t=>t.onSettingsChange())}onDOMMutate(t,e){[...this.modules,...this.uiModules].forEach(r=>r.onDOMMutate(t,e))}destroy(){[...this.modules,...this.uiModules].forEach(t=>t.destroy()),this.modules=[],this.uiModules=[]}get all(){return[...this.modules,...this.uiModules]}get core(){return this.modules}get ui(){return this.uiModules}};var C=class{constructor(t,e){this.id="";this.keys=[];this.connects=[];this.properties=new Map;this.modules=[];this.events=new w;this.htmlElement=e,this.id=t}setProperty(t,e){this.properties.set(t,e)}getProperty(t){return this.properties.get(t)??null}enter(){this.events.emit("enter",this),this.setProperty("active",!0),this.modules.forEach(t=>{t.enterObject(this.id,this)})}leave(){this.events.emit("leave",this),this.setProperty("active",!1),this.modules.forEach(t=>{t.exitObject(this.id)})}show(){this.htmlElement.classList.add("-inview")}hide(){this.getProperty("repeat")&&this.htmlElement.classList.remove("-inview")}connect(t){this.modules.includes(t)||this.modules.push(t)}};var K=class{constructor(t,e,r){this.data=t;this.modules=e;this.events=r;this.objects=new Map;this.connectQueue=[];this.globalId=1}get all(){return this.objects}add(t){let e=t.getAttribute("string-id")??`string-${this.globalId++}`,r=e&&this.objects.has(e)?this.objects.get(e):new C(e,t);t.setAttribute("string-id",r.id);let i=t.getAttribute("string")??t.getAttribute("data-string");i&&(r.keys=(i??"").split("|")),t.setAttribute("string-inited",""),this.objects.set(r.id,r);let o=this.getAllAttributes(t);this.modules.core.forEach(n=>{"setupCoreProperties"in n&&typeof n.setupCoreProperties=="function"&&n.setupCoreProperties(r,t,o)}),this.modules.core.forEach(n=>{n.canConnect(r)&&(n.initializeObject(this.globalId,r,t,o),n.calculatePositions(r,this.data.viewport.windowHeight),n.connectObject(r))}),this.connectQueue.filter(n=>n.id===r.id).forEach(n=>r.connects.push(n.element)),this.connectQueue=this.connectQueue.filter(n=>n.id!==r.id),this.initObservers(r,t)}remove(t){let e=this.objects.get(t);e&&(e.events.clearAll(),e.getProperty("observer-progress")?.disconnect(),e.getProperty("observer-inview")?.disconnect(),e.htmlElement.removeAttribute("string-inited"),e.leave(),this.objects.delete(t))}enqueueConnection(t,e){this.connectQueue.push({id:t,element:e})}getAllAttributes(t){let e={};return Array.from(t.attributes).forEach(r=>{e[r.name]=r.value}),e}initObservers(t,e){let r=t.getProperty("offset-top")??0,i=t.getProperty("offset-bottom")??0,o=t.getProperty("inview-top")??0,s=t.getProperty("inview-bottom")??0;t.getProperty("observer-progress")?.disconnect(),t.getProperty("observer-inview")?.disconnect();let n=m=>{m.forEach(c=>{this.events.emit(`object:activate:${t.id}`,c.isIntersecting),c.isIntersecting?t.enter():t.leave()})},a=m=>{m.forEach(c=>{this.events.emit(`object:inview:${t.id}`,c.isIntersecting),c.isIntersecting?t.show():t.hide()})},p=new IntersectionObserver(n,{root:null,rootMargin:`${i+this.data.viewport.windowHeight}px 0px ${r+this.data.viewport.windowHeight}px 0px`,threshold:.001}),d=new IntersectionObserver(a,{root:null,rootMargin:`${i+o}px 0px ${r+s}px 0px`,threshold:.001});p.observe(e),d.observe(e),t.setProperty("observer-progress",p),t.setProperty("observer-inview",d)}observeDOM(){new MutationObserver(e=>{e.forEach(r=>{r.type==="childList"&&(r.removedNodes.forEach(i=>{if(i.nodeType!==Node.ELEMENT_NODE)return;let o=i;this.isFixed(o)||(o.hasAttribute("string")&&this.handleRemoved(o),o.querySelectorAll("[string],[data-string]").forEach(s=>{this.isFixed(s)||this.handleRemoved(s)}))}),r.addedNodes.forEach(i=>{if(i.nodeType!==Node.ELEMENT_NODE)return;let o=i;if(this.isFixed(o))return;o.hasAttribute("string")&&!o.hasAttribute("string-inited")&&this.add(o),o.querySelectorAll("[string]:not([string-inited]),[data-string]:not([string-inited])").forEach(n=>this.add(n));let s=o.getAttribute("string-copy-from")??o.getAttribute("data-string-copy-from");s&&(this.objects.has(s)?this.objects.get(s).connects.push(o):this.enqueueConnection(s,o))}),this.modules.all.forEach(i=>i.onDOMRebuild()))})}).observe(document.body,{childList:!0,subtree:!0})}handleRemoved(t){let e=t.getAttribute("string-id");if(!e)return;let r=t.getAttribute("string-copy-from")??t.getAttribute("data-string-copy-from");r&&(this.connectQueue=this.connectQueue.filter(i=>i.id!==r)),this.remove(e)}onSettingsChange(){this.objects.forEach(t=>{this.modules.core.forEach(e=>{if(e.canConnect(t)){let r=this.getAllAttributes(t.htmlElement);e.initializeObject(this.globalId,t,t.htmlElement,r),e.calculatePositions(t,this.data.viewport.windowHeight),e.connectObject(t)}})})}isFixed(t){return t.hasAttribute("string-fixed")}};var M=class{constructor(t){this.name="";this.isProg=!1;this.isParallaxEnabled=!1;this._scrollDirection="vertical";this.onChangeDirection=()=>{};this.onScrollStart=()=>{};this.onScrollStop=()=>{};this.onCalcUpdate=()=>{this.context.data.scroll.scrollContainer?.scrollTo(0,this.context.data.scroll.current)};this.document=document,this.context=t}set scrollDirection(t){this._scrollDirection=t,this._scrollDirection==="vertical"?this.onCalcUpdate=()=>{this.context.data.scroll.scrollContainer?.scrollTo(0,this.context.data.scroll.current)}:this._scrollDirection==="horizontal"&&(this.onCalcUpdate=()=>{this.context.data.scroll.scrollContainer?.scrollTo(this.context.data.scroll.current,0)})}onFrame(){}onWheel(t){}onScroll(t){}disableScrollEvents(){}enableScrollEvents(){}};var j=class extends M{constructor(e){super(e);this.name="default"}onFrame(){if(this.context.data.scroll.delta!==0){let e=this.context.data.scroll.delta*this.context.data.scroll.speedAccelerate;this.context.data.scroll.delta-=e,this.context.data.scroll.lerped=e,Math.abs(this.context.data.scroll.lerped)<.1&&(this.context.data.scroll.delta=0,this.context.data.scroll.lerped=0,this.onScrollStop())}}onScroll(e){let r=this.context.data.scroll.elementContainer.scrollTop;this.context.data.scroll.current=r,this.context.data.scroll.target=r,this.context.data.scroll.transformedCurrent=r}onWheel(e){if(e.deltaY!==0){this.context.data.scroll.delta===0&&this.onScrollStart();let r=e.deltaY;this.context.data.scroll.target===0&&(this.context.data.scroll.delta+=Math.max(0,e.deltaY)),this.context.data.scroll.delta+=r}}};var Q=class extends M{constructor(e){super(e);this.name="disable";this.preventScroll=e=>{e.preventDefault()};this.preventKeyScroll=e=>{["ArrowUp","ArrowDown","PageUp","PageDown"," ","Home","End"].includes(e.key)&&e.preventDefault()};this.onPreventScroll=this.preventScroll.bind(this);this.onPreventKeyScroll=this.preventKeyScroll.bind(this)}disableScrollEvents(){window.addEventListener("touchmove",this.onPreventScroll,{passive:!1}),window.addEventListener("keydown",this.onPreventKeyScroll)}enableScrollEvents(){window.removeEventListener("touchmove",this.onPreventScroll),window.removeEventListener("keydown",this.onPreventKeyScroll)}onFrame(){}onWheel(e){e.preventDefault()}onScroll(e){e.preventDefault()}};var G={SCROLL_FORWARD:"-scroll-forward",SCROLL_BACK:"-scroll-back"},J=class extends M{constructor(e){super(e);this.name="smooth";this.isScrollbarManipulation=!1;this.scrollForce=0;this.wheelImpulse=0;this.previousCurrent=0;this.isBottomScrollDirection=null;this.velocityThreshold=.1}updateScrollDirection(e){if(this.isBottomScrollDirection===null){this.isBottomScrollDirection=e;return}this.context.data.scroll.isScrollingDown=e,this.onChangeDirection(),document.documentElement.classList.toggle(G.SCROLL_FORWARD,e),document.documentElement.classList.toggle(G.SCROLL_BACK,!e)}stopScroll(){this.context.data.scroll.lerped=0,this.context.data.scroll.delta=0,this.context.data.scroll.target=this.context.data.scroll.current,this.isProg=!1,this.onCalcUpdate(),document.documentElement.classList.remove(G.SCROLL_BACK,G.SCROLL_FORWARD),this.isBottomScrollDirection=null}onFrame(){if(this.isScrollbarManipulation){this.isScrollbarManipulation=!1,this.context.data.scroll.current=this.context.data.scroll.elementContainer.scrollTop,this.context.data.scroll.target=this.context.data.scroll.elementContainer.scrollTop,this.context.data.scroll.transformedCurrent=this.context.data.scroll.current*this.context.data.viewport.transformScale;return}if(this.context.data.scroll.delta!==0){this.scrollForce=this.context.data.scroll.delta*this.context.data.scroll.speedAccelerate,this.context.data.scroll.target=Math.min(Math.max(0,this.context.data.scroll.target+this.scrollForce),this.context.data.scroll.bottomPosition),this.context.data.scroll.delta-=this.scrollForce,this.context.data.scroll.lerped=(this.context.data.scroll.target-this.context.data.scroll.current)*this.context.data.scroll.speed;let e=Math.abs(this.context.data.scroll.lerped);this.context.data.scroll.lerped>0?this.context.data.scroll.current=Math.ceil(this.context.data.scroll.current+this.context.data.scroll.lerped):this.context.data.scroll.current=Math.floor(this.context.data.scroll.current+this.context.data.scroll.lerped),this.context.data.scroll.transformedCurrent=this.context.data.scroll.current*this.context.data.viewport.transformScale,this.updateScrollDirection(this.context.data.scroll.lerped>0),e<this.velocityThreshold?(this.stopScroll(),this.onScrollStop()):(this.isProg=!0,this.previousCurrent!==this.context.data.scroll.current&&(this.previousCurrent=this.context.data.scroll.current,this.onCalcUpdate()))}}onWheel(e){if(e.deltaY!==0&&e.preventDefault(),this.wheelImpulse=e.deltaY,this.wheelImpulse===0)return;this.context.data.scroll.delta===0&&this.onScrollStart();let r=Math.sign(this.wheelImpulse),i=this.context.data.scroll.target===0&&r<0,o=this.context.data.scroll.target===this.context.data.scroll.bottomPosition&&r>0;i||o||(this.context.data.scroll.delta+=this.wheelImpulse)}onScroll(e){this.isProg||(this.isScrollbarManipulation=!0)}};var Z=class{constructor(t){this.context=t;this.modes=new Map;this.modes.set("smooth",new J(t)),this.modes.set("default",new j(t)),this.modes.set("disable",new Q(t)),this.updateResponsiveMode()}setMobileMode(t){this.context.data.scroll.modeMobile=t,this.updateResponsiveMode()}setDesktopMode(t){this.context.data.scroll.modeDesktop=t,this.updateResponsiveMode()}updateResponsiveMode(){let e=window.innerWidth<1080?this.context.data.scroll.modeMobile:this.context.data.scroll.modeDesktop;this.setMode(e)}updatePosition(){this.modes.forEach(t=>{t.onCalcUpdate()})}setMode(t){if(!this.modes.has(t)){console.warn(`[ScrollManager] Unknown scroll mode: ${t}`);return}this.get().enableScrollEvents(),this.context.data.scroll.mode=t,this.get().disableScrollEvents()}get(){return this.modes.get(this.context.data.scroll.mode)}getEngines(){return this.modes}onFrame(){this.get().onFrame()}onScroll(t){this.get().onScroll(t)}onWheel(t){this.get().onWheel(t)}bindEvents(t){this.modes.forEach(e=>{e.onScrollStart=t.onScrollStart,e.onScrollStop=t.onScrollStop,e.onChangeDirection=t.onDirectionChange})}};var tt=class{constructor(){this.targetX=0;this.targetY=0;this.smoothedX=0;this.smoothedY=0;this.stepX=0;this.stepY=0}};var et=class{constructor(){this.threeInstance=null}};var rt=class{constructor(){this.target=0;this.current=0;this.transformedCurrent=0;this.delta=0;this.lerped=0;this.displacement=0;this.isScrollingDown=!1;this.topPosition=0;this.bottomPosition=0;this.direction="vertical";this.elementContainer=document.documentElement;this.scrollContainer=window;this.container=document.body;this.mode="smooth";this.modeMobile="smooth";this.modeDesktop="smooth";this.speed=.1;this.speedAccelerate=.25}};var it=class{constructor(){this.now=0;this.previous=0;this.delta=0;this.elapsed=0}};var ot=class{constructor(){this.windowWidth=0;this.windowHeight=0;this.contentWidth=0;this.contentHeight=0;this.scaleWidth=1;this.scaleHeight=1;this.transformScale=1;this.baseRem=16}};var L=class{constructor(){this.scroll=new rt;this.viewport=new ot;this.cursor=new tt;this.render=new et;this.time=new it}};var h=class{constructor(t){this.objectMap=new Map;this.objects=[];this.htmlKey="";this._type=1;this.tools=t.tools,this.data=t.data,this.settings=t.settings,this.events=t.events,this.attributesToMap=[{key:"active",type:"boolean",fallback:this.settings.active},{key:"fixed",type:"boolean",fallback:this.settings.fixed},{key:"repeat",type:"boolean",fallback:this.settings.repeat},{key:"self-disable",type:"boolean",fallback:this.settings["self-disable"]},{key:"abs",type:"boolean",fallback:this.settings.abs},{key:"key",type:"string",fallback:this.settings.key},{key:"offset-top",type:"dimension",fallback:this.settings["offset-top"]},{key:"offset-bottom",type:"dimension",fallback:this.settings["offset-bottom"]},{key:"inview-top",type:"dimension",fallback:this.settings["inview-top"]},{key:"inview-bottom",type:"dimension",fallback:this.settings["inview-bottom"]},{key:"start",type:"number",fallback:(e,r,i)=>{let o=i.top;return Math.floor(o)+this.data.scroll.container.scrollTop*this.data.viewport.transformScale}},{key:"end",type:"number",fallback:(e,r,i)=>{let o=i.top,s=i.height;return o+s-this.data.scroll.transformedCurrent}},{key:"size",type:"number",fallback:(e,r,i)=>i.height},{key:"half-width",type:"number",fallback:(e,r,i)=>i.width/2},{key:"half-height",type:"number",fallback:(e,r,i)=>i.height/2}]}get type(){return this._type}initializeObject(t,e,r,i){let o=this.tools.boundingClientRect.process({element:r});for(let{key:s,type:n,fallback:a,transform:p}of this.attributesToMap){let d=typeof a=="function"?a(r,e,o):a,m=this.tools.domAttribute.process({element:r,key:s,fallback:i[s]??this.settings[s]??d}),c=this.parseAttribute(m,n,{element:r,viewportHeight:this.data.viewport.windowHeight,baseRem:this.data.viewport.baseRem});p&&(c=p(c)),e.setProperty(s,c)}}calculatePositions(t,e){}parseAttribute(t,e,r={}){if(t==null)return null;if(typeof e=="object"&&e.type==="enum")return e.values.includes(t)?t:e.values[0];switch(e){case"number":return parseFloat(t);case"boolean":return t===""||t==="true";case"json":try{return JSON.parse(t)}catch{return null}case"tuple":return t.trim().split(/\s+/);case"easing":return this.tools.easingFunction.process({easing:t});case"color":return this.tools.colorParser.process({value:t});case"dimension":return t=="0"?0:r.element!=null&&r.viewportHeight!=null&&r.baseRem!=null?this.tools.unitParser.process({value:t,element:r.element,viewportHeight:r.viewportHeight,baseRem:r.baseRem}):0;default:return t}}canConnect(t){return t.keys.includes(this.htmlKey)}connectObject(t){t.connect(this),this.onObjectConnected(t)}enterObject(t,e){this.objectMap.has(t)||(this.objectMap.set(t,e),this.objects.push(e))}exitObject(t){let e=this.objectMap.get(t);if(!e)return;this.objectMap.delete(t);let r=this.objects.indexOf(e);r!==-1&&this.objects.splice(r,1)}onObjectConnected(t){}applyToElementAndConnects(t,e){e(t.htmlElement),t.connects.forEach(e)}destroy(){this.objects=[],this.objectMap=new Map}onInit(){}onFrame(t){}onResize(){}onScroll(t){}onDirectionChange(){}onScrollStart(){}onScrollStop(){}onScrollDirectionChange(){}onAxisChange(){}onDeviceChange(){}onScrollConfigChange(){}onSettingsChange(){}onDOMRebuild(){}onMouseMove(t){}onWheel(t){}onDOMMutate(t,e){}};var O=class{process({element:t}){return t.getBoundingClientRect()}};var D=class{process({element:t,key:e,fallback:r=null}){return t.getAttribute(`string-${e}`)??t.getAttribute(`data-string-${e}`)??r}};var k=class{process({record:t,name:e,fallback:r=null}){return t[e]??t[`data-${e}`]??r}};var E=class{process({element:t}){let e=t.getBoundingClientRect(),i=getComputedStyle(t).transform.match(/-?[\d.]+/g)?.map(parseFloat)??[];if(i.length===6){let[o,s,n,a,p,d]=i,m=o*a-s*n;return{width:e.width/(o||1),height:e.height/(a||1),left:(e.left*a-e.top*n+n*d-p*a)/m,top:(-e.left*s+e.top*o+p*s-o*d)/m}}return e}};var H=class{constructor(t=new E){this.transformTool=t}process({element:t,container:e=document.body}){let r;try{r=e.getBoundingClientRect()}catch{r=document.body.getBoundingClientRect()}let i=this.transformTool.process({element:t});return{top:i.top-r.top,left:i.left-r.left}}};var R=class{process({from:t,to:e,progress:r}){return(e-t)*r}};var A=class{process({value:t,element:e,viewportHeight:r,baseRem:i}){let o=t.startsWith("-");o&&(t=t.slice(1));let s=0;return t==="selfHeight"?s=e.offsetHeight:t.endsWith("px")?s=parseFloat(t):t.endsWith("%")?s=parseFloat(t)/100*r:t.endsWith("rem")&&(s=parseFloat(t)*i),o?-s:s}};var F=class{process({value:t,inMin:e=.1,inMax:r=1,outMin:i=.05,outMax:o=.65}){if(t<e)return o;if(t>1&&(t=1),t<=r){let s=(t-e)/(r-e);return o-s*(o-i)}return i}};var W=class{process({value:t}){let e=t.trim();if(e.startsWith("random(")&&e.endsWith(")")){let r=e.slice(7,-1).split(",").map(o=>o.trim()).filter(Boolean),i=Math.floor(Math.random()*r.length);return r[i]}return e}};var V=class{process({value:t}){let e=t.trim().toLowerCase();if(e.startsWith("#")){let o=e.slice(1);o.length===3&&(o=o.split("").map(d=>d+d).join(""));let s=parseInt(o.slice(0,2),16),n=parseInt(o.slice(2,4),16),a=parseInt(o.slice(4,6),16),p=o.length===8?parseInt(o.slice(6,8),16)/255:1;return{r:s,g:n,b:a,a:p}}let r=e.match(/rgba?\(([^)]+)\)/);if(r){let[o,s,n,a=1]=r[1].split(",").map(p=>parseFloat(p.trim()));return{r:o,g:s,b:n,a}}let i=e.match(/hsla?\(([^)]+)\)/);if(i){let[o,s,n,a="1"]=i[1].split(",").map(c=>c.trim()),[p,d,m]=this.hslToRgb(parseFloat(o),parseFloat(s),parseFloat(n));return{r:p,g:d,b:m,a:parseFloat(a)}}return{r:0,g:0,b:0,a:0}}hslToRgb(t,e,r){t=t/360,e=parseFloat(e.toString())/100,r=parseFloat(r.toString())/100;let i=(d,m,c)=>(c<0&&(c+=1),c>1&&(c-=1),c<1/6?d+(m-d)*6*c:c<1/2?m:c<2/3?d+(m-d)*(2/3-c)*6:d),o=r<.5?r*(1+e):r+e-r*e,s=2*r-o,n=Math.round(i(s,o,t+1/3)*255),a=Math.round(i(s,o,t)*255),p=Math.round(i(s,o,t-1/3)*255);return[n,a,p]}};var z=class{process({value:t,rules:e,messages:r={}}){for(let i of e){let o=null;if(i==="required"&&t.trim()===""?o="required":i==="email"&&!/^\S+@\S+\.\S+$/.test(t)?o="invalid-email":typeof i=="object"&&(i.type==="minLength"&&t.length<i.value&&(o="too-short"),i.type==="maxLength"&&t.length>i.value&&(o="too-long")),o){let s=r[o],n=typeof s=="function"?s({value:t,rule:i}):s??this.defaultMessage(o,i);return{valid:!1,error:o,message:n}}}return{valid:!0,error:null,message:null}}defaultMessage(t,e){switch(t){case"required":return"This field is required.";case"invalid-email":return"Please enter a valid email.";case"too-short":return`Too short${typeof e=="object"&&"value"in e?` (min ${e.value})`:""}.`;case"too-long":return`Too long${typeof e=="object"&&"value"in e?` (max ${e.value})`:""}.`}}};var B=class{constructor(){this.namedCurves={linear:[0,0,1,1],ease:[.25,.1,.25,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]}}process({easing:t}){let e=t.trim();if(this.namedCurves[e])return this.cubicBezier(...this.namedCurves[e]);let r=e.match(/^cubic-bezier\s*\(\s*([-+]?\d*\.?\d+)\s*,\s*([-+]?\d*\.?\d+)\s*,\s*([-+]?\d*\.?\d+)\s*,\s*([-+]?\d*\.?\d+)\s*\)$/);if(r){let[i,o,s,n]=r.slice(1).map(Number);return this.cubicBezier(i,o,s,n)}return i=>i}cubicBezier(t,e,r,i){let o=3*t,s=3*(r-t)-o,n=1-o-s,a=3*e,p=3*(i-e)-a,d=1-a-p;function m(u){return((n*u+s)*u+o)*u}function c(u){return((d*u+p)*u+a)*u}function g(u){return(3*n*u+2*s)*u+o}function b(u,x=1e-5){let y,f,v=u,S,U,P;for(P=0;P<8;P++){if(S=m(v)-u,Math.abs(S)<x)return v;if(U=g(v),Math.abs(U)<1e-6)break;v=v-S/U}for(y=0,f=1,v=u;y<f;){if(S=m(v)-u,Math.abs(S)<x)return v;S>0?f=v:y=v,v=(f+y)/2}return v}return function(u){return c(b(u))}}};var q=class{process({distance:t,radius:e,strength:r}){if(t>=e)return 0;let i=(e-t)/e;return r*i}};var N=class{process({from:t,to:e,progress:r}){return{r:t.r+(e.r-t.r)*r,g:t.g+(e.g-t.g)*r,b:t.b+(e.b-t.b)*r,a:t.a+(e.a-t.a)*r}}};var $=class{process({from:t,to:e,progress:r}){return{x:(e.x-t.x)*r,y:(e.y-t.y)*r}}};var Y=class{process({value:t}){let r=t?.trim();if(!r||r==="none")return 1;try{if(r.startsWith("matrix(")){let i=r.match(/matrix\(([^)]+)\)/);if(i&&i[1]){let o=i[1].split(",").map(s=>parseFloat(s.trim()));if(o.length>=1&&!isNaN(o[0]))return o[0]}}if(r.startsWith("scale(")){let i=r.match(/scale\(([^)]+)\)/);if(i&&i[1]){let o=i[1].split(",").map(s=>parseFloat(s.trim()));if(o.length>=1&&!isNaN(o[0]))return o[0]}}if(r.startsWith("scaleX(")){let i=r.match(/scaleX\(([^)]+)\)/);if(i&&i[1]){let o=parseFloat(i[1].trim());if(!isNaN(o))return o}}if(r.startsWith("scale3d(")){let i=r.match(/scale3d\(([^)]+)\)/);if(i&&i[1]){let o=i[1].split(",").map(s=>parseFloat(s.trim()));if(o.length>=1&&!isNaN(o[0]))return o[0]}}if(r.startsWith("matrix3d(")){let i=r.match(/matrix3d\(([^)]+)\)/);if(i&&i[1]){let o=i[1].split(",").map(s=>parseFloat(s.trim()));if(o.length>=1&&!isNaN(o[0]))return o[0]}}}catch(i){return console.error(`Error parsing transform string "${r}":`,i),1}return 1}};var nt=class{process({processedWords:t,lines:e,options:r,totalChars:i}){let o=[],s=0,n=new Map;e.forEach((d,m)=>{let c=d.words.reduce((g,b)=>g+b.text.length,0);n.set(m,c)});let a=0,p=-1;return t.forEach(d=>{let m=d.text,c=d.lineIndex,g=m.length,b=n.get(c)||0;c!==p&&(a=0,p=c),Array.from(m).forEach((x,y)=>{let f=[];r.char&&r.char.forEach(v=>{let S=this.calculateIndex(v,s,y,i);f.push({value:S,type:"char",align:v.align})}),r.charLine&&r.charLine.forEach(v=>{let S=this.calculateIndex(v,a,y,b);f.push({value:S,type:"charLine",align:v.align})}),r.charWord&&r.charWord.forEach(v=>{let S=this.calculateIndex(v,y,y,g);f.push({value:S,type:"charWord",align:v.align})}),o.push({text:x,globalCharIndex:s,lineCharIndex:a,wordCharIndex:y,parentGlobalWordIndex:d.globalIndex,parentLineIndex:d.lineIndex,parentWordIndexInLine:d.wordIndexInLine,calculatedValues:f}),s++,a++})}),o}calculateIndex(t,e,r,i){let o=e;if(t.align==="random"){let s=t.random?.min??0,n=t.random?.max??(i>0?i-1:0),a=Math.min(s,n),p=Math.max(s,n);o=Math.floor(Math.random()*(p-a+1))+a}else t.align==="end"?o=(i>0?i-1:0)-e:t.align==="center"&&(o=e-Math.floor(i/2));return t.abs&&(o=Math.abs(o)),o}};var st=class{process({text:t,targetElement:e}){if(!t||!e||e.offsetWidth<=0)return console.warn("LayoutLineSplitterTool: Invalid input or target element has zero width."),[];let i=this.decodeHtmlEntity(t).trim().split(/\s+/).filter(c=>c.length>0);if(i.length===0)return[];let o=document.createElement("span"),s=window.getComputedStyle(e);o.style.fontFamily=s.fontFamily,o.style.fontSize=s.fontSize,o.style.fontWeight=s.fontWeight,o.style.letterSpacing=s.letterSpacing,o.style.textTransform=s.textTransform,o.style.wordSpacing=s.wordSpacing,o.style.whiteSpace="nowrap",o.style.visibility="hidden",o.style.position="absolute",o.style.top="-9999px",o.style.left="-9999px",document.body.appendChild(o);let n=[],a=[],p=0,d=this.measureWidth(" ",o),m=e.offsetWidth;try{i.forEach(c=>{let g=this.measureWidth(c,o),b=p+(a.length>0?d:0)+g;a.length>0&&b>m?(n.push({text:a.join(" "),words:a.map(u=>({text:u}))}),a=[c],p=g):(a.push(c),p=a.length===1?g:b)}),a.length>0&&n.push({text:a.join(" "),words:a.map(c=>({text:c}))})}finally{o.parentNode===document.body&&document.body.removeChild(o)}return n}measureWidth(t,e){return e.textContent=t,e.offsetWidth}decodeHtmlEntity(t){return t.replace(/&amp;/g,"&")}};var at=class{process({lines:t,words:e,chars:r,options:i}){let o=document.createElement("div"),s=0,n=0,a=this.hasLineOptions(i),p=this.hasWordOptions(i),d=this.hasCharOptions(i);return t.forEach((m,c)=>{let g=a?document.createElement("span"):o;a&&(g.classList.add("-s-line"),o.appendChild(g));let b=e.slice(s,s+m.words.length);s+=m.words.length,b.forEach((u,x)=>{let y=r.slice(n,n+u.text.length);if(n+=u.text.length,p){let f=document.createElement("span");f.classList.add("-s-word"),this.applyStyles(f,u.calculatedValues),d&&u.text.length>0?y.forEach(v=>{let S=this.createCharSpan(v);f.appendChild(S)}):u.text.length>0&&f.appendChild(document.createTextNode(u.text)),g.appendChild(f)}else d&&u.text.length>0?y.forEach(f=>{let v=this.createCharSpan(f);g.appendChild(v)}):u.text.length>0&&g.appendChild(document.createTextNode(u.text));(x<b.length-1||a==!1)&&g.appendChild(document.createTextNode("\xA0"))})}),o.innerHTML}createCharSpan(t){let e=document.createElement("span");return e.classList.add("-s-char"),e.textContent=t.text,this.applyStyles(e,t.calculatedValues),e}hasLineOptions(t){return(t.line?.length??0)>0||(t.wordLine?.length??0)>0||(t.charLine?.length??0)>0}hasWordOptions(t){return(t.word?.length??0)>0||(t.wordLine?.length??0)>0}hasCharOptions(t){return(t.char?.length??0)>0||(t.charLine?.length??0)>0||(t.charWord?.length??0)>0}applyStyles(t,e){e&&e.forEach(r=>{let i=this.generateVariableName(r.type,r.align);t.style.setProperty(i,String(r.value))})}generateVariableName(t,e){return`--${t}-${e}`}};var lt=class{process({lines:t,options:e}){let r=[],i=0,o=t.reduce((s,n)=>s+n.words.length,0);return t.forEach((s,n)=>{let a=s.words,p=a.length;a.forEach((d,m)=>{let c=[];e.word&&e.word.length>0&&e.word.forEach(g=>{let b=this.calculateIndex(g,i,m,o);c.push({value:b,type:"word",align:g.align})}),e.wordLine&&e.wordLine.length>0&&e.wordLine.forEach(g=>{let b=this.calculateIndex(g,m,m,p);c.push({value:b,type:"wordLine",align:g.align})}),r.push({text:d.text,globalIndex:i,lineIndex:n,wordIndexInLine:m,calculatedValues:c}),i++})}),r}calculateIndex(t,e,r,i){let o=e;if(t.align==="random"){let s=t.random?.min??0,n=t.random?.max??(i>0?i-1:0),a=Math.min(s,n),p=Math.max(s,n);o=Math.floor(Math.random()*(p-a+1))+a}else t.align==="end"?o=(i>0?i-1:0)-e:t.align==="center"&&(o=e-Math.floor(i/2));return t.abs&&(o=Math.abs(o)),o}};var ct=class{process({attributeValue:t}){let e={line:[],word:[],char:[],charLine:[],charWord:[],wordLine:[]};return t&&t.split("|").forEach(i=>{let o=i.trim();if(!o)return;let s=o.match(/^(\w+-)?(\w+)(\[(.*?)\])?$/);if(s){let n=s[1]||"",a=s[2],p=n+a,m=(s[4]||"").split(";").map(g=>g.trim()).filter(g=>g.length>0),c=this.parseParamsArray(m);switch(p){case"line":e.line.push(c);break;case"word":e.word.push(c);break;case"char":e.char.push(c);break;case"charLine":e.charLine.push(c);break;case"charWord":e.charWord.push(c);break;case"wordLine":e.wordLine.push(c);break;default:console.warn(`SplitOptionsParserTool: Unrecognized option type "${p}" in part "${o}"`);break}}else console.warn(`SplitOptionsParserTool: Could not parse part format "${o}"`)}),e}parseParamsArray(t){let e={align:"start"};return t.forEach(r=>{if(r==="abs")e.abs=!0;else if(r.startsWith("random")){e.align="random";let i=r.match(/random\(\s*(\d+)\s*,\s*(\d+)\s*\)/);i&&(e.random={min:parseInt(i[1],10),max:parseInt(i[2],10)})}else["start","center","end"].includes(r)&&(e.align=r)}),e}};var pt=class{constructor(){this.domAttribute=new D;this.recordAttribute=new k;this.transformNullify=new E;this.boundingClientRect=new O;this.relativePosition=new H(this.transformNullify);this.unitParser=new A;this.lerp=new R;this.adaptiveLerp=new F;this.originParser=new W;this.colorParser=new V;this.validation=new z;this.easingFunction=new B;this.magneticPull=new q;this.lerpColor=new N;this.lerpVector=new $;this.transformScaleParser=new Y;this.layoutSplitter=new st;this.wordIndexer=new lt;this.charIndexer=new nt;this.domBuilder=new at;this.optionsParser=new ct}};var dt=class extends h{constructor(e){super(e);this.enterObjectsMap=new Map;this.enterObjects=new Array;this.overCount=0;this.htmlKey="cursor",this.cursor=document.querySelector("[string-cursor],[data-string-cursor]"),this.cursorContent=document.querySelector("[string-cursor-content],[data-string-cursor-content]"),this.attributesToMap=[...this.attributesToMap,{key:"target-disable",type:"boolean",fallback:this.settings["target-disable"]},{key:"target-style-disable",type:"boolean",fallback:this.settings["target-style-disable"]},{key:"target-class",type:"string",fallback:this.settings["target-class"]},{key:"cursor-class",type:"string",fallback:this.settings["cursor-class"]},{key:"alignment",type:{type:"enum",values:["start","center","end"]},fallback:this.settings.alignment},{key:"lerp",type:"number",fallback:this.settings.lerp,transform:r=>this.tools.adaptiveLerp.process({value:r,inMin:.1,inMax:1,outMin:.05,outMax:.65})}]}initializeObject(e,r,i,o){super.initializeObject(e,r,i,o),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)}onFrame(e){requestAnimationFrame(()=>{this.objects.forEach(n=>{let a=n.getProperty("is-mouse-over"),p=n.getProperty("cursor-target-disable"),d=n.getProperty("lerp")??.15;if(a&&!p){let m=n.htmlElement.getBoundingClientRect(),c=this.data.cursor.targetX,g=this.data.cursor.targetY,b=c-m.left,u=g-m.top,x=n.getProperty("mouse-pixel-x")??0,y=n.getProperty("mouse-pixel-y")??0,f=x-b,v=y-u;if(f*f+v*v>1e-4){(n.getProperty("is-mouse-move")??!1)||(n.setProperty("is-mouse-move",!0),n.setProperty("mouse-pixel-x",b),n.setProperty("mouse-pixel-y",u),n.setProperty("mouse-x",b),n.setProperty("mouse-y",u),x=b,y=u,this.events.emit(`cursor:start:${n.id}`,null));let P=this.tools.lerp.process({from:x,to:b,progress:d}),Bt=this.tools.lerp.process({from:y,to:u,progress:d}),Dt=x+P,kt=y+Bt;n.setProperty("mouse-pixel-x",Dt),n.setProperty("mouse-pixel-y",kt);let Wt=n.getProperty("alignment")??"center",Ht=this.calculateOffset(Wt,Dt,m.width),Rt=this.calculateOffset(Wt,kt,m.height);n.setProperty("mouse-x",Ht),n.setProperty("mouse-y",Rt),this.setMouseCoordinates(n,Ht,Rt),this.events.emit(`cursor:move:${n.id}`,{x:Ht,y:Rt}),this.events.emit(`cursor:pixel:${n.id}`,{x:Dt,y:kt})}else n.setProperty("mouse-pixel-x",b),n.setProperty("mouse-pixel-y",u),this.events.emit(`cursor:end:${n.id}`,null)}else{let m=n.getProperty("mouse-x")??0,c=n.getProperty("mouse-y")??0;if(m!==0||c!==0){n.setProperty("is-mouse-move",!1);let g=n.htmlElement.getBoundingClientRect(),b=n.getProperty("half-width")??g.width/2,u=n.getProperty("half-height")??g.height/2,x=this.calculateOffset("center",b,g.width),y=this.calculateOffset("center",u,g.height),f=m+this.tools.lerp.process({from:m,to:x,progress:d}),v=c+this.tools.lerp.process({from:c,to:y,progress:d});n.setProperty("mouse-x",f),n.setProperty("mouse-y",v),Math.abs(f)<.001&&Math.abs(v)<.001&&(n.setProperty("mouse-x",0),n.setProperty("mouse-y",0),n.setProperty("mouse-pixel-x",0),n.setProperty("mouse-pixel-y",0)),this.setMouseCoordinates(n,f,v)}}});let{stepX:r,stepY:i,smoothedX:o,smoothedY:s}=this.data.cursor;(r!==0||i!==0)&&(this.events.emit("cursor",{stepX:r,stepY:i,x:o,y:s}),this.cursor.style.setProperty("--x",o.toString()),this.cursor.style.setProperty("--y",s.toString()),this.cursor.style.setProperty("--x-lerp",r.toString()),this.cursor.style.setProperty("--y-lerp",i.toString()))})}onObjectConnected(e){let r=e.htmlElement;e.setProperty("timeoutId",null),e.setProperty("mouseleave",()=>{this.onMouseLeave(e)}),e.setProperty("mouseenter",()=>{this.onMouseEnter(e)}),e.setProperty("onEnterEvent",this.onEnterObject.bind(this)),e.events.on("enter",e.getProperty("onEnterEvent")),e.setProperty("onLeaveEvent",this.onLeaveObject.bind(this)),e.events.on("leave",e.getProperty("onLeaveEvent"))}getCursorClass(e){let r=e.getProperty("cursor-class");return r!=null&&r.length>0?r:null}onMouseEnter(e){this.overCount++,e.setProperty("is-mouse-over",!0);let r=this.getCursorClass(e);r&&this.cursor.classList.add(r),this.cursor.classList.add("-showing"),e.setProperty("timeoutId",setTimeout(()=>{this.cursor.classList.remove("-showing"),this.cursor.classList.add("-show")},1200)),e.htmlElement.addEventListener("mouseleave",e.getProperty("mouseleave"))}onMouseLeave(e){this.overCount--,e.setProperty("is-mouse-over",!1),e.getProperty("timeoutId")&&(clearTimeout(e.getProperty("timeoutId")),e.setProperty("timeoutId",null));let r=this.getCursorClass(e);r&&this.cursor.classList.remove(r),this.cursor.classList.remove("-showing"),this.cursor.classList.remove("-show"),e.htmlElement.removeEventListener("mouseleave",e.getProperty("mouseleave"))}onEnterObject(e){e.htmlElement.addEventListener("mouseenter",e.getProperty("mouseenter"))}onLeaveObject(e){e.htmlElement.removeEventListener("mouseenter",e.getProperty("mouseenter")),e.htmlElement.removeEventListener("mouseleave",e.getProperty("mouseleave"))}setMouseCoordinates(e,r,i){e.getProperty("cursor-target-style-disable")||this.applyToElementAndConnects(e,o=>{o.style.setProperty("--x",r.toFixed(2)),o.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 mt=class extends h{constructor(t){super(t),this.htmlKey="magnetic",this.attributesToMap=[...this.attributesToMap,{key:"strength",type:"number",fallback:this.settings.strength},{key:"radius",type:"number",fallback:this.settings.radius}]}initializeObject(t,e,r,i){super.initializeObject(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("lerp",.1)}onMouseMove(t){this.objects.forEach(e=>{let i=e.htmlElement.getBoundingClientRect(),o=i.left+(e.getProperty("half-width")??0),s=i.top+(e.getProperty("half-height")??0),n=t.clientX-o,a=t.clientY-s,p=Math.sqrt(n**2+a**2),d=e.getProperty("radius")??0,m=e.getProperty("strength")??0,c=this.tools.magneticPull.process({distance:p,radius:d,strength:m});e.setProperty("magnetic-target-x",n*c),e.setProperty("magnetic-target-y",a*c),c>0&&e.setProperty("is-magneting",!0)})}onFrame(t){this.objects.forEach(e=>{if(e.getProperty("is-magneting")){let r=e.getProperty("magnetic-x")??0,i=e.getProperty("magnetic-y")??0,o=e.getProperty("lerp")??0,s=e.getProperty("magnetic-target-x")??0,n=e.getProperty("magnetic-target-y")??0,a=this.tools.lerp.process({from:r,to:s,progress:o}),p=this.tools.lerp.process({from:i,to:n,progress:o});a>-.01&&a<.01&&(a=0,e.setProperty("magnetic-x",e.getProperty("magnetic-target-x"))),p>-.01&&p<.01&&(p=0,e.setProperty("magnetic-y",e.getProperty("magnetic-target-y"))),r+=a,i+=p,e.setProperty("magnetic-x",r),e.setProperty("magnetic-y",i),this.events.emit(`magnetic:move:${e.id}`,{x:r,y:i}),this.applyToElementAndConnects(e,d=>{d.style.setProperty("--magnetic-x",r.toString()),d.style.setProperty("--magnetic-y",i.toString())}),(e.getProperty("magnetic-target-x")==r||e.getProperty("magnetic-target-y")==i)&&e.setProperty("is-magneting",!1)}})}};var ut=class extends h{constructor(e){super(e);this.isStartLoaded=!1;this.loadingCount=0;this.htmlKey="lazy"}onInit(){document.querySelectorAll("img[string-lazy], img[data-string-lazy]").forEach(r=>this.loadImage(r)),this.isStartLoaded=!0}onObjectConnected(e){if(this.loadingCount++,this.isStartLoaded){let r=e.htmlElement;this.loadImage(r)}}async loadImage(e){let r=this.tools.domAttribute.process({element:e,key:this.htmlKey,fallback:""});if(r)try{e.classList.add("lazyLoad"),e.src=r,e.addEventListener("load",()=>{e.classList.add("-loaded")}),await this.setAspectRatio(e,r)}catch{console.warn("Failed to load image:",r)}}setAspectRatio(e,r){return new Promise((i,o)=>{let s=new XMLHttpRequest;s.open("GET",r,!0),s.responseType="arraybuffer",s.setRequestHeader("Range","bytes=0-"),s.onload=()=>{if(s.status===200||s.status===206){let n=new Blob([s.response]),a=new Image;a.onload=()=>{e.style.aspectRatio=`${a.width} / ${a.height}`,URL.revokeObjectURL(a.src),this.loadingCount--,this.loadingCount<=0&&(this.events.emit("image:load:all",null),this.loadingCount=0),i()},a.onerror=()=>{URL.revokeObjectURL(a.src),this.loadingCount--,o(new Error("Image failed to decode"))},a.src=URL.createObjectURL(n)}else o(new Error("Image request failed"))},s.onerror=()=>o(new Error("XHR error")),s.send()})}};var ht=class extends h{constructor(e){super(e);this.loadingTimeout=0;this._type=2,this.loadingTimeout=this.settings.timeout}onInit(){setTimeout(()=>{document.documentElement.classList.add("-loaded")},this.loadingTimeout)}};var gt=class extends h{constructor(t){super(t),this.htmlKey=""}canConnect(t){return t.keys[0]==null}};var T=class{constructor(t){this.min=void 0;this.max=void 0;this.enable=!0;this.min=t?.min,this.max=t?.max,this.enable=t?.enable??!0}setEnable(t=!0){this.enable=t}setRange(t,e){this.min=t??void 0,this.max=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}},vt=class extends h{constructor(e){super(e);this.queries={0:new T({max:359}),1:new T({min:360,max:1079}),2:new T({min:1080,max:1365}),3:new T({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(){}onInit(){if(this.settings!=null&&this.settings.settings!=null){let e=this.settings.settings;e.mobile?(this.queries[0].enable=!0,this.queries[0].setRange(e.mobile.min==null?null:e.mobile.min,e.mobile.max??null),this.matchMedias[0]=window.matchMedia(this.queries[0].mediaQuery)):this.queries[0].enable=!1,e.tablet?(this.queries[1].enable=!0,this.queries[1].setRange(e.mobile.min==null?null:e.mobile.min,e.mobile.max??null),this.matchMedias[1]=window.matchMedia(this.queries[0].mediaQuery)):this.queries[1].enable=!1,e.laptop?(this.queries[2].enable=!0,this.queries[2].setRange(e.mobile.min==null?null:e.mobile.min,e.mobile.max??null),this.matchMedias[2]=window.matchMedia(this.queries[0].mediaQuery)):this.queries[2].enable=!1,e.desktop?(this.queries[3].enable=!0,this.queries[3].setRange(e.mobile.min==null?null:e.mobile.min,e.mobile.max??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,o=this.matchMedias[3].matches&&this.queries[3].enable;document.querySelectorAll("[string-mobile], [string-tablet], [string-laptop], [string-desktop]").forEach(n=>{let a=!1;n.hasAttribute("string-mobile")&&e&&(a=!0,this.events.emit("screen:mobile",e)),n.hasAttribute("string-tablet")&&r&&(a=!0,this.events.emit("screen:tablet",r)),n.hasAttribute("string-laptop")&&i&&(a=!0,this.events.emit("screen:laptop",i)),n.hasAttribute("string-desktop")&&o&&(a=!0,this.events.emit("screen:desktop",o)),a?n.style.display=null:n.style.display="none"})}};var bt=class extends h{constructor(t){super(t),this.htmlKey="anchor",this.attributesToMap=[...this.attributesToMap,{key:"anchor",type:"tuple",fallback:this.settings.anchor,transform:e=>{let[r,i]=e,o=this.tools.originParser.process({value:r}),s=this.tools.originParser.process({value:i});return{x:o,y:s}}}]}onObjectConnected(t){super.onObjectConnected(t);let e=t.getProperty("anchor");e&&this.applyToElementAndConnects(t,r=>{r.style.transformOrigin=`${e.x} ${e.y}`})}};var _t=.05,Kt=.01,Vt=1,jt=-1,Qt=1,ft=class extends h{constructor(e){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.maxDisplacementValue=0;this.setupItem=e=>{let r=e.getProperty("glide")??0,i=-this.data.scroll.displacement*this.maxDisplacementValue*r;this.events.emit(`object:glide:${e.id}`,i);let o=`translate3d(0, ${i}px, 0)`;e.htmlElement.style.transform=o};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;this.htmlKey="glide",this.baseVelocityMultiplier=this.settings["glide-base-velocity"]??this.baseVelocityMultiplier,this.reducedVelocityMultiplier=this.settings["glide-reduce-velocity"]??this.reducedVelocityMultiplier,this.negativeVelocityMultiplier=this.settings["glide-negative-velocity"]??this.negativeVelocityMultiplier,this.attributesToMap=[...this.attributesToMap,{key:"glide",type:"number",fallback:this.settings.glide}]}calcExpanderFactor(e){let r=e?this.data.scroll.lerped<this.previousLerp:this.data.scroll.lerped>this.previousLerp;this.velocityMultiplier=r?this.isInitialScroll?this.baseVelocityMultiplier:this.reducedVelocityMultiplier:this.negativeVelocityMultiplier,r||(this.isInitialScroll=!1)}onStart(){this.maxDisplacementValue=this.data.viewport.windowHeight*.1}onResize(){window.innerWidth>1080?(this.maxDisplacementValue=this.data.viewport.windowHeight*.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.htmlElement.style.transform=i,r.htmlElement.style.setProperty("--glide",this.data.scroll.displacement.toString())}}onFrame(e){this.calcExpanderFactor(this.data.scroll.isScrollingDown===!1),this.acceleration=Math.min(Vt,this.acceleration+_t),this.displacement=Math.max(Kt,Math.min(Vt,this.displacement+this.velocityMultiplier)),this.data.scroll.displacement=Math.min(Qt,Math.max(jt,this.data.scroll.lerped*this.displacement*this.acceleration)),this.objects.forEach(r=>{this.applyToElementAndConnects(r,i=>{i.style.setProperty("--glide",this.data.scroll.displacement.toString())})}),this.previousLerp=this.data.scroll.lerped,this.onUpdateEvent()}};var yt=class extends h{constructor(t){super(t),this.htmlKey="lerp"}onScrollStop(){this.objects.forEach(t=>{this.setLerpValue(t,0)})}onFrame(t){let e=t.scroll.lerped;this.objects.forEach(r=>{this.setLerpValue(r,e)})}setLerpValue(t,e){this.events.emit(`object:lerp:${t.id}`,e),t.htmlElement.style.setProperty("--lerp",e.toString())}};var I=class extends h{constructor(t){super(t),this.htmlKey="progress",this.attributesToMap=[...this.attributesToMap,{key:"enter-el",type:"string",fallback:this.settings["enter-el"]},{key:"enter-vp",type:"string",fallback:this.settings["enter-vp"]},{key:"exit-el",type:"string",fallback:this.settings["exit-el"]},{key:"exit-vp",type:"string",fallback:this.settings["exit-vp"]},{key:"easing",type:"easing",fallback:this.settings.easing}]}initializeObject(t,e,r,i){super.initializeObject(t,e,r,i)}onScroll(t){super.onScroll(t),this.objects.forEach(e=>{this.setUpObject(e)})}onObjectConnected(t){super.onObjectConnected(t),t.setProperty("setUpObject",this.setUpObject.bind(this)),t.events.on("enter",t.getProperty("setUpObject"))}setUpObject(t){let e=t.getProperty("start-position"),r=t.getProperty("difference-position"),i=t.getProperty("key"),o=t.getProperty("easing")(Math.min(1,Math.max(0,(this.data.scroll.transformedCurrent-e)/r)));if(t.getProperty("progress")!==o){this.events.emit(`object:progress:${t.id}`,o),t.setProperty("progress",o);let s=o.toString();this.applyToElementAndConnects(t,n=>{n.style.setProperty(i,s)})}}calculatePositions(t,e){let r=t.getProperty("start"),i=t.getProperty("size"),o=t.getProperty("offset-bottom"),s=t.getProperty("offset-top"),n=t.getProperty("enter-el"),a=t.getProperty("enter-vp"),p=t.getProperty("exit-el"),d=t.getProperty("exit-vp"),m=0,c=0;n==="top"&&a==="top"||n==="left"&&a==="left"?m=r-o:n==="top"&&a==="bottom"||n==="left"&&a==="right"?m=r-e-o:n==="bottom"&&a==="top"||n==="right"&&a==="left"?m=r+i-o:(n==="bottom"&&a==="bottom"||n==="right"&&a==="right")&&(m=r-e+i-o),p==="top"&&d==="top"||p==="left"&&d==="left"?c=r+s:p==="top"&&d==="bottom"||p==="left"&&d==="right"?c=r-e+s:p==="bottom"&&d==="top"||p==="right"&&d==="left"?c=r+i+s:(p==="bottom"&&d==="bottom"||p==="right"&&d==="right")&&(c=r-e+i+s),t.setProperty("start-position",m-this.data.scroll.topPosition),t.setProperty("end-position",c),t.setProperty("difference-position",c-m)}};var St=class extends I{constructor(e){super(e);this.handleScrollDesktop=()=>{this.objects.forEach(e=>{let r=e.getProperty("progress")??0,i=e.getProperty("parallax")??0,o=e.getProperty("parallax-position-start")??0,s=e.getProperty("parallax-position-end")??1,n=this.data.viewport.windowHeight,a=i*n*o+r*i*n*s;this.events.emit(`object:parallax:${e.id}`,a);let p=`translate3d(0, ${a}px, 0)`;this.applyToElementAndConnects(e,d=>{d.style.transform=p})})};this.handleScrollMobile=()=>{};this.scrollHandler=this.handleScrollDesktop;this.htmlKey="parallax",this.attributesToMap=[...this.attributesToMap,{key:"parallax",type:"number",fallback:this.settings.parallax},{key:"parallax-bias",type:"number",fallback:this.settings["parallax-bias"]}]}initializeObject(e,r,i,o){super.initializeObject(e,r,i,o);let s=r.getProperty("parallax-bias")??0,n=r.getProperty("parallax")??.2;r.setProperty("parallax-position-start",-.5+.5*s),r.setProperty("parallax-position-end",.5+.5*(1-s));let a=this.data.viewport.windowHeight;r.setProperty("offset-top",n*a),r.setProperty("offset-bottom",n*a)}onScroll(e){super.onScroll(e),this.scrollHandler()}onResize(){let e=window.innerWidth>1080;this.scrollHandler=e?this.handleScrollDesktop:this.handleScrollMobile,e||this.handleScrollDesktop()}};var xt=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.viewport.contentWidth,e=this.data.viewport.windowWidth,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.viewport.contentWidth,e=this.data.viewport.windowWidth;this.thumb.style.setProperty("--position",`${this.data.scroll.current/t*e+"px"}`)}mouseDownEvent(t){this.startY=t.clientY,this.startScrollPosition=this.data.scroll.current}mouseMoveEvent(t){let e=t.clientY-this.startY,r=this.startScrollPosition+e/this.data.viewport.windowWidth*this.data.viewport.contentWidth;this.data.scroll.current=r,this.data.scroll.target=r,window.scrollTo(0,r),this.updateThumb()}};var Mt=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.viewport.contentHeight,e=this.data.viewport.windowHeight,r=e/t*e;this.thumb.style.setProperty("--height",r+"px"),t<=e?this.scrollbar.classList.add("-hide"):this.scrollbar.classList.remove("-hide")}updateThumb(){let t=this.data.viewport.contentHeight,e=this.data.viewport.windowHeight;this.thumb.style.setProperty("--position",`${this.data.scroll.current/t*e+"px"}`)}mouseDownEvent(t){this.startCoordinate=t.clientY,this.startScrollPosition=this.data.scroll.current}mouseMoveEvent(t){let e=t.clientY-this.startCoordinate,r=this.startScrollPosition+e/this.data.viewport.windowHeight*this.data.viewport.contentHeight,i=this.data.scroll.bottomPosition,o=Math.max(0,Math.min(r,i));this.data.scroll.current=o,this.data.scroll.target=o,window.scrollTo(0,o),this.updateThumb()}};var Et=class extends h{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)}onInit(){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()}addCustomStyles(){let e=document.createElement("style");e.textContent=`
1
+ "use strict";var At=Object.defineProperty;var qt=Object.getOwnPropertyDescriptor;var Nt=Object.getOwnPropertyNames;var $t=Object.prototype.hasOwnProperty;var Yt=(l,t)=>{for(var e in t)At(l,e,{get:t[e],enumerable:!0})},Ut=(l,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Nt(t))!$t.call(l,i)&&i!==e&&At(l,i,{get:()=>t[i],enumerable:!(r=qt(t,i))||r.enumerable});return l};var Xt=l=>Ut(At({},"__esModule",{value:!0}),l);var Gt={};Yt(Gt,{StringAnchor:()=>vt,StringCursor:()=>dt,StringData:()=>L,StringDelayLerpTracker:()=>Ct,StringFPSTracker:()=>Tt,StringGlide:()=>ft,StringLazy:()=>ut,StringLerp:()=>yt,StringLerpTracker:()=>Pt,StringLoading:()=>ht,StringMagnetic:()=>mt,StringModule:()=>g,StringObject:()=>C,StringParallax:()=>St,StringPositionTracker:()=>It,StringProgress:()=>P,StringResponsive:()=>bt,StringScrollbar:()=>Et,StringSplit:()=>wt,StringTune:()=>Ft,StringVideoAutoplay:()=>Ot,default:()=>Ft});module.exports=Xt(Gt);var X=class{constructor(t=.1,e){this.SETTLE_THRESHOLD=.1;this.smoothingFactor=t,this.context=e,this.onSettingsChange()}onMouseMove(t){this.context.data.cursor.targetX=t.clientX,this.context.data.cursor.targetY=t.clientY}onFrame(){let{targetX:t,targetY:e,smoothedX:r,smoothedY:i}=this.context.data.cursor,o=this.context.tools.lerp.process({from:r,to:t,progress:this.smoothingFactor}),n=this.context.tools.lerp.process({from:i,to:e,progress:this.smoothingFactor}),s=this.getStepDistance(o,n);this.isSettled(s)?this.snapToTarget():this.applyStep(o,n)}onSettingsChange(){let t=Number(this.context.settings.lerp);this.setLerpFactor(t)}setLerpFactor(t){this.smoothingFactor=this.context.tools.adaptiveLerp.process({value:t,inMin:.1,inMax:1,outMin:.05,outMax:.65})}getStepDistance(t,e){return Math.hypot(t,e)}isSettled(t){return t<this.SETTLE_THRESHOLD}snapToTarget(){this.context.data.cursor.smoothedX=this.context.data.cursor.targetX,this.context.data.cursor.smoothedY=this.context.data.cursor.targetY,this.context.data.cursor.stepX=0,this.context.data.cursor.stepY=0}applyStep(t,e){this.context.data.cursor.smoothedX+=t,this.context.data.cursor.smoothedY+=e,this.context.data.cursor.stepX=t,this.context.data.cursor.stepY=e}};var w=class{constructor(){this.listeners={}}on(t,e,r){let i=r?`${t}_${r}`:t;this.listeners[i]||(this.listeners[i]=new Set),this.listeners[i].add(e)}off(t,e,r){let i=r?`${t}_${r}`:t;this.listeners[i]&&this.listeners[i].delete(e)}emit(t,e){let r=this.listeners[t];if(r)for(let i of r)i(e)}onProgress(t,e){this.on(`progress:${t}`,e)}emitProgress(t,e){this.emit(`progress:${t}`,e)}onInview(t,e){this.on(`object:inview:${t}`,e)}emitInview(t,e){this.emit(`object:inview${t}`,e)}onScroll(t){this.on("scroll",t)}emitScroll(t){this.emit("scroll",t)}onUpdate(t){this.on("update",t)}emitUpdate(){this.emit("update")}clear(t){delete this.listeners[t]}clearAll(){this.listeners={}}};var _=class{constructor(t){this.data=t;this.modules=[];this.uiModules=[]}register(t){t.type===1&&this.modules.push(t),t.type===2&&this.uiModules.push(t)}find(t){return this.modules.find(e=>e instanceof t)}onInit(){[...this.modules,...this.uiModules].forEach(t=>t.onInit())}onFrame(){[...this.modules,...this.uiModules].forEach(t=>t.onFrame(this.data))}onScroll(){[...this.modules,...this.uiModules].forEach(t=>t.onScroll(this.data))}onResize(){[...this.modules,...this.uiModules].forEach(t=>t.onResize())}onMouseMove(t){[...this.modules,...this.uiModules].forEach(e=>e.onMouseMove(t))}onWheel(t){[...this.modules,...this.uiModules].forEach(e=>e.onWheel(t))}onDirectionChange(){[...this.modules,...this.uiModules].forEach(t=>t.onDirectionChange())}onScrollStart(){[...this.modules,...this.uiModules].forEach(t=>t.onScrollStart())}onScrollStop(){[...this.modules,...this.uiModules].forEach(t=>t.onScrollStop())}onAxisChange(){[...this.modules,...this.uiModules].forEach(t=>t.onAxisChange())}onDeviceChange(){[...this.modules,...this.uiModules].forEach(t=>t.onDeviceChange())}onScrollConfigChange(){[...this.modules,...this.uiModules].forEach(t=>t.onScrollConfigChange())}onSettingsChange(){[...this.modules,...this.uiModules].forEach(t=>t.onSettingsChange())}onDOMMutate(t,e){[...this.modules,...this.uiModules].forEach(r=>r.onDOMMutate(t,e))}destroy(){[...this.modules,...this.uiModules].forEach(t=>t.destroy()),this.modules=[],this.uiModules=[]}get all(){return[...this.modules,...this.uiModules]}get core(){return this.modules}get ui(){return this.uiModules}};var C=class{constructor(t,e){this.id="";this.keys=[];this.connects=[];this.properties=new Map;this.modules=[];this.events=new w;this.htmlElement=e,this.id=t}setProperty(t,e){this.properties.set(t,e)}getProperty(t){return this.properties.get(t)??null}enter(){this.events.emit("enter",this),this.setProperty("active",!0),this.modules.forEach(t=>{t.enterObject(this.id,this)})}leave(){this.events.emit("leave",this),this.setProperty("active",!1),this.modules.forEach(t=>{t.exitObject(this.id)})}show(){this.htmlElement.classList.add("-inview")}hide(){this.getProperty("repeat")&&this.htmlElement.classList.remove("-inview")}connect(t){this.modules.includes(t)||this.modules.push(t)}};var K=class{constructor(t,e,r){this.data=t;this.modules=e;this.events=r;this.objects=new Map;this.connectQueue=[];this.globalId=1}get all(){return this.objects}add(t){let e=`string-${this.globalId++}`,r="string-id";t.getAttribute("string-id")&&(e=t.getAttribute("string-id"),r="string-id"),t.getAttribute("data-string-id")&&(e=t.getAttribute("data-string-id"),r="data-string-id");let i=e&&this.objects.has(e)?this.objects.get(e):new C(e,t);t.setAttribute(r,i.id);let o=t.getAttribute("string")??t.getAttribute("data-string");o&&(i.keys=(o??"").split("|")),t.setAttribute("string-inited",""),this.objects.set(i.id,i);let n=this.getAllAttributes(t);this.modules.core.forEach(a=>{"setupCoreProperties"in a&&typeof a.setupCoreProperties=="function"&&a.setupCoreProperties(i,t,n)}),this.modules.core.forEach(a=>{a.canConnect(i)&&(a.initializeObject(this.globalId,i,t,n),a.calculatePositions(i,this.data.viewport.windowHeight),a.connectObject(i))}),this.connectQueue.filter(a=>a.id===i.id).forEach(a=>i.connects.push(a.element)),this.connectQueue=this.connectQueue.filter(a=>a.id!==i.id),this.initObservers(i,t)}remove(t){let e=this.objects.get(t);e&&(e.events.clearAll(),e.getProperty("observer-progress")?.disconnect(),e.getProperty("observer-inview")?.disconnect(),e.htmlElement.removeAttribute("string-inited"),e.leave(),this.objects.delete(t))}enqueueConnection(t,e){this.connectQueue.push({id:t,element:e})}getAllAttributes(t){let e={};return Array.from(t.attributes).forEach(r=>{e[r.name]=r.value}),e}initObservers(t,e){let r=t.getProperty("offset-top")??0,i=t.getProperty("offset-bottom")??0,o=t.getProperty("inview-top")??0,n=t.getProperty("inview-bottom")??0;t.getProperty("observer-progress")?.disconnect(),t.getProperty("observer-inview")?.disconnect();let s=m=>{m.forEach(c=>{this.events.emit(`object:activate:${t.id}`,c.isIntersecting),c.isIntersecting?t.enter():t.leave()})},a=m=>{m.forEach(c=>{this.events.emit(`object:inview:${t.id}`,c.isIntersecting),c.isIntersecting?t.show():t.hide()})},p=new IntersectionObserver(s,{root:null,rootMargin:`${i+this.data.viewport.windowHeight}px 0px ${r+this.data.viewport.windowHeight}px 0px`,threshold:.001}),d=new IntersectionObserver(a,{root:null,rootMargin:`${i+o+t.getProperty("end-bias")}px 0px ${r+n+t.getProperty("start-bias")}px 0px`,threshold:.001});p.observe(e),d.observe(e),t.setProperty("observer-progress",p),t.setProperty("observer-inview",d)}observeDOM(){new MutationObserver(e=>{e.forEach(r=>{r.type==="childList"&&(r.removedNodes.forEach(i=>{if(i.nodeType!==Node.ELEMENT_NODE)return;let o=i;this.isFixed(o)||(o.hasAttribute("string")&&this.handleRemoved(o),o.querySelectorAll("[string],[data-string]").forEach(n=>{this.isFixed(n)||this.handleRemoved(n)}))}),r.addedNodes.forEach(i=>{if(i.nodeType!==Node.ELEMENT_NODE)return;let o=i;if(this.isFixed(o))return;o.hasAttribute("string")&&!o.hasAttribute("string-inited")&&this.add(o),o.querySelectorAll("[string]:not([string-inited]),[data-string]:not([string-inited])").forEach(s=>this.add(s));let n=o.getAttribute("string-copy-from")??o.getAttribute("data-string-copy-from");n&&(this.objects.has(n)?this.objects.get(n).connects.push(o):this.enqueueConnection(n,o))}),this.modules.all.forEach(i=>i.onDOMRebuild()))})}).observe(document.body,{childList:!0,subtree:!0})}handleRemoved(t){let e=t.getAttribute("string-id")??t.getAttribute("data-string-id");if(!e)return;let r=t.getAttribute("string-copy-from")??t.getAttribute("data-string-copy-from");r&&(this.connectQueue=this.connectQueue.filter(i=>i.id!==r)),this.remove(e)}onSettingsChange(){this.objects.forEach(t=>{this.modules.core.forEach(e=>{if(e.canConnect(t)){let r=this.getAllAttributes(t.htmlElement);e.initializeObject(this.globalId,t,t.htmlElement,r),e.calculatePositions(t,this.data.viewport.windowHeight),e.connectObject(t)}})})}isFixed(t){return t.hasAttribute("string-fixed")}};var M=class{constructor(t){this.name="";this.isProg=!1;this.isParallaxEnabled=!1;this._scrollDirection="vertical";this.onChangeDirection=()=>{};this.onScrollStart=()=>{};this.onScrollStop=()=>{};this.onCalcUpdate=()=>{this.context.data.scroll.scrollContainer?.scrollTo(0,this.context.data.scroll.current)};this.document=document,this.context=t}set scrollDirection(t){this._scrollDirection=t,this._scrollDirection==="vertical"?this.onCalcUpdate=()=>{this.context.data.scroll.scrollContainer?.scrollTo(0,this.context.data.scroll.current)}:this._scrollDirection==="horizontal"&&(this.onCalcUpdate=()=>{this.context.data.scroll.scrollContainer?.scrollTo(this.context.data.scroll.current,0)})}onFrame(){}onWheel(t){}onScroll(t){}disableScrollEvents(){}enableScrollEvents(){}};var Q=class extends M{constructor(e){super(e);this.name="default"}onFrame(){if(this.context.data.scroll.delta!==0){let e=this.context.data.scroll.delta*this.context.data.scroll.speedAccelerate;this.context.data.scroll.delta-=e,this.context.data.scroll.lerped=e,Math.abs(this.context.data.scroll.lerped)<.1&&(this.context.data.scroll.delta=0,this.context.data.scroll.lerped=0,this.onScrollStop())}}onScroll(e){let r=this.context.data.scroll.elementContainer.scrollTop;this.context.data.scroll.current=r,this.context.data.scroll.target=r,this.context.data.scroll.transformedCurrent=r}onWheel(e){if(e.deltaY!==0){this.context.data.scroll.delta===0&&this.onScrollStart();let r=e.deltaY;this.context.data.scroll.target===0&&(this.context.data.scroll.delta+=Math.max(0,e.deltaY)),this.context.data.scroll.delta+=r}}};var j=class extends M{constructor(e){super(e);this.name="disable";this.preventScroll=e=>{e.preventDefault()};this.preventKeyScroll=e=>{["ArrowUp","ArrowDown","PageUp","PageDown"," ","Home","End"].includes(e.key)&&e.preventDefault()};this.onPreventScroll=this.preventScroll.bind(this);this.onPreventKeyScroll=this.preventKeyScroll.bind(this)}disableScrollEvents(){window.addEventListener("touchmove",this.onPreventScroll,{passive:!1}),window.addEventListener("keydown",this.onPreventKeyScroll)}enableScrollEvents(){window.removeEventListener("touchmove",this.onPreventScroll),window.removeEventListener("keydown",this.onPreventKeyScroll)}onFrame(){}onWheel(e){e.preventDefault()}onScroll(e){e.preventDefault()}};var G={SCROLL_FORWARD:"-scroll-forward",SCROLL_BACK:"-scroll-back"},J=class extends M{constructor(e){super(e);this.name="smooth";this.isScrollbarManipulation=!1;this.scrollForce=0;this.wheelImpulse=0;this.previousCurrent=0;this.isBottomScrollDirection=null;this.velocityThreshold=.1}updateScrollDirection(e){if(this.isBottomScrollDirection===null){this.isBottomScrollDirection=e;return}this.context.data.scroll.isScrollingDown=e,this.onChangeDirection(),document.documentElement.classList.toggle(G.SCROLL_FORWARD,e),document.documentElement.classList.toggle(G.SCROLL_BACK,!e)}stopScroll(){this.context.data.scroll.lerped=0,this.context.data.scroll.delta=0,this.context.data.scroll.target=this.context.data.scroll.current,this.isProg=!1,this.onCalcUpdate(),document.documentElement.classList.remove(G.SCROLL_BACK,G.SCROLL_FORWARD),this.isBottomScrollDirection=null}onFrame(){if(this.isScrollbarManipulation){this.isScrollbarManipulation=!1,this.context.data.scroll.current=this.context.data.scroll.elementContainer.scrollTop,this.context.data.scroll.target=this.context.data.scroll.elementContainer.scrollTop,this.context.data.scroll.transformedCurrent=this.context.data.scroll.current*this.context.data.viewport.transformScale;return}if(this.context.data.scroll.delta!==0){this.scrollForce=this.context.data.scroll.delta*this.context.data.scroll.speedAccelerate,this.context.data.scroll.target=Math.min(Math.max(0,this.context.data.scroll.target+this.scrollForce),this.context.data.scroll.bottomPosition),this.context.data.scroll.delta-=this.scrollForce,this.context.data.scroll.lerped=(this.context.data.scroll.target-this.context.data.scroll.current)*this.context.data.scroll.speed;let e=Math.abs(this.context.data.scroll.lerped);this.context.data.scroll.lerped>0?this.context.data.scroll.current=Math.ceil(this.context.data.scroll.current+this.context.data.scroll.lerped):this.context.data.scroll.current=Math.floor(this.context.data.scroll.current+this.context.data.scroll.lerped),this.context.data.scroll.transformedCurrent=this.context.data.scroll.current*this.context.data.viewport.transformScale,this.updateScrollDirection(this.context.data.scroll.lerped>0),e<this.velocityThreshold?(this.stopScroll(),this.onScrollStop()):(this.isProg=!0,this.previousCurrent!==this.context.data.scroll.current&&(this.previousCurrent=this.context.data.scroll.current,this.onCalcUpdate()))}}onWheel(e){if(e.deltaY!==0&&e.preventDefault(),this.wheelImpulse=e.deltaY,this.wheelImpulse===0)return;this.context.data.scroll.delta===0&&this.onScrollStart();let r=Math.sign(this.wheelImpulse),i=this.context.data.scroll.target===0&&r<0,o=this.context.data.scroll.target===this.context.data.scroll.bottomPosition&&r>0;i||o||(this.context.data.scroll.delta+=this.wheelImpulse)}onScroll(e){this.isProg||(this.isScrollbarManipulation=!0)}};var Z=class{constructor(t){this.context=t;this.modes=new Map;this.modes.set("smooth",new J(t)),this.modes.set("default",new Q(t)),this.modes.set("disable",new j(t)),this.updateResponsiveMode()}setMobileMode(t){this.context.data.scroll.modeMobile=t,this.updateResponsiveMode()}setDesktopMode(t){this.context.data.scroll.modeDesktop=t,this.updateResponsiveMode()}updateResponsiveMode(){let e=window.innerWidth<1080?this.context.data.scroll.modeMobile:this.context.data.scroll.modeDesktop;this.setMode(e)}updatePosition(){this.modes.forEach(t=>{t.onCalcUpdate()})}setMode(t){if(!this.modes.has(t)){console.warn(`[ScrollManager] Unknown scroll mode: ${t}`);return}this.get().enableScrollEvents(),this.context.data.scroll.mode=t,this.get().disableScrollEvents()}get(){return this.modes.get(this.context.data.scroll.mode)}getEngines(){return this.modes}onFrame(){this.get().onFrame()}onScroll(t){this.get().onScroll(t)}onWheel(t){this.get().onWheel(t)}bindEvents(t){this.modes.forEach(e=>{e.onScrollStart=t.onScrollStart,e.onScrollStop=t.onScrollStop,e.onChangeDirection=t.onDirectionChange})}};var tt=class{constructor(){this.targetX=0;this.targetY=0;this.smoothedX=0;this.smoothedY=0;this.stepX=0;this.stepY=0}};var et=class{constructor(){this.threeInstance=null}};var rt=class{constructor(){this.target=0;this.current=0;this.transformedCurrent=0;this.delta=0;this.lerped=0;this.displacement=0;this.isScrollingDown=!1;this.topPosition=0;this.bottomPosition=0;this.direction="vertical";this.elementContainer=document.documentElement;this.scrollContainer=window;this.container=document.body;this.mode="smooth";this.modeMobile="smooth";this.modeDesktop="smooth";this.speed=.1;this.speedAccelerate=.25}};var it=class{constructor(){this.now=0;this.previous=0;this.delta=0;this.elapsed=0}};var ot=class{constructor(){this.windowWidth=0;this.windowHeight=0;this.contentWidth=0;this.contentHeight=0;this.scaleWidth=1;this.scaleHeight=1;this.transformScale=1;this.baseRem=16}};var L=class{constructor(){this.scroll=new rt;this.viewport=new ot;this.cursor=new tt;this.render=new et;this.time=new it}};var g=class{constructor(t){this.objectMap=new Map;this.objects=[];this.htmlKey="";this._type=1;this.tools=t.tools,this.data=t.data,this.settings=t.settings,this.events=t.events,this.attributesToMap=[{key:"active",type:"boolean",fallback:this.settings.active},{key:"fixed",type:"boolean",fallback:this.settings.fixed},{key:"repeat",type:"boolean",fallback:this.settings.repeat},{key:"self-disable",type:"boolean",fallback:this.settings["self-disable"]},{key:"abs",type:"boolean",fallback:this.settings.abs},{key:"key",type:"string",fallback:this.settings.key},{key:"offset-top",type:"dimension",fallback:this.settings["offset-top"]},{key:"offset-bottom",type:"dimension",fallback:this.settings["offset-bottom"]},{key:"inview-top",type:"dimension",fallback:this.settings["inview-top"]},{key:"inview-bottom",type:"dimension",fallback:this.settings["inview-bottom"]},{key:"start",type:"number",fallback:(e,r,i)=>{let o=i.top;return Math.floor(o)+this.data.scroll.container.scrollTop*this.data.viewport.transformScale}},{key:"end",type:"number",fallback:(e,r,i)=>{let o=i.top,n=i.height;return o+n-this.data.scroll.transformedCurrent}},{key:"size",type:"number",fallback:(e,r,i)=>i.height},{key:"half-width",type:"number",fallback:(e,r,i)=>i.width/2},{key:"half-height",type:"number",fallback:(e,r,i)=>i.height/2}]}get type(){return this._type}initializeObject(t,e,r,i){let o=this.tools.boundingClientRect.process({element:r});for(let{key:n,type:s,fallback:a,transform:p}of this.attributesToMap){let d=typeof a=="function"?a(r,e,o):a,m=this.tools.domAttribute.process({element:r,key:n,fallback:i[n]??this.settings[n]??d}),c=this.parseAttribute(m,s,{element:r,viewportHeight:this.data.viewport.windowHeight,baseRem:this.data.viewport.baseRem});p&&(c=p(c)),e.setProperty(n,c)}}calculatePositions(t,e){let r=t.getProperty("start"),i=t.getProperty("size"),o=t.getProperty("offset-bottom"),n=t.getProperty("offset-top"),s=t.getProperty("enter-el"),a=t.getProperty("enter-vp"),p=t.getProperty("exit-el"),d=t.getProperty("exit-vp"),m=0,c=0,h=0,v=0;s==="top"&&a==="top"||s==="left"&&a==="left"?(h=-e+1,m=r-o):s==="top"&&a==="bottom"||s==="left"&&a==="right"?m=r-e-o:s==="bottom"&&a==="top"||s==="right"&&a==="left"?(h=-e-i+1,m=r+i-o):(s==="bottom"&&a==="bottom"||s==="right"&&a==="right")&&(h=-i+1,m=r-e+i-o),p==="top"&&d==="top"||p==="left"&&d==="left"?(v=-i+1,c=r+n):p==="top"&&d==="bottom"||p==="left"&&d==="right"?(v=-e-i+1,c=r-e+n):p==="bottom"&&d==="top"||p==="right"&&d==="left"?c=r+i+n:(p==="bottom"&&d==="bottom"||p==="right"&&d==="right")&&(v=-e+1,c=r-e+i+n),t.setProperty("start-bias",h),t.setProperty("end-bias",v),t.setProperty("start-position",m-this.data.scroll.topPosition),t.setProperty("end-position",c),t.setProperty("difference-position",c-m)}parseAttribute(t,e,r={}){if(t==null)return null;if(typeof e=="object"&&e.type==="enum")return e.values.includes(t)?t:e.values[0];switch(e){case"number":return parseFloat(t);case"boolean":return t===""||t==="true";case"json":try{return JSON.parse(t)}catch{return null}case"tuple":return t.trim().split(/\s+/);case"easing":return this.tools.easingFunction.process({easing:t});case"color":return this.tools.colorParser.process({value:t});case"dimension":return t=="0"?0:r.element!=null&&r.viewportHeight!=null&&r.baseRem!=null?this.tools.unitParser.process({value:t,element:r.element,viewportHeight:r.viewportHeight,baseRem:r.baseRem}):0;default:return t}}canConnect(t){return t.keys.includes(this.htmlKey)}connectObject(t){t.connect(this),this.onObjectConnected(t)}enterObject(t,e){this.objectMap.has(t)||(this.objectMap.set(t,e),this.objects.push(e))}exitObject(t){let e=this.objectMap.get(t);if(!e)return;this.objectMap.delete(t);let r=this.objects.indexOf(e);r!==-1&&this.objects.splice(r,1)}onObjectConnected(t){}applyToElementAndConnects(t,e){e(t.htmlElement),t.connects.forEach(e)}destroy(){this.objects=[],this.objectMap=new Map}onInit(){}onFrame(t){}onResize(){}onScroll(t){}onDirectionChange(){}onScrollStart(){}onScrollStop(){}onScrollDirectionChange(){}onAxisChange(){}onDeviceChange(){}onScrollConfigChange(){}onSettingsChange(){}onDOMRebuild(){}onMouseMove(t){}onWheel(t){}onDOMMutate(t,e){}};var O=class{process({element:t}){return t.getBoundingClientRect()}};var D=class{process({element:t,key:e,fallback:r=null}){return t.getAttribute(`string-${e}`)??t.getAttribute(`data-string-${e}`)??r}};var k=class{process({record:t,name:e,fallback:r=null}){return t[e]??t[`data-${e}`]??r}};var E=class{process({element:t}){let e=t.getBoundingClientRect(),i=getComputedStyle(t).transform.match(/-?[\d.]+/g)?.map(parseFloat)??[];if(i.length===6){let[o,n,s,a,p,d]=i,m=o*a-n*s;return{width:e.width/(o||1),height:e.height/(a||1),left:(e.left*a-e.top*s+s*d-p*a)/m,top:(-e.left*n+e.top*o+p*n-o*d)/m}}return e}};var H=class{constructor(t=new E){this.transformTool=t}process({element:t,container:e=document.body}){let r;try{r=e.getBoundingClientRect()}catch{r=document.body.getBoundingClientRect()}let i=this.transformTool.process({element:t});return{top:i.top-r.top,left:i.left-r.left}}};var R=class{process({from:t,to:e,progress:r}){return(e-t)*r}};var A=class{process({value:t,element:e,viewportHeight:r,baseRem:i}){let o=t.startsWith("-");o&&(t=t.slice(1));let n=0;return t==="selfHeight"?n=e.offsetHeight:t.endsWith("px")?n=parseFloat(t):t.endsWith("%")?n=parseFloat(t)/100*r:t.endsWith("rem")&&(n=parseFloat(t)*i),o?-n:n}};var F=class{process({value:t,inMin:e=.1,inMax:r=1,outMin:i=.05,outMax:o=.65}){if(t<e)return o;if(t>1&&(t=1),t<=r){let n=(t-e)/(r-e);return o-n*(o-i)}return i}};var W=class{process({value:t}){let e=t.trim();if(e.startsWith("random(")&&e.endsWith(")")){let r=e.slice(7,-1).split(",").map(o=>o.trim()).filter(Boolean),i=Math.floor(Math.random()*r.length);return r[i]}return e}};var V=class{process({value:t}){let e=t.trim().toLowerCase();if(e.startsWith("#")){let o=e.slice(1);o.length===3&&(o=o.split("").map(d=>d+d).join(""));let n=parseInt(o.slice(0,2),16),s=parseInt(o.slice(2,4),16),a=parseInt(o.slice(4,6),16),p=o.length===8?parseInt(o.slice(6,8),16)/255:1;return{r:n,g:s,b:a,a:p}}let r=e.match(/rgba?\(([^)]+)\)/);if(r){let[o,n,s,a=1]=r[1].split(",").map(p=>parseFloat(p.trim()));return{r:o,g:n,b:s,a}}let i=e.match(/hsla?\(([^)]+)\)/);if(i){let[o,n,s,a="1"]=i[1].split(",").map(c=>c.trim()),[p,d,m]=this.hslToRgb(parseFloat(o),parseFloat(n),parseFloat(s));return{r:p,g:d,b:m,a:parseFloat(a)}}return{r:0,g:0,b:0,a:0}}hslToRgb(t,e,r){t=t/360,e=parseFloat(e.toString())/100,r=parseFloat(r.toString())/100;let i=(d,m,c)=>(c<0&&(c+=1),c>1&&(c-=1),c<1/6?d+(m-d)*6*c:c<1/2?m:c<2/3?d+(m-d)*(2/3-c)*6:d),o=r<.5?r*(1+e):r+e-r*e,n=2*r-o,s=Math.round(i(n,o,t+1/3)*255),a=Math.round(i(n,o,t)*255),p=Math.round(i(n,o,t-1/3)*255);return[s,a,p]}};var B=class{process({value:t,rules:e,messages:r={}}){for(let i of e){let o=null;if(i==="required"&&t.trim()===""?o="required":i==="email"&&!/^\S+@\S+\.\S+$/.test(t)?o="invalid-email":typeof i=="object"&&(i.type==="minLength"&&t.length<i.value&&(o="too-short"),i.type==="maxLength"&&t.length>i.value&&(o="too-long")),o){let n=r[o],s=typeof n=="function"?n({value:t,rule:i}):n??this.defaultMessage(o,i);return{valid:!1,error:o,message:s}}}return{valid:!0,error:null,message:null}}defaultMessage(t,e){switch(t){case"required":return"This field is required.";case"invalid-email":return"Please enter a valid email.";case"too-short":return`Too short${typeof e=="object"&&"value"in e?` (min ${e.value})`:""}.`;case"too-long":return`Too long${typeof e=="object"&&"value"in e?` (max ${e.value})`:""}.`}}};var z=class{constructor(){this.namedCurves={linear:[0,0,1,1],ease:[.25,.1,.25,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]}}process({easing:t}){let e=t.trim();if(this.namedCurves[e])return this.cubicBezier(...this.namedCurves[e]);let r=e.match(/^cubic-bezier\s*\(\s*([-+]?\d*\.?\d+)\s*,\s*([-+]?\d*\.?\d+)\s*,\s*([-+]?\d*\.?\d+)\s*,\s*([-+]?\d*\.?\d+)\s*\)$/);if(r){let[i,o,n,s]=r.slice(1).map(Number);return this.cubicBezier(i,o,n,s)}return i=>i}cubicBezier(t,e,r,i){let o=3*t,n=3*(r-t)-o,s=1-o-n,a=3*e,p=3*(i-e)-a,d=1-a-p;function m(u){return((s*u+n)*u+o)*u}function c(u){return((d*u+p)*u+a)*u}function h(u){return(3*s*u+2*n)*u+o}function v(u,x=1e-5){let y,f,b=u,S,U,I;for(I=0;I<8;I++){if(S=m(b)-u,Math.abs(S)<x)return b;if(U=h(b),Math.abs(U)<1e-6)break;b=b-S/U}for(y=0,f=1,b=u;y<f;){if(S=m(b)-u,Math.abs(S)<x)return b;S>0?f=b:y=b,b=(f+y)/2}return b}return function(u){return c(v(u))}}};var q=class{process({distance:t,radius:e,strength:r}){if(t>=e)return 0;let i=(e-t)/e;return r*i}};var N=class{process({from:t,to:e,progress:r}){return{r:t.r+(e.r-t.r)*r,g:t.g+(e.g-t.g)*r,b:t.b+(e.b-t.b)*r,a:t.a+(e.a-t.a)*r}}};var $=class{process({from:t,to:e,progress:r}){return{x:(e.x-t.x)*r,y:(e.y-t.y)*r}}};var Y=class{process({value:t}){let r=t?.trim();if(!r||r==="none")return 1;try{if(r.startsWith("matrix(")){let i=r.match(/matrix\(([^)]+)\)/);if(i&&i[1]){let o=i[1].split(",").map(n=>parseFloat(n.trim()));if(o.length>=1&&!isNaN(o[0]))return o[0]}}if(r.startsWith("scale(")){let i=r.match(/scale\(([^)]+)\)/);if(i&&i[1]){let o=i[1].split(",").map(n=>parseFloat(n.trim()));if(o.length>=1&&!isNaN(o[0]))return o[0]}}if(r.startsWith("scaleX(")){let i=r.match(/scaleX\(([^)]+)\)/);if(i&&i[1]){let o=parseFloat(i[1].trim());if(!isNaN(o))return o}}if(r.startsWith("scale3d(")){let i=r.match(/scale3d\(([^)]+)\)/);if(i&&i[1]){let o=i[1].split(",").map(n=>parseFloat(n.trim()));if(o.length>=1&&!isNaN(o[0]))return o[0]}}if(r.startsWith("matrix3d(")){let i=r.match(/matrix3d\(([^)]+)\)/);if(i&&i[1]){let o=i[1].split(",").map(n=>parseFloat(n.trim()));if(o.length>=1&&!isNaN(o[0]))return o[0]}}}catch(i){return console.error(`Error parsing transform string "${r}":`,i),1}return 1}};var nt=class{process({processedWords:t,lines:e,options:r,totalChars:i}){let o=[],n=0,s=new Map;e.forEach((d,m)=>{let c=d.words.reduce((h,v)=>h+v.text.length,0);s.set(m,c)});let a=0,p=-1;return t.forEach(d=>{let m=d.text,c=d.lineIndex,h=m.length,v=s.get(c)||0;c!==p&&(a=0,p=c),Array.from(m).forEach((x,y)=>{let f=[];r.char&&r.char.forEach(b=>{let S=this.calculateIndex(b,n,y,i);f.push({value:S,type:"char",align:b.align})}),r.charLine&&r.charLine.forEach(b=>{let S=this.calculateIndex(b,a,y,v);f.push({value:S,type:"charLine",align:b.align})}),r.charWord&&r.charWord.forEach(b=>{let S=this.calculateIndex(b,y,y,h);f.push({value:S,type:"charWord",align:b.align})}),o.push({text:x,globalCharIndex:n,lineCharIndex:a,wordCharIndex:y,parentGlobalWordIndex:d.globalIndex,parentLineIndex:d.lineIndex,parentWordIndexInLine:d.wordIndexInLine,calculatedValues:f}),n++,a++})}),o}calculateIndex(t,e,r,i){let o=e;if(t.align==="random"){let n=t.random?.min??0,s=t.random?.max??(i>0?i-1:0),a=Math.min(n,s),p=Math.max(n,s);o=Math.floor(Math.random()*(p-a+1))+a}else t.align==="end"?o=(i>0?i-1:0)-e:t.align==="center"&&(o=e-Math.floor(i/2));return t.abs&&(o=Math.abs(o)),o}};var st=class{process({text:t,targetElement:e}){if(!t||!e||e.offsetWidth<=0)return console.warn("LayoutLineSplitterTool: Invalid input or target element has zero width."),[];let i=this.decodeHtmlEntity(t).trim().split(/\s+/).filter(c=>c.length>0);if(i.length===0)return[];let o=document.createElement("span"),n=window.getComputedStyle(e);o.style.fontFamily=n.fontFamily,o.style.fontSize=n.fontSize,o.style.fontWeight=n.fontWeight,o.style.letterSpacing=n.letterSpacing,o.style.textTransform=n.textTransform,o.style.wordSpacing=n.wordSpacing,o.style.whiteSpace="nowrap",o.style.visibility="hidden",o.style.position="absolute",o.style.top="-9999px",o.style.left="-9999px",document.body.appendChild(o);let s=[],a=[],p=0,d=this.measureWidth(" ",o),m=e.offsetWidth;try{i.forEach(c=>{let h=this.measureWidth(c,o),v=p+(a.length>0?d:0)+h;a.length>0&&v>m?(s.push({text:a.join(" "),words:a.map(u=>({text:u}))}),a=[c],p=h):(a.push(c),p=a.length===1?h:v)}),a.length>0&&s.push({text:a.join(" "),words:a.map(c=>({text:c}))})}finally{o.parentNode===document.body&&document.body.removeChild(o)}return s}measureWidth(t,e){return e.textContent=t,e.offsetWidth}decodeHtmlEntity(t){return t.replace(/&amp;/g,"&")}};var at=class{process({lines:t,words:e,chars:r,options:i}){let o=document.createElement("div"),n=0,s=0,a=this.hasLineOptions(i),p=this.hasWordOptions(i),d=this.hasCharOptions(i);return t.forEach((m,c)=>{let h=a?document.createElement("span"):o;a&&(h.classList.add("-s-line"),o.appendChild(h));let v=e.slice(n,n+m.words.length);n+=m.words.length,v.forEach((u,x)=>{let y=r.slice(s,s+u.text.length);if(s+=u.text.length,p){let f=document.createElement("span");f.classList.add("-s-word"),this.applyStyles(f,u.calculatedValues),d&&u.text.length>0?y.forEach(b=>{let S=this.createCharSpan(b);f.appendChild(S)}):u.text.length>0&&f.appendChild(document.createTextNode(u.text)),f.appendChild(document.createTextNode("\xA0")),h.appendChild(f)}else d&&u.text.length>0?(y.forEach(f=>{let b=this.createCharSpan(f);h.appendChild(b)}),h.appendChild(document.createTextNode("\xA0"))):u.text.length>0&&h.appendChild(document.createTextNode(u.text))})}),o.innerHTML}createCharSpan(t){let e=document.createElement("span");return e.classList.add("-s-char"),e.textContent=t.text,this.applyStyles(e,t.calculatedValues),e}hasLineOptions(t){return(t.line?.length??0)>0||(t.wordLine?.length??0)>0||(t.charLine?.length??0)>0}hasWordOptions(t){return(t.word?.length??0)>0||(t.wordLine?.length??0)>0}hasCharOptions(t){return(t.char?.length??0)>0||(t.charLine?.length??0)>0||(t.charWord?.length??0)>0}applyStyles(t,e){e&&e.forEach(r=>{let i=this.generateVariableName(r.type,r.align);t.style.setProperty(i,String(r.value))})}generateVariableName(t,e){return`--${t}-${e}`}};var lt=class{process({lines:t,options:e}){let r=[],i=0,o=t.reduce((n,s)=>n+s.words.length,0);return t.forEach((n,s)=>{let a=n.words,p=a.length;a.forEach((d,m)=>{let c=[];e.word&&e.word.length>0&&e.word.forEach(h=>{let v=this.calculateIndex(h,i,m,o);c.push({value:v,type:"word",align:h.align})}),e.wordLine&&e.wordLine.length>0&&e.wordLine.forEach(h=>{let v=this.calculateIndex(h,m,m,p);c.push({value:v,type:"wordLine",align:h.align})}),r.push({text:d.text,globalIndex:i,lineIndex:s,wordIndexInLine:m,calculatedValues:c}),i++})}),r}calculateIndex(t,e,r,i){let o=e;if(t.align==="random"){let n=t.random?.min??0,s=t.random?.max??(i>0?i-1:0),a=Math.min(n,s),p=Math.max(n,s);o=Math.floor(Math.random()*(p-a+1))+a}else t.align==="end"?o=(i>0?i-1:0)-e:t.align==="center"&&(o=e-Math.floor(i/2));return t.abs&&(o=Math.abs(o)),o}};var ct=class{process({attributeValue:t}){let e={line:[],word:[],char:[],charLine:[],charWord:[],wordLine:[]};return t&&t.split("|").forEach(i=>{let o=i.trim();if(!o)return;let n=o.match(/^(\w+-)?(\w+)(\[(.*?)\])?$/);if(n){let s=n[1]||"",a=n[2],p=s+a,m=(n[4]||"").split(";").map(h=>h.trim()).filter(h=>h.length>0),c=this.parseParamsArray(m);switch(p){case"line":e.line.push(c);break;case"word":e.word.push(c);break;case"char":e.char.push(c);break;case"charLine":e.charLine.push(c);break;case"charWord":e.charWord.push(c);break;case"wordLine":e.wordLine.push(c);break;default:console.warn(`SplitOptionsParserTool: Unrecognized option type "${p}" in part "${o}"`);break}}else console.warn(`SplitOptionsParserTool: Could not parse part format "${o}"`)}),e}parseParamsArray(t){let e={align:"start"};return t.forEach(r=>{if(r==="abs")e.abs=!0;else if(r.startsWith("random")){e.align="random";let i=r.match(/random\(\s*(\d+)\s*,\s*(\d+)\s*\)/);i&&(e.random={min:parseInt(i[1],10),max:parseInt(i[2],10)})}else["start","center","end"].includes(r)&&(e.align=r)}),e}};var pt=class{constructor(){this.domAttribute=new D;this.recordAttribute=new k;this.transformNullify=new E;this.boundingClientRect=new O;this.relativePosition=new H(this.transformNullify);this.unitParser=new A;this.lerp=new R;this.adaptiveLerp=new F;this.originParser=new W;this.colorParser=new V;this.validation=new B;this.easingFunction=new z;this.magneticPull=new q;this.lerpColor=new N;this.lerpVector=new $;this.transformScaleParser=new Y;this.layoutSplitter=new st;this.wordIndexer=new lt;this.charIndexer=new nt;this.domBuilder=new at;this.optionsParser=new ct}};var dt=class extends g{constructor(e){super(e);this.enterObjectsMap=new Map;this.enterObjects=new Array;this.overCount=0;this.htmlKey="cursor",this.cursor=document.querySelector("[string-cursor],[data-string-cursor]"),this.cursorContent=document.querySelector("[string-cursor-content],[data-string-cursor-content]"),this.attributesToMap=[...this.attributesToMap,{key:"target-disable",type:"boolean",fallback:this.settings["target-disable"]},{key:"target-style-disable",type:"boolean",fallback:this.settings["target-style-disable"]},{key:"target-class",type:"string",fallback:this.settings["target-class"]},{key:"cursor-class",type:"string",fallback:this.settings["cursor-class"]},{key:"alignment",type:{type:"enum",values:["start","center","end"]},fallback:this.settings.alignment},{key:"lerp",type:"number",fallback:this.settings.lerp,transform:r=>this.tools.adaptiveLerp.process({value:r,inMin:.1,inMax:1,outMin:.05,outMax:.65})}]}initializeObject(e,r,i,o){super.initializeObject(e,r,i,o),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)}onFrame(e){requestAnimationFrame(()=>{this.objects.forEach(s=>{let a=s.getProperty("is-mouse-over"),p=s.getProperty("cursor-target-disable"),d=s.getProperty("lerp")??.15;if(a&&!p){let m=s.htmlElement.getBoundingClientRect(),c=this.data.cursor.targetX,h=this.data.cursor.targetY,v=c-m.left,u=h-m.top,x=s.getProperty("mouse-pixel-x")??0,y=s.getProperty("mouse-pixel-y")??0,f=x-v,b=y-u;if(f*f+b*b>1e-4){(s.getProperty("is-mouse-move")??!1)||(s.setProperty("is-mouse-move",!0),s.setProperty("mouse-pixel-x",v),s.setProperty("mouse-pixel-y",u),s.setProperty("mouse-x",v),s.setProperty("mouse-y",u),x=v,y=u,this.events.emit(`cursor:start:${s.id}`,null));let I=this.tools.lerp.process({from:x,to:v,progress:d}),zt=this.tools.lerp.process({from:y,to:u,progress:d}),Dt=x+I,kt=y+zt;s.setProperty("mouse-pixel-x",Dt),s.setProperty("mouse-pixel-y",kt);let Wt=s.getProperty("alignment")??"center",Ht=this.calculateOffset(Wt,Dt,m.width),Rt=this.calculateOffset(Wt,kt,m.height);s.setProperty("mouse-x",Ht),s.setProperty("mouse-y",Rt),this.setMouseCoordinates(s,Ht,Rt),this.events.emit(`cursor:move:${s.id}`,{x:Ht,y:Rt}),this.events.emit(`cursor:pixel:${s.id}`,{x:Dt,y:kt})}else s.setProperty("mouse-pixel-x",v),s.setProperty("mouse-pixel-y",u),this.events.emit(`cursor:end:${s.id}`,null)}else{let m=s.getProperty("mouse-x")??0,c=s.getProperty("mouse-y")??0;if(m!==0||c!==0){s.setProperty("is-mouse-move",!1);let h=s.htmlElement.getBoundingClientRect(),v=s.getProperty("half-width")??h.width/2,u=s.getProperty("half-height")??h.height/2,x=this.calculateOffset("center",v,h.width),y=this.calculateOffset("center",u,h.height),f=m+this.tools.lerp.process({from:m,to:x,progress:d}),b=c+this.tools.lerp.process({from:c,to:y,progress:d});s.setProperty("mouse-x",f),s.setProperty("mouse-y",b),Math.abs(f)<.001&&Math.abs(b)<.001&&(s.setProperty("mouse-x",0),s.setProperty("mouse-y",0),s.setProperty("mouse-pixel-x",0),s.setProperty("mouse-pixel-y",0)),this.setMouseCoordinates(s,f,b)}}});let{stepX:r,stepY:i,smoothedX:o,smoothedY:n}=this.data.cursor;(r!==0||i!==0)&&(this.events.emit("cursor",{stepX:r,stepY:i,x:o,y:n}),this.cursor.style.setProperty("--x",o.toString()),this.cursor.style.setProperty("--y",n.toString()),this.cursor.style.setProperty("--x-lerp",r.toString()),this.cursor.style.setProperty("--y-lerp",i.toString()))})}onObjectConnected(e){let r=e.htmlElement;e.setProperty("timeoutId",null),e.setProperty("mouseleave",()=>{this.onMouseLeave(e)}),e.setProperty("mouseenter",()=>{this.onMouseEnter(e)}),e.setProperty("onEnterEvent",this.onEnterObject.bind(this)),e.events.on("enter",e.getProperty("onEnterEvent")),e.setProperty("onLeaveEvent",this.onLeaveObject.bind(this)),e.events.on("leave",e.getProperty("onLeaveEvent"))}getCursorClass(e){let r=e.getProperty("cursor-class");return r!=null&&r.length>0?r:null}onMouseEnter(e){this.overCount++,e.setProperty("is-mouse-over",!0);let r=this.getCursorClass(e);r&&this.cursor.classList.add(r),this.cursor.classList.add("-showing"),e.setProperty("timeoutId",setTimeout(()=>{this.cursor.classList.remove("-showing"),this.cursor.classList.add("-show")},1200)),e.htmlElement.addEventListener("mouseleave",e.getProperty("mouseleave"))}onMouseLeave(e){this.overCount--,e.setProperty("is-mouse-over",!1),e.getProperty("timeoutId")&&(clearTimeout(e.getProperty("timeoutId")),e.setProperty("timeoutId",null));let r=this.getCursorClass(e);r&&this.cursor.classList.remove(r),this.cursor.classList.remove("-showing"),this.cursor.classList.remove("-show"),e.htmlElement.removeEventListener("mouseleave",e.getProperty("mouseleave"))}onEnterObject(e){e.htmlElement.addEventListener("mouseenter",e.getProperty("mouseenter"))}onLeaveObject(e){e.htmlElement.removeEventListener("mouseenter",e.getProperty("mouseenter")),e.htmlElement.removeEventListener("mouseleave",e.getProperty("mouseleave"))}setMouseCoordinates(e,r,i){e.getProperty("cursor-target-style-disable")||this.applyToElementAndConnects(e,o=>{o.style.setProperty("--x",r.toFixed(2)),o.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 mt=class extends g{constructor(t){super(t),this.htmlKey="magnetic",this.attributesToMap=[...this.attributesToMap,{key:"strength",type:"number",fallback:this.settings.strength},{key:"radius",type:"number",fallback:this.settings.radius}]}initializeObject(t,e,r,i){super.initializeObject(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("lerp",.1)}onMouseMove(t){this.objects.forEach(e=>{let i=e.htmlElement.getBoundingClientRect(),o=i.left+(e.getProperty("half-width")??0),n=i.top+(e.getProperty("half-height")??0),s=t.clientX-o,a=t.clientY-n,p=Math.sqrt(s**2+a**2),d=e.getProperty("radius")??0,m=e.getProperty("strength")??0,c=this.tools.magneticPull.process({distance:p,radius:d,strength:m});e.setProperty("magnetic-target-x",s*c),e.setProperty("magnetic-target-y",a*c),c>0&&e.setProperty("is-magneting",!0)})}onFrame(t){this.objects.forEach(e=>{if(e.getProperty("is-magneting")){let r=e.getProperty("magnetic-x")??0,i=e.getProperty("magnetic-y")??0,o=e.getProperty("lerp")??0,n=e.getProperty("magnetic-target-x")??0,s=e.getProperty("magnetic-target-y")??0,a=this.tools.lerp.process({from:r,to:n,progress:o}),p=this.tools.lerp.process({from:i,to:s,progress:o});a>-.01&&a<.01&&(a=0,e.setProperty("magnetic-x",e.getProperty("magnetic-target-x"))),p>-.01&&p<.01&&(p=0,e.setProperty("magnetic-y",e.getProperty("magnetic-target-y"))),r+=a,i+=p,e.setProperty("magnetic-x",r),e.setProperty("magnetic-y",i),this.events.emit(`magnetic:move:${e.id}`,{x:r,y:i}),this.applyToElementAndConnects(e,d=>{d.style.setProperty("--magnetic-x",r.toString()),d.style.setProperty("--magnetic-y",i.toString())}),(e.getProperty("magnetic-target-x")==r||e.getProperty("magnetic-target-y")==i)&&e.setProperty("is-magneting",!1)}})}};var ut=class extends g{constructor(e){super(e);this.isStartLoaded=!1;this.loadingCount=0;this.htmlKey="lazy"}onInit(){document.querySelectorAll("img[string-lazy], img[data-string-lazy]").forEach(r=>this.loadImage(r)),this.isStartLoaded=!0}onObjectConnected(e){if(this.loadingCount++,this.isStartLoaded){let r=e.htmlElement;this.loadImage(r)}}async loadImage(e){let r=this.tools.domAttribute.process({element:e,key:this.htmlKey,fallback:""});if(r)try{e.classList.add("lazyLoad"),e.src=r,e.addEventListener("load",()=>{e.classList.add("-loaded")}),await this.setAspectRatio(e,r)}catch{console.warn("Failed to load image:",r)}}setAspectRatio(e,r){return new Promise((i,o)=>{let n=new XMLHttpRequest;n.open("GET",r,!0),n.responseType="arraybuffer",n.setRequestHeader("Range","bytes=0-"),n.onload=()=>{if(n.status===200||n.status===206){let s=new Blob([n.response]),a=new Image;a.onload=()=>{e.style.aspectRatio=`${a.width} / ${a.height}`,URL.revokeObjectURL(a.src),this.loadingCount--,this.loadingCount<=0&&(this.events.emit("image:load:all",null),this.loadingCount=0),i()},a.onerror=()=>{URL.revokeObjectURL(a.src),this.loadingCount--,o(new Error("Image failed to decode"))},a.src=URL.createObjectURL(s)}else o(new Error("Image request failed"))},n.onerror=()=>o(new Error("XHR error")),n.send()})}};var ht=class extends g{constructor(e){super(e);this.loadingTimeout=0;this._type=2,this.loadingTimeout=this.settings.timeout}onInit(){setTimeout(()=>{document.documentElement.classList.add("-loaded")},this.loadingTimeout)}};var gt=class extends g{constructor(t){super(t),this.htmlKey=""}canConnect(t){return t.keys[0]==null}};var T=class{constructor(t){this.min=void 0;this.max=void 0;this.enable=!0;this.min=t?.min,this.max=t?.max,this.enable=t?.enable??!0}setEnable(t=!0){this.enable=t}setRange(t,e){this.min=t??void 0,this.max=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}},bt=class extends g{constructor(e){super(e);this.queries={0:new T({max:359}),1:new T({min:360,max:1079}),2:new T({min:1080,max:1365}),3:new T({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(){}onInit(){if(this.settings!=null&&this.settings.settings!=null){let e=this.settings.settings;e.mobile?(this.queries[0].enable=!0,this.queries[0].setRange(e.mobile.min==null?null:e.mobile.min,e.mobile.max??null),this.matchMedias[0]=window.matchMedia(this.queries[0].mediaQuery)):this.queries[0].enable=!1,e.tablet?(this.queries[1].enable=!0,this.queries[1].setRange(e.mobile.min==null?null:e.mobile.min,e.mobile.max??null),this.matchMedias[1]=window.matchMedia(this.queries[0].mediaQuery)):this.queries[1].enable=!1,e.laptop?(this.queries[2].enable=!0,this.queries[2].setRange(e.mobile.min==null?null:e.mobile.min,e.mobile.max??null),this.matchMedias[2]=window.matchMedia(this.queries[0].mediaQuery)):this.queries[2].enable=!1,e.desktop?(this.queries[3].enable=!0,this.queries[3].setRange(e.mobile.min==null?null:e.mobile.min,e.mobile.max??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,o=this.matchMedias[3].matches&&this.queries[3].enable;document.querySelectorAll("[string-mobile], [string-tablet], [string-laptop], [string-desktop]").forEach(s=>{let a=!1;s.hasAttribute("string-mobile")&&e&&(a=!0,this.events.emit("screen:mobile",e)),s.hasAttribute("string-tablet")&&r&&(a=!0,this.events.emit("screen:tablet",r)),s.hasAttribute("string-laptop")&&i&&(a=!0,this.events.emit("screen:laptop",i)),s.hasAttribute("string-desktop")&&o&&(a=!0,this.events.emit("screen:desktop",o)),a?s.style.display=null:s.style.display="none"})}};var vt=class extends g{constructor(t){super(t),this.htmlKey="anchor",this.attributesToMap=[...this.attributesToMap,{key:"anchor",type:"tuple",fallback:this.settings.anchor,transform:e=>{let[r,i]=e,o=this.tools.originParser.process({value:r}),n=this.tools.originParser.process({value:i});return{x:o,y:n}}}]}onObjectConnected(t){super.onObjectConnected(t);let e=t.getProperty("anchor");e&&this.applyToElementAndConnects(t,r=>{r.style.transformOrigin=`${e.x} ${e.y}`})}};var _t=.05,Kt=.01,Vt=1,Qt=-1,jt=1,ft=class extends g{constructor(e){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.maxDisplacementValue=0;this.setupItem=e=>{let r=e.getProperty("glide")??0,i=-this.data.scroll.displacement*this.maxDisplacementValue*r;this.events.emit(`object:glide:${e.id}`,i);let o=`translate3d(0, ${i}px, 0)`;e.htmlElement.style.transform=o};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;this.htmlKey="glide",this.baseVelocityMultiplier=this.settings["glide-base-velocity"]??this.baseVelocityMultiplier,this.reducedVelocityMultiplier=this.settings["glide-reduce-velocity"]??this.reducedVelocityMultiplier,this.negativeVelocityMultiplier=this.settings["glide-negative-velocity"]??this.negativeVelocityMultiplier,this.attributesToMap=[...this.attributesToMap,{key:"glide",type:"number",fallback:this.settings.glide}]}calcExpanderFactor(e){let r=e?this.data.scroll.lerped<this.previousLerp:this.data.scroll.lerped>this.previousLerp;this.velocityMultiplier=r?this.isInitialScroll?this.baseVelocityMultiplier:this.reducedVelocityMultiplier:this.negativeVelocityMultiplier,r||(this.isInitialScroll=!1)}onStart(){this.maxDisplacementValue=this.data.viewport.windowHeight*.1}onResize(){window.innerWidth>1080?(this.maxDisplacementValue=this.data.viewport.windowHeight*.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.htmlElement.style.transform=i,r.htmlElement.style.setProperty("--glide",this.data.scroll.displacement.toString())}}onFrame(e){this.calcExpanderFactor(this.data.scroll.isScrollingDown===!1),this.acceleration=Math.min(Vt,this.acceleration+_t),this.displacement=Math.max(Kt,Math.min(Vt,this.displacement+this.velocityMultiplier)),this.data.scroll.displacement=Math.min(jt,Math.max(Qt,this.data.scroll.lerped*this.displacement*this.acceleration)),this.objects.forEach(r=>{this.applyToElementAndConnects(r,i=>{i.style.setProperty("--glide",this.data.scroll.displacement.toString())})}),this.previousLerp=this.data.scroll.lerped,this.onUpdateEvent()}};var yt=class extends g{constructor(t){super(t),this.htmlKey="lerp"}onScrollStop(){this.objects.forEach(t=>{this.setLerpValue(t,0)})}onFrame(t){let e=t.scroll.lerped;this.objects.forEach(r=>{this.setLerpValue(r,e)})}setLerpValue(t,e){this.events.emit(`object:lerp:${t.id}`,e),t.htmlElement.style.setProperty("--lerp",e.toString())}};var P=class extends g{constructor(t){super(t),this.htmlKey="progress",this.attributesToMap=[...this.attributesToMap,{key:"enter-el",type:"string",fallback:this.settings["enter-el"]},{key:"enter-vp",type:"string",fallback:this.settings["enter-vp"]},{key:"exit-el",type:"string",fallback:this.settings["exit-el"]},{key:"exit-vp",type:"string",fallback:this.settings["exit-vp"]},{key:"easing",type:"easing",fallback:this.settings.easing}]}initializeObject(t,e,r,i){super.initializeObject(t,e,r,i)}onScroll(t){super.onScroll(t),this.objects.forEach(e=>{this.setUpObject(e)})}onObjectConnected(t){super.onObjectConnected(t),t.setProperty("setUpObject",this.setUpObject.bind(this)),t.events.on("enter",t.getProperty("setUpObject"))}setUpObject(t){let e=t.getProperty("start-position"),r=t.getProperty("difference-position"),i=t.getProperty("key"),o=t.getProperty("easing")(Math.min(1,Math.max(0,(this.data.scroll.transformedCurrent-e)/r)));if(t.getProperty("progress")!==o){this.events.emit(`object:progress:${t.id}`,o),t.setProperty("progress",o);let n=o.toString();this.applyToElementAndConnects(t,s=>{s.style.setProperty(i,n)})}}};var St=class extends P{constructor(e){super(e);this.handleScrollDesktop=()=>{this.objects.forEach(e=>{let r=e.getProperty("progress")??0,i=e.getProperty("parallax")??0,o=e.getProperty("parallax-position-start")??0,n=e.getProperty("parallax-position-end")??1,s=this.data.viewport.windowHeight,a=i*s*o+r*i*s*n;this.events.emit(`object:parallax:${e.id}`,a);let p=`translate3d(0, ${a}px, 0)`;this.applyToElementAndConnects(e,d=>{d.style.transform=p})})};this.handleScrollMobile=()=>{};this.scrollHandler=this.handleScrollDesktop;this.htmlKey="parallax",this.attributesToMap=[...this.attributesToMap,{key:"parallax",type:"number",fallback:this.settings.parallax},{key:"parallax-bias",type:"number",fallback:this.settings["parallax-bias"]}]}initializeObject(e,r,i,o){super.initializeObject(e,r,i,o);let n=r.getProperty("parallax-bias")??0,s=r.getProperty("parallax")??.2;r.setProperty("parallax-position-start",-.5+.5*n),r.setProperty("parallax-position-end",.5+.5*(1-n));let a=this.data.viewport.windowHeight;r.setProperty("offset-top",s*a),r.setProperty("offset-bottom",s*a)}onScroll(e){super.onScroll(e),this.scrollHandler()}onResize(){let e=window.innerWidth>1080;this.scrollHandler=e?this.handleScrollDesktop:this.handleScrollMobile,e||this.handleScrollDesktop()}};var xt=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.viewport.contentWidth,e=this.data.viewport.windowWidth,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.viewport.contentWidth,e=this.data.viewport.windowWidth;this.thumb.style.setProperty("--position",`${this.data.scroll.current/t*e+"px"}`)}mouseDownEvent(t){this.startY=t.clientY,this.startScrollPosition=this.data.scroll.current}mouseMoveEvent(t){let e=t.clientY-this.startY,r=this.startScrollPosition+e/this.data.viewport.windowWidth*this.data.viewport.contentWidth;this.data.scroll.current=r,this.data.scroll.target=r,window.scrollTo(0,r),this.updateThumb()}};var Mt=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.viewport.contentHeight,e=this.data.viewport.windowHeight,r=e/t*e;this.thumb.style.setProperty("--height",r+"px"),t<=e?this.scrollbar.classList.add("-hide"):this.scrollbar.classList.remove("-hide")}updateThumb(){let t=this.data.viewport.contentHeight,e=this.data.viewport.windowHeight;this.thumb.style.setProperty("--position",`${this.data.scroll.current/t*e+"px"}`)}mouseDownEvent(t){this.startCoordinate=t.clientY,this.startScrollPosition=this.data.scroll.current}mouseMoveEvent(t){let e=t.clientY-this.startCoordinate,r=this.startScrollPosition+e/this.data.viewport.windowHeight*this.data.viewport.contentHeight,i=this.data.scroll.bottomPosition,o=Math.max(0,Math.min(r,i));this.data.scroll.current=o,this.data.scroll.target=o,window.scrollTo(0,o),this.updateThumb()}};var Et=class extends g{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)}onInit(){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()}addCustomStyles(){let e=document.createElement("style");e.textContent=`
2
2
  ::-webkit-scrollbar {
3
3
  display: none;
4
4
  width: 0;
@@ -16,9 +16,9 @@
16
16
  -ms-overflow-style: none; /* IE and Edge */
17
17
  scrollbar-width: none; /* Firefox */
18
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 xt(this.data,this.scrollbar,this.thumb),this.scrollbarStateVertical=new Mt(this.data,this.scrollbar,this.thumb),this.scrollbarState=this.scrollbarStateVertical}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 wt=class extends h{constructor(t){super(t),this.htmlKey="split"}onInit(){document.querySelectorAll(`[string="${this.htmlKey}"]`).forEach(t=>{t instanceof HTMLElement&&this.processElement(t)})}onResize(){document.querySelectorAll(`[string="${this.htmlKey}"].-splited`).forEach(t=>{t instanceof HTMLElement&&this.processElement(t)})}onObjectConnected(t){this.processElement(t.htmlElement)}processElement(t){if(!t)return;let e=t.classList.contains("-splited"),r=t.getAttribute("string-split-original");if((!e||r===null)&&(r=t.innerHTML,t.setAttribute("string-split-original",r),t.classList.add("-splited")),!r||r.trim()===""){t.innerHTML!==""&&(t.innerHTML="");return}try{let i=t.getAttribute("string-split"),o=this.tools.optionsParser.process({attributeValue:i}),s=this.generateSplitHtml(r,t,o);t.innerHTML!==s&&(t.innerHTML=s)}catch(i){if(console.error("StringSplit: Error processing element:",t,i),r!==null)try{t.innerHTML!==r&&(t.innerHTML=r)}catch(o){console.error("StringSplit: Error reverting element to original HTML:",t,o),t.innerHTML=""}else t.innerHTML="";t.classList.remove("-splited")}}generateSplitHtml(t,e,r){if(!this.tools?.layoutSplitter||!this.tools?.wordIndexer||!this.tools?.charIndexer||!this.tools?.domBuilder)return console.error("StringSplit: Required tools are not initialized."),"";if(!t||!e)return console.error("StringSplit.generateSplitHtml: Invalid input provided."),"";e.isConnected||console.warn("StringSplit.generateSplitHtml: layoutReferenceElement is not connected to the DOM. Layout calculation might be inaccurate.");try{let i=t,s=this.tools.layoutSplitter.decodeHtmlEntity(i).replace(/\s+/g,"").length,n=this.tools.layoutSplitter.process({text:i,targetElement:e});if(n.length===0&&i.trim()!=="")return console.warn("StringSplit: Layout calculation resulted in no lines for text:",i,"within element:",e),"";let a=this.tools.wordIndexer.process({lines:n,options:{word:r.word,wordLine:r.wordLine}}),p=this.tools.charIndexer.process({processedWords:a,lines:n,options:{char:r.char,charLine:r.charLine,charWord:r.charWord},totalChars:s});return this.tools.domBuilder.process({lines:n,words:a,chars:p,options:r})}catch(i){return console.error("StringSplit.generateSplitHtml: Error processing text:",t,"within element:",e,i),""}}exampleUsage(t){let e={word:[{align:"center"}],char:[{align:"start",random:{min:0,max:t.textContent?.length||0},abs:!0}]},r=t.innerHTML;return this.generateSplitHtml(r,t,e)}};var Ct=class extends h{constructor(e){super(e);this.history=[];this.maxPoints=0;this.height=0;this.value=0;this.target=0;this._type=2}onInit(){this.initCanvas(),this.maxPoints=this.canvas.width}onScroll(e){let r=Math.abs(e.scroll.displacement);this.value=r,this.history.push(r),this.history.length>this.maxPoints&&this.history.shift(),this.draw()}draw(){let e=this.context,r=this.canvas.width,i=this.canvas.height;e.clearRect(0,0,r,i),e.strokeStyle="red",e.lineWidth=2,e.beginPath(),this.history.forEach((o,s)=>{let n=s,a=i-o*this.height;s===0?e.moveTo(n,a):e.lineTo(n,a)}),e.stroke()}initCanvas(){let e=document.createElement("canvas"),r=window.innerWidth*.5;this.height=window.innerHeight/15-20,e.width=r,e.height=this.height,Object.assign(e.style,{position:"fixed",bottom:`${window.innerHeight/20+10}px`,left:"50%",transform:"translateX(-50%)",backgroundColor:"#000000",border:"1px solid rgba(255, 255, 255, 0.2)",zIndex:"1000",pointerEvents:"none"}),this.canvas=e,this.context=e.getContext("2d"),document.body.appendChild(e)}setTarget(e){this.target=e}clear(){this.canvas.remove(),this.history=[]}};var Tt=class extends h{constructor(e){super(e);this.frameCount=0;this._type=2}onInit(){this.createDisplayElement(),this.intervalId=window.setInterval(()=>{this.displayElement.textContent=`FPS: ${this.frameCount}`,this.frameCount=0},1e3)}onFrame(e){this.frameCount++}destroy(){clearInterval(this.intervalId),this.displayElement.remove()}createDisplayElement(){let e=document.createElement("div");Object.assign(e.style,{position:"fixed",bottom:"10px",right:"10px",backgroundColor:"#000",color:"#fff",padding:"4px 8px",fontSize:"12px",fontFamily:"monospace",border:"1px solid rgba(255,255,255,0.2)",zIndex:"1000",pointerEvents:"none"}),e.textContent="FPS: 0",document.body.appendChild(e),this.displayElement=e}};var It=class extends h{constructor(e){super(e);this.history=[];this.maxPoints=0;this.canvasHeight=0;this.currentValue=0;this.targetValue=0;this._type=2}onInit(){this.initCanvas(),this.maxPoints=this.canvas.width}onScroll(e){let r=Math.abs(e.scroll.displacement);this.currentValue=r,this.history.push(r),this.history.length>this.maxPoints&&this.history.shift(),this.draw()}draw(){let e=this.context,r=this.canvas.width,i=this.canvas.height;e.clearRect(0,0,r,i),e.strokeStyle="#007bff",e.lineWidth=2,e.beginPath(),this.history.forEach((o,s)=>{let n=s,a=i-o/2;s===0?e.moveTo(n,a):e.lineTo(n,a)}),e.stroke()}initCanvas(){this.canvas=document.createElement("canvas"),this.canvasHeight=window.innerHeight/15-20,this.canvas.width=window.innerWidth*.5,this.canvas.height=this.canvasHeight,Object.assign(this.canvas.style,{position:"fixed",bottom:"10px",left:"50%",transform:"translateX(-50%)",backgroundColor:"#000",border:"1px solid rgba(255,255,255,0.2)",zIndex:"1000",pointerEvents:"none"}),this.context=this.canvas.getContext("2d"),document.body.appendChild(this.canvas)}setTarget(e){this.targetValue=e}clear(){this.canvas.remove(),this.history=[]}};var Pt=class extends h{constructor(t){super(t),this._type=2}onInit(){this.createDisplayElement()}onScroll(t){let e=t.scroll.current,r=t.scroll.target,i=e<r?"\u2193":e>r?"\u2191":"-";this.displayElement.setAttribute("data-dir",i),this.displayElement.setAttribute("data-val",`${Math.round(e)}`)}destroy(){this.displayElement.remove()}createDisplayElement(){let t=document.createElement("div");Object.assign(t.style,{position:"fixed",bottom:"10px",left:"10px",backgroundColor:"#000",color:"#fff",border:"1px solid rgba(255,255,255,0.2)",padding:"5px 8px",fontSize:"12px",fontFamily:"monospace",zIndex:"1000",pointerEvents:"none"}),t.setAttribute("data-dir","-"),t.setAttribute("data-val","0"),document.body.appendChild(t);let e=document.createElement("style");e.innerHTML=`
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 xt(this.data,this.scrollbar,this.thumb),this.scrollbarStateVertical=new Mt(this.data,this.scrollbar,this.thumb),this.scrollbarState=this.scrollbarStateVertical}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 wt=class extends g{constructor(t){super(t),this.htmlKey="split"}onInit(){document.querySelectorAll(`[string="${this.htmlKey}"]`).forEach(t=>{t instanceof HTMLElement&&this.processElement(t)})}onResize(){document.querySelectorAll(`[string="${this.htmlKey}"].-splited`).forEach(t=>{t instanceof HTMLElement&&this.processElement(t)})}onObjectConnected(t){this.processElement(t.htmlElement)}processElement(t){if(!t)return;let e=t.classList.contains("-splited"),r=t.getAttribute("string-split-original");if((!e||r===null)&&(r=t.innerHTML,t.setAttribute("string-split-original",r),t.classList.add("-splited")),!r||r.trim()===""){t.innerHTML!==""&&(t.innerHTML="");return}try{let i=t.getAttribute("string-split"),o=this.tools.optionsParser.process({attributeValue:i}),n=this.generateSplitHtml(r,t,o);t.innerHTML!==n&&(t.innerHTML=n)}catch(i){if(console.error("StringSplit: Error processing element:",t,i),r!==null)try{t.innerHTML!==r&&(t.innerHTML=r)}catch(o){console.error("StringSplit: Error reverting element to original HTML:",t,o),t.innerHTML=""}else t.innerHTML="";t.classList.remove("-splited")}}generateSplitHtml(t,e,r){if(!this.tools?.layoutSplitter||!this.tools?.wordIndexer||!this.tools?.charIndexer||!this.tools?.domBuilder)return console.error("StringSplit: Required tools are not initialized."),"";if(!t||!e)return console.error("StringSplit.generateSplitHtml: Invalid input provided."),"";e.isConnected||console.warn("StringSplit.generateSplitHtml: layoutReferenceElement is not connected to the DOM. Layout calculation might be inaccurate.");try{let i=t,n=this.tools.layoutSplitter.decodeHtmlEntity(i).replace(/\s+/g,"").length,s=this.tools.layoutSplitter.process({text:i,targetElement:e});if(s.length===0&&i.trim()!=="")return console.warn("StringSplit: Layout calculation resulted in no lines for text:",i,"within element:",e),"";let a=this.tools.wordIndexer.process({lines:s,options:{word:r.word,wordLine:r.wordLine}}),p=this.tools.charIndexer.process({processedWords:a,lines:s,options:{char:r.char,charLine:r.charLine,charWord:r.charWord},totalChars:n});return this.tools.domBuilder.process({lines:s,words:a,chars:p,options:r})}catch(i){return console.error("StringSplit.generateSplitHtml: Error processing text:",t,"within element:",e,i),""}}exampleUsage(t){let e={word:[{align:"center"}],char:[{align:"start",random:{min:0,max:t.textContent?.length||0},abs:!0}]},r=t.innerHTML;return this.generateSplitHtml(r,t,e)}};var Ct=class extends g{constructor(e){super(e);this.history=[];this.maxPoints=0;this.height=0;this.value=0;this.target=0;this._type=2}onInit(){this.initCanvas(),this.maxPoints=this.canvas.width}onScroll(e){let r=Math.abs(e.scroll.displacement);this.value=r,this.history.push(r),this.history.length>this.maxPoints&&this.history.shift(),this.draw()}draw(){let e=this.context,r=this.canvas.width,i=this.canvas.height;e.clearRect(0,0,r,i),e.strokeStyle="red",e.lineWidth=2,e.beginPath(),this.history.forEach((o,n)=>{let s=n,a=i-o*this.height;n===0?e.moveTo(s,a):e.lineTo(s,a)}),e.stroke()}initCanvas(){let e=document.createElement("canvas"),r=window.innerWidth*.5;this.height=window.innerHeight/15-20,e.width=r,e.height=this.height,Object.assign(e.style,{position:"fixed",bottom:`${window.innerHeight/20+10}px`,left:"50%",transform:"translateX(-50%)",backgroundColor:"#000000",border:"1px solid rgba(255, 255, 255, 0.2)",zIndex:"1000",pointerEvents:"none"}),this.canvas=e,this.context=e.getContext("2d"),document.body.appendChild(e)}setTarget(e){this.target=e}clear(){this.canvas.remove(),this.history=[]}};var Tt=class extends g{constructor(e){super(e);this.frameCount=0;this._type=2}onInit(){this.createDisplayElement(),this.intervalId=window.setInterval(()=>{this.displayElement.textContent=`FPS: ${this.frameCount}`,this.frameCount=0},1e3)}onFrame(e){this.frameCount++}destroy(){clearInterval(this.intervalId),this.displayElement.remove()}createDisplayElement(){let e=document.createElement("div");Object.assign(e.style,{position:"fixed",bottom:"10px",right:"10px",backgroundColor:"#000",color:"#fff",padding:"4px 8px",fontSize:"12px",fontFamily:"monospace",border:"1px solid rgba(255,255,255,0.2)",zIndex:"1000",pointerEvents:"none"}),e.textContent="FPS: 0",document.body.appendChild(e),this.displayElement=e}};var Pt=class extends g{constructor(e){super(e);this.history=[];this.maxPoints=0;this.canvasHeight=0;this.currentValue=0;this.targetValue=0;this._type=2}onInit(){this.initCanvas(),this.maxPoints=this.canvas.width}onScroll(e){let r=Math.abs(e.scroll.displacement);this.currentValue=r,this.history.push(r),this.history.length>this.maxPoints&&this.history.shift(),this.draw()}draw(){let e=this.context,r=this.canvas.width,i=this.canvas.height;e.clearRect(0,0,r,i),e.strokeStyle="#007bff",e.lineWidth=2,e.beginPath(),this.history.forEach((o,n)=>{let s=n,a=i-o/2;n===0?e.moveTo(s,a):e.lineTo(s,a)}),e.stroke()}initCanvas(){this.canvas=document.createElement("canvas"),this.canvasHeight=window.innerHeight/15-20,this.canvas.width=window.innerWidth*.5,this.canvas.height=this.canvasHeight,Object.assign(this.canvas.style,{position:"fixed",bottom:"10px",left:"50%",transform:"translateX(-50%)",backgroundColor:"#000",border:"1px solid rgba(255,255,255,0.2)",zIndex:"1000",pointerEvents:"none"}),this.context=this.canvas.getContext("2d"),document.body.appendChild(this.canvas)}setTarget(e){this.targetValue=e}clear(){this.canvas.remove(),this.history=[]}};var It=class extends g{constructor(t){super(t),this._type=2}onInit(){this.createDisplayElement()}onScroll(t){let e=t.scroll.current,r=t.scroll.target,i=e<r?"\u2193":e>r?"\u2191":"-";this.displayElement.setAttribute("data-dir",i),this.displayElement.setAttribute("data-val",`${Math.round(e)}`)}destroy(){this.displayElement.remove()}createDisplayElement(){let t=document.createElement("div");Object.assign(t.style,{position:"fixed",bottom:"10px",left:"10px",backgroundColor:"#000",color:"#fff",border:"1px solid rgba(255,255,255,0.2)",padding:"5px 8px",fontSize:"12px",fontFamily:"monospace",zIndex:"1000",pointerEvents:"none"}),t.setAttribute("data-dir","-"),t.setAttribute("data-val","0"),document.body.appendChild(t);let e=document.createElement("style");e.innerHTML=`
20
20
  div[data-dir][data-val]::before {
21
21
  content: attr(data-dir) ' Top: ' attr(data-val) 'px';
22
22
  }
23
- `,document.head.appendChild(e),this.displayElement=t}};function zt(l,t){let e=null;return function(...r){let i=this;e&&clearTimeout(e),e=setTimeout(()=>{l.apply(i,r),e=null},t)}}var Lt=class{constructor(){this.fps=0;this.isAnimationStarted=!1;this.fpsInterval=0;this.then=0;this.requestAnimationId=0;this.onFrameCallback=t=>{};this.animate=()=>{};this.onVisibilityChangeBind=this.onVisibilityChange.bind(this)}onVisibilityChange(){document.hidden?(this.stop(),this.isAnimationStarted=!1):this.start(this.fps)}start(t){this.fps=t,!this.isAnimationStarted&&(this.fpsInterval=1e3/t,this.then=performance.now(),this.isAnimationStarted=!0,t===0?this.animate=()=>{let e=performance.now();this.requestAnimationId=requestAnimationFrame(()=>this.animate()),this.onFrameCallback(e)}:this.animate=()=>{let e=performance.now(),r=e-this.then;r>this.fpsInterval&&(this.then=e-r%this.fpsInterval,this.onFrameCallback(e)),this.requestAnimationId=requestAnimationFrame(()=>this.animate())},this.animate())}stop(){this.isAnimationStarted&&(cancelAnimationFrame(this.requestAnimationId),this.requestAnimationId=0,this.isAnimationStarted=!1)}setOnFrame(t){this.onFrameCallback=t}destructor(){this.stop()}};var Ot=class extends h{constructor(t){super(t),this.htmlKey="autoplay",this.attributesToMap=[...this.attributesToMap,{key:"src",type:"string",fallback:""}]}onObjectConnected(t){t.setProperty("onEnterEvent",this.onEnterObject.bind(this)),t.events.on("enter",t.getProperty("onEnterEvent")),t.setProperty("onLeaveEvent",this.onLeaveObject.bind(this)),t.events.on("leave",t.getProperty("onLeaveEvent"));let e=t.htmlElement,r=this.tools.domAttribute.process({element:e,key:"string-started",fallback:null})!==null;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",""),e.src=t.getProperty("src"),e.load(),e.addEventListener("canplay",()=>{}))}onEnterObject(t){let e=t.htmlElement;this.tryPlay(e)}onLeaveObject(t){t.htmlElement.pause()}tryPlay(t){t.play().catch(e=>console.warn("[StringVideoAutoplay] Autoplay failed:",e))}};var Ft=class l{constructor(){this.prevWidth=0;this.prevHeight=0;this.loop=new Lt;this.debouncedResize=zt(this.onResize,30);this.root=document.body,this.window=window,this.tools=new pt,this.data=new L,this.eventManager=new w,this.moduleManager=new _(this.data),this.objectManager=new K(this.data,this.moduleManager,this.eventManager),this.context={events:this.eventManager,data:this.data,tools:this.tools,settings:{}},this.cursorController=new X(1,this.context),this.scrollManager=new Z(this.context),this.setupSettings({"offset-top":"0%","offset-bottom":"0%",key:"--progress","inview-top":"0%","inview-bottom":"0%","enter-el":"top","enter-vp":"bottom","exit-el":"bottom","exit-vp":"top","parallax-bias":"0.0",parallax:"0.2",lerp:"0.2",radius:"150",strength:"0.3",glide:"1",anchor:"center center",timeout:900,alignment:"center","target-disable":"false","target-style-disable":"false","target-class":"",active:"false",fixed:"false",repeat:"false","self-disable":"false",abs:"false",easing:"cubic-bezier(0.25, 0.25, 0.25, 0.25)","glide-base-velocity":.00125,"glide-reduce-velocity":625e-7,"glide-negative-velocity":-1e-4}),this.onWheelBind=this.onWheelEvent.bind(this),this.onScrollBind=this.onScrollEvent.bind(this),this.onResizeBind=this.onResize.bind(this),this.onMouseMoveBind=this.onMouseMoveEvent.bind(this),this.onScrollStartBind=this.onScrollStart.bind(this),this.onScrollStopBind=this.onScrollStop.bind(this),this.onDirectionChangeBind=this.onDirectionChange.bind(this),this.scrollManager.bindEvents({onScrollStart:this.onScrollStartBind,onScrollStop:this.onScrollStopBind,onDirectionChange:this.onDirectionChangeBind}),this.loop.setOnFrame(t=>{this.data.time.delta=t-this.data.time.now,this.data.time.previous=this.data.time.now,this.data.time.now=t,this.data.time.elapsed+=this.data.time.delta,this.onUpdateEvent()}),this.on("image:load:all",()=>{this.onResize()}),this.scrollContainer=window}set scrollPosition(t){this.data.scroll.current=t,this.data.scroll.target=t,this.data.scroll.delta=0,this.data.scroll.lerped=0,this.scrollManager.updatePosition()}set scrollContainer(t){t instanceof Window?(this.data.scroll.container=document.body,this.data.scroll.elementContainer=document.documentElement,this.data.scroll.scrollContainer=t):t instanceof HTMLElement?(this.data.scroll.container=t,this.data.scroll.elementContainer=t,this.data.scroll.scrollContainer=t):(this.data.scroll.container=document.body,this.data.scroll.elementContainer=document.documentElement,this.data.scroll.scrollContainer=t),this.debouncedResize()}get speed(){return this.data.scroll.current}set speed(t){this.data.scroll.speed=t}set speedAccelerate(t){this.data.scroll.speedAccelerate=.1+(.5-.1)*t}set scrollDesktopMode(t){this.scrollManager.setDesktopMode(t)}set scrollMobileMode(t){this.scrollManager.setMobileMode(t)}static getInstance(){return l.i||(l.i=new l),l.i}reuse(t){return this.moduleManager.find(t)}use(t,e=null){let r={...this.context.settings,...e},i=new t({events:this.eventManager,data:this.data,tools:this.tools,settings:r});this.moduleManager.register(i)}on(t,e,r=""){this.eventManager.on(t,e,r)}off(t,e,r=""){this.eventManager.off(t,e,r)}start(t){this.data.scroll.scrollContainer?.addEventListener("scroll",this.onScrollBind),this.data.scroll.container?.addEventListener("wheel",this.onWheelBind,{passive:!1}),window.addEventListener("resize",this.onResizeBind),this.root.addEventListener("mousemove",this.onMouseMoveBind),new ResizeObserver(()=>{this.debouncedResize()}).observe(this.context.data.scroll.container);let r=new MutationObserver((n,a)=>{for(let p of n)p.type==="attributes"&&(p.attributeName==="style"||p.attributeName==="class")&&this.onResize()}),i={attributes:!0,attributeFilter:["style","class"]};r.observe(this.context.data.scroll.container,i),this.use(gt);let o=window.getComputedStyle(document.documentElement).fontSize,s=parseFloat(o);this.context.data.viewport.baseRem=s,document.documentElement.classList.add("-string"),this.moduleManager.onInit(),this.onResize(),this.initObjects(),this.objectManager.observeDOM(),this.loop.start(t),this.eventManager.emit("start",null)}initObjects(){document.querySelectorAll("[string],[data-string]").forEach(t=>{this.objectManager.add(t)}),document.querySelectorAll("[string-copy-from],[data-string-copy-from]").forEach(t=>{let e=this.tools.domAttribute.process({element:t,key:"copy-from",fallback:""});e&&e.length>0&&this.objectManager.enqueueConnection(e,t)}),this.moduleManager.onResize(),this.moduleManager.onScroll(),this.moduleManager.onFrame()}setupSettings(t){this.context.settings={...this.context.settings,...t},this.onSettingsChange()}onMouseMoveEvent(t){this.cursorController.onMouseMove(t),this.moduleManager.onMouseMove(t)}onWheelEvent(t){this.scrollManager.get().onWheel(t),this.moduleManager.onWheel(t)}onScrollStart(){this.moduleManager.onScrollStart()}onScrollStop(){this.moduleManager.onScrollStop()}onDirectionChange(){this.moduleManager.onDirectionChange()}onSettingsChange(){this.cursorController.onSettingsChange(),this.objectManager.onSettingsChange(),this.moduleManager.onSettingsChange()}onScrollEvent(t){return t.preventDefault(),this.scrollManager.get().onScroll(t),this.moduleManager.onScroll(),this.eventManager.emit("lerp",this.data.scroll.lerped),this.eventManager.emit("scroll",this.data.scroll.current),!1}onUpdateEvent(){this.cursorController.onFrame(),this.scrollManager.get().onFrame(),this.moduleManager.onFrame(),this.eventManager.emit("update",null)}onResize(){let t=this.data.scroll.container,e=this.context.data.scroll,r=0,i=0;var o,s=0;let n=t.getBoundingClientRect();t.tagName=="BODY"?(r=window.innerWidth,i=window.innerHeight):(r=n.width,i=n.height),s=n.top,o=e.container.scrollHeight;let a=this.tools.transformScaleParser.process({value:window.getComputedStyle(t).transform});this.context.data.viewport.transformScale=a;let p=r>1080,d=this.prevWidth!==r,m=this.prevHeight!==i,c=this.context.data.viewport.contentHeight!==o,g=d||p&&m||c;this.context.data.scroll.topPosition=s,this.context.data.viewport.contentWidth=r,this.context.data.viewport.contentHeight=o,this.prevWidth=r,this.prevHeight=i,this.context.data.viewport.windowWidth=r,this.context.data.viewport.windowHeight=i;let b=window.getComputedStyle(document.documentElement).fontSize,u=parseFloat(b);this.context.data.viewport.baseRem=u*a,e.bottomPosition=this.context.data.viewport.contentHeight-i,g&&(this.context.data.scroll.current=this.context.data.scroll.container.scrollTop,this.context.data.scroll.target=this.context.data.scroll.container.scrollTop,this.context.data.scroll.transformedCurrent=this.context.data.scroll.current*this.context.data.viewport.transformScale,this.scrollManager.updateResponsiveMode(),this.moduleManager.onResize(),this.onSettingsChange(),this.moduleManager.onScroll(),this.moduleManager.onFrame())}destroy(){this.data.scroll.scrollContainer?.removeEventListener("scroll",this.onScrollBind),this.data.scroll.container?.removeEventListener("wheel",this.onScrollBind),this.window.removeEventListener("resize",this.onResizeBind),this.root.removeEventListener("mousemove",this.onMouseMoveBind),this.loop.stop(),this.moduleManager.destroy(),this.eventManager.clearAll()}};0&&(module.exports={StringAnchor,StringCursor,StringData,StringDelayLerpTracker,StringFPSTracker,StringGlide,StringLazy,StringLerp,StringLerpTracker,StringLoading,StringMagnetic,StringModule,StringObject,StringParallax,StringPositionTracker,StringProgress,StringResponsive,StringScrollbar,StringSplit,StringTune,StringVideoAutoplay});
23
+ `,document.head.appendChild(e),this.displayElement=t}};function Bt(l,t){let e=null;return function(...r){let i=this;e&&clearTimeout(e),e=setTimeout(()=>{l.apply(i,r),e=null},t)}}var Lt=class{constructor(){this.fps=0;this.isAnimationStarted=!1;this.fpsInterval=0;this.then=0;this.requestAnimationId=0;this.onFrameCallback=t=>{};this.animate=()=>{};this.onVisibilityChangeBind=this.onVisibilityChange.bind(this)}onVisibilityChange(){document.hidden?(this.stop(),this.isAnimationStarted=!1):this.start(this.fps)}start(t){this.fps=t,!this.isAnimationStarted&&(this.fpsInterval=1e3/t,this.then=performance.now(),this.isAnimationStarted=!0,t===0?this.animate=()=>{let e=performance.now();this.requestAnimationId=requestAnimationFrame(()=>this.animate()),this.onFrameCallback(e)}:this.animate=()=>{let e=performance.now(),r=e-this.then;r>this.fpsInterval&&(this.then=e-r%this.fpsInterval,this.onFrameCallback(e)),this.requestAnimationId=requestAnimationFrame(()=>this.animate())},this.animate())}stop(){this.isAnimationStarted&&(cancelAnimationFrame(this.requestAnimationId),this.requestAnimationId=0,this.isAnimationStarted=!1)}setOnFrame(t){this.onFrameCallback=t}destructor(){this.stop()}};var Ot=class extends g{constructor(t){super(t),this.htmlKey="autoplay",this.attributesToMap=[...this.attributesToMap,{key:"src",type:"string",fallback:""}]}onObjectConnected(t){t.setProperty("onEnterEvent",this.onEnterObject.bind(this)),t.events.on("enter",t.getProperty("onEnterEvent")),t.setProperty("onLeaveEvent",this.onLeaveObject.bind(this)),t.events.on("leave",t.getProperty("onLeaveEvent"));let e=t.htmlElement,r=this.tools.domAttribute.process({element:e,key:"string-started",fallback:null})!==null;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",""),e.src=t.getProperty("src"),e.load(),e.addEventListener("canplay",()=>{}))}onEnterObject(t){let e=t.htmlElement;this.tryPlay(e)}onLeaveObject(t){t.htmlElement.pause()}tryPlay(t){t.play().catch(e=>console.warn("[StringVideoAutoplay] Autoplay failed:",e))}};var Ft=class l{constructor(){this.prevWidth=0;this.prevHeight=0;this.loop=new Lt;this.debouncedResize=Bt(this.onResize,30);this.root=document.body,this.window=window,this.tools=new pt,this.data=new L,this.eventManager=new w,this.moduleManager=new _(this.data),this.objectManager=new K(this.data,this.moduleManager,this.eventManager),this.context={events:this.eventManager,data:this.data,tools:this.tools,settings:{}},this.cursorController=new X(1,this.context),this.scrollManager=new Z(this.context),this.setupSettings({"offset-top":"0%","offset-bottom":"0%",key:"--progress","inview-top":"0%","inview-bottom":"0%","enter-el":"top","enter-vp":"bottom","exit-el":"bottom","exit-vp":"top","parallax-bias":"0.0",parallax:"0.2",lerp:"0.2",radius:"150",strength:"0.3",glide:"1",anchor:"center center",timeout:900,alignment:"center","target-disable":"false","target-style-disable":"false","target-class":"",active:"false",fixed:"false",repeat:"false","self-disable":"false",abs:"false",easing:"cubic-bezier(0.25, 0.25, 0.25, 0.25)","glide-base-velocity":.00125,"glide-reduce-velocity":625e-7,"glide-negative-velocity":-1e-4}),this.onWheelBind=this.onWheelEvent.bind(this),this.onScrollBind=this.onScrollEvent.bind(this),this.onResizeBind=this.onResize.bind(this),this.onMouseMoveBind=this.onMouseMoveEvent.bind(this),this.onScrollStartBind=this.onScrollStart.bind(this),this.onScrollStopBind=this.onScrollStop.bind(this),this.onDirectionChangeBind=this.onDirectionChange.bind(this),this.scrollManager.bindEvents({onScrollStart:this.onScrollStartBind,onScrollStop:this.onScrollStopBind,onDirectionChange:this.onDirectionChangeBind}),this.loop.setOnFrame(t=>{this.data.time.delta=t-this.data.time.now,this.data.time.previous=this.data.time.now,this.data.time.now=t,this.data.time.elapsed+=this.data.time.delta,this.onUpdateEvent()}),this.on("image:load:all",()=>{this.onResize()}),this.scrollContainer=window}set scrollPosition(t){this.data.scroll.current=t,this.data.scroll.target=t,this.data.scroll.delta=0,this.data.scroll.lerped=0,this.scrollManager.updatePosition()}set scrollContainer(t){t instanceof Window?(this.data.scroll.container=document.body,this.data.scroll.elementContainer=document.documentElement,this.data.scroll.scrollContainer=t):t instanceof HTMLElement?(this.data.scroll.container=t,this.data.scroll.elementContainer=t,this.data.scroll.scrollContainer=t):(this.data.scroll.container=document.body,this.data.scroll.elementContainer=document.documentElement,this.data.scroll.scrollContainer=t),this.debouncedResize()}get speed(){return this.data.scroll.current}set speed(t){this.data.scroll.speed=t}set speedAccelerate(t){this.data.scroll.speedAccelerate=.1+(.5-.1)*t}set scrollDesktopMode(t){this.scrollManager.setDesktopMode(t)}set scrollMobileMode(t){this.scrollManager.setMobileMode(t)}static getInstance(){return l.i||(l.i=new l),l.i}reuse(t){return this.moduleManager.find(t)}use(t,e=null){let r={...this.context.settings,...e},i=new t({events:this.eventManager,data:this.data,tools:this.tools,settings:r});this.moduleManager.register(i)}on(t,e,r=""){this.eventManager.on(t,e,r)}off(t,e,r=""){this.eventManager.off(t,e,r)}start(t){this.data.scroll.scrollContainer?.addEventListener("scroll",this.onScrollBind),this.data.scroll.container?.addEventListener("wheel",this.onWheelBind,{passive:!1}),window.addEventListener("resize",this.onResizeBind),this.root.addEventListener("mousemove",this.onMouseMoveBind),new ResizeObserver(()=>{this.debouncedResize()}).observe(this.context.data.scroll.container);let r=new MutationObserver((s,a)=>{for(let p of s)p.type==="attributes"&&(p.attributeName==="style"||p.attributeName==="class")&&this.onResize()}),i={attributes:!0,attributeFilter:["style","class"]};r.observe(this.context.data.scroll.container,i),this.use(gt);let o=window.getComputedStyle(document.documentElement).fontSize,n=parseFloat(o);this.context.data.viewport.baseRem=n,document.documentElement.classList.add("-string"),this.moduleManager.onInit(),this.onResize(),this.initObjects(),this.objectManager.observeDOM(),this.loop.start(t),this.eventManager.emit("start",null)}initObjects(){document.querySelectorAll("[string],[data-string]").forEach(t=>{this.objectManager.add(t)}),document.querySelectorAll("[string-copy-from],[data-string-copy-from]").forEach(t=>{let e=this.tools.domAttribute.process({element:t,key:"copy-from",fallback:""});e&&e.length>0&&this.objectManager.enqueueConnection(e,t)}),this.moduleManager.onResize(),this.moduleManager.onScroll(),this.moduleManager.onFrame()}setupSettings(t){this.context.settings={...this.context.settings,...t},this.onSettingsChange()}onMouseMoveEvent(t){this.cursorController.onMouseMove(t),this.moduleManager.onMouseMove(t)}onWheelEvent(t){this.scrollManager.get().onWheel(t),this.moduleManager.onWheel(t)}onScrollStart(){this.moduleManager.onScrollStart()}onScrollStop(){this.moduleManager.onScrollStop()}onDirectionChange(){this.moduleManager.onDirectionChange()}onSettingsChange(){this.cursorController.onSettingsChange(),this.objectManager.onSettingsChange(),this.moduleManager.onSettingsChange()}onScrollEvent(t){return t.preventDefault(),this.scrollManager.get().onScroll(t),this.moduleManager.onScroll(),this.eventManager.emit("lerp",this.data.scroll.lerped),this.eventManager.emit("scroll",this.data.scroll.current),!1}onUpdateEvent(){this.cursorController.onFrame(),this.scrollManager.get().onFrame(),this.moduleManager.onFrame(),this.eventManager.emit("update",null)}onResize(){let t=this.data.scroll.container,e=this.context.data.scroll,r=0,i=0;var o,n=0;let s=t.getBoundingClientRect();t.tagName=="BODY"?(r=window.innerWidth,i=window.innerHeight):(r=s.width,i=s.height),n=s.top,o=e.container.scrollHeight;let a=this.tools.transformScaleParser.process({value:window.getComputedStyle(t).transform});this.context.data.viewport.transformScale=a;let p=r>1080,d=this.prevWidth!==r,m=this.prevHeight!==i,c=this.context.data.viewport.contentHeight!==o,h=d||p&&m||c;this.context.data.scroll.topPosition=n,this.context.data.viewport.contentWidth=r,this.context.data.viewport.contentHeight=o,this.prevWidth=r,this.prevHeight=i,this.context.data.viewport.windowWidth=r,this.context.data.viewport.windowHeight=i;let v=window.getComputedStyle(document.documentElement).fontSize,u=parseFloat(v);this.context.data.viewport.baseRem=u*a,e.bottomPosition=this.context.data.viewport.contentHeight-i,h&&(this.context.data.scroll.container.scrollTop>0&&(this.context.data.scroll.current=this.context.data.scroll.container.scrollTop,this.context.data.scroll.target=this.context.data.scroll.container.scrollTop,this.context.data.scroll.transformedCurrent=this.context.data.scroll.current*this.context.data.viewport.transformScale),this.scrollManager.updateResponsiveMode(),this.moduleManager.onResize(),this.onSettingsChange(),this.moduleManager.onScroll(),this.moduleManager.onFrame())}destroy(){this.data.scroll.scrollContainer?.removeEventListener("scroll",this.onScrollBind),this.data.scroll.container?.removeEventListener("wheel",this.onScrollBind),this.window.removeEventListener("resize",this.onResizeBind),this.root.removeEventListener("mousemove",this.onMouseMoveBind),this.loop.stop(),this.moduleManager.destroy(),this.eventManager.clearAll()}};0&&(module.exports={StringAnchor,StringCursor,StringData,StringDelayLerpTracker,StringFPSTracker,StringGlide,StringLazy,StringLerp,StringLerpTracker,StringLoading,StringMagnetic,StringModule,StringObject,StringParallax,StringPositionTracker,StringProgress,StringResponsive,StringScrollbar,StringSplit,StringTune,StringVideoAutoplay});
24
24
  //# sourceMappingURL=index.cjs.map