@fiddle-digital/string-tune 1.1.20 → 1.1.21

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 Vt=Object.defineProperty;var Gt=Object.getOwnPropertyDescriptor;var Zt=Object.getOwnPropertyNames;var Jt=Object.prototype.hasOwnProperty;var te=(c,e)=>{for(var t in e)Vt(c,t,{get:e[t],enumerable:!0})},ee=(c,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Zt(e))!Jt.call(c,i)&&i!==t&&Vt(c,i,{get:()=>e[i],enumerable:!(r=Gt(e,i))||r.enumerable});return c};var re=c=>ee(Vt({},"__esModule",{value:!0}),c);var pe={};te(pe,{StringAnchor:()=>Mt,StringCursor:()=>gt,StringData:()=>N,StringDelayLerpTracker:()=>It,StringFPSTracker:()=>Ot,StringForm:()=>Ft,StringGlide:()=>xt,StringLazy:()=>bt,StringLerp:()=>Et,StringLerpTracker:()=>kt,StringLoading:()=>vt,StringMagnetic:()=>ft,StringModule:()=>g,StringObject:()=>R,StringParallax:()=>Tt,StringPositionTracker:()=>Dt,StringProgress:()=>H,StringResponsive:()=>St,StringScrollbar:()=>Lt,StringSequence:()=>Ht,StringSplit:()=>Pt,StringTune:()=>zt,StringVideoAutoplay:()=>At,default:()=>zt});module.exports=re(pe);var tt=class{constructor(e=.1,t){this.SETTLE_THRESHOLD=.1;this.smoothingFactor=e,this.context=t,this.onSettingsChange()}onMouseMove(e){this.context.data.cursor.targetX=e.clientX,this.context.data.cursor.targetY=e.clientY}onFrame(){let{targetX:e,targetY:t,smoothedX:r,smoothedY:i}=this.context.data.cursor,o=this.context.tools.lerp.process({from:r,to:e,progress:this.smoothingFactor}),s=this.context.tools.lerp.process({from:i,to:t,progress:this.smoothingFactor}),a=this.getStepDistance(o,s);this.isSettled(a)?this.snapToTarget():this.applyStep(o,s)}onSettingsChange(){let e=Number(this.context.settings.lerp);this.setLerpFactor(e)}setLerpFactor(e){this.smoothingFactor=this.context.tools.adaptiveLerp.process({value:e,inMin:.1,inMax:1,outMin:.05,outMax:.65})}getStepDistance(e,t){return Math.hypot(e,t)}isSettled(e){return e<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(e,t){this.context.data.cursor.smoothedX+=e,this.context.data.cursor.smoothedY+=t,this.context.data.cursor.stepX=e,this.context.data.cursor.stepY=t}};var D=class{constructor(){this.listeners={};this.stateEvents=new Set;this.lastPayloads={};this.stateEvents.add("screen:mobile"),this.stateEvents.add("screen:tablet"),this.stateEvents.add("screen:laptop"),this.stateEvents.add("screen:desktop"),this.stateEvents.add("start")}on(e,t,r){let i=r?`${e}:${r}`:e;this.listeners[i]||(this.listeners[i]=new Set),this.listeners[i].add(t),this.stateEvents.has(i)&&this.lastPayloads[i]!==void 0&&t(this.lastPayloads[i])}off(e,t,r){let i=r?`${e}:${r}`:e;this.listeners[i]&&this.listeners[i].delete(t)}emit(e,t){this.stateEvents.has(e)&&(this.lastPayloads[e]=t);let r=this.listeners[e];if(r)for(let i of r)i(t)}onProgress(e,t){this.on(`progress:${e}`,t)}emitProgress(e,t){this.emit(`progress:${e}`,t)}onInview(e,t){this.on(`object:inview:${e}`,t)}emitInview(e,t){this.emit(`object:inview:${e}`,t)}onScroll(e){this.on("scroll",e)}emitScroll(e){this.emit("scroll",e)}onUpdate(e){this.on("update",e)}emitUpdate(){this.emit("update")}clear(e){delete this.listeners[e]}clearAll(){this.listeners={}}};var et=class{constructor(e){this.data=e;this.modules=[];this.uiModules=[]}register(e){e.type===1&&this.modules.push(e),e.type===2&&this.uiModules.push(e)}find(e){return this.modules.find(t=>t instanceof e)}onInit(){[...this.modules,...this.uiModules].forEach(e=>e.onInit())}onFrame(){[...this.modules,...this.uiModules].forEach(e=>e.onFrame(this.data))}onScroll(){[...this.modules,...this.uiModules].forEach(e=>e.onScroll(this.data))}onResize(){[...this.modules,...this.uiModules].forEach(e=>e.onResize())}onMouseMove(e){[...this.modules,...this.uiModules].forEach(t=>t.onMouseMove(e))}onWheel(e){[...this.modules,...this.uiModules].forEach(t=>t.onWheel(e))}onDirectionChange(){[...this.modules,...this.uiModules].forEach(e=>e.onDirectionChange())}onScrollStart(){[...this.modules,...this.uiModules].forEach(e=>e.onScrollStart())}onScrollStop(){[...this.modules,...this.uiModules].forEach(e=>e.onScrollStop())}onAxisChange(){[...this.modules,...this.uiModules].forEach(e=>e.onAxisChange())}onDeviceChange(){[...this.modules,...this.uiModules].forEach(e=>e.onDeviceChange())}onScrollConfigChange(){[...this.modules,...this.uiModules].forEach(e=>e.onScrollConfigChange())}onSettingsChange(){[...this.modules,...this.uiModules].forEach(e=>e.onSettingsChange())}onDOMMutate(e,t){[...this.modules,...this.uiModules].forEach(r=>r.onDOMMutate(e,t))}destroy(){[...this.modules,...this.uiModules].forEach(e=>e.destroy()),this.modules=[],this.uiModules=[]}get all(){return[...this.modules,...this.uiModules]}get core(){return this.modules}get ui(){return this.uiModules}};var R=class{constructor(e,t){this.id="";this.keys=[];this.connects=[];this.properties=new Map;this.modules=[];this.events=new D;this.htmlElement=t,this.id=e}setProperty(e,t){this.properties.set(e,t)}getProperty(e){return this.properties.get(e)??null}enter(){this.events.emit("enter",this),this.setProperty("active",!0),this.modules.forEach(e=>{e.enterObject(this.id,this)})}leave(){this.events.emit("leave",this),this.setProperty("active",!1),this.modules.forEach(e=>{e.exitObject(this.id)})}remove(){this.modules.forEach(e=>{e.removeObject(this.id)})}show(){this.htmlElement.classList.add("-inview")}hide(){this.getProperty("repeat")&&this.htmlElement.classList.remove("-inview")}connect(e){this.modules.includes(e)||this.modules.push(e)}};var rt=class{constructor(e,t,r){this.data=e;this.modules=t;this.events=r;this.objects=new Map;this.connectQueue=[];this.globalId=1}get all(){return this.objects}add(e){let t=`string-${this.globalId++}`,r="string-id";e.getAttribute("string-id")&&(t=e.getAttribute("string-id"),r="string-id"),e.getAttribute("data-string-id")&&(t=e.getAttribute("data-string-id"),r="data-string-id");let i=t&&this.objects.has(t)?this.objects.get(t):new R(t,e);e.setAttribute(r,i.id);let o=e.getAttribute("string")??e.getAttribute("data-string");o&&(i.keys=(o??"").split("|")),e.setAttribute("string-inited",""),this.objects.set(i.id,i);let s=this.getAllAttributes(e);this.modules.core.forEach(n=>{"setupCoreProperties"in n&&typeof n.setupCoreProperties=="function"&&n.setupCoreProperties(i,e,s)}),this.modules.core.forEach(n=>{n.canConnect(i)&&(n.initializeObject(this.globalId,i,e,s),n.calculatePositions(i,this.data.viewport.windowHeight),n.connectObject(i),n.addObject(i.id,i))}),this.connectQueue.filter(n=>n.id===i.id).forEach(n=>i.connects.push(n.element)),this.connectQueue=this.connectQueue.filter(n=>n.id!==i.id),this.initObservers(i,e),this.checkInviewForObject(i)}remove(e){let t=this.objects.get(e);t&&(t.events.clearAll(),t.getProperty("observer-progress")?.disconnect(),t.getProperty("observer-inview")?.disconnect(),t.htmlElement.removeAttribute("string-inited"),t.leave(),t.remove(),this.objects.delete(e))}enqueueConnection(e,t){this.connectQueue.push({id:e,element:t}),console.log(this.connectQueue.length)}getAllAttributes(e){let t={};return Array.from(e.attributes).forEach(r=>{t[r.name]=r.value}),t}initObservers(e,t){let r=e.getProperty("offset-top")??0,i=e.getProperty("offset-bottom")??0;e.getProperty("observer-progress")?.disconnect();let o=a=>{a.forEach(n=>{this.events.emit(`object:activate:${e.id}`,n.isIntersecting),n.isIntersecting?e.enter():e.leave()})},s=new IntersectionObserver(o,{root:null,rootMargin:`${i+this.data.viewport.windowHeight}px 0px ${r+this.data.viewport.windowHeight}px 0px`,threshold:0});s.observe(t),e.setProperty("observer-progress",s)}observeDOM(){new MutationObserver(t=>{t.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(a=>this.add(a));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(e){let t=e.getAttribute("string-id")??e.getAttribute("data-string-id");if(!t)return;let r=e.getAttribute("string-copy-from")??e.getAttribute("data-string-copy-from");r&&(this.connectQueue=this.connectQueue.filter(i=>i.id!==r)),this.remove(t)}onSettingsChange(){this.objects.forEach(e=>{this.modules.core.forEach(t=>{if(t.canConnect(e)){let r=this.getAllAttributes(e.htmlElement);t.initializeObject(this.globalId,e,e.htmlElement,r),t.calculatePositions(e,this.data.viewport.windowHeight),t.connectObject(e)}})})}isFixed(e){return e.hasAttribute("string-fixed")}checkInview(){this.objects.forEach(e=>{this.checkInviewForObject(e)})}checkInviewForObject(e){let t=this.data.scroll.transformedCurrent,r=e.getProperty("inview-start-position"),i=e.getProperty("inview-end-position"),o=e.getProperty("is-inview")??!1,s=t>=r&&t<=i,a=null;!o&&s?a=t<r?"enter-bottom":"enter-top":o&&!s&&(a=t<r?"exit-top":"exit-bottom"),s!==o&&(e.setProperty("is-inview",s),this.events.emit(`object:inview:${e.id}`,{inView:s,direction:a}),s?e.show():e.hide())}};var L=class{constructor(e){this.name="";this.isProg=!1;this.isParallaxEnabled=!1;this._scrollDirection="vertical";this.isBottomScrollDirection=null;this.isLastBottomScrollDirection=!0;this.scrollTriggerRules=[];this.onChangeDirection=()=>{};this.onScrollStart=()=>{};this.onScrollStop=()=>{};this.onCalcUpdate=()=>{this.context.data.scroll.scrollContainer?.scrollTo(0,this.context.data.scroll.current),this.triggerScrollRules()};this.document=document,this.context=e}set scrollDirection(e){this._scrollDirection=e,this._scrollDirection==="vertical"?this.onCalcUpdate=()=>{this.context.data.scroll.scrollContainer?.scrollTo(0,this.context.data.scroll.current),this.triggerScrollRules()}:this._scrollDirection==="horizontal"&&(this.onCalcUpdate=()=>{this.context.data.scroll.scrollContainer?.scrollTo(this.context.data.scroll.current,0)})}onFrame(){}onWheel(e){}onScroll(e){}disableScrollEvents(){}enableScrollEvents(){}triggerScrollRules(){this.scrollTriggerRules.forEach(e=>{(e.direction==="any"||this.isLastBottomScrollDirection&&e.direction==="forward")&&this.context.data.scroll.current>=e.offset?(e.onEnter?.(),e.toggleClass&&e.toggleClass.target.classList.add(e.toggleClass.className)):(e.onLeave?.(),e.toggleClass&&e.toggleClass.target.classList.remove(e.toggleClass.className))})}addScrollMark(e){this.scrollTriggerRules.push(e)}removeScrollMark(e){this.scrollTriggerRules=this.scrollTriggerRules.filter(t=>t.id!==e)}};var it=class extends L{constructor(t){super(t);this.name="default"}onFrame(){if(this.context.data.scroll.delta!==0){let t=this.context.data.scroll.delta*this.context.data.scroll.speedAccelerate;this.context.data.scroll.delta-=t,this.context.data.scroll.lerped=t,Math.abs(this.context.data.scroll.lerped)<.1&&(this.context.data.scroll.delta=0,this.context.data.scroll.lerped=0,this.onScrollStop())}}onScroll(t){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(t){if(t.deltaY!==0){this.context.data.scroll.delta===0&&this.onScrollStart();let r=t.deltaY;this.context.data.scroll.target===0&&(this.context.data.scroll.delta+=Math.max(0,t.deltaY)),this.context.data.scroll.delta+=r}}};var ot=class extends L{constructor(t){super(t);this.name="disable";this.preventScroll=t=>{t.preventDefault()};this.preventKeyScroll=t=>{["ArrowUp","ArrowDown","PageUp","PageDown"," ","Home","End"].includes(t.key)&&t.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(t){t.preventDefault()}onScroll(t){t.preventDefault()}};var I={SCROLL_FORWARD:"-scroll-forward",SCROLL_BACKWARD:"-scroll-backward",SCROLLING_FORWARD:"-scrolling-forward",SCROLLING_BACKWARD:"-scrolling-backward"};var st=class extends L{constructor(t){super(t);this.name="smooth";this.isScrollbarManipulation=!1;this.scrollForce=0;this.wheelImpulse=0;this.previousCurrent=0;this.velocityThreshold=.1}updateScrollDirection(t){if(this.isLastBottomScrollDirection=t,this.isBottomScrollDirection===null){this.isBottomScrollDirection=t;return}this.context.data.scroll.isScrollingDown=t,this.onChangeDirection(),document.documentElement.classList.toggle(I.SCROLLING_FORWARD,t),document.documentElement.classList.toggle(I.SCROLLING_BACKWARD,!t),document.documentElement.classList.toggle(I.SCROLL_FORWARD,t),document.documentElement.classList.toggle(I.SCROLL_BACKWARD,!t)}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(I.SCROLLING_BACKWARD,I.SCROLLING_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 t=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),t<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(t){if(t.deltaY!==0&&t.preventDefault(),this.wheelImpulse=t.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(t){this.isProg||(this.isScrollbarManipulation=!0)}};var nt=class{constructor(e){this.context=e;this.modes=new Map;this.modes.set("smooth",new st(e)),this.modes.set("default",new it(e)),this.modes.set("disable",new ot(e)),this.updateResponsiveMode()}setMobileMode(e){this.context.data.scroll.modeMobile=e,this.updateResponsiveMode()}setDesktopMode(e){this.context.data.scroll.modeDesktop=e,this.updateResponsiveMode()}updateResponsiveMode(){let t=window.innerWidth<1080?this.context.data.scroll.modeMobile:this.context.data.scroll.modeDesktop;this.setMode(t)}updatePosition(){this.modes.forEach(e=>{e.onCalcUpdate()})}setMode(e){if(!this.modes.has(e)){console.warn(`[ScrollManager] Unknown scroll mode: ${e}`);return}this.get().enableScrollEvents(),this.context.data.scroll.mode=e,this.get().disableScrollEvents()}get(){return this.modes.get(this.context.data.scroll.mode)}getEngines(){return this.modes}onFrame(){this.get().onFrame()}onScroll(e){this.get().onScroll(e)}onWheel(e){this.get().onWheel(e)}bindEvents(e){this.modes.forEach(t=>{t.onScrollStart=e.onScrollStart,t.onScrollStop=e.onScrollStop,t.onChangeDirection=e.onDirectionChange})}addScrollMark(e){this.modes.forEach(t=>{t.addScrollMark(e)})}removeScrollMark(e){this.modes.forEach(t=>{t.removeScrollMark(e)})}};var at=class{constructor(){this.targetX=0;this.targetY=0;this.smoothedX=0;this.smoothedY=0;this.stepX=0;this.stepY=0}};var lt=class{constructor(){this.threeInstance=null}};var ct=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 pt=class{constructor(){this.now=0;this.previous=0;this.delta=0;this.elapsed=0}};var dt=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 N=class{constructor(){this.scroll=new ct;this.viewport=new dt;this.cursor=new at;this.render=new lt;this.time=new pt}};var g=class{constructor(e){this.objectMapOnPage=new Map;this.objectsOnPage=[];this.objectMap=new Map;this.objects=[];this.htmlKey="";this._type=1;this.tools=e.tools,this.data=e.data,this.settings=e.settings,this.events=e.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:(t,r,i)=>{let o=i.top;return Math.floor(o)+this.data.scroll.container.scrollTop*this.data.viewport.transformScale}},{key:"end",type:"number",fallback:(t,r,i)=>{let o=i.top,s=i.height;return o+s-this.data.scroll.transformedCurrent}},{key:"size",type:"number",fallback:(t,r,i)=>i.height},{key:"half-width",type:"number",fallback:(t,r,i)=>i.width/2},{key:"half-height",type:"number",fallback:(t,r,i)=>i.height/2},{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"]}]}get type(){return this._type}initializeObject(e,t,r,i){let o=this.tools.boundingClientRect.process({element:r});for(let{key:s,type:a,fallback:n,transform:l}of this.attributesToMap){let m=typeof n=="function"?n(r,t,o):n,d=this.tools.domAttribute.process({element:r,key:s,fallback:i[s]??this.settings[s]??m}),p=this.parseAttribute(d,a,{element:r,boundingRect:o,viewportHeight:this.data.viewport.windowHeight,baseRem:this.data.viewport.baseRem});l&&(p=l(p)),t.setProperty(s,p)}}calculatePositions(e,t){let r=e.getProperty("start"),i=e.getProperty("size"),o=e.getProperty("offset-bottom"),s=e.getProperty("offset-top"),a=e.getProperty("enter-el"),n=e.getProperty("enter-vp"),l=e.getProperty("exit-el"),m=e.getProperty("exit-vp"),d=0,p=0,h=0,v=0;a==="top"&&n==="top"||a==="left"&&n==="left"?(h=-t+1,d=r-o):a==="top"&&n==="bottom"||a==="left"&&n==="right"?d=r-t-o:a==="bottom"&&n==="top"||a==="right"&&n==="left"?(h=-t-i+1,d=r+i-o):(a==="bottom"&&n==="bottom"||a==="right"&&n==="right")&&(h=-i+1,d=r-t+i-o),l==="top"&&m==="top"||l==="left"&&m==="left"?(v=-i+1,p=r+s):l==="top"&&m==="bottom"||l==="left"&&m==="right"?(v=-t-i+1,p=r-t+s):l==="bottom"&&m==="top"||l==="right"&&m==="left"?p=r+i+s:(l==="bottom"&&m==="bottom"||l==="right"&&m==="right")&&(v=-t+1,p=r-t+i+s),e.setProperty("start-bias",h),e.setProperty("end-bias",v),e.setProperty("start-position",d-this.data.scroll.topPosition),e.setProperty("end-position",p-this.data.scroll.topPosition),e.setProperty("difference-position",p-d);let u=e.getProperty("inview-top")??0,b=e.getProperty("inview-bottom")??0;e.setProperty("inview-start-position",e.getProperty("start-position")+u),e.setProperty("inview-end-position",e.getProperty("end-position")+b)}parseAttribute(e,t,r={}){if(e==null)return null;if(typeof t=="object"&&t.type==="enum")return t.values.includes(e)?e:t.values[0];switch(t){case"number":return parseFloat(e);case"boolean":return e===""||e==="true";case"json":try{return JSON.parse(e)}catch{return null}case"tuple":return e.trim().split(/\s+/);case"easing":return this.tools.easingFunction.process({easing:e});case"color":return this.tools.colorParser.process({value:e});case"dimension":return e=="0"?0:r.element!=null&&r.viewportHeight!=null&&r.baseRem!=null&&r.boundingRect!=null?this.tools.unitParser.process({value:e,element:r.element,viewportHeight:r.viewportHeight,boundingRect:r.boundingRect,baseRem:r.baseRem}):0;default:return e}}canConnect(e){return e.keys.includes(this.htmlKey)}connectObject(e){e.connect(this),this.onObjectConnected(e)}enterObject(e,t){this.objectMap.has(e)||(this.objectMap.set(e,t),this.objects.push(t))}exitObject(e){let t=this.objectMap.get(e);if(!t)return;this.objectMap.delete(e);let r=this.objects.indexOf(t);r!==-1&&this.objects.splice(r,1)}addObject(e,t){this.objectMapOnPage.has(e)||(this.objectMapOnPage.set(e,t),this.objectsOnPage.push(t))}removeObject(e){let t=this.objectMapOnPage.get(e);if(!t)return;this.objectMapOnPage.delete(e);let r=this.objectsOnPage.indexOf(t);r!==-1&&this.objectsOnPage.splice(r,1)}onObjectConnected(e){}applyToElementAndConnects(e,t){e.getProperty("self-disable")==!1&&t(e.htmlElement),e.connects.forEach(t)}destroy(){this.objects=[],this.objectMap=new Map}onInit(){}onFrame(e){}onResize(){}onScroll(e){}onDirectionChange(){}onScrollStart(){}onScrollStop(){}onScrollDirectionChange(){}onAxisChange(){}onDeviceChange(){}onScrollConfigChange(){}onSettingsChange(){}onDOMRebuild(){}onMouseMove(e){}onWheel(e){}onDOMMutate(e,t){}};var B=class{process({element:e}){return e.getBoundingClientRect()}};var V=class{process({element:e,key:t,fallback:r=null}){return e.getAttribute(`string-${t}`)??e.getAttribute(`data-string-${t}`)??r}};var W=class{process({record:e,name:t,fallback:r=null}){return e[t]??e[`data-${t}`]??r}};var O=class{process({element:e}){let t=e.getBoundingClientRect(),i=getComputedStyle(e).transform.match(/-?[\d.]+/g)?.map(parseFloat)??[];if(i.length===6){let[o,s,a,n,l,m]=i,d=o*n-s*a;return{width:t.width/(o||1),height:t.height/(n||1),left:(t.left*n-t.top*a+a*m-l*n)/d,top:(-t.left*s+t.top*o+l*s-o*m)/d}}return t}};var $=class{constructor(e=new O){this.transformTool=e}process({element:e,container:t=document.body}){let r;try{r=t.getBoundingClientRect()}catch{r=document.body.getBoundingClientRect()}let i=this.transformTool.process({element:e});return{top:i.top-r.top,left:i.left-r.left}}};var z=class{process({from:e,to:t,progress:r}){return(t-e)*r}};var q=class{process({value:e,element:t,viewportHeight:r,baseRem:i,boundingRect:o}){let s=e.split("|").map(n=>n.trim()).filter(Boolean),a=0;for(let n of s){let l=n,m=!1;l.startsWith("-")&&(m=!0,l=l.slice(1));let d=0;if(l==="selfHeight")d=t.offsetHeight;else if(l.endsWith("px"))d=parseFloat(l);else if(l.endsWith("%"))d=parseFloat(l)/100*r;else if(l.endsWith("rem"))d=parseFloat(l)*i;else if(l.endsWith("sh"))d=parseFloat(l)*o.height/100;else continue;a+=m?-d:d}return a}};var _=class{process({value:e,inMin:t=.1,inMax:r=1,outMin:i=.05,outMax:o=.65}){if(e<t)return o;if(e>1&&(e=1),e<=r){let s=(e-t)/(r-t);return o-s*(o-i)}return i}};var Y=class{process({value:e}){let t=e.trim();if(t.startsWith("random(")&&t.endsWith(")")){let r=t.slice(7,-1).split(",").map(o=>o.trim()).filter(Boolean),i=Math.floor(Math.random()*r.length);return r[i]}return t}};var U=class{process({value:e}){let t=e.trim().toLowerCase();if(t.startsWith("#")){let o=t.slice(1);o.length===3&&(o=o.split("").map(m=>m+m).join(""));let s=parseInt(o.slice(0,2),16),a=parseInt(o.slice(2,4),16),n=parseInt(o.slice(4,6),16),l=o.length===8?parseInt(o.slice(6,8),16)/255:1;return{r:s,g:a,b:n,a:l}}let r=t.match(/rgba?\(([^)]+)\)/);if(r){let[o,s,a,n=1]=r[1].split(",").map(l=>parseFloat(l.trim()));return{r:o,g:s,b:a,a:n}}let i=t.match(/hsla?\(([^)]+)\)/);if(i){let[o,s,a,n="1"]=i[1].split(",").map(p=>p.trim()),[l,m,d]=this.hslToRgb(parseFloat(o),parseFloat(s),parseFloat(a));return{r:l,g:m,b:d,a:parseFloat(n)}}return{r:0,g:0,b:0,a:0}}hslToRgb(e,t,r){e=e/360,t=parseFloat(t.toString())/100,r=parseFloat(r.toString())/100;let i=(m,d,p)=>(p<0&&(p+=1),p>1&&(p-=1),p<1/6?m+(d-m)*6*p:p<1/2?d:p<2/3?m+(d-m)*(2/3-p)*6:m),o=r<.5?r*(1+t):r+t-r*t,s=2*r-o,a=Math.round(i(s,o,e+1/3)*255),n=Math.round(i(s,o,e)*255),l=Math.round(i(s,o,e-1/3)*255);return[a,n,l]}};var X=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:e}){let t=e.trim();if(this.namedCurves[t])return this.cubicBezier(...this.namedCurves[t]);let r=t.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,a]=r.slice(1).map(Number);return this.cubicBezier(i,o,s,a)}return i=>i}cubicBezier(e,t,r,i){let o=3*e,s=3*(r-e)-o,a=1-o-s,n=3*t,l=3*(i-t)-n,m=1-n-l;function d(u){return((a*u+s)*u+o)*u}function p(u){return((m*u+l)*u+n)*u}function h(u){return(3*a*u+2*s)*u+o}function v(u,b=1e-5){let S,M,f=u,x,y,E;for(E=0;E<8;E++){if(x=d(f)-u,Math.abs(x)<b)return f;if(y=h(f),Math.abs(y)<1e-6)break;f=f-x/y}for(S=0,M=1,f=u;S<M;){if(x=d(f)-u,Math.abs(x)<b)return f;x>0?M=f:S=f,f=(M+S)/2}return f}return function(u){return p(v(u))}}};var K=class{process({distance:e,radius:t,strength:r}){if(e>=t)return 0;let i=(t-e)/t;return r*i}};var j=class{process({from:e,to:t,progress:r}){return{r:e.r+(t.r-e.r)*r,g:e.g+(t.g-e.g)*r,b:e.b+(t.b-e.b)*r,a:e.a+(t.a-e.a)*r}}};var Q=class{process({from:e,to:t,progress:r}){return{x:(t.x-e.x)*r,y:(t.y-e.y)*r}}};var G=class{process({value:e}){let r=e?.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 ut=class{process({attributeValue:e}){let t={line:[],word:[],char:[],charLine:[],charWord:[],wordLine:[]};return e&&e.split("|").forEach(i=>{let o=i.trim();if(!o)return;let s=o.match(/^(\w+-)?(\w+)(\[(.*?)\])?$/);if(s){let a=s[1]||"",n=s[2],l=a+n,d=(s[4]||"").split(";").map(h=>h.trim()).filter(h=>h.length>0),p=this.parseParamsArray(d);switch(l){case"line":t.line.push(p);break;case"word":t.word.push(p);break;case"char":t.char.push(p);break;case"charLine":t.charLine.push(p);break;case"charWord":t.charWord.push(p);break;case"wordLine":t.wordLine.push(p);break;default:console.warn(`SplitOptionsParserTool: Unrecognized option type "${l}" in part "${o}"`);break}}else console.warn(`SplitOptionsParserTool: Could not parse part format "${o}"`)}),t}parseParamsArray(e){let t={align:"start"};return e.forEach(r=>{if(r==="abs")t.abs=!0;else if(r.startsWith("random")){t.align="random";let i=r.match(/random\(\s*(\d+)\s*,\s*(\d+)\s*\)/);i&&(t.random={min:parseInt(i[1],10),max:parseInt(i[2],10)})}else["start","center","end"].includes(r)&&(t.align=r)}),t}};var Z=class{process({value:e}){let t=[],r="",i=0;for(let o=0;o<e.length;o++){let s=e[o];s==="("&&i++,s===")"&&i--,s==="|"&&i===0?(r.trim()&&t.push(r.trim()),r=""):r+=s}return r.trim()&&t.push(r.trim()),t.map(o=>{let s=o.match(/^(\w+)(?:\((.*)\))?$/);if(!s)return{key:o};let[,a,n]=s;return n?{key:a,params:n.split(",").map(l=>l.trim())}:{key:a}})}};var mt=class{constructor(){this.inputValidators={required:e=>e!=null&&String(e).trim()!=="",min:(e,t)=>typeof e=="string"&&e.length>=Number(t),checked:e=>e===!0||e==="true"||e===1||e==="1",email:e=>typeof e=="string"&&/^[\w-.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e),max:(e,t)=>typeof e=="string"&&e.length<=Number(t),phone:e=>typeof e=="string"&&/^(\+?\d{1,3}[-.\s]?)?(\(?\d{1,4}\)?[-.\s]?)?[\d\-.\s]{5,15}$/.test(e),number:e=>typeof e=="string"&&/^-?\d+(\.\d+)?$/.test(e),url:e=>typeof e=="string"&&/^(https?:\/\/)?([\w\-]+\.)+[\w\-]+(\/[\w\-._~:/?#[\]@!$&'()*+,;=]*)?$/.test(e)};this.beforeInputValidators={number:e=>/^-?\d*\.?\d*$/.test(e),integer:e=>/^-?\d*$/.test(e),email:e=>/^[\w@.\-+]*$/.test(e),phone:e=>/^(\+)?[\d\-() ]*$/.test(e)&&(e.match(/\+/g)?.length??0)<=1&&(!e.includes("+")||e.indexOf("+")===0),letters:e=>/^[a-zA-Z]*$/.test(e),lettersSpaces:e=>/^[a-zA-Z\s]*$/.test(e),lettersNumbers:e=>/^[a-zA-Z0-9]*$/.test(e),url:e=>/^[a-zA-Z0-9\-._~:/?#\[\]@!$&'()*+,;=%]*$/.test(e),pattern:(e,t)=>{try{return new RegExp(t||"").test(e)}catch{return!0}}}}process({rules:e,value:t,type:r="input"}){let i=[];for(let l of e){var o=null,s=null,a=!0,n=!0;r=="input"&&(s=this.inputValidators[l.key],!s)||r=="beforeinput"&&(o=this.beforeInputValidators[l.key],!o)||(s&&(a=s(t,...l.params||[])),o&&(n=o(t,...l.params||[])),n||i.push(this.getErrorMessage(l.key,l.params)),a||i.push(this.getErrorMessage(l.key,l.params)))}return{valid:i.length===0,errors:i}}getErrorMessage(e,t){switch(e){case"required":return"This field is required";case"email":return"Invalid email address";case"min":return`Minimum ${t?.[0]} characters`;case"max":return`Maximum ${t?.[0]} characters`;case"phone":return"Invalid phone number";case"number":return"Only numbers are allowed";case"url":return"Invalid URL address";case"checked":return"You must accept";default:return"Invalid value"}}};var ht=class{constructor(){this.domAttribute=new V;this.recordAttribute=new W;this.transformNullify=new O;this.boundingClientRect=new B;this.relativePosition=new $(this.transformNullify);this.unitParser=new q;this.lerp=new z;this.adaptiveLerp=new _;this.originParser=new Y;this.colorParser=new U;this.validation=new mt;this.easingFunction=new X;this.magneticPull=new K;this.lerpColor=new j;this.lerpVector=new Q;this.transformScaleParser=new G;this.optionsParser=new ut;this.ruleParser=new Z}};var gt=class extends g{constructor(t){super(t);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(t,r,i,o){super.initializeObject(t,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(t){requestAnimationFrame(()=>{this.objects.forEach(a=>{let n=a.getProperty("is-mouse-over"),l=a.getProperty("cursor-target-disable"),m=a.getProperty("lerp")??.15;if(n&&!l){let d=a.htmlElement.getBoundingClientRect(),p=this.data.cursor.targetX,h=this.data.cursor.targetY,v=p-d.left,u=h-d.top,b=a.getProperty("mouse-pixel-x")??0,S=a.getProperty("mouse-pixel-y")??0,M=b-v,f=S-u;if(M*M+f*f>1e-4){(a.getProperty("is-mouse-move")??!1)||(a.setProperty("is-mouse-move",!0),a.setProperty("mouse-pixel-x",v),a.setProperty("mouse-pixel-y",u),a.setProperty("mouse-x",v),a.setProperty("mouse-y",u),b=v,S=u,this.events.emit(`cursor:start:${a.id}`,null));let E=this.tools.lerp.process({from:b,to:v,progress:m}),C=this.tools.lerp.process({from:S,to:u,progress:m}),T=b+E,P=S+C;a.setProperty("mouse-pixel-x",T),a.setProperty("mouse-pixel-y",P);let F=a.getProperty("alignment")??"center",Nt=this.calculateOffset(F,T,d.width),Bt=this.calculateOffset(F,P,d.height);a.setProperty("mouse-x",Nt),a.setProperty("mouse-y",Bt),this.setMouseCoordinates(a,Nt,Bt),this.events.emit(`cursor:move:${a.id}`,{x:Nt,y:Bt}),this.events.emit(`cursor:pixel:${a.id}`,{x:T,y:P})}else a.setProperty("mouse-pixel-x",v),a.setProperty("mouse-pixel-y",u),this.events.emit(`cursor:end:${a.id}`,null)}else{let d=a.getProperty("mouse-x")??0,p=a.getProperty("mouse-y")??0;if(d!==0||p!==0){a.setProperty("is-mouse-move",!1);let h=a.htmlElement.getBoundingClientRect(),v=a.getProperty("half-width")??h.width/2,u=a.getProperty("half-height")??h.height/2,b=this.calculateOffset("center",v,h.width),S=this.calculateOffset("center",u,h.height),M=d+this.tools.lerp.process({from:d,to:b,progress:m}),f=p+this.tools.lerp.process({from:p,to:S,progress:m});a.setProperty("mouse-x",M),a.setProperty("mouse-y",f),Math.abs(M)<.001&&Math.abs(f)<.001&&(a.setProperty("mouse-x",0),a.setProperty("mouse-y",0),a.setProperty("mouse-pixel-x",0),a.setProperty("mouse-pixel-y",0)),this.setMouseCoordinates(a,M,f)}}});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(t){let r=t.htmlElement;t.setProperty("timeoutId",null),t.setProperty("mouseleave",()=>{this.onMouseLeave(t)}),t.setProperty("mouseenter",()=>{this.onMouseEnter(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"))}getCursorClass(t){let r=t.getProperty("cursor-class");return r!=null&&r.length>0?r:null}onMouseEnter(t){this.overCount++,t.setProperty("is-mouse-over",!0);let r=this.getCursorClass(t);r&&this.cursor.classList.add(r),this.cursor.classList.add("-showing"),t.setProperty("timeoutId",setTimeout(()=>{this.cursor.classList.remove("-showing"),this.cursor.classList.add("-show")},1200)),t.htmlElement.addEventListener("mouseleave",t.getProperty("mouseleave"))}onMouseLeave(t){this.overCount--,t.setProperty("is-mouse-over",!1),t.getProperty("timeoutId")&&(clearTimeout(t.getProperty("timeoutId")),t.setProperty("timeoutId",null));let r=this.getCursorClass(t);r&&this.cursor.classList.remove(r),this.cursor.classList.remove("-showing"),this.cursor.classList.remove("-show"),t.htmlElement.removeEventListener("mouseleave",t.getProperty("mouseleave"))}onEnterObject(t){t.htmlElement.addEventListener("mouseenter",t.getProperty("mouseenter"))}onLeaveObject(t){t.htmlElement.removeEventListener("mouseenter",t.getProperty("mouseenter")),t.htmlElement.removeEventListener("mouseleave",t.getProperty("mouseleave"))}setMouseCoordinates(t,r,i){t.getProperty("cursor-target-style-disable")||this.applyToElementAndConnects(t,o=>{o.style.setProperty("--x",r.toFixed(2)),o.style.setProperty("--y",i.toFixed(2))})}calculateOffset(t,r,i){switch(t){case"start":return r/i;case"end":return(r-i)/i;case"center":default:return(r-i/2)/(i/2)}}};var ft=class extends g{constructor(e){super(e),this.htmlKey="magnetic",this.attributesToMap=[...this.attributesToMap,{key:"strength",type:"number",fallback:this.settings.strength},{key:"radius",type:"number",fallback:this.settings.radius}]}initializeObject(e,t,r,i){super.initializeObject(e,t,r,i),t.setProperty("is-magneting",!1),t.setProperty("magnetic-target-x",0),t.setProperty("magnetic-target-y",0),t.setProperty("magnetic-x",0),t.setProperty("magnetic-y",0),t.setProperty("lerp",.1)}onMouseMove(e){this.objects.forEach(t=>{let i=t.htmlElement.getBoundingClientRect(),o=i.left+(t.getProperty("half-width")??0),s=i.top+(t.getProperty("half-height")??0),a=e.clientX-o,n=e.clientY-s,l=Math.sqrt(a**2+n**2),m=t.getProperty("radius")??0,d=t.getProperty("strength")??0,p=this.tools.magneticPull.process({distance:l,radius:m,strength:d});t.setProperty("magnetic-target-x",a*p),t.setProperty("magnetic-target-y",n*p),p>0&&t.setProperty("is-magneting",!0)})}onFrame(e){this.objects.forEach(t=>{if(t.getProperty("is-magneting")){let r=t.getProperty("magnetic-x")??0,i=t.getProperty("magnetic-y")??0,o=t.getProperty("lerp")??0,s=t.getProperty("magnetic-target-x")??0,a=t.getProperty("magnetic-target-y")??0,n=this.tools.lerp.process({from:r,to:s,progress:o}),l=this.tools.lerp.process({from:i,to:a,progress:o});n>-.01&&n<.01&&(n=0,t.setProperty("magnetic-x",t.getProperty("magnetic-target-x"))),l>-.01&&l<.01&&(l=0,t.setProperty("magnetic-y",t.getProperty("magnetic-target-y"))),r+=n,i+=l,t.setProperty("magnetic-x",r),t.setProperty("magnetic-y",i),this.events.emit(`magnetic:move:${t.id}`,{x:r,y:i}),this.applyToElementAndConnects(t,m=>{m.style.setProperty("--magnetic-x",r.toString()),m.style.setProperty("--magnetic-y",i.toString())}),(t.getProperty("magnetic-target-x")==r||t.getProperty("magnetic-target-y")==i)&&t.setProperty("is-magneting",!1)}})}};var bt=class extends g{constructor(t){super(t);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(t){if(this.loadingCount++,this.isStartLoaded){let r=t.htmlElement;this.loadImage(r)}}async loadImage(t){let r=this.tools.domAttribute.process({element:t,key:this.htmlKey,fallback:""});if(r)try{t.classList.add("lazyLoad"),t.src=r,t.addEventListener("load",()=>{t.classList.add("-loaded")}),await this.setAspectRatio(t,r)}catch{console.warn("Failed to load image:",r)}}setAspectRatio(t,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 a=new Blob([s.response]),n=new Image;n.onload=()=>{t.style.aspectRatio=`${n.width} / ${n.height}`,URL.revokeObjectURL(n.src),this.loadingCount--,this.loadingCount<=0&&(this.events.emit("image:load:all",null),this.loadingCount=0),i()},n.onerror=()=>{URL.revokeObjectURL(n.src),this.loadingCount--,o(new Error("Image failed to decode"))},n.src=URL.createObjectURL(a)}else o(new Error("Image request failed"))},s.onerror=()=>o(new Error("XHR error")),s.send()})}};var vt=class extends g{constructor(t){super(t);this.loadingTimeout=0;this._type=2,this.loadingTimeout=this.settings.timeout}onInit(){setTimeout(()=>{document.documentElement.classList.add("-loaded")},this.loadingTimeout)}};var yt=class extends g{constructor(e){super(e),this.htmlKey=""}canConnect(e){return e.keys[0]==null}};var A=class{constructor(e){this.min=void 0;this.max=void 0;this.enable=!0;this.min=e?.min,this.max=e?.max,this.enable=e?.enable??!0}setEnable(e=!0){this.enable=e}setRange(e,t){this.min=e??void 0,this.max=t??void 0}get mediaQuery(){let e="screen";return this.min&&(e+=` and (min-width: ${this.min}px)`),this.max&&(e+=` and (max-width: ${this.max}px)`),e}},St=class extends g{constructor(t){super(t);this.queries={0:new A({max:359}),1:new A({min:360,max:1079}),2:new A({min:1080,max:1365}),3:new A({min:1366})};this.isMobileMedia=!1;this.isTabletMedia=!1;this.isLaptopMedia=!1;this.isDesktopMedia=!1;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 t=this.settings.settings;t.mobile?(this.queries[0].enable=!0,this.queries[0].setRange(t.mobile.min==null?null:t.mobile.min,t.mobile.max??null),this.matchMedias[0]=window.matchMedia(this.queries[0].mediaQuery)):this.queries[0].enable=!1,t.tablet?(this.queries[1].enable=!0,this.queries[1].setRange(t.tablet.min==null?null:t.tablet.min,t.tablet.max??null),this.matchMedias[1]=window.matchMedia(this.queries[1].mediaQuery)):this.queries[1].enable=!1,t.laptop?(this.queries[2].enable=!0,this.queries[2].setRange(t.laptop.min==null?null:t.laptop.min,t.laptop.max??null),this.matchMedias[2]=window.matchMedia(this.queries[2].mediaQuery)):this.queries[2].enable=!1,t.desktop?(this.queries[3].enable=!0,this.queries[3].setRange(t.desktop.min==null?null:t.desktop.min,t.desktop.max??null),this.matchMedias[3]=window.matchMedia(this.queries[3].mediaQuery)):this.queries[3].enable=!1}this.updateElements()}onResize(){this.updateElements()}updateElements(){let t=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;this.isMobileMedia!=t&&this.events.emit("screen:mobile",t),this.isTabletMedia!=r&&this.events.emit("screen:tablet",r),this.isLaptopMedia!=i&&this.events.emit("screen:laptop",i),this.isDesktopMedia!=o&&this.events.emit("screen:desktop",o),this.isMobileMedia=t,this.isTabletMedia=r,this.isLaptopMedia=i,this.isDesktopMedia=o,document.querySelectorAll("[string-mobile], [string-tablet], [string-laptop], [string-desktop]").forEach(a=>{let n=!1;a.hasAttribute("string-mobile")&&t&&(n=!0),a.hasAttribute("string-tablet")&&r&&(n=!0),a.hasAttribute("string-laptop")&&i&&(n=!0),a.hasAttribute("string-desktop")&&o&&(n=!0),n?a.style.display=null:a.style.display="none"})}};var Mt=class extends g{constructor(e){super(e),this.htmlKey="anchor",this.attributesToMap=[...this.attributesToMap,{key:"anchor",type:"tuple",fallback:this.settings.anchor,transform:t=>{let[r,i]=t,o=this.tools.originParser.process({value:r}),s=this.tools.originParser.process({value:i});return{x:o,y:s}}}]}onObjectConnected(e){super.onObjectConnected(e);let t=e.getProperty("anchor");t&&this.applyToElementAndConnects(e,r=>{r.style.transformOrigin=`${t.x} ${t.y}`})}};var ie=.05,oe=.01,qt=1,se=-1,ne=1,xt=class extends g{constructor(t){super(t);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=t=>{let r=t.getProperty("glide")??0,i=-this.data.scroll.displacement*this.maxDisplacementValue*r;this.events.emit(`object:glide:${t.id}`,i);let o=`translate3d(0, ${i}px, 0)`;t.htmlElement.style.transform=o};this.onUpdateDesktopEvent=()=>{for(let t=0;t<this.objects.length;t++){let r=this.objects[t];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(t){let r=t?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(t=>{this.setupItem(t)}))}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 t=0;t<this.objects.length;t++){let r=this.objects[t],i="translate3d(0, 0px, 0)";r.htmlElement.style.transform=i,r.htmlElement.style.setProperty("--glide",this.data.scroll.displacement.toString())}}onFrame(t){this.calcExpanderFactor(this.data.scroll.isScrollingDown===!1),this.acceleration=Math.min(qt,this.acceleration+ie),this.displacement=Math.max(oe,Math.min(qt,this.displacement+this.velocityMultiplier)),this.data.scroll.displacement=Math.min(ne,Math.max(se,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 Et=class extends g{constructor(e){super(e),this.htmlKey="lerp"}onScrollStop(){this.objects.forEach(e=>{this.setLerpValue(e,0)})}onFrame(e){let t=e.scroll.lerped;this.objects.forEach(r=>{this.setLerpValue(r,t)})}setLerpValue(e,t){this.events.emit(`object:lerp:${e.id}`,t),e.htmlElement.style.setProperty("--lerp",t.toString())}};var H=class extends g{constructor(e){super(e),this.htmlKey="progress",this.attributesToMap=[...this.attributesToMap,{key:"easing",type:"easing",fallback:this.settings.easing}]}initializeObject(e,t,r,i){super.initializeObject(e,t,r,i)}onScroll(e){super.onScroll(e),this.objects.forEach(t=>{this.setUpObject(t)})}onObjectConnected(e){super.onObjectConnected(e),e.setProperty("setUpObject",this.setUpObject.bind(this)),e.events.on("enter",e.getProperty("setUpObject"))}setUpObject(e){let t=e.getProperty("start-position"),r=e.getProperty("difference-position"),i=e.getProperty("key"),o=e.getProperty("easing")(Math.min(1,Math.max(0,(this.data.scroll.transformedCurrent-t)/r)));if(e.getProperty("progress")!==o){this.events.emit(`object:progress:${e.id}`,o),e.setProperty("progress",o);let s=o.toString();this.applyToElementAndConnects(e,a=>{a.style.setProperty(i,s)})}}};var Tt=class extends H{constructor(t){super(t);this.handleScrollDesktop=()=>{this.objects.forEach(t=>{let r=t.getProperty("progress")??0,i=t.getProperty("parallax")??0,o=t.getProperty("parallax-position-start")??0,s=t.getProperty("parallax-position-end")??1,a=t.getProperty("parallax-sign")??1,n=this.data.viewport.windowHeight,l=a*i*(n*o+r*n*s);this.events.emit(`object:parallax:${t.id}`,l);let m=`translate3d(0, ${l}px, 0)`;this.applyToElementAndConnects(t,d=>{d.style.transform=m})})};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(t,r,i,o){super.initializeObject(t,r,i,o);let s=r.getProperty("parallax-bias")??0,a=Math.abs(r.getProperty("parallax")??.2);r.setProperty("parallax-sign",Math.sign(r.getProperty("parallax"))),r.setProperty("parallax",a),r.setProperty("parallax-position-start",-.5+.5*s),r.setProperty("parallax-position-end",.5+.5*(1-s));let n=this.data.viewport.windowHeight;r.setProperty("offset-top",a*n),r.setProperty("offset-bottom",a*n)}onScroll(t){super.onScroll(t),this.scrollHandler()}onResize(){let t=window.innerWidth>1080;this.scrollHandler=t?this.handleScrollDesktop:this.handleScrollMobile,t?this.handleScrollDesktop():this.objects.forEach(r=>{let i="translate3d(0, 0px, 0)";this.applyToElementAndConnects(r,o=>{o.style.transform=i})})}};var Ct=class{constructor(e,t,r){this.isDragging=!1;this.startY=0;this.startScrollPosition=0;this.data=e,this.scrollbar=t,this.thumb=r}onResize(){let e=this.data.viewport.contentWidth,t=this.data.viewport.windowWidth,r=t/e*t;this.thumb.style.setProperty("--size",r+"px"),e<=t?this.scrollbar.classList.add("-hide"):this.scrollbar.classList.remove("-hide")}updateThumb(){let e=this.data.viewport.contentWidth,t=this.data.viewport.windowWidth;this.thumb.style.setProperty("--position",`${this.data.scroll.current/e*t+"px"}`)}mouseDownEvent(e){this.startY=e.clientY,this.startScrollPosition=this.data.scroll.current}mouseMoveEvent(e){let t=e.clientY-this.startY,r=this.startScrollPosition+t/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 wt=class{constructor(e,t,r){this.isDragging=!1;this.startCoordinate=0;this.startScrollPosition=0;this.data=e,this.scrollbar=t,this.thumb=r}onResize(){let e=this.data.viewport.contentHeight,t=this.data.viewport.windowHeight,r=t/e*t;this.thumb.style.setProperty("--height",r+"px"),e<=t?this.scrollbar.classList.add("-hide"):this.scrollbar.classList.remove("-hide")}updateThumb(){let e=this.data.viewport.contentHeight,t=this.data.viewport.windowHeight;this.thumb.style.setProperty("--position",`${this.data.scroll.current/e*t+"px"}`)}mouseDownEvent(e){this.startCoordinate=e.clientY,this.startScrollPosition=this.data.scroll.current}mouseMoveEvent(e){let t=e.clientY-this.startCoordinate,r=this.startScrollPosition+t/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 Lt=class extends g{constructor(t){super(t);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(t){this.updateThumb(),this.showScrollbar(),this.hideScrollbar()}onResize(){this.scrollbarState.onResize()}addCustomStyles(){let t=document.createElement("style");t.textContent=`
1
+ "use strict";var Vt=Object.defineProperty;var Gt=Object.getOwnPropertyDescriptor;var Zt=Object.getOwnPropertyNames;var Jt=Object.prototype.hasOwnProperty;var te=(c,e)=>{for(var t in e)Vt(c,t,{get:e[t],enumerable:!0})},ee=(c,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Zt(e))!Jt.call(c,i)&&i!==t&&Vt(c,i,{get:()=>e[i],enumerable:!(r=Gt(e,i))||r.enumerable});return c};var re=c=>ee(Vt({},"__esModule",{value:!0}),c);var pe={};te(pe,{StringAnchor:()=>Mt,StringCursor:()=>gt,StringData:()=>N,StringDelayLerpTracker:()=>It,StringFPSTracker:()=>Ot,StringForm:()=>Ft,StringGlide:()=>xt,StringLazy:()=>bt,StringLerp:()=>Et,StringLerpTracker:()=>kt,StringLoading:()=>vt,StringMagnetic:()=>ft,StringModule:()=>g,StringObject:()=>R,StringParallax:()=>Tt,StringPositionTracker:()=>Dt,StringProgress:()=>H,StringResponsive:()=>St,StringScrollbar:()=>Lt,StringSequence:()=>Ht,StringSplit:()=>Pt,StringTune:()=>zt,StringVideoAutoplay:()=>At,default:()=>zt});module.exports=re(pe);var tt=class{constructor(e=.1,t){this.SETTLE_THRESHOLD=.1;this.smoothingFactor=e,this.context=t,this.onSettingsChange()}onMouseMove(e){this.context.data.cursor.targetX=e.clientX,this.context.data.cursor.targetY=e.clientY}onFrame(){let{targetX:e,targetY:t,smoothedX:r,smoothedY:i}=this.context.data.cursor,o=this.context.tools.lerp.process({from:r,to:e,progress:this.smoothingFactor}),s=this.context.tools.lerp.process({from:i,to:t,progress:this.smoothingFactor}),a=this.getStepDistance(o,s);this.isSettled(a)?this.snapToTarget():this.applyStep(o,s)}onSettingsChange(){let e=Number(this.context.settings.lerp);this.setLerpFactor(e)}setLerpFactor(e){this.smoothingFactor=this.context.tools.adaptiveLerp.process({value:e,inMin:.1,inMax:1,outMin:.05,outMax:.65})}getStepDistance(e,t){return Math.hypot(e,t)}isSettled(e){return e<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(e,t){this.context.data.cursor.smoothedX+=e,this.context.data.cursor.smoothedY+=t,this.context.data.cursor.stepX=e,this.context.data.cursor.stepY=t}};var D=class{constructor(){this.listeners={};this.stateEvents=new Set;this.lastPayloads={};this.stateEvents.add("screen:mobile"),this.stateEvents.add("screen:tablet"),this.stateEvents.add("screen:laptop"),this.stateEvents.add("screen:desktop"),this.stateEvents.add("start")}on(e,t,r){let i=r?`${e}:${r}`:e;this.listeners[i]||(this.listeners[i]=new Set),this.listeners[i].add(t),this.stateEvents.has(i)&&this.lastPayloads[i]!==void 0&&t(this.lastPayloads[i])}off(e,t,r){let i=r?`${e}:${r}`:e;this.listeners[i]&&this.listeners[i].delete(t)}emit(e,t){this.stateEvents.has(e)&&(this.lastPayloads[e]=t);let r=this.listeners[e];if(r)for(let i of r)i(t)}onProgress(e,t){this.on(`progress:${e}`,t)}emitProgress(e,t){this.emit(`progress:${e}`,t)}onInview(e,t){this.on(`object:inview:${e}`,t)}emitInview(e,t){this.emit(`object:inview:${e}`,t)}onScroll(e){this.on("scroll",e)}emitScroll(e){this.emit("scroll",e)}onUpdate(e){this.on("update",e)}emitUpdate(){this.emit("update")}clear(e){delete this.listeners[e]}clearAll(){this.listeners={}}};var et=class{constructor(e){this.data=e;this.modules=[];this.uiModules=[]}register(e){e.type===1&&this.modules.push(e),e.type===2&&this.uiModules.push(e)}find(e){return this.modules.find(t=>t instanceof e)}onInit(){[...this.modules,...this.uiModules].forEach(e=>e.onInit())}onFrame(){[...this.modules,...this.uiModules].forEach(e=>e.onFrame(this.data))}onScroll(){[...this.modules,...this.uiModules].forEach(e=>e.onScroll(this.data))}onResize(){[...this.modules,...this.uiModules].forEach(e=>e.onResize())}onMouseMove(e){[...this.modules,...this.uiModules].forEach(t=>t.onMouseMove(e))}onWheel(e){[...this.modules,...this.uiModules].forEach(t=>t.onWheel(e))}onDirectionChange(){[...this.modules,...this.uiModules].forEach(e=>e.onDirectionChange())}onScrollStart(){[...this.modules,...this.uiModules].forEach(e=>e.onScrollStart())}onScrollStop(){[...this.modules,...this.uiModules].forEach(e=>e.onScrollStop())}onAxisChange(){[...this.modules,...this.uiModules].forEach(e=>e.onAxisChange())}onDeviceChange(){[...this.modules,...this.uiModules].forEach(e=>e.onDeviceChange())}onScrollConfigChange(){[...this.modules,...this.uiModules].forEach(e=>e.onScrollConfigChange())}onSettingsChange(){[...this.modules,...this.uiModules].forEach(e=>e.onSettingsChange())}onDOMMutate(e,t){[...this.modules,...this.uiModules].forEach(r=>r.onDOMMutate(e,t))}destroy(){[...this.modules,...this.uiModules].forEach(e=>e.destroy()),this.modules=[],this.uiModules=[]}get all(){return[...this.modules,...this.uiModules]}get core(){return this.modules}get ui(){return this.uiModules}};var R=class{constructor(e,t){this.id="";this.keys=[];this.connects=[];this.properties=new Map;this.modules=[];this.events=new D;this.htmlElement=t,this.id=e}setProperty(e,t){this.properties.set(e,t)}getProperty(e){return this.properties.get(e)??null}enter(){this.events.emit("enter",this),this.setProperty("active",!0),this.modules.forEach(e=>{e.enterObject(this.id,this)})}leave(){this.events.emit("leave",this),this.setProperty("active",!1),this.modules.forEach(e=>{e.exitObject(this.id)})}remove(){this.modules.forEach(e=>{e.removeObject(this.id)})}show(){this.htmlElement.classList.add("-inview")}hide(){this.getProperty("repeat")&&this.htmlElement.classList.remove("-inview")}connect(e){this.modules.includes(e)||this.modules.push(e)}};var rt=class{constructor(e,t,r){this.data=e;this.modules=t;this.events=r;this.objects=new Map;this.connectQueue=[];this.globalId=1}get all(){return this.objects}add(e){let t=`string-${this.globalId++}`,r="string-id";e.getAttribute("string-id")&&(t=e.getAttribute("string-id"),r="string-id"),e.getAttribute("data-string-id")&&(t=e.getAttribute("data-string-id"),r="data-string-id");let i=t&&this.objects.has(t)?this.objects.get(t):new R(t,e);e.setAttribute(r,i.id);let o=e.getAttribute("string")??e.getAttribute("data-string");o&&(i.keys=(o??"").split("|")),e.setAttribute("string-inited",""),this.objects.set(i.id,i);let s=this.getAllAttributes(e);this.modules.core.forEach(n=>{"setupCoreProperties"in n&&typeof n.setupCoreProperties=="function"&&n.setupCoreProperties(i,e,s)}),this.modules.core.forEach(n=>{n.canConnect(i)&&(n.initializeObject(this.globalId,i,e,s),n.calculatePositions(i,this.data.viewport.windowHeight),n.connectObject(i),n.addObject(i.id,i))}),this.connectQueue.filter(n=>n.id===i.id).forEach(n=>i.connects.push(n.element)),this.connectQueue=this.connectQueue.filter(n=>n.id!==i.id),this.initObservers(i,e),this.checkInviewForObject(i)}remove(e){let t=this.objects.get(e);t&&(t.events.clearAll(),t.getProperty("observer-progress")?.disconnect(),t.getProperty("observer-inview")?.disconnect(),t.htmlElement.removeAttribute("string-inited"),t.leave(),t.remove(),this.objects.delete(e))}enqueueConnection(e,t){this.connectQueue.push({id:e,element:t}),console.log(this.connectQueue.length)}getAllAttributes(e){let t={};return Array.from(e.attributes).forEach(r=>{t[r.name]=r.value}),t}initObservers(e,t){let r=e.getProperty("offset-top")??0,i=e.getProperty("offset-bottom")??0;e.getProperty("observer-progress")?.disconnect();let o=a=>{a.forEach(n=>{this.events.emit(`object:activate:${e.id}`,n.isIntersecting),n.isIntersecting?e.enter():e.leave()})},s=new IntersectionObserver(o,{root:null,rootMargin:`${i+this.data.viewport.windowHeight}px 0px ${r+this.data.viewport.windowHeight}px 0px`,threshold:0});s.observe(t),e.setProperty("observer-progress",s)}observeDOM(){new MutationObserver(t=>{t.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(a=>this.add(a));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(e){let t=e.getAttribute("string-id")??e.getAttribute("data-string-id");if(!t)return;let r=e.getAttribute("string-copy-from")??e.getAttribute("data-string-copy-from");r&&(this.connectQueue=this.connectQueue.filter(i=>i.id!==r)),this.remove(t)}onSettingsChange(){this.objects.forEach(e=>{this.modules.core.forEach(t=>{if(t.canConnect(e)){let r=this.getAllAttributes(e.htmlElement);t.initializeObject(this.globalId,e,e.htmlElement,r),t.calculatePositions(e,this.data.viewport.windowHeight),t.connectObject(e)}})})}isFixed(e){return e.hasAttribute("string-fixed")}checkInview(){this.objects.forEach(e=>{this.checkInviewForObject(e)})}checkInviewForObject(e){let t=this.data.scroll.transformedCurrent,r=e.getProperty("inview-start-position"),i=e.getProperty("inview-end-position"),o=e.getProperty("is-inview")??!1,s=t>=r&&t<=i,a=null;!o&&s?a=t<r?"enter-bottom":"enter-top":o&&!s&&(a=t<r?"exit-top":"exit-bottom"),s!==o&&(e.setProperty("is-inview",s),this.events.emit(`object:inview:${e.id}`,{inView:s,direction:a}),s?e.show():e.hide())}};var L=class{constructor(e){this.name="";this.isProg=!1;this.isParallaxEnabled=!1;this._scrollDirection="vertical";this.isBottomScrollDirection=null;this.isLastBottomScrollDirection=!0;this.scrollTriggerRules=[];this.onChangeDirection=()=>{};this.onScrollStart=()=>{};this.onScrollStop=()=>{};this.onCalcUpdate=()=>{this.context.data.scroll.scrollContainer?.scrollTo(0,this.context.data.scroll.current),this.triggerScrollRules()};this.document=document,this.context=e}set scrollDirection(e){this._scrollDirection=e,this._scrollDirection==="vertical"?this.onCalcUpdate=()=>{this.context.data.scroll.scrollContainer?.scrollTo(0,this.context.data.scroll.current),this.triggerScrollRules()}:this._scrollDirection==="horizontal"&&(this.onCalcUpdate=()=>{this.context.data.scroll.scrollContainer?.scrollTo(this.context.data.scroll.current,0)})}onFrame(){}onWheel(e){}onScroll(e){}disableScrollEvents(){}enableScrollEvents(){}triggerScrollRules(){this.scrollTriggerRules.forEach(e=>{(e.direction==="any"||this.isLastBottomScrollDirection&&e.direction==="forward")&&this.context.data.scroll.current>=e.offset?(e.onEnter?.(),e.toggleClass&&e.toggleClass.target.classList.add(e.toggleClass.className)):(e.onLeave?.(),e.toggleClass&&e.toggleClass.target.classList.remove(e.toggleClass.className))})}addScrollMark(e){this.scrollTriggerRules.push(e)}removeScrollMark(e){this.scrollTriggerRules=this.scrollTriggerRules.filter(t=>t.id!==e)}};var it=class extends L{constructor(t){super(t);this.name="default"}onFrame(){if(this.context.data.scroll.delta!==0){let t=this.context.data.scroll.delta*this.context.data.scroll.speedAccelerate;this.context.data.scroll.delta-=t,this.context.data.scroll.lerped=t,Math.abs(this.context.data.scroll.lerped)<.1&&(this.context.data.scroll.delta=0,this.context.data.scroll.lerped=0,this.onScrollStop())}}onScroll(t){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(t){if(t.deltaY!==0){this.context.data.scroll.delta===0&&this.onScrollStart();let r=t.deltaY;this.context.data.scroll.target===0&&(this.context.data.scroll.delta+=Math.max(0,t.deltaY)),this.context.data.scroll.delta+=r}}};var ot=class extends L{constructor(t){super(t);this.name="disable";this.preventScroll=t=>{t.preventDefault()};this.preventKeyScroll=t=>{["ArrowUp","ArrowDown","PageUp","PageDown"," ","Home","End"].includes(t.key)&&t.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(t){t.preventDefault()}onScroll(t){t.preventDefault()}};var I={SCROLL_FORWARD:"-scroll-forward",SCROLL_BACKWARD:"-scroll-backward",SCROLLING_FORWARD:"-scrolling-forward",SCROLLING_BACKWARD:"-scrolling-backward"};var st=class extends L{constructor(t){super(t);this.name="smooth";this.isScrollbarManipulation=!1;this.scrollForce=0;this.wheelImpulse=0;this.previousCurrent=0;this.velocityThreshold=.1}updateScrollDirection(t){if(this.isLastBottomScrollDirection=t,this.isBottomScrollDirection===null){this.isBottomScrollDirection=t;return}this.context.data.scroll.isScrollingDown=t,this.onChangeDirection(),document.documentElement.classList.toggle(I.SCROLLING_FORWARD,t),document.documentElement.classList.toggle(I.SCROLLING_BACKWARD,!t),document.documentElement.classList.toggle(I.SCROLL_FORWARD,t),document.documentElement.classList.toggle(I.SCROLL_BACKWARD,!t)}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(I.SCROLLING_BACKWARD,I.SCROLLING_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 t=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),t<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(t){if(t.deltaY!==0&&t.preventDefault(),this.wheelImpulse=t.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(t){this.isProg||(this.isScrollbarManipulation=!0)}};var nt=class{constructor(e){this.context=e;this.modes=new Map;this.modes.set("smooth",new st(e)),this.modes.set("default",new it(e)),this.modes.set("disable",new ot(e)),this.updateResponsiveMode()}setMobileMode(e){this.context.data.scroll.modeMobile=e,this.updateResponsiveMode()}setDesktopMode(e){this.context.data.scroll.modeDesktop=e,this.updateResponsiveMode()}updateResponsiveMode(){let t=window.innerWidth<1080?this.context.data.scroll.modeMobile:this.context.data.scroll.modeDesktop;this.setMode(t)}updatePosition(){this.modes.forEach(e=>{e.onCalcUpdate()})}setMode(e){if(!this.modes.has(e)){console.warn(`[ScrollManager] Unknown scroll mode: ${e}`);return}this.get().enableScrollEvents(),this.context.data.scroll.mode=e,this.get().disableScrollEvents()}get(){return this.modes.get(this.context.data.scroll.mode)}getEngines(){return this.modes}onFrame(){this.get().onFrame()}onScroll(e){this.get().onScroll(e)}onWheel(e){this.get().onWheel(e)}bindEvents(e){this.modes.forEach(t=>{t.onScrollStart=e.onScrollStart,t.onScrollStop=e.onScrollStop,t.onChangeDirection=e.onDirectionChange})}addScrollMark(e){this.modes.forEach(t=>{t.addScrollMark(e)})}removeScrollMark(e){this.modes.forEach(t=>{t.removeScrollMark(e)})}};var at=class{constructor(){this.targetX=0;this.targetY=0;this.smoothedX=0;this.smoothedY=0;this.stepX=0;this.stepY=0}};var lt=class{constructor(){this.threeInstance=null}};var ct=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 pt=class{constructor(){this.now=0;this.previous=0;this.delta=0;this.elapsed=0}};var dt=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 N=class{constructor(){this.scroll=new ct;this.viewport=new dt;this.cursor=new at;this.render=new lt;this.time=new pt}};var g=class{constructor(e){this.objectMapOnPage=new Map;this.objectsOnPage=[];this.objectMap=new Map;this.objects=[];this.htmlKey="";this._type=1;this.tools=e.tools,this.data=e.data,this.settings=e.settings,this.events=e.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:(t,r,i)=>{let o=i.top;return Math.floor(o)+this.data.scroll.container.scrollTop*this.data.viewport.transformScale}},{key:"end",type:"number",fallback:(t,r,i)=>{let o=i.top,s=i.height;return o+s-this.data.scroll.transformedCurrent}},{key:"size",type:"number",fallback:(t,r,i)=>i.height},{key:"half-width",type:"number",fallback:(t,r,i)=>i.width/2},{key:"half-height",type:"number",fallback:(t,r,i)=>i.height/2},{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"]}]}get type(){return this._type}initializeObject(e,t,r,i){let o=this.tools.boundingClientRect.process({element:r});for(let{key:s,type:a,fallback:n,transform:l}of this.attributesToMap){let m=typeof n=="function"?n(r,t,o):n,d=this.tools.domAttribute.process({element:r,key:s,fallback:i[s]??this.settings[s]??m}),p=this.parseAttribute(d,a,{element:r,boundingRect:o,viewportHeight:this.data.viewport.windowHeight,baseRem:this.data.viewport.baseRem});l&&(p=l(p)),t.setProperty(s,p)}}calculatePositions(e,t){let r=e.getProperty("start"),i=e.getProperty("size"),o=e.getProperty("offset-bottom"),s=e.getProperty("offset-top"),a=e.getProperty("enter-el"),n=e.getProperty("enter-vp"),l=e.getProperty("exit-el"),m=e.getProperty("exit-vp"),d=0,p=0,h=0,v=0;a==="top"&&n==="top"||a==="left"&&n==="left"?(h=-t+1,d=r-o):a==="top"&&n==="bottom"||a==="left"&&n==="right"?d=r-t-o:a==="bottom"&&n==="top"||a==="right"&&n==="left"?(h=-t-i+1,d=r+i-o):(a==="bottom"&&n==="bottom"||a==="right"&&n==="right")&&(h=-i+1,d=r-t+i-o),l==="top"&&m==="top"||l==="left"&&m==="left"?(v=-i+1,p=r+s):l==="top"&&m==="bottom"||l==="left"&&m==="right"?(v=-t-i+1,p=r-t+s):l==="bottom"&&m==="top"||l==="right"&&m==="left"?p=r+i+s:(l==="bottom"&&m==="bottom"||l==="right"&&m==="right")&&(v=-t+1,p=r-t+i+s),e.setProperty("start-bias",h),e.setProperty("end-bias",v),e.setProperty("start-position",d-this.data.scroll.topPosition),e.setProperty("end-position",p-this.data.scroll.topPosition),e.setProperty("difference-position",p-d);let u=e.getProperty("inview-top")??0,b=e.getProperty("inview-bottom")??0;e.setProperty("inview-start-position",e.getProperty("start-position")+u),e.setProperty("inview-end-position",e.getProperty("end-position")+b)}parseAttribute(e,t,r={}){if(e==null)return null;if(typeof t=="object"&&t.type==="enum")return t.values.includes(e)?e:t.values[0];switch(t){case"number":return parseFloat(e);case"boolean":return e===""||e==="true";case"json":try{return JSON.parse(e)}catch{return null}case"tuple":return e.trim().split(/\s+/);case"easing":return this.tools.easingFunction.process({easing:e});case"color":return this.tools.colorParser.process({value:e});case"dimension":return e=="0"?0:r.element!=null&&r.viewportHeight!=null&&r.baseRem!=null&&r.boundingRect!=null?this.tools.unitParser.process({value:e,element:r.element,viewportHeight:r.viewportHeight,boundingRect:r.boundingRect,baseRem:r.baseRem}):0;default:return e}}canConnect(e){return e.keys.includes(this.htmlKey)}connectObject(e){e.connect(this),this.onObjectConnected(e)}enterObject(e,t){this.objectMap.has(e)||(this.objectMap.set(e,t),this.objects.push(t))}exitObject(e){let t=this.objectMap.get(e);if(!t)return;this.objectMap.delete(e);let r=this.objects.indexOf(t);r!==-1&&this.objects.splice(r,1)}addObject(e,t){this.objectMapOnPage.has(e)||(this.objectMapOnPage.set(e,t),this.objectsOnPage.push(t))}removeObject(e){let t=this.objectMapOnPage.get(e);if(!t)return;this.objectMapOnPage.delete(e);let r=this.objectsOnPage.indexOf(t);r!==-1&&this.objectsOnPage.splice(r,1)}onObjectConnected(e){}applyToElementAndConnects(e,t){e.getProperty("self-disable")==!1&&t(e.htmlElement),e.connects.forEach(t)}destroy(){this.objects=[],this.objectMap=new Map}onInit(){}onFrame(e){}onResize(){}onScroll(e){}onDirectionChange(){}onScrollStart(){}onScrollStop(){}onScrollDirectionChange(){}onAxisChange(){}onDeviceChange(){}onScrollConfigChange(){}onSettingsChange(){}onDOMRebuild(){}onMouseMove(e){}onWheel(e){}onDOMMutate(e,t){}};var B=class{process({element:e}){return e.getBoundingClientRect()}};var V=class{process({element:e,key:t,fallback:r=null}){return e.getAttribute(`string-${t}`)??e.getAttribute(`data-string-${t}`)??r}};var W=class{process({record:e,name:t,fallback:r=null}){return e[t]??e[`data-${t}`]??r}};var O=class{process({element:e}){let t=e.getBoundingClientRect(),i=getComputedStyle(e).transform.match(/-?[\d.]+/g)?.map(parseFloat)??[];if(i.length===6){let[o,s,a,n,l,m]=i,d=o*n-s*a;return{width:t.width/(o||1),height:t.height/(n||1),left:(t.left*n-t.top*a+a*m-l*n)/d,top:(-t.left*s+t.top*o+l*s-o*m)/d}}return t}};var $=class{constructor(e=new O){this.transformTool=e}process({element:e,container:t=document.body}){let r;try{r=t.getBoundingClientRect()}catch{r=document.body.getBoundingClientRect()}let i=this.transformTool.process({element:e});return{top:i.top-r.top,left:i.left-r.left}}};var z=class{process({from:e,to:t,progress:r}){return(t-e)*r}};var q=class{process({value:e,element:t,viewportHeight:r,baseRem:i,boundingRect:o}){let s=e.split("|").map(n=>n.trim()).filter(Boolean),a=0;for(let n of s){let l=n,m=!1;l.startsWith("-")&&(m=!0,l=l.slice(1));let d=0;if(l==="selfHeight")d=t.offsetHeight;else if(l.endsWith("px"))d=parseFloat(l);else if(l.endsWith("%"))d=parseFloat(l)/100*r;else if(l.endsWith("rem"))d=parseFloat(l)*i;else if(l.endsWith("sh"))d=parseFloat(l)*o.height/100;else continue;a+=m?-d:d}return a}};var _=class{process({value:e,inMin:t=.1,inMax:r=1,outMin:i=.05,outMax:o=.65}){if(e<t)return o;if(e>1&&(e=1),e<=r){let s=(e-t)/(r-t);return o-s*(o-i)}return i}};var Y=class{process({value:e}){let t=e.trim();if(t.startsWith("random(")&&t.endsWith(")")){let r=t.slice(7,-1).split(",").map(o=>o.trim()).filter(Boolean),i=Math.floor(Math.random()*r.length);return r[i]}return t}};var U=class{process({value:e}){let t=e.trim().toLowerCase();if(t.startsWith("#")){let o=t.slice(1);o.length===3&&(o=o.split("").map(m=>m+m).join(""));let s=parseInt(o.slice(0,2),16),a=parseInt(o.slice(2,4),16),n=parseInt(o.slice(4,6),16),l=o.length===8?parseInt(o.slice(6,8),16)/255:1;return{r:s,g:a,b:n,a:l}}let r=t.match(/rgba?\(([^)]+)\)/);if(r){let[o,s,a,n=1]=r[1].split(",").map(l=>parseFloat(l.trim()));return{r:o,g:s,b:a,a:n}}let i=t.match(/hsla?\(([^)]+)\)/);if(i){let[o,s,a,n="1"]=i[1].split(",").map(p=>p.trim()),[l,m,d]=this.hslToRgb(parseFloat(o),parseFloat(s),parseFloat(a));return{r:l,g:m,b:d,a:parseFloat(n)}}return{r:0,g:0,b:0,a:0}}hslToRgb(e,t,r){e=e/360,t=parseFloat(t.toString())/100,r=parseFloat(r.toString())/100;let i=(m,d,p)=>(p<0&&(p+=1),p>1&&(p-=1),p<1/6?m+(d-m)*6*p:p<1/2?d:p<2/3?m+(d-m)*(2/3-p)*6:m),o=r<.5?r*(1+t):r+t-r*t,s=2*r-o,a=Math.round(i(s,o,e+1/3)*255),n=Math.round(i(s,o,e)*255),l=Math.round(i(s,o,e-1/3)*255);return[a,n,l]}};var X=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:e}){let t=e.trim();if(this.namedCurves[t])return this.cubicBezier(...this.namedCurves[t]);let r=t.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,a]=r.slice(1).map(Number);return this.cubicBezier(i,o,s,a)}return i=>i}cubicBezier(e,t,r,i){let o=3*e,s=3*(r-e)-o,a=1-o-s,n=3*t,l=3*(i-t)-n,m=1-n-l;function d(u){return((a*u+s)*u+o)*u}function p(u){return((m*u+l)*u+n)*u}function h(u){return(3*a*u+2*s)*u+o}function v(u,b=1e-5){let S,M,f=u,x,y,E;for(E=0;E<8;E++){if(x=d(f)-u,Math.abs(x)<b)return f;if(y=h(f),Math.abs(y)<1e-6)break;f=f-x/y}for(S=0,M=1,f=u;S<M;){if(x=d(f)-u,Math.abs(x)<b)return f;x>0?M=f:S=f,f=(M+S)/2}return f}return function(u){return p(v(u))}}};var j=class{process({distance:e,radius:t,strength:r}){if(e>=t)return 0;let i=(t-e)/t;return r*i}};var K=class{process({from:e,to:t,progress:r}){return{r:e.r+(t.r-e.r)*r,g:e.g+(t.g-e.g)*r,b:e.b+(t.b-e.b)*r,a:e.a+(t.a-e.a)*r}}};var Q=class{process({from:e,to:t,progress:r}){return{x:(t.x-e.x)*r,y:(t.y-e.y)*r}}};var G=class{process({value:e}){let r=e?.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 ut=class{process({attributeValue:e}){let t={line:[],word:[],char:[],charLine:[],charWord:[],wordLine:[]};return e&&e.split("|").forEach(i=>{let o=i.trim();if(!o)return;let s=o.match(/^(\w+-)?(\w+)(\[(.*?)\])?$/);if(s){let a=s[1]||"",n=s[2],l=a+n,d=(s[4]||"").split(";").map(h=>h.trim()).filter(h=>h.length>0),p=this.parseParamsArray(d);switch(l){case"line":t.line.push(p);break;case"word":t.word.push(p);break;case"char":t.char.push(p);break;case"charLine":t.charLine.push(p);break;case"charWord":t.charWord.push(p);break;case"wordLine":t.wordLine.push(p);break;default:console.warn(`SplitOptionsParserTool: Unrecognized option type "${l}" in part "${o}"`);break}}else console.warn(`SplitOptionsParserTool: Could not parse part format "${o}"`)}),t}parseParamsArray(e){let t={align:"start"};return e.forEach(r=>{if(r==="abs")t.abs=!0;else if(r.startsWith("random")){t.align="random";let i=r.match(/random\(\s*(\d+)\s*,\s*(\d+)\s*\)/);i&&(t.random={min:parseInt(i[1],10),max:parseInt(i[2],10)})}else["start","center","end"].includes(r)&&(t.align=r)}),t}};var Z=class{process({value:e}){let t=[],r="",i=0;for(let o=0;o<e.length;o++){let s=e[o];s==="("&&i++,s===")"&&i--,s==="|"&&i===0?(r.trim()&&t.push(r.trim()),r=""):r+=s}return r.trim()&&t.push(r.trim()),t.map(o=>{let s=o.match(/^(\w+)(?:\((.*)\))?$/);if(!s)return{key:o};let[,a,n]=s;return n?{key:a,params:n.split(",").map(l=>l.trim())}:{key:a}})}};var mt=class{constructor(){this.inputValidators={required:e=>e!=null&&String(e).trim()!=="",min:(e,t)=>typeof e=="string"&&e.length>=Number(t),checked:e=>e===!0||e==="true"||e===1||e==="1",email:e=>typeof e=="string"&&/^[\w-.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e),max:(e,t)=>typeof e=="string"&&e.length<=Number(t),phone:e=>typeof e=="string"&&/^(\+?\d{1,3}[-.\s]?)?(\(?\d{1,4}\)?[-.\s]?)?[\d\-.\s]{5,15}$/.test(e),number:e=>typeof e=="string"&&/^-?\d+(\.\d+)?$/.test(e),url:e=>typeof e=="string"&&/^(https?:\/\/)?([\w\-]+\.)+[\w\-]+(\/[\w\-._~:/?#[\]@!$&'()*+,;=]*)?$/.test(e)};this.beforeInputValidators={number:e=>/^-?\d*\.?\d*$/.test(e),integer:e=>/^-?\d*$/.test(e),email:e=>/^[\w@.\-+]*$/.test(e),phone:e=>/^(\+)?[\d\-() ]*$/.test(e)&&(e.match(/\+/g)?.length??0)<=1&&(!e.includes("+")||e.indexOf("+")===0),letters:e=>/^[a-zA-Z]*$/.test(e),lettersSpaces:e=>/^[a-zA-Z\s]*$/.test(e),lettersNumbers:e=>/^[a-zA-Z0-9]*$/.test(e),url:e=>/^[a-zA-Z0-9\-._~:/?#\[\]@!$&'()*+,;=%]*$/.test(e),pattern:(e,t)=>{try{return new RegExp(t||"").test(e)}catch{return!0}}}}process({rules:e,value:t,type:r="input"}){let i=[];for(let l of e){var o=null,s=null,a=!0,n=!0;r=="input"&&(s=this.inputValidators[l.key],!s)||r=="beforeinput"&&(o=this.beforeInputValidators[l.key],!o)||(s&&(a=s(t,...l.params||[])),o&&(n=o(t,...l.params||[])),n||i.push(this.getErrorMessage(l.key,l.params)),a||i.push(this.getErrorMessage(l.key,l.params)))}return{valid:i.length===0,errors:i}}getErrorMessage(e,t){switch(e){case"required":return"This field is required";case"email":return"Invalid email address";case"min":return`Minimum ${t?.[0]} characters`;case"max":return`Maximum ${t?.[0]} characters`;case"phone":return"Invalid phone number";case"number":return"Only numbers are allowed";case"url":return"Invalid URL address";case"checked":return"You must accept";default:return"Invalid value"}}};var ht=class{constructor(){this.domAttribute=new V;this.recordAttribute=new W;this.transformNullify=new O;this.boundingClientRect=new B;this.relativePosition=new $(this.transformNullify);this.unitParser=new q;this.lerp=new z;this.adaptiveLerp=new _;this.originParser=new Y;this.colorParser=new U;this.validation=new mt;this.easingFunction=new X;this.magneticPull=new j;this.lerpColor=new K;this.lerpVector=new Q;this.transformScaleParser=new G;this.optionsParser=new ut;this.ruleParser=new Z}};var gt=class extends g{constructor(t){super(t);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(t,r,i,o){super.initializeObject(t,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(t){requestAnimationFrame(()=>{this.objects.forEach(a=>{let n=a.getProperty("is-mouse-over"),l=a.getProperty("cursor-target-disable"),m=a.getProperty("lerp")??.15;if(n&&!l){let d=a.htmlElement.getBoundingClientRect(),p=this.data.cursor.targetX,h=this.data.cursor.targetY,v=p-d.left,u=h-d.top,b=a.getProperty("mouse-pixel-x")??0,S=a.getProperty("mouse-pixel-y")??0,M=b-v,f=S-u;if(M*M+f*f>1e-4){(a.getProperty("is-mouse-move")??!1)||(a.setProperty("is-mouse-move",!0),a.setProperty("mouse-pixel-x",v),a.setProperty("mouse-pixel-y",u),a.setProperty("mouse-x",v),a.setProperty("mouse-y",u),b=v,S=u,this.events.emit(`cursor:start:${a.id}`,null));let E=this.tools.lerp.process({from:b,to:v,progress:m}),C=this.tools.lerp.process({from:S,to:u,progress:m}),T=b+E,P=S+C;a.setProperty("mouse-pixel-x",T),a.setProperty("mouse-pixel-y",P);let F=a.getProperty("alignment")??"center",Nt=this.calculateOffset(F,T,d.width),Bt=this.calculateOffset(F,P,d.height);a.setProperty("mouse-x",Nt),a.setProperty("mouse-y",Bt),this.setMouseCoordinates(a,Nt,Bt),this.events.emit(`cursor:move:${a.id}`,{x:Nt,y:Bt}),this.events.emit(`cursor:pixel:${a.id}`,{x:T,y:P})}else a.setProperty("mouse-pixel-x",v),a.setProperty("mouse-pixel-y",u),this.events.emit(`cursor:end:${a.id}`,null)}else{let d=a.getProperty("mouse-x")??0,p=a.getProperty("mouse-y")??0;if(d!==0||p!==0){a.setProperty("is-mouse-move",!1);let h=a.htmlElement.getBoundingClientRect(),v=a.getProperty("half-width")??h.width/2,u=a.getProperty("half-height")??h.height/2,b=this.calculateOffset("center",v,h.width),S=this.calculateOffset("center",u,h.height),M=d+this.tools.lerp.process({from:d,to:b,progress:m}),f=p+this.tools.lerp.process({from:p,to:S,progress:m});a.setProperty("mouse-x",M),a.setProperty("mouse-y",f),Math.abs(M)<.001&&Math.abs(f)<.001&&(a.setProperty("mouse-x",0),a.setProperty("mouse-y",0),a.setProperty("mouse-pixel-x",0),a.setProperty("mouse-pixel-y",0)),this.setMouseCoordinates(a,M,f)}}});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(t){let r=t.htmlElement;t.setProperty("timeoutId",null),t.setProperty("mouseleave",()=>{this.onMouseLeave(t)}),t.setProperty("mouseenter",()=>{this.onMouseEnter(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"))}getCursorClass(t){let r=t.getProperty("cursor-class");return r!=null&&r.length>0?r:null}onMouseEnter(t){this.overCount++,t.setProperty("is-mouse-over",!0);let r=this.getCursorClass(t);r&&this.cursor.classList.add(r),this.cursor.classList.add("-showing"),t.setProperty("timeoutId",setTimeout(()=>{this.cursor.classList.remove("-showing"),this.cursor.classList.add("-show")},1200)),t.htmlElement.addEventListener("mouseleave",t.getProperty("mouseleave"))}onMouseLeave(t){this.overCount--,t.setProperty("is-mouse-over",!1),t.getProperty("timeoutId")&&(clearTimeout(t.getProperty("timeoutId")),t.setProperty("timeoutId",null));let r=this.getCursorClass(t);r&&this.cursor.classList.remove(r),this.cursor.classList.remove("-showing"),this.cursor.classList.remove("-show"),t.htmlElement.removeEventListener("mouseleave",t.getProperty("mouseleave"))}onEnterObject(t){t.htmlElement.addEventListener("mouseenter",t.getProperty("mouseenter"))}onLeaveObject(t){t.htmlElement.removeEventListener("mouseenter",t.getProperty("mouseenter")),t.htmlElement.removeEventListener("mouseleave",t.getProperty("mouseleave"))}setMouseCoordinates(t,r,i){t.getProperty("cursor-target-style-disable")||this.applyToElementAndConnects(t,o=>{o.style.setProperty("--x",r.toFixed(2)),o.style.setProperty("--y",i.toFixed(2))})}calculateOffset(t,r,i){switch(t){case"start":return r/i;case"end":return(r-i)/i;case"center":default:return(r-i/2)/(i/2)}}};var ft=class extends g{constructor(e){super(e),this.htmlKey="magnetic",this.attributesToMap=[...this.attributesToMap,{key:"strength",type:"number",fallback:this.settings.strength},{key:"radius",type:"number",fallback:this.settings.radius}]}initializeObject(e,t,r,i){super.initializeObject(e,t,r,i),t.setProperty("is-magneting",!1),t.setProperty("magnetic-target-x",0),t.setProperty("magnetic-target-y",0),t.setProperty("magnetic-x",0),t.setProperty("magnetic-y",0),t.setProperty("lerp",.1)}onMouseMove(e){this.objects.forEach(t=>{let i=t.htmlElement.getBoundingClientRect(),o=i.left+(t.getProperty("half-width")??0),s=i.top+(t.getProperty("half-height")??0),a=e.clientX-o,n=e.clientY-s,l=Math.sqrt(a**2+n**2),m=t.getProperty("radius")??0,d=t.getProperty("strength")??0,p=this.tools.magneticPull.process({distance:l,radius:m,strength:d});t.setProperty("magnetic-target-x",a*p),t.setProperty("magnetic-target-y",n*p),p>0&&t.setProperty("is-magneting",!0)})}onFrame(e){this.objects.forEach(t=>{if(t.getProperty("is-magneting")){let r=t.getProperty("magnetic-x")??0,i=t.getProperty("magnetic-y")??0,o=t.getProperty("lerp")??0,s=t.getProperty("magnetic-target-x")??0,a=t.getProperty("magnetic-target-y")??0,n=this.tools.lerp.process({from:r,to:s,progress:o}),l=this.tools.lerp.process({from:i,to:a,progress:o});n>-.01&&n<.01&&(n=0,t.setProperty("magnetic-x",t.getProperty("magnetic-target-x"))),l>-.01&&l<.01&&(l=0,t.setProperty("magnetic-y",t.getProperty("magnetic-target-y"))),r+=n,i+=l,t.setProperty("magnetic-x",r),t.setProperty("magnetic-y",i),this.events.emit(`magnetic:move:${t.id}`,{x:r,y:i}),this.applyToElementAndConnects(t,m=>{m.style.setProperty("--magnetic-x",r.toString()),m.style.setProperty("--magnetic-y",i.toString())}),(t.getProperty("magnetic-target-x")==r||t.getProperty("magnetic-target-y")==i)&&t.setProperty("is-magneting",!1)}})}};var bt=class extends g{constructor(t){super(t);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(t){if(this.loadingCount++,this.isStartLoaded){let r=t.htmlElement;this.loadImage(r)}}async loadImage(t){let r=this.tools.domAttribute.process({element:t,key:this.htmlKey,fallback:""});if(r)try{t.classList.add("lazyLoad"),t.src=r,t.addEventListener("load",()=>{t.classList.add("-loaded")}),await this.setAspectRatio(t,r)}catch{console.warn("Failed to load image:",r)}}setAspectRatio(t,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 a=new Blob([s.response]),n=new Image;n.onload=()=>{t.style.aspectRatio=`${n.width} / ${n.height}`,URL.revokeObjectURL(n.src),this.loadingCount--,this.loadingCount<=0&&(this.events.emit("image:load:all",null),this.loadingCount=0),i()},n.onerror=()=>{URL.revokeObjectURL(n.src),this.loadingCount--,o(new Error("Image failed to decode"))},n.src=URL.createObjectURL(a)}else o(new Error("Image request failed"))},s.onerror=()=>o(new Error("XHR error")),s.send()})}};var vt=class extends g{constructor(t){super(t);this.loadingTimeout=0;this._type=2,this.loadingTimeout=this.settings.timeout}onInit(){setTimeout(()=>{document.documentElement.classList.add("-loaded")},this.loadingTimeout)}};var yt=class extends g{constructor(e){super(e),this.htmlKey=""}canConnect(e){return e.keys[0]==null}};var A=class{constructor(e){this.min=void 0;this.max=void 0;this.enable=!0;this.min=e?.min,this.max=e?.max,this.enable=e?.enable??!0}setEnable(e=!0){this.enable=e}setRange(e,t){this.min=e??void 0,this.max=t??void 0}get mediaQuery(){let e="screen";return this.min&&(e+=` and (min-width: ${this.min}px)`),this.max&&(e+=` and (max-width: ${this.max}px)`),e}},St=class extends g{constructor(t){super(t);this.queries={0:new A({max:359}),1:new A({min:360,max:1079}),2:new A({min:1080,max:1365}),3:new A({min:1366})};this.isMobileMedia=!1;this.isTabletMedia=!1;this.isLaptopMedia=!1;this.isDesktopMedia=!1;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 t=this.settings.settings;t.mobile?(this.queries[0].enable=!0,this.queries[0].setRange(t.mobile.min==null?null:t.mobile.min,t.mobile.max??null),this.matchMedias[0]=window.matchMedia(this.queries[0].mediaQuery)):this.queries[0].enable=!1,t.tablet?(this.queries[1].enable=!0,this.queries[1].setRange(t.tablet.min==null?null:t.tablet.min,t.tablet.max??null),this.matchMedias[1]=window.matchMedia(this.queries[1].mediaQuery)):this.queries[1].enable=!1,t.laptop?(this.queries[2].enable=!0,this.queries[2].setRange(t.laptop.min==null?null:t.laptop.min,t.laptop.max??null),this.matchMedias[2]=window.matchMedia(this.queries[2].mediaQuery)):this.queries[2].enable=!1,t.desktop?(this.queries[3].enable=!0,this.queries[3].setRange(t.desktop.min==null?null:t.desktop.min,t.desktop.max??null),this.matchMedias[3]=window.matchMedia(this.queries[3].mediaQuery)):this.queries[3].enable=!1}this.updateElements()}onResize(){this.updateElements()}updateElements(){let t=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;this.isMobileMedia!=t&&this.events.emit("screen:mobile",t),this.isTabletMedia!=r&&this.events.emit("screen:tablet",r),this.isLaptopMedia!=i&&this.events.emit("screen:laptop",i),this.isDesktopMedia!=o&&this.events.emit("screen:desktop",o),this.isMobileMedia=t,this.isTabletMedia=r,this.isLaptopMedia=i,this.isDesktopMedia=o,document.querySelectorAll("[string-mobile], [string-tablet], [string-laptop], [string-desktop]").forEach(a=>{let n=!1;a.hasAttribute("string-mobile")&&t&&(n=!0),a.hasAttribute("string-tablet")&&r&&(n=!0),a.hasAttribute("string-laptop")&&i&&(n=!0),a.hasAttribute("string-desktop")&&o&&(n=!0),n?a.style.display=null:a.style.display="none"})}};var Mt=class extends g{constructor(e){super(e),this.htmlKey="anchor",this.attributesToMap=[...this.attributesToMap,{key:"anchor",type:"tuple",fallback:this.settings.anchor,transform:t=>{let[r,i]=t,o=this.tools.originParser.process({value:r}),s=this.tools.originParser.process({value:i});return{x:o,y:s}}}]}onObjectConnected(e){super.onObjectConnected(e);let t=e.getProperty("anchor");t&&this.applyToElementAndConnects(e,r=>{r.style.transformOrigin=`${t.x} ${t.y}`})}};var ie=.05,oe=.01,qt=1,se=-1,ne=1,xt=class extends g{constructor(t){super(t);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=t=>{let r=t.getProperty("glide")??0,i=-this.data.scroll.displacement*this.maxDisplacementValue*r;this.events.emit(`object:glide:${t.id}`,i);let o=`translate3d(0, ${i}px, 0)`;t.htmlElement.style.transform=o};this.onUpdateDesktopEvent=()=>{for(let t=0;t<this.objects.length;t++){let r=this.objects[t];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(t){let r=t?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(t=>{this.setupItem(t)}))}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 t=0;t<this.objects.length;t++){let r=this.objects[t],i="translate3d(0, 0px, 0)";r.htmlElement.style.transform=i,r.htmlElement.style.setProperty("--glide",this.data.scroll.displacement.toString())}}onFrame(t){this.calcExpanderFactor(this.data.scroll.isScrollingDown===!1),this.acceleration=Math.min(qt,this.acceleration+ie),this.displacement=Math.max(oe,Math.min(qt,this.displacement+this.velocityMultiplier)),this.data.scroll.displacement=Math.min(ne,Math.max(se,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 Et=class extends g{constructor(e){super(e),this.htmlKey="lerp"}onScrollStop(){this.objects.forEach(e=>{this.setLerpValue(e,0)})}onFrame(e){let t=e.scroll.lerped;this.objects.forEach(r=>{this.setLerpValue(r,t)})}setLerpValue(e,t){this.events.emit(`object:lerp:${e.id}`,t),e.htmlElement.style.setProperty("--lerp",t.toString())}};var H=class extends g{constructor(e){super(e),this.htmlKey="progress",this.attributesToMap=[...this.attributesToMap,{key:"easing",type:"easing",fallback:this.settings.easing}]}initializeObject(e,t,r,i){super.initializeObject(e,t,r,i)}onScroll(e){super.onScroll(e),this.objects.forEach(t=>{this.setUpObject(t)})}onObjectConnected(e){super.onObjectConnected(e),e.setProperty("setUpObject",this.setUpObject.bind(this)),e.events.on("enter",e.getProperty("setUpObject"))}setUpObject(e){let t=e.getProperty("start-position"),r=e.getProperty("difference-position"),i=e.getProperty("key"),o=e.getProperty("easing")(Math.min(1,Math.max(0,(this.data.scroll.transformedCurrent-t)/r)));if(e.getProperty("progress")!==o){this.events.emit(`object:progress:${e.id}`,o),e.setProperty("progress",o);let s=o.toString();this.applyToElementAndConnects(e,a=>{a.style.setProperty(i,s)})}}};var Tt=class extends H{constructor(t){super(t);this.handleScrollDesktop=()=>{this.objects.forEach(t=>{let r=t.getProperty("progress")??0,i=t.getProperty("parallax")??0,o=t.getProperty("parallax-position-start")??0,s=t.getProperty("parallax-position-end")??1,a=t.getProperty("parallax-sign")??1,n=this.data.viewport.windowHeight,l=a*i*(n*o+r*n*s);this.events.emit(`object:parallax:${t.id}`,l);let m=`translate3d(0, ${l}px, 0)`;this.applyToElementAndConnects(t,d=>{d.style.transform=m})})};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(t,r,i,o){super.initializeObject(t,r,i,o);let s=r.getProperty("parallax-bias")??0,a=Math.abs(r.getProperty("parallax")??.2);r.setProperty("parallax-sign",Math.sign(r.getProperty("parallax"))),r.setProperty("parallax",a),r.setProperty("parallax-position-start",-.5+.5*s),r.setProperty("parallax-position-end",.5+.5*(1-s));let n=this.data.viewport.windowHeight;r.setProperty("offset-top",a*n),r.setProperty("offset-bottom",a*n)}onScroll(t){super.onScroll(t),this.scrollHandler()}onResize(){let t=window.innerWidth>1080;this.scrollHandler=t?this.handleScrollDesktop:this.handleScrollMobile,t?this.handleScrollDesktop():this.objects.forEach(r=>{let i="translate3d(0, 0px, 0)";this.applyToElementAndConnects(r,o=>{o.style.transform=i})})}};var Ct=class{constructor(e,t,r){this.isDragging=!1;this.startY=0;this.startScrollPosition=0;this.data=e,this.scrollbar=t,this.thumb=r}onResize(){let e=this.data.viewport.contentWidth,t=this.data.viewport.windowWidth,r=t/e*t;this.thumb.style.setProperty("--size",r+"px"),e<=t?this.scrollbar.classList.add("-hide"):this.scrollbar.classList.remove("-hide")}updateThumb(){let e=this.data.viewport.contentWidth,t=this.data.viewport.windowWidth;this.thumb.style.setProperty("--position",`${this.data.scroll.current/e*t+"px"}`)}mouseDownEvent(e){this.startY=e.clientY,this.startScrollPosition=this.data.scroll.current}mouseMoveEvent(e){let t=e.clientY-this.startY,r=this.startScrollPosition+t/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 wt=class{constructor(e,t,r){this.isDragging=!1;this.startCoordinate=0;this.startScrollPosition=0;this.data=e,this.scrollbar=t,this.thumb=r}onResize(){let e=this.data.viewport.contentHeight,t=this.data.viewport.windowHeight,r=t/e*t;this.thumb.style.setProperty("--height",r+"px"),e<=t?this.scrollbar.classList.add("-hide"):this.scrollbar.classList.remove("-hide")}updateThumb(){let e=this.data.viewport.contentHeight,t=this.data.viewport.windowHeight;this.thumb.style.setProperty("--position",`${this.data.scroll.current/e*t+"px"}`)}mouseDownEvent(e){this.startCoordinate=e.clientY,this.startScrollPosition=this.data.scroll.current}mouseMoveEvent(e){let t=e.clientY-this.startCoordinate,r=this.startScrollPosition+t/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 Lt=class extends g{constructor(t){super(t);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(t){this.updateThumb(),this.showScrollbar(),this.hideScrollbar()}onResize(){this.scrollbarState.onResize()}addCustomStyles(){let t=document.createElement("style");t.textContent=`
2
2
  ::-webkit-scrollbar {
3
3
  display: none;
4
4
  width: 0;
@@ -16,7 +16,7 @@
16
16
  -ms-overflow-style: none; /* IE and Edge */
17
17
  scrollbar-width: none; /* Firefox */
18
18
  }
19
- `,document.head.appendChild(t)}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 Ct(this.data,this.scrollbar,this.thumb),this.scrollbarStateVertical=new wt(this.data,this.scrollbar,this.thumb),this.scrollbarState=this.scrollbarStateVertical}updateThumb(){this.scrollbarState.updateThumb()}mouseDownEvent(t){this.isDragging=!0,this.scrollbarState.mouseDownEvent(t),document.body.style.userSelect="none",this.scrollbar.classList.add("-touch")}mouseMoveEvent(t){this.isDragging&&this.scrollbarState.mouseMoveEvent(t)}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 k={BEFORE_ELEMENT:"-before-element",AFTER_ELEMENT:"-after-element"};function _t(c,e){let t=document.createDocumentFragment(),r=0,i=w(e,"line")||w(e,"charLine")||w(e,"wordLine");return c.forEach((o,s)=>{let a=s===c.length-1,n=t;i&&(n=document.createElement("span"),n.classList.add("-s-line"),o.isBeforeElement&&n.classList.add(k.BEFORE_ELEMENT),o.isAfterElement&&n.classList.add(k.AFTER_ELEMENT),n.style.setProperty("--line-index",String(o.lineIndex)),n.style.setProperty("--word-total",String(o.words.length)),Wt(n,o.calculatedValues,e)),o.words.forEach((l,m)=>{let d=m===o.words.length-1;if(l.chars.length===1&&l.chars[0].token.type==="element"){let u=l.chars[0].token.node.cloneNode(!0);n.appendChild(u),d||n.appendChild(document.createTextNode("\xA0"));return}let p=w(e,"word")||w(e,"charWord")||w(e,"wordLine"),h=p?document.createElement("span"):n;if(p&&(h.classList.add("-s-word"),l.isBeforeElement&&h.classList.add(k.BEFORE_ELEMENT),l.isAfterElement&&h.classList.add(k.AFTER_ELEMENT),h.style.setProperty("--word-index",String(l.wordIndexGlobal)),h.style.setProperty("--char-total",String(l.chars.length)),Wt(h,l.calculatedValues,e)),w(e,"char")||w(e,"charLine")||w(e,"charWord"))l.chars.forEach(u=>{if(u.char===" "||u.char===" ")return;let b=document.createElement("span"),S=b;S.classList.add("-s-char"),u.isBeforeElement&&S.classList.add(k.BEFORE_ELEMENT),u.isAfterElement&&S.classList.add(k.AFTER_ELEMENT),S.textContent=u.char,S.style.setProperty("--char-index",String(r++)),Wt(S,u.calculatedValues,e),h.appendChild(b)});else{let u=document.createTextNode(l.chars.map(b=>b.char).join(""));h.appendChild(u)}p&&n.appendChild(h),i?d?n.appendChild(document.createElement("br")):h.appendChild(document.createTextNode("\xA0")):a||h.appendChild(document.createTextNode("\xA0"))}),i&&t.appendChild(n)}),t}function Wt(c,e,t){if(e)for(let r of e){if(!ae(r.type,r.align,t))continue;let i=le(r.type,r.align);c.style.setProperty(i,String(r.value))}}function ae(c,e,t){let r=t[c]??[];return Array.isArray(r)&&r.some(i=>e.startsWith("random")?i.align.startsWith("random"):i.align===e)}function le(c,e){let t=e.startsWith("random")?"random":e;return`--${c}-${t}`}function w(c,e){return Array.isArray(c[e])&&c[e].length>0}var J=0;function Yt(c){J=0;let e=[];return c.forEach(t=>{if(t.nodeType===Node.ELEMENT_NODE){let r=t;if(r.tagName.toLowerCase()==="br"){e.push({type:"br",id:`br_${J++}`,node:r,tagName:"br"});return}e.push({type:"element",id:`el_${J++}`,node:r,tagName:r.tagName.toLowerCase()})}else if(t.nodeType===Node.TEXT_NODE){let r=t.nodeValue??"",i=`text_${J++}`;r.trim()?e.push({type:"text",id:i,node:t,content:r}):e.push({type:"space",id:i,node:t,content:r})}else e.push({type:"other",id:`node_${J++}`,node:t})}),e}function ce(c){let e=[],t=[];for(let r of c)r.type==="br"?(t.length&&e.push(t),e.push([r]),t=[]):t.push(r);return t.length&&e.push(t),e}function Ut(c,e){let t=document.createElement("div"),r=window.getComputedStyle(e);t.style.position="absolute",t.style.visibility="hidden",t.style.pointerEvents="none",t.style.width=e.clientWidth+"px",t.style.padding=r.padding,t.style.font=r.font,t.style.letterSpacing=r.letterSpacing,t.style.lineHeight=r.lineHeight,t.style.fontVariant=r.fontVariant,t.style.fontStretch=r.fontStretch,e.appendChild(t);let i=[],o=ce(c),s=!1;for(let a of o){if(a.length===1&&a[0].type==="br"){i.push({token:a[0],rect:new DOMRect(0,0,0,0)});continue}if(a.length===0)continue;let n=document.createElement("div");n.style.position="absolute",n.style.visibility="hidden",n.style.pointerEvents="none",n.style.width=e.clientWidth+"px",n.style.padding=r.padding,n.style.font=r.font,n.style.letterSpacing=r.letterSpacing,n.style.lineHeight=r.lineHeight,n.style.fontVariant=r.fontVariant,n.style.fontStretch=r.fontStretch,e.appendChild(n),a.forEach((l,m)=>{let d,p,h;switch(l.type){case"text":l.content.trim().split(/\s+/).filter(b=>b.length>0).forEach((b,S)=>{d=document.createTextNode(b),p=document.createElement("span"),p.style.display="inline-block",p.appendChild(d);let M=document.createTextNode("\xA0");p.appendChild(M),n.appendChild(p),h=p.getBoundingClientRect();let f={token:{type:"text",id:"",node:d,content:b},rect:h};s&&(s=!1,f.token.meta={...f.token.meta||{},isAfterElement:!0}),i.push(f)});break;case"element":d=l.node.cloneNode(!0),p=document.createElement("span"),p.style.display="inline-block",p.appendChild(d),n.appendChild(p),h=p.getBoundingClientRect(),i.push({token:l,rect:h});let u=i[i.length-2];u?.token.type==="text"&&(u.token.meta={...u.token.meta||{},isBeforeElement:!0}),s=!0;break;case"space":case"other":break}}),e.removeChild(n)}return i}var Xt=1;function jt(c){let e=[],t=null,r=0,i=0,o=0;return c.forEach(s=>{let a=s.token,n=a.meta?.isBeforeElement??!1,l=a.meta?.isAfterElement??!1;if(a.type==="br"){t=null;return}if(a.type==="text"){let m=a.content.match(/(\s+|\S+)/g);if(!m)return;let d=s.rect.left,p=a.content.length,h=p>0?s.rect.width/p:0;m.forEach(v=>{if(/^\s+$/.test(v)){d+=h*v.length;return}let u=[];if(v.split("").forEach((x,y)=>{let E=new DOMRect(d,s.rect.top,h,s.rect.height);u.push({char:x,rect:E,token:a,charIndexInWord:y,charIndexInLine:0,charIndexGlobal:i++}),d+=h}),u.length>0){let x=u[u.length-1];n&&(x.isBeforeElement=!0),l&&(x.isAfterElement=!0)}if((!t||Math.abs(s.rect.top-r)>Xt)&&(r=s.rect.top,t={words:[],rect:s.rect,lineIndex:e.length},e.push(t)),!t)return;let S=t.words.length,M=t.words.reduce((x,y)=>x+y.chars.length,0);u.forEach((x,y)=>x.charIndexInLine=M+y);let f={chars:u,rect:s.rect,wordIndexGlobal:o++,wordIndexInLine:S,isBeforeElement:n,isAfterElement:l};t.words.push(f),t.rect=Kt(t.words.map(x=>x.rect)),n&&(t.isBeforeElement=!0),l&&(t.isAfterElement=!0)})}else if(a.type==="element"){let m=s.rect;if((!t||Math.abs(m.top-r)>Xt)&&(r=m.top,t={words:[],rect:m,lineIndex:e.length},e.push(t)),!t)return;let p=t.words.length,h=t.words.reduce((b,S)=>b+S.chars.length,0),u={chars:[{char:"[E]",rect:m,token:a,charIndexInWord:0,charIndexInLine:h,charIndexGlobal:i++}],rect:m,wordIndexGlobal:o++,wordIndexInLine:p,isBeforeElement:!1,isAfterElement:!1};t.words.push(u),t.rect=Kt(t.words.map(b=>b.rect))}}),e}function Kt(c){let e=Math.min(...c.map(o=>o.left)),t=Math.min(...c.map(o=>o.top)),r=Math.max(...c.map(o=>o.right)),i=Math.max(...c.map(o=>o.bottom));return new DOMRect(e,t,r-e,i-t)}var Pt=class extends g{constructor(e){super(e),this.htmlKey="split"}onResize(){this.objectsOnPage.forEach(e=>{this.onObjectConnected(e)})}onObjectConnected(e){let t=e.htmlElement;if(!t)return;let r=t.classList.contains("-splitted"),i=t.getAttribute("string-split-original");(!r||i===null)&&(i=this.escapeAttribute(t.innerHTML),t.setAttribute("string-split-original",i),t.classList.add("-splitted")),e.htmlElement.innerHTML=i;let o=t.getAttribute("string-split")??t.getAttribute("data-string-split")??"",s=this.tools.optionsParser.process({attributeValue:o}),{fragment:a,result:n}=this.split(t,s);e.setProperty("nodes",a.childNodes),t.innerHTML="",t.appendChild(n);let l=t.getAttribute("string-split-restore-after");l&&!isNaN(Number(l))&&setTimeout(()=>{t.innerHTML=i,t.classList.add("-restored")},Number(l))}split(e,t){let r=document.createDocumentFragment();e.childNodes.forEach(n=>r.appendChild(n.cloneNode(!0)));let i=Yt(r.childNodes),o=Ut(i,e),s=jt(o);this.applyCalculatedValues(s,t);let a=_t(s,t);return{fragment:r,result:a}}computeValue(e,t,r){if(e.align.startsWith("random")){let i=e.random?.min??0,o=e.random?.max??r-1;return Math.floor(Math.random()*(o-i+1))+i}switch(e.align){case"start":return t;case"end":return r-t-1;case"center":{let i=Math.floor((r-1)/2);return Math.abs(t-i)}default:return t}}applyCalculatedValues(e,t){let r=s=>s.words.reduce((a,n)=>a+n.chars.length,0),i=e.reduce((s,a)=>s+a.words.length,0),o=e.reduce((s,a)=>s+a.words.reduce((n,l)=>n+l.chars.length,0),0);e.forEach((s,a)=>{t.line&&(s.calculatedValues=t.line.map(n=>({type:"line",align:n.align,value:this.computeValue(n,a,e.length)}))),s.words.forEach((n,l)=>{t.word&&(n.calculatedValues=t.word.map(d=>({type:"word",align:d.align,value:this.computeValue(d,n.wordIndexGlobal,i)}))),t.wordLine&&(n.calculatedValues??(n.calculatedValues=[]),n.calculatedValues.push(...t.wordLine.map(d=>({type:"wordLine",align:d.align,value:this.computeValue(d,n.wordIndexInLine,s.words.length)}))));let m=r(s);n.chars.forEach(d=>{let p=[];t.char&&p.push(...t.char.map(h=>({type:"char",align:h.align,value:this.computeValue(h,d.charIndexGlobal,o)}))),t.charWord&&p.push(...t.charWord.map(h=>({type:"charWord",align:h.align,value:this.computeValue(h,d.charIndexInWord,n.chars.length)}))),t.charLine&&p.push(...t.charLine.map(h=>({type:"charLine",align:h.align,value:this.computeValue(h,d.charIndexInLine,m)}))),d.calculatedValues=p})})})}escapeAttribute(e){return e.replace(/src="(https?:\/\/[^"\s]+)"/g,"src=$1")}};var It=class extends g{constructor(t){super(t);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(t){let r=Math.abs(t.scroll.displacement);this.value=r,this.history.push(r),this.history.length>this.maxPoints&&this.history.shift(),this.draw()}draw(){let t=this.context,r=this.canvas.width,i=this.canvas.height;t.clearRect(0,0,r,i),t.strokeStyle="red",t.lineWidth=2,t.beginPath(),this.history.forEach((o,s)=>{let a=s,n=i-o*this.height;s===0?t.moveTo(a,n):t.lineTo(a,n)}),t.stroke()}initCanvas(){let t=document.createElement("canvas"),r=window.innerWidth*.5;this.height=window.innerHeight/15-20,t.width=r,t.height=this.height,Object.assign(t.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=t,this.context=t.getContext("2d"),document.body.appendChild(t)}setTarget(t){this.target=t}clear(){this.canvas.remove(),this.history=[]}};var Ot=class extends g{constructor(t){super(t);this.frameCount=0;this._type=2}onInit(){this.createDisplayElement(),this.intervalId=window.setInterval(()=>{this.displayElement.textContent=`FPS: ${this.frameCount}`,this.frameCount=0},1e3)}onFrame(t){this.frameCount++}destroy(){clearInterval(this.intervalId),this.displayElement.remove()}createDisplayElement(){let t=document.createElement("div");Object.assign(t.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"}),t.textContent="FPS: 0",document.body.appendChild(t),this.displayElement=t}};var kt=class extends g{constructor(t){super(t);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(t){let r=Math.abs(t.scroll.displacement);this.currentValue=r,this.history.push(r),this.history.length>this.maxPoints&&this.history.shift(),this.draw()}draw(){let t=this.context,r=this.canvas.width,i=this.canvas.height;t.clearRect(0,0,r,i),t.strokeStyle="#007bff",t.lineWidth=2,t.beginPath(),this.history.forEach((o,s)=>{let a=s,n=i-o/2;s===0?t.moveTo(a,n):t.lineTo(a,n)}),t.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(t){this.targetValue=t}clear(){this.canvas.remove(),this.history=[]}};var Dt=class extends g{constructor(e){super(e),this._type=2}onInit(){this.createDisplayElement()}onScroll(e){let t=e.scroll.current,r=e.scroll.target,i=t<r?"\u2193":t>r?"\u2191":"-";this.displayElement.setAttribute("data-dir",i),this.displayElement.setAttribute("data-val",`${Math.round(t)}`)}destroy(){this.displayElement.remove()}createDisplayElement(){let e=document.createElement("div");Object.assign(e.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"}),e.setAttribute("data-dir","-"),e.setAttribute("data-val","0"),document.body.appendChild(e);let t=document.createElement("style");t.innerHTML=`
19
+ `,document.head.appendChild(t)}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 Ct(this.data,this.scrollbar,this.thumb),this.scrollbarStateVertical=new wt(this.data,this.scrollbar,this.thumb),this.scrollbarState=this.scrollbarStateVertical}updateThumb(){this.scrollbarState.updateThumb()}mouseDownEvent(t){this.isDragging=!0,this.scrollbarState.mouseDownEvent(t),document.body.style.userSelect="none",this.scrollbar.classList.add("-touch")}mouseMoveEvent(t){this.isDragging&&this.scrollbarState.mouseMoveEvent(t)}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 k={BEFORE_ELEMENT:"-before-element",AFTER_ELEMENT:"-after-element"};function _t(c,e){let t=document.createDocumentFragment(),r=0,i=w(e,"line")||w(e,"charLine")||w(e,"wordLine");return c.forEach((o,s)=>{let a=s===c.length-1,n=t;i&&(n=document.createElement("span"),n.classList.add("-s-line"),o.isBeforeElement&&n.classList.add(k.BEFORE_ELEMENT),o.isAfterElement&&n.classList.add(k.AFTER_ELEMENT),n.style.setProperty("--line-index",String(o.lineIndex)),n.style.setProperty("--word-total",String(o.words.length)),Wt(n,o.calculatedValues,e)),o.words.forEach((l,m)=>{let d=m===o.words.length-1;if(l.chars.length===1&&l.chars[0].token.type==="element"){let u=l.chars[0].token.node.cloneNode(!0);n.appendChild(u),d||n.appendChild(document.createTextNode("\xA0"));return}let p=w(e,"word")||w(e,"charWord")||w(e,"wordLine"),h=p?document.createElement("span"):n;if(p&&(h.classList.add("-s-word"),l.isBeforeElement&&h.classList.add(k.BEFORE_ELEMENT),l.isAfterElement&&h.classList.add(k.AFTER_ELEMENT),h.style.setProperty("--word-index",String(l.wordIndexGlobal)),h.style.setProperty("--char-total",String(l.chars.length)),Wt(h,l.calculatedValues,e)),w(e,"char")||w(e,"charLine")||w(e,"charWord"))l.chars.forEach(u=>{if(u.char===" "||u.char===" ")return;let b=document.createElement("span"),S=b;S.classList.add("-s-char"),u.isBeforeElement&&S.classList.add(k.BEFORE_ELEMENT),u.isAfterElement&&S.classList.add(k.AFTER_ELEMENT),S.textContent=u.char,S.style.setProperty("--char-index",String(r++)),Wt(S,u.calculatedValues,e),h.appendChild(b)});else{let u=document.createTextNode(l.chars.map(b=>b.char).join(""));h.appendChild(u)}p&&n.appendChild(h),console.log(l.chars.map(u=>u.char).join("")),i?d?a||n.appendChild(document.createElement("br")):h.appendChild(document.createTextNode("\xA0")):d||h.appendChild(document.createTextNode("\xA0"))}),i&&t.appendChild(n)}),t}function Wt(c,e,t){if(e)for(let r of e){if(!ae(r.type,r.align,t))continue;let i=le(r.type,r.align);c.style.setProperty(i,String(r.value))}}function ae(c,e,t){let r=t[c]??[];return Array.isArray(r)&&r.some(i=>e.startsWith("random")?i.align.startsWith("random"):i.align===e)}function le(c,e){let t=e.startsWith("random")?"random":e;return`--${c}-${t}`}function w(c,e){return Array.isArray(c[e])&&c[e].length>0}var J=0;function Yt(c){J=0;let e=[];return c.forEach(t=>{if(t.nodeType===Node.ELEMENT_NODE){let r=t;if(r.tagName.toLowerCase()==="br"){e.push({type:"br",id:`br_${J++}`,node:r,tagName:"br"});return}e.push({type:"element",id:`el_${J++}`,node:r,tagName:r.tagName.toLowerCase()})}else if(t.nodeType===Node.TEXT_NODE){let r=t.nodeValue??"",i=`text_${J++}`;r.trim()?e.push({type:"text",id:i,node:t,content:r}):e.push({type:"space",id:i,node:t,content:r})}else e.push({type:"other",id:`node_${J++}`,node:t})}),e}function ce(c){let e=[],t=[];for(let r of c)r.type==="br"?(t.length&&e.push(t),e.push([r]),t=[]):t.push(r);return t.length&&e.push(t),e}function Ut(c,e){let t=document.createElement("div"),r=window.getComputedStyle(e);t.style.position="absolute",t.style.visibility="hidden",t.style.pointerEvents="none",t.style.width=e.clientWidth+"px",t.style.padding=r.padding,t.style.font=r.font,t.style.letterSpacing=r.letterSpacing,t.style.lineHeight=r.lineHeight,t.style.fontVariant=r.fontVariant,t.style.fontStretch=r.fontStretch,e.appendChild(t);let i=[],o=ce(c),s=!1;for(let a of o){if(a.length===1&&a[0].type==="br"){i.push({token:a[0],rect:new DOMRect(0,0,0,0)});continue}if(a.length===0)continue;let n=document.createElement("div");n.style.position="absolute",n.style.visibility="hidden",n.style.pointerEvents="none",n.style.width=e.clientWidth+"px",n.style.padding=r.padding,n.style.font=r.font,n.style.letterSpacing=r.letterSpacing,n.style.lineHeight=r.lineHeight,n.style.fontVariant=r.fontVariant,n.style.fontStretch=r.fontStretch,e.appendChild(n),a.forEach((l,m)=>{let d,p,h;switch(l.type){case"text":l.content.trim().split(/\s+/).filter(b=>b.length>0).forEach((b,S)=>{d=document.createTextNode(b),p=document.createElement("span"),p.style.display="inline-block",p.appendChild(d);let M=document.createTextNode("\xA0");p.appendChild(M),n.appendChild(p),h=p.getBoundingClientRect();let f={token:{type:"text",id:"",node:d,content:b},rect:h};s&&(s=!1,f.token.meta={...f.token.meta||{},isAfterElement:!0}),i.push(f)});break;case"element":d=l.node.cloneNode(!0),p=document.createElement("span"),p.style.display="inline-block",p.appendChild(d),n.appendChild(p),h=p.getBoundingClientRect(),i.push({token:l,rect:h});let u=i[i.length-2];u?.token.type==="text"&&(u.token.meta={...u.token.meta||{},isBeforeElement:!0}),s=!0;break;case"space":case"other":break}}),e.removeChild(n)}return i}var Xt=1;function Kt(c){let e=[],t=null,r=0,i=0,o=0;return c.forEach(s=>{let a=s.token,n=a.meta?.isBeforeElement??!1,l=a.meta?.isAfterElement??!1;if(a.type==="br"){t=null;return}if(a.type==="text"){let m=a.content.match(/(\s+|\S+)/g);if(!m)return;let d=s.rect.left,p=a.content.length,h=p>0?s.rect.width/p:0;m.forEach(v=>{if(/^\s+$/.test(v)){d+=h*v.length;return}let u=[];if(v.split("").forEach((x,y)=>{let E=new DOMRect(d,s.rect.top,h,s.rect.height);u.push({char:x,rect:E,token:a,charIndexInWord:y,charIndexInLine:0,charIndexGlobal:i++}),d+=h}),u.length>0){let x=u[u.length-1];n&&(x.isBeforeElement=!0),l&&(x.isAfterElement=!0)}if((!t||Math.abs(s.rect.top-r)>Xt)&&(r=s.rect.top,t={words:[],rect:s.rect,lineIndex:e.length},e.push(t)),!t)return;let S=t.words.length,M=t.words.reduce((x,y)=>x+y.chars.length,0);u.forEach((x,y)=>x.charIndexInLine=M+y);let f={chars:u,rect:s.rect,wordIndexGlobal:o++,wordIndexInLine:S,isBeforeElement:n,isAfterElement:l};t.words.push(f),t.rect=jt(t.words.map(x=>x.rect)),n&&(t.isBeforeElement=!0),l&&(t.isAfterElement=!0)})}else if(a.type==="element"){let m=s.rect;if((!t||Math.abs(m.top-r)>Xt)&&(r=m.top,t={words:[],rect:m,lineIndex:e.length},e.push(t)),!t)return;let p=t.words.length,h=t.words.reduce((b,S)=>b+S.chars.length,0),u={chars:[{char:"[E]",rect:m,token:a,charIndexInWord:0,charIndexInLine:h,charIndexGlobal:i++}],rect:m,wordIndexGlobal:o++,wordIndexInLine:p,isBeforeElement:!1,isAfterElement:!1};t.words.push(u),t.rect=jt(t.words.map(b=>b.rect))}}),e}function jt(c){let e=Math.min(...c.map(o=>o.left)),t=Math.min(...c.map(o=>o.top)),r=Math.max(...c.map(o=>o.right)),i=Math.max(...c.map(o=>o.bottom));return new DOMRect(e,t,r-e,i-t)}var Pt=class extends g{constructor(e){super(e),this.htmlKey="split"}onResize(){this.objectsOnPage.forEach(e=>{this.onObjectConnected(e)})}onObjectConnected(e){let t=e.htmlElement;if(!t)return;let r=t.classList.contains("-splitted"),i=t.getAttribute("string-split-original");(!r||i===null)&&(i=this.escapeAttribute(t.innerHTML),t.setAttribute("string-split-original",i),t.classList.add("-splitted")),e.htmlElement.innerHTML=i;let o=t.getAttribute("string-split")??t.getAttribute("data-string-split")??"",s=this.tools.optionsParser.process({attributeValue:o}),{fragment:a,result:n}=this.split(t,s);e.setProperty("nodes",a.childNodes),t.innerHTML="",t.appendChild(n);let l=t.getAttribute("string-split-restore-after");l&&!isNaN(Number(l))&&setTimeout(()=>{t.innerHTML=i,t.classList.add("-restored")},Number(l))}split(e,t){let r=document.createDocumentFragment();e.childNodes.forEach(n=>r.appendChild(n.cloneNode(!0)));let i=Yt(r.childNodes),o=Ut(i,e),s=Kt(o);this.applyCalculatedValues(s,t);let a=_t(s,t);return{fragment:r,result:a}}computeValue(e,t,r){if(e.align.startsWith("random")){let i=e.random?.min??0,o=e.random?.max??r-1;return Math.floor(Math.random()*(o-i+1))+i}switch(e.align){case"start":return t;case"end":return r-t-1;case"center":{let i=Math.floor((r-1)/2);return Math.abs(t-i)}default:return t}}applyCalculatedValues(e,t){let r=s=>s.words.reduce((a,n)=>a+n.chars.length,0),i=e.reduce((s,a)=>s+a.words.length,0),o=e.reduce((s,a)=>s+a.words.reduce((n,l)=>n+l.chars.length,0),0);e.forEach((s,a)=>{t.line&&(s.calculatedValues=t.line.map(n=>({type:"line",align:n.align,value:this.computeValue(n,a,e.length)}))),s.words.forEach((n,l)=>{t.word&&(n.calculatedValues=t.word.map(d=>({type:"word",align:d.align,value:this.computeValue(d,n.wordIndexGlobal,i)}))),t.wordLine&&(n.calculatedValues??(n.calculatedValues=[]),n.calculatedValues.push(...t.wordLine.map(d=>({type:"wordLine",align:d.align,value:this.computeValue(d,n.wordIndexInLine,s.words.length)}))));let m=r(s);n.chars.forEach(d=>{let p=[];t.char&&p.push(...t.char.map(h=>({type:"char",align:h.align,value:this.computeValue(h,d.charIndexGlobal,o)}))),t.charWord&&p.push(...t.charWord.map(h=>({type:"charWord",align:h.align,value:this.computeValue(h,d.charIndexInWord,n.chars.length)}))),t.charLine&&p.push(...t.charLine.map(h=>({type:"charLine",align:h.align,value:this.computeValue(h,d.charIndexInLine,m)}))),d.calculatedValues=p})})})}escapeAttribute(e){return e.replace(/src="(https?:\/\/[^"\s]+)"/g,"src=$1")}};var It=class extends g{constructor(t){super(t);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(t){let r=Math.abs(t.scroll.displacement);this.value=r,this.history.push(r),this.history.length>this.maxPoints&&this.history.shift(),this.draw()}draw(){let t=this.context,r=this.canvas.width,i=this.canvas.height;t.clearRect(0,0,r,i),t.strokeStyle="red",t.lineWidth=2,t.beginPath(),this.history.forEach((o,s)=>{let a=s,n=i-o*this.height;s===0?t.moveTo(a,n):t.lineTo(a,n)}),t.stroke()}initCanvas(){let t=document.createElement("canvas"),r=window.innerWidth*.5;this.height=window.innerHeight/15-20,t.width=r,t.height=this.height,Object.assign(t.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=t,this.context=t.getContext("2d"),document.body.appendChild(t)}setTarget(t){this.target=t}clear(){this.canvas.remove(),this.history=[]}};var Ot=class extends g{constructor(t){super(t);this.frameCount=0;this._type=2}onInit(){this.createDisplayElement(),this.intervalId=window.setInterval(()=>{this.displayElement.textContent=`FPS: ${this.frameCount}`,this.frameCount=0},1e3)}onFrame(t){this.frameCount++}destroy(){clearInterval(this.intervalId),this.displayElement.remove()}createDisplayElement(){let t=document.createElement("div");Object.assign(t.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"}),t.textContent="FPS: 0",document.body.appendChild(t),this.displayElement=t}};var kt=class extends g{constructor(t){super(t);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(t){let r=Math.abs(t.scroll.displacement);this.currentValue=r,this.history.push(r),this.history.length>this.maxPoints&&this.history.shift(),this.draw()}draw(){let t=this.context,r=this.canvas.width,i=this.canvas.height;t.clearRect(0,0,r,i),t.strokeStyle="#007bff",t.lineWidth=2,t.beginPath(),this.history.forEach((o,s)=>{let a=s,n=i-o/2;s===0?t.moveTo(a,n):t.lineTo(a,n)}),t.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(t){this.targetValue=t}clear(){this.canvas.remove(),this.history=[]}};var Dt=class extends g{constructor(e){super(e),this._type=2}onInit(){this.createDisplayElement()}onScroll(e){let t=e.scroll.current,r=e.scroll.target,i=t<r?"\u2193":t>r?"\u2191":"-";this.displayElement.setAttribute("data-dir",i),this.displayElement.setAttribute("data-val",`${Math.round(t)}`)}destroy(){this.displayElement.remove()}createDisplayElement(){let e=document.createElement("div");Object.assign(e.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"}),e.setAttribute("data-dir","-"),e.setAttribute("data-val","0"),document.body.appendChild(e);let t=document.createElement("style");t.innerHTML=`
20
20
  div[data-dir][data-val]::before {
21
21
  content: attr(data-dir) ' Top: ' attr(data-val) 'px';
22
22
  }