@fiddle-digital/string-tune 1.1.52 → 1.1.54
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 +613 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +176 -2
- package/dist/index.d.ts +176 -2
- package/dist/index.js +613 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +613 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var At=Object.defineProperty;var ur=Object.getOwnPropertyDescriptor;var dr=Object.getOwnPropertyNames;var hr=Object.prototype.hasOwnProperty;var pr=(u,r)=>{for(var e in r)At(u,e,{get:r[e],enumerable:!0})},mr=(u,r,e,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of dr(r))!hr.call(u,i)&&i!==e&&At(u,i,{get:()=>r[i],enumerable:!(t=ur(r,i))||t.enumerable});return u};var gr=u=>mr(At({},"__esModule",{value:!0}),u);var $r={};pr($r,{CursorReactiveModule:()=>ce,DOMBatcher:()=>ae,ScrollController:()=>$,StringAnchor:()=>st,StringCursor:()=>Ge,StringData:()=>pe,StringDelayLerpTracker:()=>gt,StringFPSTracker:()=>ft,StringForm:()=>xt,StringGlide:()=>ot,StringImpulse:()=>Ke,StringLazy:()=>tt,StringLerp:()=>at,StringLerpTracker:()=>bt,StringLoading:()=>rt,StringMagnetic:()=>Je,StringMasonry:()=>Ze,StringModule:()=>x,StringObject:()=>oe,StringParallax:()=>lt,StringPositionTracker:()=>vt,StringProgress:()=>de,StringProgressPart:()=>Lt,StringRandom:()=>Ot,StringResponsive:()=>nt,StringScrollContainer:()=>Pt,StringScrollbar:()=>dt,StringScroller:()=>Ct,StringSequence:()=>Mt,StringSplit:()=>mt,StringSpotlight:()=>et,StringTune:()=>Wt,StringVideoAutoplay:()=>St,default:()=>Wt,frameDOM:()=>V,styleTxn:()=>M});module.exports=gr($r);var Ae=class{constructor(r=.1,e){this.SETTLE_THRESHOLD=.1;this.lastMouseX=0;this.lastMouseY=0;this.lastMouseTime=0;this.smoothingFactor=r,this.context=e,this.onSettingsChange({isDesktop:e.data.viewport.windowWidth>1024,isForceRebuild:!1,widthChanged:!0,heightChanged:!0,scrollHeightChanged:!0})}onMouseMove(r){this.context.data.cursor.targetX=r.clientX,this.context.data.cursor.targetY=r.clientY;let e=performance.now(),t=e-this.lastMouseTime;t>0&&(this.context.data.cursor.velocityX=(r.clientX-this.lastMouseX)/t,this.context.data.cursor.velocityY=(r.clientY-this.lastMouseY)/t),this.lastMouseX=r.clientX,this.lastMouseY=r.clientY,this.lastMouseTime=e}onFrame(){let{targetX:r,targetY:e,smoothedX:t,smoothedY:i}=this.context.data.cursor,n=this.context.tools.lerp.process({from:t,to:r,progress:this.smoothingFactor}),s=this.context.tools.lerp.process({from:i,to:e,progress:this.smoothingFactor}),o=this.getStepDistance(n,s);this.isSettled(o)?this.snapToTarget():this.applyStep(n,s)}onSettingsChange(r){let e=Number(this.context.settings["cursor-lerp"]);this.setLerpFactor(e)}setLerpFactor(r){this.smoothingFactor=this.context.tools.adaptiveLerp.process({value:r,inMin:.1,inMax:1,outMin:.05,outMax:.65})}getStepDistance(r,e){return Math.hypot(r,e)}isSettled(r){return r<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(r,e){this.context.data.cursor.smoothedX+=r,this.context.data.cursor.smoothedY+=e,this.context.data.cursor.stepX=r,this.context.data.cursor.stepY=e}};var se=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")}registerStateEvent(r,e){this.stateEvents.add(r),e!==void 0&&(this.lastPayloads[r]=e)}on(r,e,t){let i=t?`${r}:${t}`:r;this.listeners[i]||(this.listeners[i]=new Set),this.listeners[i].add(e),this.stateEvents.has(i)&&this.lastPayloads[i]!==void 0&&e(this.lastPayloads[i])}off(r,e,t){let i=t?`${r}:${t}`:r;this.listeners[i]&&this.listeners[i].delete(e)}emit(r,e){this.stateEvents.has(r)&&(this.lastPayloads[r]=e);let t=this.listeners[r];if(t)for(let i of t)i(e)}onProgress(r,e){this.on(`progress:${r}`,e)}emitProgress(r,e){this.emit(`progress:${r}`,e)}onInview(r,e){this.on(`object:inview:${r}`,e)}emitInview(r,e){this.emit(`object:inview:${r}`,e)}onScroll(r){this.on("scroll",r)}emitScroll(r){this.emit("scroll",r)}onUpdate(r){this.on("update",r)}emitUpdate(){this.emit("update")}clear(r){delete this.listeners[r]}clearAll(){this.listeners={}}};var De=class{constructor(r){this.data=r;this.modules=[];this.uiModules=[];this.allModules=[]}register(r){if(r.type===1?this.modules.push(r):r.type===2&&this.uiModules.push(r),r.cssProperties&&r.cssProperties.length>0&&typeof window.CSS<"u"&&"registerProperty"in window.CSS)for(let e=0;e<r.cssProperties.length;e++)try{window.CSS.registerProperty(r.cssProperties[e])}catch{}r.onSubscribe(),this.rebuildAllModules()}find(r){for(let e=0;e<this.modules.length;e++){let t=this.modules[e];if(t instanceof r)return t}}onInit(){this.callAll("onInit")}onFrame(){this.callAll("onFrame")}onMutate(){this.callAll("onMutate")}onScrollMeasure(){this.callAll("onScrollMeasure")}onMouseMoveMeasure(){this.callAll("onMouseMoveMeasure")}onScroll(){this.callAll("onScroll")}onResizeWidth(){this.callAll("onResizeWidth")}onResize(){this.callAll("onResize")}onMouseMove(r){this.callAll("onMouseMove",r)}onWheel(r){this.callAll("onWheel",r)}onDirectionChange(){this.callAll("onDirectionChange")}onScrollStart(){this.callAll("onScrollStart")}onScrollStop(){this.callAll("onScrollStop")}onAxisChange(){this.callAll("onAxisChange")}onDeviceChange(){this.callAll("onDeviceChange")}onScrollConfigChange(){this.callAll("onScrollConfigChange")}onSettingsChange(r){this.callAll("onSettingsChange")}onDOMMutate(r,e){this.callAll("onDOMMutate",r,e)}destroy(){this.callAll("onUnsubscribe"),this.callAll("destroy"),this.modules=[],this.uiModules=[],this.allModules=[]}get all(){return this.allModules}get core(){return this.modules}get ui(){return this.uiModules}callAll(r,e,t){this.modules.length>0&&this.callLifecycleStrict(this.modules,r,e,t),this.uiModules.length>0&&this.callLifecycleStrict(this.uiModules,r,e,t)}callLifecycleStrict(r,e,t,i){let n=r.length;switch(e){case"onFrame":case"onMutate":case"onScrollMeasure":case"onMouseMoveMeasure":case"onScroll":for(let s=0;s<n;s++){let o=r[s];o&&o[e](this.data)}break;case"onDOMMutate":for(let s=0;s<n;s++){let o=r[s];o&&o[e](t,i)}break;case"onMouseMove":case"onWheel":for(let s=0;s<n;s++){let o=r[s];o&&o[e](t)}break;default:for(let s=0;s<n;s++){let o=r[s];o&&o[e]()}break}}rebuildAllModules(){this.allModules.length=0;for(let r=0;r<this.modules.length;r++)this.allModules.push(this.modules[r]);for(let r=0;r<this.uiModules.length;r++)this.allModules.push(this.uiModules[r])}};var Ie=class{constructor(r,e,t){this.parent=t;this.properties=new Map;this.id=r,this.htmlElement=e}get parentObject(){return this.parent}setProperty(r,e){this.properties.set(r,e)}getProperty(r){return this.properties.get(r)??null}setEasing(r){this.easingFn=r??void 0}getEasing(){return this.easingFn}applyProgress(r,e){let t=this.easingFn??e;return t?t(r):r}};var oe=class{constructor(r,e){this.id="";this.keys=[];this.mirrors=new Map;this.properties=new Map;this.eventNameCache=new Map;this.eventNameSuffixCache=new Map;this.progress=0;this.progressRaw=0;this.startPosition=0;this.differencePosition=0;this.transformValue=null;this.eventProgressName=null;this.lerp=0;this.glide=0;this.isMagneting=!1;this.magneticX=0;this.magneticY=0;this.magneticTargetX=0;this.magneticTargetY=0;this.eventLerpName=null;this.eventGlideName=null;this.eventMagneticName=null;this.modules=[];this.events=new se;this.htmlElement=e,this.id=r,this.eventProgressName=this.getScopedEventName("object:progress")}getScopedEventName(r,e){if(e==null){let s=this.eventNameCache.get(r);if(s)return s;let o=`${r}:${this.id}`;return this.eventNameCache.set(r,o),o}let t=this.eventNameSuffixCache.get(r);t||(t=new Map,this.eventNameSuffixCache.set(r,t));let i=t.get(e);if(i)return i;let n=`${r}:${this.id}:${e}`;return t.set(e,n),n}setProperty(r,e){this.properties.set(r,e)}getProperty(r){return this.properties.get(r)??null}enter(){this.events.emit("enter",this),this.setProperty("active",!0),this.modules.forEach(r=>{r.enterObject(this.id,this)})}leave(){this.events.emit("leave",this),this.setProperty("active",!1),this.modules.forEach(r=>{r.exitObject(this.id)})}remove(){this.modules.forEach(r=>{r.removeObject(this.id)})}show(){this.htmlElement.classList.add("-inview")}hide(){this.getProperty("repeat")&&this.htmlElement.classList.remove("-inview")}connect(r){return this.modules.includes(r)?!1:(this.modules.push(r),!0)}addMirror(r){this.mirrors.set(r.id,r)}removeMirror(r){this.mirrors.delete(r)}get mirrorObjects(){return Array.from(this.mirrors.values())}get connects(){return this.mirrorObjects.map(r=>r.htmlElement)}};var ae=class{constructor(){this.readQueue=[];this.writeQueue=[];this.computeQueue=[];this.isProcessing=!1;this.pendingFrame=null;this.rectCache=new WeakMap;this.dimensionCache=new WeakMap}scheduleRead(r,e=0){this.readQueue.push({priority:e,execute:r}),this.scheduleFlush()}scheduleCompute(r,e=0){this.computeQueue.push({priority:e,execute:r}),this.scheduleFlush()}scheduleWrite(r,e=0){this.writeQueue.push({priority:e,execute:r}),this.scheduleFlush()}batchModuleInitialization(r){r.forEach(({module:e,object:t,element:i,attributes:n,globalId:s})=>{this.scheduleRead(()=>{let o=i.getBoundingClientRect();this.rectCache.set(i,o),this.dimensionCache.set(i,{width:i.offsetWidth||i.clientWidth||o.width,height:i.offsetHeight||i.clientHeight||o.height}),e.initializeObject(s,t,i,n)},1)}),r.forEach(({module:e,object:t,windowSize:i})=>{this.scheduleCompute(()=>{e.calculatePositions(t,i)},2)}),r.forEach(({module:e,object:t})=>{this.scheduleWrite(()=>{e.connectObject(t),e.addObject(t.id,t)},3)})}getCachedRect(r){return this.rectCache.get(r)}getCachedDimensions(r){return this.dimensionCache.get(r)}scheduleFlush(){this.pendingFrame!==null||this.isProcessing||(this.pendingFrame=requestAnimationFrame(()=>{this.flush()}))}flush(){this.isProcessing=!0,this.pendingFrame=null;let r=(e,t)=>t.priority-e.priority;try{[...this.readQueue].sort(r).forEach(n=>{try{n.execute()}catch(s){console.error("[DOMBatcher] Read task error:",s)}}),this.readQueue=[],[...this.computeQueue].sort(r).forEach(n=>{try{n.execute()}catch(s){console.error("[DOMBatcher] Compute task error:",s)}}),this.computeQueue=[],[...this.writeQueue].sort(r).forEach(n=>{try{n.execute()}catch(s){console.error("[DOMBatcher] Write task error:",s)}}),this.writeQueue=[]}finally{this.rectCache=new WeakMap,this.dimensionCache=new WeakMap,this.isProcessing=!1}}flushSync(){this.pendingFrame!==null&&(cancelAnimationFrame(this.pendingFrame),this.pendingFrame=null),this.flush()}clear(){this.pendingFrame!==null&&(cancelAnimationFrame(this.pendingFrame),this.pendingFrame=null),this.readQueue=[],this.writeQueue=[],this.computeQueue=[],this.rectCache=new WeakMap,this.dimensionCache=new WeakMap}};var Re=class{constructor(){this.desktop={rebuild:{width:!0,height:!0,scrollHeight:!0}};this.mobile={rebuild:{width:!0,height:!0,scrollHeight:!0}}}};var x=class{constructor(r){this.cssProperties=[];this.objectMapOnPage=new Map;this.objectsOnPage=[];this.objectMap=new Map;this.objects=[];this.htmlKey="";this._type=1;this.permissions=new Re;this.tools=r.tools,this.data=r.data,this.settings=r.settings,this.events=r.events,this.centers=r.centers,this.hover=r.hover,this.objectManager=r.objectManager,this.attributesToMap=[{key:"active",type:"boolean",fallback:this.settings.active},{key:"fixed",type:"boolean",fallback:this.settings.fixed},{key:"outside-container",type:"boolean",fallback:this.settings["outside-container"]},{key:"repeat",type:"boolean",fallback:this.settings.repeat},{key:"self-disable",type:"boolean",fallback:this.settings["self-disable"]},{key:"abs",type:"boolean",fallback:this.settings.abs},{key:"key",type:"string",fallback:this.settings.key},{key:"offset-top",type:"dimension",fallback:this.settings["offset-top"]},{key:"offset-bottom",type:"dimension",fallback:this.settings["offset-bottom"]},{key:"inview-top",type:"dimension",fallback:this.settings["inview-top"]},{key:"inview-bottom",type:"dimension",fallback:this.settings["inview-bottom"]},{key:"start",type:"number",fallback:(e,t,i)=>{let n=i.top;return Math.floor(n)+this.data.scroll.elementContainer.scrollTop*this.data.viewport.transformScale}},{key:"end",type:"number",fallback:(e,t,i)=>{let n=i.top,s=i.height;return n+s-this.data.scroll.transformedCurrent}},{key:"size",type:"number",fallback:(e,t,i)=>i.height},{key:"half-width",type:"number",fallback:(e,t,i)=>i.width/2},{key:"half-height",type:"number",fallback:(e,t,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(r,e,t,i){let n=this.tools.boundingClientRect.process({element:t});for(let{key:s,type:o,fallback:a,transform:l}of this.attributesToMap){let c=typeof a=="function"?a(t,e,n):a,d=i[s]??i[`string-${s}`]??i[`data-string-${s}`],h=this.tools.domAttribute.process({element:t,key:s,fallback:d??this.settings[s]??c}),p=this.parseAttribute(h,o,{element:t,boundingRect:n,viewportHeight:this.data.viewport.windowHeight,baseRem:this.data.viewport.baseRem});l&&(p=l(p)),e.setProperty(s,p)}}calculatePositions(r,e){let t=r.getProperty("start"),i=r.getProperty("size"),n=r.getProperty("offset-bottom"),s=r.getProperty("offset-top"),o=r.getProperty("enter-el"),a=r.getProperty("enter-vp"),l=r.getProperty("exit-el"),c=r.getProperty("exit-vp"),d=0,h=0,p=0,b=0;o==="top"&&a==="top"||o==="left"&&a==="left"?(p=-e+1,d=t-n):o==="top"&&a==="bottom"||o==="left"&&a==="right"?d=t-e-n:o==="bottom"&&a==="top"||o==="right"&&a==="left"?(p=-e-i+1,d=t+i-n):(o==="bottom"&&a==="bottom"||o==="right"&&a==="right")&&(p=-i+1,d=t-e+i-n),l==="top"&&c==="top"||l==="left"&&c==="left"?(b=-i+1,h=t+s):l==="top"&&c==="bottom"||l==="left"&&c==="right"?(b=-e-i+1,h=t-e+s):l==="bottom"&&c==="top"||l==="right"&&c==="left"?h=t+i+s:(l==="bottom"&&c==="bottom"||l==="right"&&c==="right")&&(b=-e+1,h=t-e+i+s),r.setProperty("start-bias",p),r.setProperty("end-bias",b),r.setProperty("start-position",d-this.data.scroll.topPosition),r.setProperty("end-position",h-this.data.scroll.topPosition),r.setProperty("difference-position",h-d);let m=r.getProperty("inview-top")??0,g=r.getProperty("inview-bottom")??0;r.setProperty("inview-start-position",r.getProperty("start-position")+m),r.setProperty("inview-end-position",r.getProperty("end-position")+g)}parseAttribute(r,e,t={}){if(r==null)return null;if(typeof e=="object"&&e.type==="enum")return e.values.includes(r)?r:e.values[0];switch(e){case"number":return parseFloat(r);case"boolean":return r===""||r==="true";case"json":try{return JSON.parse(r)}catch{return null}case"tuple":return r.trim().split(/\s+/);case"easing":return this.tools.easingFunction.process({easing:r});case"color":return this.tools.colorParser.process({value:r});case"dimension":return r=="0"?0:t.element!=null&&t.viewportHeight!=null&&t.baseRem!=null&&t.boundingRect!=null?this.tools.unitParser.process({value:r,element:t.element,viewportHeight:t.viewportHeight,boundingRect:t.boundingRect,baseRem:t.baseRem}):0;case"breakpoint-dimension":if(t.element!=null&&t.viewportHeight!=null&&t.baseRem!=null&&t.boundingRect!=null){let i=r.trim().split("|"),n=[];for(let s of i)if(s.includes(":")){let[o,a]=s.split(":");n.push({breakpoint:parseInt(o),value:this.tools.unitParser.process({value:`${a}|`,element:t.element,viewportHeight:t.viewportHeight,boundingRect:t.boundingRect,baseRem:t.baseRem})})}else n.push({breakpoint:0,value:this.tools.unitParser.process({value:s,element:t.element,viewportHeight:t.viewportHeight,boundingRect:t.boundingRect,baseRem:t.baseRem})});return n}default:return r}}canConnect(r){return r.keys.includes(this.htmlKey)}connectObject(r){r.connect(this)&&this.onObjectConnected(r)}enterObject(r,e){this.objectMap.has(r)||(this.objectMap.set(r,e),this.objects.push(e))}exitObject(r){let e=this.objectMap.get(r);if(!e)return;this.objectMap.delete(r);let t=this.objects.indexOf(e);t!==-1&&this.objects.splice(t,1)}addObject(r,e){this.objectMapOnPage.has(r)||(this.objectMapOnPage.set(r,e),this.objectsOnPage.push(e))}removeObject(r){let e=this.objectMapOnPage.get(r);if(!e)return;this.objectMapOnPage.delete(r);let t=this.objectsOnPage.indexOf(e);t!==-1&&this.objectsOnPage.splice(t,1),this.onObjectDisconnected(e)}onObjectConnected(r){}onObjectDisconnected(r){}applyToElementAndConnects(r,e,t=e){r.getProperty("self-disable")!==!0&&e(r.htmlElement),r.mirrorObjects.forEach(i=>t(i.htmlElement,i))}applyVarToElement(r,e,t){r.getProperty("self-disable")!==!0&&this.tools.styleTxn.setVar(r.htmlElement,e,t)}applyPropToElement(r,e,t){r.getProperty("self-disable")!==!0&&this.tools.styleTxn.setProp(r.htmlElement,e,t)}applyVarToConnects(r,e,t){for(let i of r.mirrorObjects)this.tools.styleTxn.setVar(i.htmlElement,e,t)}applyPropToConnects(r,e,t){for(let i of r.mirrorObjects)this.tools.styleTxn.setProp(i.htmlElement,e,t)}getObjectEventName(r,e,t){return r.getScopedEventName(e,t)}destroy(){this.objects=[],this.objectMap=new Map}onInit(){}onSubscribe(){}onUnsubscribe(){}onFrame(r){}onMutate(r){}onScrollMeasure(r){}onMouseMoveMeasure(r){}onResize(){}onResizeWidth(){}onScroll(r){}onDirectionChange(){}onScrollStart(){}onScrollStop(){}onScrollDirectionChange(){}onAxisChange(){}onDeviceChange(){}onScrollConfigChange(){}onSettingsChange(){}onDOMRebuild(){}onMouseMove(r){}onWheel(r){}onDOMMutate(r,e){}};var ke=class{constructor(r,e,t,i){this.data=r;this.modules=e;this.events=t;this.tools=i;this.objects=new Map;this.connectQueue=[];this.connectableModulesBuffer=[];this.mirrors=new Map;this.mirrorId=1;this.globalId=1;this.domBatcher=new ae;this.domBatcherEnabled=!1;this.inviewStarts=[];this.inviewEnds=[];this.inviewActive=new Set;this.inviewStartIdx=0;this.inviewEndIdx=0;this.inviewIndexDirty=!0;this.lastInviewScrollPos=0;this.intersectionObserverEnabled=!0;this.domObserver=null}get all(){return this.objects}add(r){let e=`string-${this.globalId++}`,t="string-id";r.getAttribute("string-id")&&(e=r.getAttribute("string-id"),t="string-id"),r.getAttribute("data-string-id")&&(e=r.getAttribute("data-string-id"),t="data-string-id");let i=e&&this.objects.has(e)?this.objects.get(e):new oe(e,r);r.setAttribute(t,i.id);let n=r.getAttribute("string")??r.getAttribute("data-string");n&&(i.keys=this.splitPipeAndTrim(n)),r.setAttribute("string-inited",""),this.objects.set(i.id,i);let s=this.getAllAttributes(r),o=this.modules.core;for(let c=0;c<o.length;c++){let d=o[c];"setupCoreProperties"in d&&typeof d.setupCoreProperties=="function"&&d.setupCoreProperties(i,r,s)}let a=this.connectableModulesBuffer;a.length=0;let l=this.modules.all;for(let c=0;c<l.length;c++){let d=l[c];d instanceof x&&d.canConnect(i)&&a.push(d)}if(this.domBatcherEnabled&&a.length>0){let c=new Array(a.length);for(let d=0;d<a.length;d++)c[d]={module:a[d],object:i,element:r,attributes:s,globalId:this.globalId,windowSize:this.data.viewport.windowHeight};this.domBatcher.batchModuleInitialization(c),this.domBatcher.scheduleWrite(()=>{this.initObservers(i,r),this.checkInviewForObject(i)})}else{for(let c=0;c<a.length;c++){let d=a[c];d.initializeObject(this.globalId,i,r,s),d.calculatePositions(i,this.data.viewport.windowHeight),d.connectObject(i),d.addObject(i.id,i)}this.initObservers(i,r),this.checkInviewForObject(i)}if(this.connectQueue.length>0){let c=0;for(let d=0;d<this.connectQueue.length;d++){let h=this.connectQueue[d];if(h.id===i.id){this.attachMirrorToObject(i,h.element);continue}this.connectQueue[c++]=h}this.connectQueue.length=c}a.length=0,this.inviewIndexDirty=!0}setDOMBatcherEnabled(r){this.domBatcherEnabled=r,r||this.domBatcher.flushSync()}setIntersectionObserverEnabled(r){if(this.intersectionObserverEnabled!==r){this.intersectionObserverEnabled=r;for(let e of this.objects.values())e.getProperty("observer-progress")?.disconnect(),r&&this.initObservers(e,e.htmlElement)}}invalidateInviewIndex(){this.inviewIndexDirty=!0}refreshLayoutForRoot(r){if(!r)return;let e=new Set,t=n=>{let s=n.getAttribute("string-id")??n.getAttribute("data-string-id");if(!s)return;let o=this.objects.get(s);o&&e.add(o)};if(r instanceof HTMLElement){t(r);let n=r.querySelectorAll("[string-id],[data-string-id]");for(let s=0;s<n.length;s++)t(n[s])}if(e.size===0)return;let i=this.data.viewport.windowHeight;for(let n of e){let s=n.htmlElement;if(!s||!s.isConnected)continue;let o=this.getAllAttributes(s),a=this.modules.all;for(let l=0;l<a.length;l++){let c=a[l];c instanceof x&&c.canConnect(n)&&(c.initializeObject(this.globalId,n,s,o),c.calculatePositions(n,i))}}this.inviewIndexDirty=!0,this.checkInview()}remove(r){let e=this.objects.get(r);e&&(e.events.clearAll(),e.getProperty("observer-progress")?.disconnect(),e.getProperty("observer-inview")?.disconnect(),e.htmlElement.removeAttribute("string-inited"),e.leave(),e.remove(),e.mirrorObjects.forEach(t=>{let i=this.getMirrorIds(t.htmlElement);this.setMirrorIds(t.htmlElement,i.filter(s=>s!==t.id)),this.mirrors.delete(t.id);let n=t.htmlElement.getAttribute("string-copy-from")??t.htmlElement.getAttribute("data-string-copy-from");n&&this.enqueueConnection(n,t.htmlElement)}),this.objects.delete(r),this.inviewActive.delete(e),this.inviewIndexDirty=!0)}enqueueConnection(r,e){let t=this.splitPipeAndTrim(r);for(let i=0;i<t.length;i++){let n=t[i];this.connectQueue.some(s=>s.id===n&&s.element===e)||this.connectQueue.push({id:n,element:e})}}linkMirror(r,e){let t=this.splitPipeAndTrim(r);for(let i=0;i<t.length;i++){let n=t[i],s=this.objects.get(n);s?this.attachMirrorToObject(s,e):this.enqueueConnection(n,e)}}attachMirrorToObject(r,e){let t=this.getMirrorIds(e);for(let o of t){let a=this.mirrors.get(o);if(a&&a.parentObject===r)return a}let i=`string-mirror-${this.mirrorId++}`,n=new Ie(i,e,r);this.setMirrorIds(e,[...t,i]),r.addMirror(n),this.mirrors.set(i,n);let s=e.getAttribute("string-easing")??e.getAttribute("data-string-easing");return s&&s.trim().length>0&&(n.setEasing(this.tools.easingFunction.process({easing:s})),n.setProperty("easing",s)),n}detachMirrorByElement(r){let e=this.getMirrorIds(r);e.length!==0&&(e.forEach(t=>this.detachMirrorById(t)),this.clearMirrorIds(r))}detachMirrorById(r){let e=this.mirrors.get(r);e&&(e.parentObject.removeMirror(r),this.mirrors.delete(r))}getMirrorIds(r){let e=r.getAttribute("string-mirror-id")??r.getAttribute("data-string-mirror-id");return e?this.splitPipeAndTrim(e):[]}setMirrorIds(r,e){if(e.length===0){this.clearMirrorIds(r);return}r.setAttribute("string-mirror-id",e.join("|"))}clearMirrorIds(r){r.removeAttribute("string-mirror-id"),r.removeAttribute("data-string-mirror-id")}getAllAttributes(r){let e={},t=r.attributes;for(let i=0;i<t.length;i++){let n=t[i];e[n.name]=n.value}return e}initObservers(r,e){if(!this.intersectionObserverEnabled)return;let t=r.getProperty("offset-top")??0,i=r.getProperty("offset-bottom")??0;r.getProperty("observer-progress")?.disconnect();let n=p=>{p.forEach(b=>{this.events.emit(r.getScopedEventName("object:activate"),b.isIntersecting),b.isIntersecting?r.enter():r.leave()})},s=r.getProperty("outside-container"),o=e.getAttribute("string-outside-container")??e.getAttribute("data-string-outside-container"),a=o!=null?o.trim().toLowerCase():null,l=a===""||a==="true"||a==="1",c=s!=null?s===!0:l,d=this.data.scroll.container===document.body||c?null:this.data.scroll.container,h=new IntersectionObserver(n,{root:d,rootMargin:`${i+this.data.viewport.windowHeight}px 0px ${t+this.data.viewport.windowHeight}px 0px`,threshold:0});h.observe(e),r.setProperty("observer-progress",h)}observeDOM(){this.domObserver?.disconnect();let r=new MutationObserver(e=>{let t=!1;for(let i=0;i<e.length;i++){let n=e[i];if(n.type==="childList"){let s=!1;for(let o=0;o<n.removedNodes.length;o++){let a=n.removedNodes[o];if(a.nodeType!==Node.ELEMENT_NODE)continue;s=!0;let l=a;if(this.detachMirrorByElement(l),this.isFixed(l))continue;l.hasAttribute("string")&&this.handleRemoved(l);let c=l.querySelectorAll("[string],[data-string]");for(let h=0;h<c.length;h++){let p=c[h];this.isFixed(p)||this.handleRemoved(p)}let d=l.querySelectorAll("[string-copy-from],[data-string-copy-from]");for(let h=0;h<d.length;h++)this.detachMirrorByElement(d[h])}for(let o=0;o<n.addedNodes.length;o++){let a=n.addedNodes[o];if(a.nodeType!==Node.ELEMENT_NODE)continue;s=!0;let l=a;if(this.isFixed(l))continue;l.hasAttribute("string")&&!l.hasAttribute("string-inited")&&this.add(l);let c=l.querySelectorAll("[string]:not([string-inited]),[data-string]:not([string-inited])");for(let p=0;p<c.length;p++)this.add(c[p]);let d=l.getAttribute("string-copy-from")??l.getAttribute("data-string-copy-from");d&&this.linkMirror(d,l);let h=l.querySelectorAll("[string-copy-from],[data-string-copy-from]");for(let p=0;p<h.length;p++){let b=h[p],m=b.getAttribute("string-copy-from")??b.getAttribute("data-string-copy-from");m&&this.linkMirror(m,b)}}s&&(this.modules.onDOMMutate(n.addedNodes,n.removedNodes),t=!0)}}if(t){let i=this.modules.all;for(let n=0;n<i.length;n++)i[n].onDOMRebuild();this.events.emit("dom:changed",null)}});r.observe(document.body,{childList:!0,subtree:!0}),this.domObserver=r}handleRemoved(r){let e=r.getAttribute("string-id")??r.getAttribute("data-string-id");if(!e)return;let t=r.getAttribute("string-copy-from")??r.getAttribute("data-string-copy-from");t&&(this.connectQueue=this.connectQueue.filter(i=>i.id!==t)),this.remove(e)}onSettingsChange(r){for(let e of this.objects.values()){if(!e.htmlElement||!e.htmlElement.isConnected)continue;let t=null,i=this.modules.all;for(let n=0;n<i.length;n++){let s=i[n],o=!1;r.isDesktop?(s.permissions.desktop.rebuild.scrollHeight&&r.scrollHeightChanged&&(o=!0),s.permissions.desktop.rebuild.width&&r.widthChanged&&(o=!0),s.permissions.desktop.rebuild.height&&r.heightChanged&&(o=!0)):(s.permissions.mobile.rebuild.scrollHeight&&r.scrollHeightChanged&&(o=!0),s.permissions.mobile.rebuild.width&&r.widthChanged&&(o=!0),s.permissions.mobile.rebuild.height&&r.heightChanged&&(o=!0)),(o||r.isForceRebuild)&&s.canConnect(e)&&(t==null&&(t=this.getAllAttributes(e.htmlElement)),s.initializeObject(this.globalId,e,e.htmlElement,t),s.calculatePositions(e,this.data.viewport.windowHeight),s.connectObject(e))}}this.inviewIndexDirty=!0}isFixed(r){return r.hasAttribute("string-fixed")}checkInview(){let r=this.data.scroll.transformedCurrent;this.updateInviewWindow(r);for(let e of this.inviewActive)this.checkInviewForObject(e)}checkInviewForObject(r){let e=this.data.scroll.transformedCurrent;if(!this.intersectionObserverEnabled){let c=r.getProperty("start-position"),d=r.getProperty("end-position");if(c!=null&&d!=null){let h=Math.min(c,d),p=Math.max(c,d),b=r.getProperty("is-active")??!1,m=e>=h&&e<=p;m!==b&&(r.setProperty("is-active",m),this.events.emit(r.getScopedEventName("object:activate"),m),m?r.enter():r.leave())}}let t=r.getProperty("inview-start-position"),i=r.getProperty("inview-end-position"),n=r.getProperty("is-inview")??!1,s=Math.min(t,i),o=Math.max(t,i),a=e>=s&&e<=o,l=null;if(!n&&a){let c=Math.abs(e-s),d=Math.abs(o-e);l=c<=d?"enter-top":"enter-bottom"}else n&&!a&&(l=e<s?"exit-top":"exit-bottom");a!==n&&(r.setProperty("is-inview",a),this.events.emit(r.getScopedEventName("object:inview"),{inView:a,direction:l}),a?r.show():r.hide())}updateInviewWindow(r){let e=this.data.viewport.windowHeight,t=r-e,i=r+this.data.viewport.windowHeight+e;for((this.inviewIndexDirty||r<this.lastInviewScrollPos)&&this.rebuildInviewIndex(t,i);this.inviewStartIdx<this.inviewStarts.length&&this.inviewStarts[this.inviewStartIdx].pos<=i;)this.inviewActive.add(this.inviewStarts[this.inviewStartIdx].object),this.inviewStartIdx++;for(;this.inviewEndIdx<this.inviewEnds.length&&this.inviewEnds[this.inviewEndIdx].pos<t;)this.inviewActive.delete(this.inviewEnds[this.inviewEndIdx].object),this.inviewEndIdx++;this.lastInviewScrollPos=r}rebuildInviewIndex(r,e){this.inviewStarts=[],this.inviewEnds=[];for(let t of this.objects.values()){let i=t.getProperty("inview-start-position"),n=t.getProperty("inview-end-position");i==null||n==null||(this.inviewStarts.push({pos:Math.min(i,n),object:t}),this.inviewEnds.push({pos:Math.max(i,n),object:t}))}this.inviewStarts.sort((t,i)=>t.pos-i.pos),this.inviewEnds.sort((t,i)=>t.pos-i.pos),this.inviewActive.clear(),this.inviewStartIdx=this.upperBound(this.inviewStarts,e),this.inviewEndIdx=this.upperBound(this.inviewEnds,r-1);for(let t=0;t<this.inviewStartIdx;t++)this.inviewActive.add(this.inviewStarts[t].object);for(let t=0;t<this.inviewEndIdx;t++)this.inviewActive.delete(this.inviewEnds[t].object);this.inviewIndexDirty=!1}upperBound(r,e){let t=0,i=r.length;for(;t<i;){let n=t+i>>>1;r[n].pos<=e?t=n+1:i=n}return t}splitPipeAndTrim(r){let e=r.split("|"),t=[];for(let i=0;i<e.length;i++){let n=e[i].trim();n.length>0&&t.push(n)}return t}destroy(){this.domObserver?.disconnect(),this.domObserver=null,this.domBatcher.clear()}};var te={SCROLL_FORWARD:"-scroll-forward",SCROLL_BACKWARD:"-scroll-backward",SCROLLING_FORWARD:"-scrolling-forward",SCROLLING_BACKWARD:"-scrolling-backward"};var $=class{constructor(r){this.name="";this.isProg=!1;this.isParallaxEnabled=!1;this._scrollDirection="vertical";this.isBottomScrollDirection=null;this.isLastBottomScrollDirection=!0;this.scrollTriggerRules=[];this.isActive=!1;this.lastAppliedDirection=null;this.onChangeDirection=()=>{};this.onScrollStart=()=>{};this.onScrollStop=()=>{};this.onCalcUpdate=()=>{this.isActive&&(this.context.data.scroll.scrollContainer?.scrollTo(0,this.context.data.scroll.current),this.triggerScrollRules())};this.document=document,this.context=r}set scrollDirection(r){this._scrollDirection=r,this._scrollDirection==="vertical"?this.onCalcUpdate=()=>{this.isActive&&(this.context.data.scroll.scrollContainer?.scrollTo(0,this.context.data.scroll.current),this.triggerScrollRules())}:this._scrollDirection==="horizontal"&&(this.onCalcUpdate=()=>{this.isActive&&this.context.data.scroll.scrollContainer?.scrollTo(this.context.data.scroll.current,0)})}onFrame(){}onWheel(r){}onScroll(r){}disableScrollEvents(){}enableScrollEvents(){}activate(){this.isActive||(this.isActive=!0,this.enableScrollEvents())}deactivate(){this.isActive&&(this.isActive=!1,this.disableScrollEvents(),this.isProg=!1,this.context.data.scroll.target=this.context.data.scroll.current,this.context.data.scroll.delta=0,this.context.data.scroll.lerped=0,this.context.data.scroll.displacement=0,this.clearScrollingClasses(),this.isBottomScrollDirection=null,this.lastAppliedDirection=null,this.onScrollStop())}destroy(){}updateScrollDirection(r){if(this.isLastBottomScrollDirection=r,this.isBottomScrollDirection===null){this.isBottomScrollDirection=r;return}this.context.data.scroll.isScrollingDown=r,this.onChangeDirection(),this.context.events.emit("scroll:direction:change",this.context.data.scroll.isScrollingDown),this.context.settings["global-class"]&&this.lastAppliedDirection!==r&&(document.documentElement.classList.toggle(te.SCROLLING_FORWARD,r),document.documentElement.classList.toggle(te.SCROLLING_BACKWARD,!r),document.documentElement.classList.toggle(te.SCROLL_FORWARD,r),document.documentElement.classList.toggle(te.SCROLL_BACKWARD,!r),this.lastAppliedDirection=r)}clearScrollingClasses(){document.documentElement.classList.remove(te.SCROLLING_BACKWARD,te.SCROLLING_FORWARD)}triggerScrollRules(){this.scrollTriggerRules.forEach(r=>{let e=(r.direction==="any"||this.isLastBottomScrollDirection&&r.direction==="forward")&&this.context.data.scroll.current>=r.offset;e&&!r.isActive?(r.onEnter?.(),r.toggleClass&&r.toggleClass.target.classList.add(r.toggleClass.className),r.isActive=!0):!e&&r.isActive&&(r.onLeave?.(),r.toggleClass&&r.toggleClass.target.classList.remove(r.toggleClass.className),r.isActive=!1)})}addScrollMark(r){this.scrollTriggerRules.push(r)}removeScrollMark(r){this.scrollTriggerRules=this.scrollTriggerRules.filter(e=>e.id!==r)}scrollTo(r,e){}};var Fe=class extends ${constructor(e){super(e);this.name="default";this.previousScrollTop=0;this.isScrolling=!1;this.lastScrollEventTime=0;this.scrollStopDelay=120}onFrame(){if(this.context.data.scroll.delta!==0){let e=this.context.data.scroll.delta*this.context.data.scroll.speedAccelerate;this.context.data.scroll.delta-=e,this.context.data.scroll.lerped=e,Math.abs(this.context.data.scroll.lerped)<.1&&(this.context.data.scroll.delta=0,this.context.data.scroll.lerped=0,this.isScrolling&&(this.isScrolling=!1,this.onScrollStop(),this.clearScrollingClasses()))}this.isScrolling&&performance.now()-this.lastScrollEventTime>this.scrollStopDelay&&(this.isScrolling=!1,this.onScrollStop(),this.clearScrollingClasses())}onScroll(e){let t=this.context.data.scroll.elementContainer.scrollTop;this.context.data.scroll.current=t,this.context.data.scroll.target=t,this.context.data.scroll.transformedCurrent=t,t!==this.previousScrollTop&&(this.updateScrollDirection(t>this.previousScrollTop),this.previousScrollTop=t),this.lastScrollEventTime=performance.now(),this.isScrolling||(this.isScrolling=!0,this.onScrollStart())}onWheel(e){if(e.deltaY!==0){this.context.data.scroll.delta===0&&!this.isScrolling&&(this.isScrolling=!0,this.onScrollStart());let t=e.deltaY;this.context.data.scroll.target===0&&(this.context.data.scroll.delta+=Math.max(0,e.deltaY)),this.context.data.scroll.delta+=t,this.lastScrollEventTime=performance.now()}}deactivate(){super.deactivate(),this.isScrolling=!1,this.lastScrollEventTime=0,this.previousScrollTop=this.context.data.scroll.current}scrollTo(e,t){this.context.data.scroll.target=e,this.context.data.scroll.current=e,this.context.data.scroll.delta=0,this.context.data.scroll.lerped=0,this._scrollDirection==="vertical"?this.context.data.scroll.scrollContainer?.scrollTo({top:e,left:0,behavior:t?"auto":"smooth"}):this.context.data.scroll.scrollContainer?.scrollTo({left:e,top:0,behavior:t?"auto":"smooth"})}};var He=class extends ${constructor(e){super(e);this.name="disable";this.preventScroll=e=>{e.preventDefault()};this.preventKeyScroll=e=>{["ArrowUp","ArrowDown","PageUp","PageDown"," ","Home","End"].includes(e.key)&&e.preventDefault()};this.onPreventScroll=this.preventScroll.bind(this);this.onPreventKeyScroll=this.preventKeyScroll.bind(this)}enableScrollEvents(){window.addEventListener("touchmove",this.onPreventScroll,{passive:!1}),window.addEventListener("keydown",this.onPreventKeyScroll)}disableScrollEvents(){window.removeEventListener("touchmove",this.onPreventScroll),window.removeEventListener("keydown",this.onPreventKeyScroll)}onFrame(){}onWheel(e){e.preventDefault()}onScroll(e){e.preventDefault()}};var Ne=class extends ${constructor(e){super(e);this.name="smooth";this.isScrollbarManipulation=!1;this.scrollForce=0;this.wheelImpulse=0;this.previousCurrent=0;this.velocityThreshold=.1;this.stepResult={current:0,target:0,delta:0,lerped:0,scrollForce:0,absVelocity:0}}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(),this.clearScrollingClasses(),this.isBottomScrollDirection=null,this.lastAppliedDirection=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}this.context.data.scroll.delta!==0&&(this.computeStep(this.context.data.scroll.current,this.context.data.scroll.target,this.context.data.scroll.delta,this.context.data.scroll.speed,this.context.data.scroll.speedAccelerate,this.context.data.scroll.bottomPosition,this.stepResult),this.scrollForce=this.stepResult.scrollForce,this.context.data.scroll.target=this.stepResult.target,this.context.data.scroll.delta=this.stepResult.delta,this.context.data.scroll.lerped=this.stepResult.lerped,this.context.data.scroll.current=this.stepResult.current,this.context.data.scroll.transformedCurrent=this.context.data.scroll.current*this.context.data.viewport.transformScale,this.updateScrollDirection(this.context.data.scroll.lerped>0),this.stepResult.absVelocity<this.velocityThreshold?(this.stopScroll(),this.onScrollStop()):(this.isProg=!0,this.previousCurrent!==this.context.data.scroll.current&&(this.previousCurrent=this.context.data.scroll.current,this.onCalcUpdate())))}onWheel(e){if(e.deltaY!==0&&e.preventDefault(),this.wheelImpulse=e.deltaY,this.wheelImpulse===0)return;this.context.data.scroll.delta===0&&this.onScrollStart();let t=Math.sign(this.wheelImpulse),i=this.context.data.scroll.target===0&&t<0,n=this.context.data.scroll.target===this.context.data.scroll.bottomPosition&&t>0;i||n||(this.context.data.scroll.delta+=this.wheelImpulse)}onScroll(e){this.isProg||(this.isScrollbarManipulation=!0)}deactivate(){super.deactivate(),this.isScrollbarManipulation=!1,this.scrollForce=0,this.wheelImpulse=0,this.previousCurrent=this.context.data.scroll.current}scrollTo(e,t){if(t){this.context.data.scroll.current=e,this.context.data.scroll.target=e,this.context.data.scroll.delta=0,this.context.data.scroll.lerped=0,this.context.data.scroll.transformedCurrent=this.context.data.scroll.current*this.context.data.viewport.transformScale,this.onCalcUpdate();return}this.context.data.scroll.target=e,this.context.data.scroll.delta=1}computeStep(e,t,i,n,s,o,a){let l=i*s,c=Math.min(Math.max(0,t+l),o),d=i-l,h=(c-e)*n,p=h>0?Math.ceil(e+h):Math.floor(e+h);a.current=p,a.target=c,a.delta=d,a.lerped=h,a.scrollForce=l,a.absVelocity=Math.abs(h)}};var We=class{constructor(r){this.context=r;this.modes=new Map;this.boundEvents=null;this.scrollMarks=[];this.registerMode("smooth",new Ne(r)),this.registerMode("default",new Fe(r)),this.registerMode("disable",new He(r)),this.updateResponsiveMode()}registerMode(r,e){let t=this.context.data.scroll.mode===r,i=this.modes.get(r);i&&(t&&i.deactivate(),i.destroy()),e.name||(e.name=String(r)),this.modes.set(r,e),this.boundEvents&&(e.onScrollStart=this.boundEvents.onScrollStart,e.onScrollStop=this.boundEvents.onScrollStop,e.onChangeDirection=this.boundEvents.onDirectionChange),this.scrollMarks.length>0&&this.scrollMarks.forEach(n=>e.addScrollMark(n)),t&&e.activate()}setMobileMode(r){this.context.data.scroll.modeMobile=r,this.updateResponsiveMode()}setDesktopMode(r){this.context.data.scroll.modeDesktop=r,this.updateResponsiveMode()}updateResponsiveMode(){let e=window.innerWidth<1024?this.context.data.scroll.modeMobile:this.context.data.scroll.modeDesktop;this.setMode(e)}updatePosition(){this.modes.forEach(r=>{r.onCalcUpdate()})}setMode(r){if(!this.modes.has(r)){console.warn(`[ScrollManager] Unknown scroll mode: ${r}`);return}if(this.context.data.scroll.mode===r){this.get().activate();return}this.get().deactivate(),this.context.data.scroll.mode=r,this.get().activate()}get(){return this.modes.get(this.context.data.scroll.mode)}getEngines(){return this.modes}onFrame(){this.get().onFrame()}onScroll(r){this.get().onScroll(r)}onWheel(r){this.get().onWheel(r)}bindEvents(r){this.boundEvents=r,this.modes.forEach(e=>{e.onScrollStart=r.onScrollStart,e.onScrollStop=r.onScrollStop,e.onChangeDirection=r.onDirectionChange})}addScrollMark(r){this.scrollMarks.push(r),this.modes.forEach(e=>{e.addScrollMark(r)})}removeScrollMark(r){this.scrollMarks=this.scrollMarks.filter(e=>e.id!==r),this.modes.forEach(e=>{e.removeScrollMark(r)})}destroy(){this.modes.forEach(r=>{r.deactivate(),r.destroy()})}};var Ve=class{constructor(){this.targetX=0;this.targetY=0;this.smoothedX=0;this.smoothedY=0;this.stepX=0;this.stepY=0;this.velocityX=0;this.velocityY=0}};var _e=class{constructor(){this.threeInstance=null}};var ze=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 Be=class{constructor(){this.fpsTracker=!1;this.positionTracker=!1;this.suppressMasonryResize=!1}};var $e=class{constructor(){this.now=0;this.previous=0;this.delta=0;this.elapsed=0}};var je=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 pe=class{constructor(){this.scroll=new ze;this.viewport=new je;this.cursor=new Ve;this.render=new _e;this.time=new $e;this.system=new Be}};var me=class{process({element:r}){return r.getBoundingClientRect()}};var ge=class{process({element:r,key:e,fallback:t=null}){return r.getAttribute(`string-${e}`)??r.getAttribute(`data-string-${e}`)??t}};var fe=class{process({record:r,name:e,fallback:t=null}){return r[e]??r[`data-${e}`]??t}};var re=class{process({element:r}){let e=r.getBoundingClientRect(),i=getComputedStyle(r).transform.match(/-?[\d.]+/g)?.map(parseFloat)??[];if(i.length===6){let[n,s,o,a,l,c]=i,d=n*a-s*o;return{width:e.width/(n||1),height:e.height/(a||1),left:(e.left*a-e.top*o+o*c-l*a)/d,top:(-e.left*s+e.top*n+l*s-n*c)/d}}return e}};var be=class{constructor(r=new re){this.transformTool=r}process({element:r,container:e=document.body}){let t;try{t=e.getBoundingClientRect()}catch{t=document.body.getBoundingClientRect()}let i=this.transformTool.process({element:r});return{top:i.top-t.top,left:i.left-t.left}}};var ve=class{process({from:r,to:e,progress:t}){return(e-r)*t}};var ye=class{process({value:r,element:e,viewportHeight:t,baseRem:i,boundingRect:n}){let s=r.split("|").map(a=>a.trim()).filter(Boolean),o=0;for(let a of s){let l=a,c=!1;l.startsWith("-")&&(c=!0,l=l.slice(1));let d=0;l==="selfHeight"?d=e.offsetHeight:l.endsWith("px")?d=parseFloat(l):l.endsWith("%")?d=parseFloat(l)/100*t:l.endsWith("rem")?d=parseFloat(l)*i:l.endsWith("sh")?d=parseFloat(l)*n.height/100:d=parseFloat(l),o+=c?-d:d}return o}};var Se=class{process({value:r,inMin:e=.1,inMax:t=1,outMin:i=.05,outMax:n=.65}){if(r<e)return n;if(r>1&&(r=1),r<=t){let s=(r-e)/(t-e);return n-s*(n-i)}return i}};var X={left:0,center:.5,right:1},G={top:0,center:.5,bottom:1},Me=class{process({value:r}){if(!r)return"center";let e=r.trim();if(e.startsWith("random(")&&e.endsWith(")")){let t=e.slice(7,-1).split(",").map(n=>n.trim()).filter(Boolean),i=Math.floor(Math.random()*t.length);return t[i]}return e}toNormalized({value:r}){let t=this.process({value:r}).toLowerCase().split(/\s+/).filter(Boolean);if(t.length===0)return{x:.5,y:.5};if(t.length===1){let a=t[0],l=this.parseValue(a);return a in X&&!(a in G)?{x:l,y:.5}:a in G&&!(a in X)?{x:.5,y:l}:{x:l,y:l}}let[i,n]=t,s=i in G&&!(i in X),o=n in X&&!(n in G);return s||o?{x:this.parseValue(n,"horizontal"),y:this.parseValue(i,"vertical")}:{x:this.parseValue(i,"horizontal"),y:this.parseValue(n,"vertical")}}parseValue(r,e){if(e==="horizontal"&&r in X)return X[r];if(e==="vertical"&&r in G)return G[r];if(r in X)return X[r];if(r in G)return G[r];if(r.endsWith("%")){let i=parseFloat(r);if(!isNaN(i))return i/100}let t=parseFloat(r);return isNaN(t)?.5:t>1?t/100:t}};var Ee=class{process({value:r}){let e=r.trim().toLowerCase();if(e.startsWith("#")){let n=e.slice(1);n.length===3&&(n=n.split("").map(c=>c+c).join(""));let s=parseInt(n.slice(0,2),16),o=parseInt(n.slice(2,4),16),a=parseInt(n.slice(4,6),16),l=n.length===8?parseInt(n.slice(6,8),16)/255:1;return{r:s,g:o,b:a,a:l}}let t=e.match(/rgba?\(([^)]+)\)/);if(t){let[n,s,o,a=1]=t[1].split(",").map(l=>parseFloat(l.trim()));return{r:n,g:s,b:o,a}}let i=e.match(/hsla?\(([^)]+)\)/);if(i){let[n,s,o,a="1"]=i[1].split(",").map(h=>h.trim()),[l,c,d]=this.hslToRgb(parseFloat(n),parseFloat(s),parseFloat(o));return{r:l,g:c,b:d,a:parseFloat(a)}}return{r:0,g:0,b:0,a:0}}hslToRgb(r,e,t){r=r/360,e=parseFloat(e.toString())/100,t=parseFloat(t.toString())/100;let i=(c,d,h)=>(h<0&&(h+=1),h>1&&(h-=1),h<1/6?c+(d-c)*6*h:h<1/2?d:h<2/3?c+(d-c)*(2/3-h)*6:c),n=t<.5?t*(1+e):t+e-t*e,s=2*t-n,o=Math.round(i(s,n,r+1/3)*255),a=Math.round(i(s,n,r)*255),l=Math.round(i(s,n,r-1/3)*255);return[o,a,l]}};var xe=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:r}){let e=r.trim();if(this.namedCurves[e])return this.cubicBezier(...this.namedCurves[e]);let t=e.match(/^cubic-bezier\s*\(\s*([-+]?\d*\.?\d+)\s*,\s*([-+]?\d*\.?\d+)\s*,\s*([-+]?\d*\.?\d+)\s*,\s*([-+]?\d*\.?\d+)\s*\)$/);if(t){let[i,n,s,o]=t.slice(1).map(Number);return this.cubicBezier(i,n,s,o)}return i=>i}cubicBezier(r,e,t,i){let n=3*r,s=3*(t-r)-n,o=1-n-s,a=3*e,l=3*(i-e)-a,c=1-a-l;function d(m){return((o*m+s)*m+n)*m}function h(m){return((c*m+l)*m+a)*m}function p(m){return(3*o*m+2*s)*m+n}function b(m,g=1e-5){let v,y,f=m,S,E,T;for(T=0;T<8;T++){if(S=d(f)-m,Math.abs(S)<g)return f;if(E=p(f),Math.abs(E)<1e-6)break;f=f-S/E}for(v=0,y=1,f=m;v<y;){if(S=d(f)-m,Math.abs(S)<g)return f;S>0?y=f:v=f,f=(y+v)/2}return f}return function(m){return h(b(m))}}};var we=class{process({distance:r,radius:e,strength:t}){if(r>=e)return 0;let i=(e-r)/e;return t*i}};var Te=class{process({from:r,to:e,progress:t}){return{r:r.r+(e.r-r.r)*t,g:r.g+(e.g-r.g)*t,b:r.b+(e.b-r.b)*t,a:r.a+(e.a-r.a)*t}}};var Ce=class{process({from:r,to:e,progress:t}){return{x:(e.x-r.x)*t,y:(e.y-r.y)*t}}};var Pe=class{process({value:r}){let t=r?.trim();if(!t||t==="none")return 1;try{if(t.startsWith("matrix(")){let i=t.match(/matrix\(([^)]+)\)/);if(i&&i[1]){let n=i[1].split(",").map(s=>parseFloat(s.trim()));if(n.length>=1&&!isNaN(n[0]))return n[0]}}if(t.startsWith("scale(")){let i=t.match(/scale\(([^)]+)\)/);if(i&&i[1]){let n=i[1].split(",").map(s=>parseFloat(s.trim()));if(n.length>=1&&!isNaN(n[0]))return n[0]}}if(t.startsWith("scaleX(")){let i=t.match(/scaleX\(([^)]+)\)/);if(i&&i[1]){let n=parseFloat(i[1].trim());if(!isNaN(n))return n}}if(t.startsWith("scale3d(")){let i=t.match(/scale3d\(([^)]+)\)/);if(i&&i[1]){let n=i[1].split(",").map(s=>parseFloat(s.trim()));if(n.length>=1&&!isNaN(n[0]))return n[0]}}if(t.startsWith("matrix3d(")){let i=t.match(/matrix3d\(([^)]+)\)/);if(i&&i[1]){let n=i[1].split(",").map(s=>parseFloat(s.trim()));if(n.length>=1&&!isNaN(n[0]))return n[0]}}}catch(i){return console.error(`Error parsing transform string "${t}":`,i),1}return 1}};var qe=class{process({attributeValue:r}){let e={line:[],word:[],char:[],charLine:[],charWord:[],wordLine:[],fit:!1};return r&&r.split("|").forEach(i=>{let n=i.trim();if(!n)return;let s=n.match(/^(\w+-)?(\w+)(\[(.*?)\])?$/);if(s){let o=s[1]||"",a=s[2],l=this.toCamelCase(o+a),d=(s[4]||"").split(";").map(p=>p.trim()).filter(p=>p.length>0),h=this.parseParamsArray(d);switch(l){case"line":e.line.push(h);break;case"word":e.word.push(h);break;case"char":e.char.push(h);break;case"charLine":e.charLine.push(h);break;case"charWord":e.charWord.push(h);break;case"wordLine":e.wordLine.push(h);break;case"fit":e.fit=!0;break;default:console.warn(`SplitOptionsParserTool: Unrecognized option type "${l}" in part "${n}"`);break}}else console.warn(`SplitOptionsParserTool: Could not parse part format "${n}"`)}),e}toCamelCase(r){return r.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}parseParamsArray(r){let e={align:"start"};return r.forEach(t=>{if(t==="abs")e.abs=!0;else if(t.startsWith("random")){e.align="random";let i=t.match(/random\(\s*(\d+)\s*,\s*(\d+)\s*\)/);i&&(e.random={min:parseInt(i[1],10),max:parseInt(i[2],10)})}else["start","center","end"].includes(t)&&(e.align=t)}),e}};var Le=class{process({value:r}){let e=[],t="",i=0;for(let n=0;n<r.length;n++){let s=r[n];s==="("&&i++,s===")"&&i--,s==="|"&&i===0?(t.trim()&&e.push(t.trim()),t=""):t+=s}return t.trim()&&e.push(t.trim()),e.map(n=>{let s=n.match(/^(\w+)(?:\((.*)\))?$/);if(s){let[,a,l]=s;return l?{key:a,params:l.split(",").map(c=>c.trim())}:{key:a}}let o=n.indexOf(":");if(o!==-1){let a=n.slice(0,o).trim(),l=n.slice(o+1).trim(),c=l?l.split(",").map(d=>d.trim()):void 0;return{key:a,params:c}}return{key:n}})}};var Ue=class{constructor(){this.inputValidators={required:r=>r!=null&&String(r).trim()!=="",min:(r,e)=>typeof r=="string"&&r.length>=Number(e?.[0]??0),max:(r,e)=>typeof r=="string"&&r.length<=Number(e?.[0]??Number.MAX_SAFE_INTEGER),checked:r=>{if(Array.isArray(r))return r.length>0;if(r===!0||r==="true"||r===1||r==="1")return!0;if(typeof r=="string"){let e=r.trim().toLowerCase();return e==="false"||e==="0"?!1:e.length>0}return!!r},email:r=>typeof r=="string"&&/^[^\s@]+@([a-z0-9-]+\.)+[a-z]{2,}$/i.test(r),phone:r=>{if(typeof r!="string")return!1;let e=r.trim();if(e===""||!/^[0-9()\s+-.]+$/.test(e))return!1;let t=e.replace(/\D/g,"").length;return t>=7&&t<=15},number:r=>typeof r=="string"&&/^-?\d+(\.\d+)?$/.test(r),integer:r=>typeof r=="string"&&/^-?\d+$/.test(r),url:r=>typeof r=="string"&&/^(https?:\/\/)?([\w\-]+\.)+[\w\-]+(\/[\w\-._~:\/?#[\]@!$&'()*+,;=]*)?$/.test(r),regex:(r,e)=>this.testByRegex(r,e?.[0]),alpha:r=>this.testByRegex(r,"^[A-Za-z]+$",!0),alpha_num:r=>this.testByRegex(r,"^[A-Za-z0-9]+$",!0),alpha_dash:r=>this.testByRegex(r,"^[A-Za-z0-9_-]+$",!0),same:(r,e,t)=>{let i=e?.[0],n=this.getContextValue(t,i);return i&&n===void 0?!1:this.areValuesEqual(r,n)},different:(r,e,t)=>{let i=e?.[0],n=this.getContextValue(t,i);return i&&n===void 0?!1:!this.areValuesEqual(r,n)},range:(r,e)=>{if(r==null||r==="")return!0;let t=Number(r),i=Number(e?.[0]),n=Number(e?.[1]);return Number.isNaN(t)||Number.isNaN(i)||Number.isNaN(n)?!1:t>=i&&t<=n},digits:(r,e)=>{if(typeof r!="string")return!1;let t=Number(e?.[0]??0);return t<=0?!1:new RegExp(`^\\d{${t}}$`).test(r)},ip:r=>typeof r=="string"&&(this.isIPv4(r)||this.isIPv6(r)),mimes:(r,e)=>this.validateMimes(r,e),max_size:(r,e)=>{let t=Number(e?.[0]);return!t||t<=0?!0:this.validateMaxSize(r,t)},after:(r,e,t)=>this.compareDates(r,e,t,"after"),before:(r,e,t)=>this.compareDates(r,e,t,"before")};this.beforeInputValidators={number:r=>/^-?\d*\.?\d*$/.test(r),integer:r=>/^-?\d*$/.test(r),email:r=>/^[\w@.\-+]*$/.test(r),phone:r=>/^[0-9()\s+-.]*$/.test(r),letters:r=>/^[a-zA-Z]*$/.test(r),lettersSpaces:r=>/^[a-zA-Z\s]*$/.test(r),lettersNumbers:r=>/^[a-zA-Z0-9]*$/.test(r),alpha:r=>/^[A-Za-z]*$/.test(r),alpha_num:r=>/^[A-Za-z0-9]*$/.test(r),alpha_dash:r=>/^[A-Za-z0-9_-]*$/.test(r),digits:(r,e)=>{let t=Number(e?.[0]??0);return t<=0?/^\d*$/.test(r):new RegExp(`^\\d{0,${t}}$`).test(r)},url:r=>/^[a-zA-Z0-9\-._~:\/?#\[\]@!$&'()*+,;=%]*$/.test(r),pattern:(r,e)=>{try{return new RegExp(e?.[0]||"").test(r)}catch{return!0}}}}process({rules:r,value:e,type:t="input",context:i}){let n=[];for(let c of r){var s=null,o=null,a=!0,l=!0;t=="input"&&(o=this.inputValidators[c.key],!o)||t=="beforeinput"&&(s=this.beforeInputValidators[c.key],!s)||(o&&(a=o(e,c.params,i)),s&&(l=s(e,c.params,i)),l||n.push(this.getErrorMessage(c.key,c.params)),a||n.push(this.getErrorMessage(c.key,c.params)))}return{valid:n.length===0,errors:n}}getErrorMessage(r,e){switch(r){case"required":return"This field is required";case"email":return"Invalid email address";case"min":return`Minimum ${e?.[0]} characters`;case"max":return`Maximum ${e?.[0]} characters`;case"phone":return"Invalid phone number";case"number":return"Only numbers are allowed";case"integer":return"Only whole numbers are allowed";case"url":return"Invalid URL address";case"checked":return"You must accept";case"regex":return"Value does not match the required pattern";case"alpha":return"Only letters are allowed";case"alpha_num":return"Only letters and numbers are allowed";case"alpha_dash":return"Only letters, numbers, dashes, and underscores are allowed";case"same":return"Values do not match";case"different":return"Values must be different";case"range":return`Value must be between ${e?.[0]} and ${e?.[1]}`;case"digits":return`Value must contain exactly ${e?.[0]} digits`;case"ip":return"Invalid IP address";case"mimes":return`Allowed file types: ${e?.join(", ")}`;case"max_size":return`File must be smaller than ${e?.[0]} KB`;case"after":return`Date must be after ${e?.[0]}`;case"before":return`Date must be before ${e?.[0]}`;default:return"Invalid value"}}validateMimes(r,e){if(!e||e.length===0)return!0;let t=this.extractFiles(r);if(t.length===0)return!0;let i=e.map(n=>n.trim().toLowerCase());return t.every(n=>this.isMimeAllowed(n,i))}validateMaxSize(r,e){let t=this.extractFiles(r);if(t.length===0)return!0;let i=e*1024;return t.every(n=>typeof n.size!="number"?!0:n.size<=i)}extractFiles(r){if(!r)return[];let e=[];return typeof File<"u"&&r instanceof File?(e.push(r),e):typeof FileList<"u"&&r instanceof FileList?Array.from(r):Array.isArray(r)?(r.forEach(t=>{e.push(...this.extractFiles(t))}),e):typeof r=="object"&&("name"in r||"size"in r||"type"in r)?(e.push(r),e):(typeof r=="string"&&r!==""&&e.push({name:r}),e)}isMimeAllowed(r,e){let t=(r.type||"").toLowerCase(),i=this.getFileExtension(r.name);return e.some(n=>{let s=n.replace(/^\./,"").toLowerCase();return s?s.includes("/")?t===s:i===s:!1})}getFileExtension(r){if(!r)return"";let e=r.split(".");return e.length<=1?"":(e.pop()||"").toLowerCase()}compareDates(r,e,t,i){if(r==null||r==="")return!0;let n=e?.[0];if(!n)return!0;let s=this.toDate(r),o=this.resolveDateReference(n,t);return!s||!o?!1:i==="after"?s.getTime()>o.getTime():s.getTime()<o.getTime()}resolveDateReference(r,e){let t=this.getContextValue(e,r);if(t!==void 0)return this.toDate(t);if(r.toLowerCase()==="now")return new Date;if(r.toLowerCase()==="today"){let i=new Date;return i.setHours(0,0,0,0),i}return this.toDate(r)}toDate(r){if(r==null||r==="")return null;if(r instanceof Date)return Number.isNaN(r.getTime())?null:r;if(typeof r=="number"){let e=new Date(r);return Number.isNaN(e.getTime())?null:e}if(typeof r=="string"){let e=Date.parse(r);if(!Number.isNaN(e))return new Date(e)}return null}testByRegex(r,e,t=!1){if(e==null||e==="")return!0;let i=typeof r=="string"?r:r==null?"":String(r);if(t&&i==="")return!0;try{let{source:n,flags:s}=this.normalizeRegex(e);return new RegExp(n,s).test(i)}catch{return!0}}normalizeRegex(r){let e=r.trim();if(e.startsWith("/")&&e.lastIndexOf("/")>0){let t=e.lastIndexOf("/"),i=e.slice(1,t),n=e.slice(t+1);return{source:i,flags:n}}return{source:e,flags:""}}getContextValue(r,e){if(!(!r||!e)){if(r.values&&Object.prototype.hasOwnProperty.call(r.values,e))return r.values[e];if(r.getValue)return r.getValue(e)}}areValuesEqual(r,e){return Array.isArray(r)||Array.isArray(e)?JSON.stringify(r)===JSON.stringify(e):r===e}isIPv4(r){let e=r.split(".");return e.length!==4?!1:e.every(t=>{if(!/^\d+$/.test(t))return!1;let i=Number(t);return i>=0&&i<=255})}isIPv6(r){if(!r)return!1;if(r==="::")return!0;let e=r.split("::");if(e.length>2)return!1;let t=/^[0-9a-fA-F]{1,4}$/,i=r.split(":");return e.length===2?i.every(n=>n===""||t.test(n))&&i.length<=8:i.length===8&&i.every(n=>t.test(n))}};var Dt=class{constructor(){this.pendingVars=new Map;this.pendingProps=new Map;this.isOpen=!1}canUseTypedOM(r){return"attributeStyleMap"in r&&typeof CSS<"u"&&typeof CSS.number=="function"&&typeof CSS.px=="function"}writeVar(r,e,t){let i=r.style;if(this.canUseTypedOM(r)&&typeof t=="number"&&Number.isFinite(t))try{r.attributeStyleMap.set(e,CSS.number(t));return}catch{}i.setProperty(e,String(t))}begin(){this.isOpen||(this.isOpen=!0)}setVars(r,e){if(!this.isOpen){console.warn("StyleTxn: call begin() first to set custom properties.");return}let t=this.pendingVars.get(r)??{};for(let[i,n]of Object.entries(e))t[i]!==n&&(t[i]=n);this.pendingVars.set(r,t)}setVar(r,e,t){if(!this.isOpen){console.warn("StyleTxn: call begin() first to set custom properties.");return}let i=this.pendingVars.get(r)??{};i[e]!==t&&(i[e]=t,this.pendingVars.set(r,i))}setVarDirect(r,e,t){this.writeVar(r,e,t)}setProps(r,e){if(!this.isOpen){console.warn("StyleTxn: call begin() first to set standard properties.");return}let t=this.pendingProps.get(r)??{};for(let[i,n]of Object.entries(e))t[i]!==n&&(t[i]=n);this.pendingProps.set(r,t)}setProp(r,e,t){if(!this.isOpen){console.warn("StyleTxn: call begin() first to set standard properties.");return}let i=this.pendingProps.get(r)??{};i[e]!==t&&(i[e]=t,this.pendingProps.set(r,i))}run(r){let e=this.isOpen;e||this.begin();try{r(),e||this.commit()}catch(t){throw e||this.cancel(),t}}commit(){if(this.isOpen){this.isOpen=!1;for(let[r,e]of this.pendingVars)for(let[t,i]of Object.entries(e))this.writeVar(r,t,i);this.pendingVars.clear();for(let[r,e]of this.pendingProps){let t=r.style;for(let[i,n]of Object.entries(e))t[i]=String(n)}this.pendingProps.clear()}}cancel(){this.pendingVars.clear(),this.pendingProps.clear(),this.isOpen=!1}},M=new Dt;var Ye=class{constructor(){this.domAttribute=new ge;this.recordAttribute=new fe;this.transformNullify=new re;this.boundingClientRect=new me;this.relativePosition=new be(this.transformNullify);this.unitParser=new ye;this.lerp=new ve;this.adaptiveLerp=new Se;this.originParser=new Me;this.colorParser=new Ee;this.validation=new Ue;this.easingFunction=new xe;this.magneticPull=new we;this.lerpColor=new Te;this.lerpVector=new Ce;this.transformScaleParser=new Pe;this.optionsParser=new qe;this.ruleParser=new Le;this.styleTxn=M}};function Xe(){let u=typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)").matches:!1,r=typeof navigator<"u"?(navigator.maxTouchPoints||0)>0:!1,e=typeof window<"u"?window.innerWidth<=768:!1;return u||r||e}var jt=new WeakMap,W=5e-4,le="default",It="[string-cursor],[data-string-cursor]",qt="[string-cursor-content],[data-string-cursor-content]",Rt=1/240,z=(u,r)=>{let e=Math.pow(10,r);return Math.round(u*e)/e};function fr(u){let r=jt.get(u);return r||(r={prevX:Number.NaN,prevY:Number.NaN},jt.set(u,r)),r}var Ge=class extends x{constructor(e){super(e);this.cursorPrev={x:Number.NaN,y:Number.NaN,stepX:Number.NaN,stepY:Number.NaN};this.cursorPortals=new Map;this.hoveredObjects=new Set;this.globalListenersBound=!1;this.boundBeforeUnload=()=>this.cleanupHoverTargets();this.boundPageHide=()=>this.cleanupHoverTargets();this.boundVisibilityChange=()=>{document.hidden&&this.cleanupHoverTargets()};this.enabled=!0;this.lastFrameTime=0;this.htmlKey="cursor",this.cssProperties=[{name:"--x",syntax:"<number>",initialValue:"0",inherits:!0},{name:"--y",syntax:"<number>",initialValue:"0",inherits:!0},{name:"--x-lerp",syntax:"<number>",initialValue:"0",inherits:!0},{name:"--y-lerp",syntax:"<number>",initialValue:"0",inherits:!0},{name:"--x-px",syntax:"<number>",initialValue:"0",inherits:!0},{name:"--y-px",syntax:"<number>",initialValue:"0",inherits:!0},{name:"--dx",syntax:"<number>",initialValue:"0",inherits:!0},{name:"--dy",syntax:"<number>",initialValue:"0",inherits:!0},{name:"--angle",syntax:"<number>",initialValue:"0",inherits:!0},{name:"--angle-deg",syntax:"<number>",initialValue:"0",inherits:!0}],this.permissions.mobile.rebuild.height=!1,this.permissions.mobile.rebuild.width=!1,this.permissions.mobile.rebuild.scrollHeight=!1,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:"cursor-target",type:"string",fallback:this.settings["cursor-target"]??le},{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:"cursor-enter",type:{type:"enum",values:["snap","smooth"]},fallback:"snap"},{key:"cursor-leave",type:{type:"enum",values:["snap","smooth"]},fallback:"smooth"},{key:"cursor-leave-hold",type:"boolean",fallback:!1},{key:"lerp",type:"number",fallback:this.settings.lerp,transform:t=>this.tools.adaptiveLerp.process({value:t,inMin:.1,inMax:1,outMin:.05,outMax:.65})},{key:"cursor-float",type:"number",fallback:2},{key:"cursor-vars",type:"string",fallback:""}],Xe()&&(this.enabled=!1),this.collectCursorPortals(),this.enabled&&this.bindGlobalLifecycleListeners()}initializeObject(e,t,i,n){super.initializeObject(e,t,i,n),t.setProperty("mouse-x",0),t.setProperty("mouse-y",0),t.setProperty("mouse-pixel-x",0),t.setProperty("mouse-pixel-y",0),t.setProperty("is-mouse-over",!1),t.setProperty("is-mouse-move",!1),t.setProperty("__cursor-vars",this.parseCursorVars(t.getProperty("cursor-vars")));let s=i.getBoundingClientRect();t.setProperty("cached-width",s.width||i.offsetWidth||1),t.setProperty("cached-height",s.height||i.offsetHeight||1)}onResize(){super.onResize(),this.objects.forEach(e=>{let t=e.htmlElement.getBoundingClientRect();e.setProperty("cached-width",t.width||e.htmlElement.offsetWidth||1),e.setProperty("cached-height",t.height||e.htmlElement.offsetHeight||1)})}onMutate(e){if(!this.enabled)return;let t=performance.now(),i=this.lastFrameTime?(t-this.lastFrameTime)/1e3:.016;this.lastFrameTime=t,i>.1&&(i=.1),i<Rt&&(i=Rt);let n=this.data.cursor.targetX,s=this.data.cursor.targetY;if(this.objects.forEach(o=>{let a=o.getProperty("is-mouse-over"),l=o.getProperty("cursor-target-disable"),c=o.getProperty("lerp")??.15,d=this.getFrameAdjustedLerp(c,i),h=this.getObjectDimensions(o),{halfWidth:p,halfHeight:b,width:m,height:g}=h;if(a&&!l){let{cx:v,cy:y}=this.centers.getCenter(o),f=n-(v-p),S=s-(y-b),E=o.getProperty("mouse-pixel-x")??0,T=o.getProperty("mouse-pixel-y")??0,D=E-f,R=T-S;if(D*D+R*R>1e-4){let I=o.getProperty("is-mouse-move")??!1,O=o.getProperty("cursor-enter")??"snap",L=o.getProperty("alignment")??"center";if(!I){if(o.setProperty("is-mouse-move",!0),O==="snap")o.setProperty("mouse-pixel-x",f),o.setProperty("mouse-pixel-y",S),o.setProperty("mouse-x",f),o.setProperty("mouse-y",S),E=f,T=S;else{let Y=o.getProperty("mouse-x")??0,ne=o.getProperty("mouse-y")??0;E=this.reverseOffset(L,Y,m),T=this.reverseOffset(L,ne,g),o.setProperty("mouse-pixel-x",E),o.setProperty("mouse-pixel-y",T)}this.events.emit(this.getObjectEventName(o,"cursor:start"),null)}let H=this.tools.lerp.process({from:E,to:f,progress:d}),w=this.tools.lerp.process({from:T,to:S,progress:d}),A=E+H,F=T+w,k=Math.abs(A-E)>W||Math.abs(F-T)>W;o.setProperty("mouse-pixel-x",A),o.setProperty("mouse-pixel-y",F);let N=this.calculateOffset(L,A,m),_=this.calculateOffset(L,F,g);o.setProperty("mouse-x",N),o.setProperty("mouse-y",_),this.setMouseCoordinates(o,N,_,A,F)&&this.events.emit(this.getObjectEventName(o,"cursor:move"),{x:N,y:_}),k&&this.events.emit(this.getObjectEventName(o,"cursor:pixel"),{x:A,y:F})}else{o.setProperty("mouse-pixel-x",f),o.setProperty("mouse-pixel-y",S),o.getProperty("is-mouse-move")&&(o.setProperty("is-mouse-move",!1),this.events.emit(this.getObjectEventName(o,"cursor:end"),null));let I=o.getProperty("alignment")??"center",O=this.calculateOffset(I,f,m),L=this.calculateOffset(I,S,g);this.setMouseCoordinates(o,O,L,f,S)}}else{if(o.getProperty("cursor-leave-hold")??!1){o.getProperty("is-mouse-move")&&(o.setProperty("is-mouse-move",!1),this.events.emit(this.getObjectEventName(o,"cursor:end"),null));return}if((o.getProperty("cursor-leave")??"smooth")==="snap"){o.setProperty("is-mouse-move",!1),o.setProperty("mouse-x",0),o.setProperty("mouse-y",0),o.setProperty("mouse-pixel-x",0),o.setProperty("mouse-pixel-y",0),this.setMouseCoordinates(o,0,0,0,0);return}let f=o.getProperty("mouse-x")??0,S=o.getProperty("mouse-y")??0;if(f!==0||S!==0){o.setProperty("is-mouse-move",!1);let E=this.calculateOffset("center",p,m),T=this.calculateOffset("center",b,g),D=f+this.tools.lerp.process({from:f,to:E,progress:d}),R=S+this.tools.lerp.process({from:S,to:T,progress:d});o.setProperty("mouse-x",D),o.setProperty("mouse-y",R),Math.abs(D)<.001&&Math.abs(R)<.001?(o.setProperty("mouse-x",0),o.setProperty("mouse-y",0),o.setProperty("mouse-pixel-x",0),o.setProperty("mouse-pixel-y",0),this.setMouseCoordinates(o,0,0,0,0)):this.setMouseCoordinates(o,D,R)}}}),this.cursorPortals.size>0){let{stepX:o,stepY:a,smoothedX:l,smoothedY:c}=this.data.cursor,d=this.cursorPrev;(!Number.isFinite(d.x)||Math.abs(l-d.x)>W||Math.abs(c-d.y)>W||Math.abs(o-d.stepX)>W||Math.abs(a-d.stepY)>W)&&(this.events.emit("cursor",{stepX:o,stepY:a,x:l,y:c}),this.cursorPrev={x:l,y:c,stepX:o,stepY:a});let p=this.data.cursor.targetX,b=this.data.cursor.targetY;this.cursorPortals.forEach(m=>{m.forEach(g=>{this.updatePortalPosition(g,p,b,i)})})}}onObjectConnected(e){let t=e.htmlElement;this.centers.attach(e),e.setProperty("mouseleave",()=>{this.onMouseLeave(e)}),e.setProperty("mouseenter",()=>{this.onMouseEnter(e)}),e.setProperty("onEnterEvent",this.onEnterObject.bind(this)),e.events.on("enter",e.getProperty("onEnterEvent")),e.setProperty("onLeaveEvent",this.onLeaveObject.bind(this)),e.events.on("leave",e.getProperty("onLeaveEvent"))}getCursorClass(e){let t=e.getProperty("cursor-class");return t!=null&&t.length>0?t:null}onMouseEnter(e){if(!document.contains(e.htmlElement))return;e.setProperty("is-mouse-over",!0),this.hoveredObjects.add(e);let t=this.getCursorClass(e);this.withPortalsForObject(e,i=>{t&&i.element.classList.add(t),this.incrementPortalHover(i)}),e.htmlElement.addEventListener("mouseleave",e.getProperty("mouseleave"))}onMouseLeave(e){e.setProperty("is-mouse-over",!1),this.hoveredObjects.delete(e);let t=this.getCursorClass(e);this.withPortalsForObject(e,i=>{t&&i.element.classList.remove(t),this.decrementPortalHover(i)}),document.contains(e.htmlElement)&&e.htmlElement.removeEventListener("mouseleave",e.getProperty("mouseleave"))}onEnterObject(e){e.htmlElement.addEventListener("mouseenter",e.getProperty("mouseenter"))}onLeaveObject(e){e.htmlElement.removeEventListener("mouseenter",e.getProperty("mouseenter")),e.htmlElement.removeEventListener("mouseleave",e.getProperty("mouseleave"))}safariNavigationCleanup(e){e.getProperty("is-mouse-over")&&this.onMouseLeave(e)}onElementRemovedFromDOM(e){e.getProperty("is-mouse-over")&&this.onMouseLeave(e)}onObjectDisconnected(e){e.getProperty("is-mouse-over")&&this.onMouseLeave(e)}onDOMRebuild(){this.enabled&&this.collectCursorPortals()}onDOMMutate(e,t){this.enabled&&((this.shouldRefreshPortals(e)||this.shouldRefreshPortals(t))&&this.collectCursorPortals(),t.length>0&&this.handleRemovedNodes(t))}collectCursorPortals(){this.cursorPortals.clear(),document.querySelectorAll(It).forEach(t=>{if(!(t instanceof HTMLElement))return;let i=this.resolvePortalId(t),n=this.resolvePortalLerp(t),s=t.matches(qt)?t:t.querySelector(qt),o=this.data.cursor.targetX,a=this.data.cursor.targetY,l={id:i,element:t,content:s,prev:{x:o,y:a,stepX:0,stepY:0},hoverCount:0,showTimer:null,lerp:n},c=this.cursorPortals.get(i);c?c.push(l):this.cursorPortals.set(i,[l])})}resolvePortalId(e){let t=[e.getAttribute("data-string-cursor"),e.getAttribute("string-cursor"),e.getAttribute("data-string-cursor-id"),e.getAttribute("string-cursor-id")];for(let i of t)if(i&&i.trim().length>0)return i.trim();return le}resolvePortalLerp(e){let t=e.getAttribute("data-string-cursor-lerp")??e.getAttribute("string-cursor-lerp")??this.settings["cursor-lerp"];if(!t)return null;let i=parseFloat(t);if(!Number.isFinite(i))return null;let n=Math.min(1,Math.max(.01,i));return this.tools.adaptiveLerp.process({value:n,inMin:.1,inMax:1,outMin:.05,outMax:.65})}shouldRefreshPortals(e){for(let t of Array.from(e))if(t instanceof Element&&(t.matches(It)||t.querySelector(It)))return!0;return!1}withPortalsForObject(e,t){this.getPortalsForObject(e).forEach(n=>t(n))}getPortalsForObject(e){if(this.cursorPortals.size===0)return[];let t=this.extractPortalIds(e),i=[];if(t.forEach(n=>{if(n==="*"){this.cursorPortals.forEach(a=>{a.forEach(l=>i.push(l))});return}let s=n.length>0?n:le,o=this.cursorPortals.get(s);o&&o.forEach(a=>i.push(a))}),i.length===0){let n=this.cursorPortals.get(le)??this.cursorPortals.values().next().value;n&&n.length>0&&n.forEach(s=>i.push(s))}return i}extractPortalIds(e){if(!e)return[le];let t=e.getProperty("cursor-target");return typeof t!="string"||t.trim().length===0?[le]:t.split(/[,|]/).map(i=>i.trim()).filter(Boolean)}incrementPortalHover(e){e.hoverCount++,e.element.classList.remove("-show"),this.restartPortalShowTimer(e)}decrementPortalHover(e){e.hoverCount=Math.max(0,e.hoverCount-1),e.hoverCount===0&&(this.clearPortalShowTimer(e),e.element.classList.remove("-show"))}restartPortalShowTimer(e){if(this.clearPortalShowTimer(e),!e.element.isConnected){e.showTimer=null;return}e.element.classList.add("-show"),e.showTimer=null}clearPortalShowTimer(e){e.showTimer&&(clearTimeout(e.showTimer),e.showTimer=null)}updatePortalPosition(e,t,i,n){if(!e.element.isConnected)return;let s=e.prev,o=Number.isFinite(s.x)?s.x:t,a=Number.isFinite(s.y)?s.y:i,l=e.lerp??.1,c=this.getFrameAdjustedLerp(l,n),d=(t-o)*c,h=(i-a)*c,p=n>1e-4?n:1/60,b=d/(p*60),m=h/(p*60);if(Math.abs(d)<W&&Math.abs(h)<W)return;let g=o+d,v=a+h;this.writePortalVars(e.element,{"--x":z(g,2),"--y":z(v,2),"--x-lerp":z(b,3),"--y-lerp":z(m,3)}),s.x=g,s.y=v,s.stepX=d,s.stepY=h}handleRemovedNodes(e){this.hoveredObjects.size!==0&&Array.from(this.hoveredObjects).forEach(t=>{t.htmlElement.isConnected||this.onElementRemovedFromDOM(t)})}cleanupHoverTargets(){this.hoveredObjects.size!==0&&Array.from(this.hoveredObjects).forEach(e=>this.safariNavigationCleanup(e))}bindGlobalLifecycleListeners(){this.globalListenersBound||(window.addEventListener("beforeunload",this.boundBeforeUnload),window.addEventListener("pagehide",this.boundPageHide),document.addEventListener("visibilitychange",this.boundVisibilityChange),this.globalListenersBound=!0)}unbindGlobalLifecycleListeners(){this.globalListenersBound&&(window.removeEventListener("beforeunload",this.boundBeforeUnload),window.removeEventListener("pagehide",this.boundPageHide),document.removeEventListener("visibilitychange",this.boundVisibilityChange),this.globalListenersBound=!1)}setMouseCoordinates(e,t,i,n,s){if(e.getProperty("cursor-target-style-disable"))return!1;let o=fr(e),a=e.getProperty("cursor-float")??2,l=Math.pow(10,a),c=Math.abs(t)<W&&Number.isFinite(o.prevX)&&Math.abs(o.prevX)<W?o.prevX:Math.round(t*l)/l,d=Math.abs(i)<W&&Number.isFinite(o.prevY)&&Math.abs(o.prevY)<W?o.prevY:Math.round(i*l)/l;if(Number.isFinite(o.prevX)&&Math.abs(c-o.prevX)<=W&&Number.isFinite(o.prevY)&&Math.abs(d-o.prevY)<=W)return!1;o.prevX=c,o.prevY=d;let h=e.getProperty("__cursor-vars"),p={"--x":z(c,a),"--y":z(d,a)};if(h&&h.size>0){let m=Number.isFinite(n)?n:e.getProperty("mouse-pixel-x"),g=Number.isFinite(s)?s:e.getProperty("mouse-pixel-y"),v=e.getProperty("__prev-x-px"),y=e.getProperty("__prev-y-px"),f=Number.isFinite(v)?m-v:0,S=Number.isFinite(y)?g-y:0;e.setProperty("__prev-x-px",m),e.setProperty("__prev-y-px",g);let E=f===0&&S===0?0:Math.atan2(S,f),T=E*180/Math.PI;h.has("xpx")&&(p["--x-px"]=z(m,2)),h.has("ypx")&&(p["--y-px"]=z(g,2)),h.has("dx")&&(p["--dx"]=z(f,3)),h.has("dy")&&(p["--dy"]=z(S,3)),h.has("angle")&&(p["--angle"]=z(E,4)),h.has("angle-deg")&&(p["--angle-deg"]=z(T,2))}let b=()=>{this.applyToElementAndConnects(e,m=>{M.setVars(m,p)})};return M.isOpen?b():M.run(b),!0}writePortalVars(e,t){if(M.isOpen){M.setVars(e,t);return}M.run(()=>{M.setVars(e,t)})}parseCursorVars(e){return e?new Set(e.split(/[|,]/).map(t=>t.trim().toLowerCase()).filter(t=>t.length>0)):new Set}getFrameAdjustedLerp(e,t){let i=Math.min(.99,Math.max(.001,e));if(!Number.isFinite(t)||t<=0)return i;let s=Math.max(t,Rt)*60,o=1-Math.pow(1-i,s);return Math.min(.999,Math.max(1e-4,o))}getObjectDimensions(e){let t=e.getProperty("cached-width"),i=e.getProperty("cached-height");if(typeof t=="number"&&typeof i=="number"&&t>0&&i>0){let b=t/2,m=i/2;return{width:t,height:i,halfWidth:b,halfHeight:m}}let n=e.htmlElement,s=n.offsetWidth||n.clientWidth||n.scrollWidth||1,o=n.offsetHeight||n.clientHeight||n.scrollHeight||1,a=e.getProperty("half-width"),l=e.getProperty("half-height"),c=typeof a=="number"&&Number.isFinite(a)?a:s/2,d=typeof l=="number"&&Number.isFinite(l)?l:o/2,h=c>0?c*2:s,p=d>0?d*2:o;return e.setProperty("cached-width",h),e.setProperty("cached-height",p),{width:h,height:p,halfWidth:c,halfHeight:d}}calculateOffset(e,t,i){switch(e){case"start":return t/i;case"end":return(t-i)/i;case"center":default:return(t-i/2)/(i/2)}}reverseOffset(e,t,i){switch(e){case"start":return t*i;case"end":return t*i+i;case"center":default:return t*(i/2)+i/2}}removeObject(e){if(!this.enabled)return super.removeObject(e);let t=this.objectMapOnPage.get(e);t&&this.centers.detach(t),super.removeObject(e)}destroy(){this.unbindGlobalLifecycleListeners(),this.hoveredObjects.clear(),super.destroy()}};var Ke=class extends x{constructor(e){super(e);this.originObservers=new WeakMap;this.htmlKey="impulse",this.cssProperties=[{name:"--push-x",syntax:"<number>",initialValue:"0",inherits:!0},{name:"--push-y",syntax:"<number>",initialValue:"0",inherits:!0},{name:"--push-rotation",syntax:"<number>",initialValue:"0",inherits:!0}],this.attributesToMap.push({key:"position-strength",type:"number",fallback:this.settings["position-strength"]},{key:"position-tension",type:"number",fallback:this.settings["position-tension"]},{key:"position-friction",type:"number",fallback:this.settings["position-friction"]},{key:"position-max-velocity",type:"number",fallback:this.settings["position-max-velocity"]},{key:"position-update-threshold",type:"number",fallback:this.settings["position-update-threshold"]},{key:"rotation-strength",type:"number",fallback:this.settings["rotation-strength"]},{key:"rotation-tension",type:"number",fallback:this.settings["rotation-tension"]},{key:"rotation-friction",type:"number",fallback:this.settings["rotation-friction"]},{key:"rotation-max-angular-velocity",type:"number",fallback:this.settings["rotation-max-angular-velocity"]},{key:"rotation-max-angle",type:"number",fallback:this.settings["rotation-max-angle"]},{key:"rotation-update-threshold",type:"number",fallback:this.settings["rotation-update-threshold"]},{key:"max-offset",type:"number",fallback:this.settings["max-offset"]},{key:"sleep-epsilon",type:"number",fallback:this.settings["sleep-epsilon"]},{key:"continuous-push",type:"boolean",fallback:this.settings["continuous-push"]},{key:"rotation-origin",type:"string",fallback:this.settings["rotation-origin"]??"center center"})}onObjectConnected(e){super.onObjectConnected(e),e.setProperty("offset-x",0),e.setProperty("offset-y",0),e.setProperty("velocity-x",0),e.setProperty("velocity-y",0),e.setProperty("angle-deg",0),e.setProperty("ang-vel-deg",0),e.setProperty("__prev-css-x",0),e.setProperty("__prev-css-y",0),e.setProperty("__prev-css-rot",0),e.setProperty("__push-latch",!1),e.setProperty("__rotate-latch",!1),this.cacheRotationOrigin(e),this.observeRotationOrigin(e),this.hover.track(e),this.centers.attach(e)}onObjectDisconnected(e){this.hover.untrack(e),this.centers.detach(e);let t=this.originObservers.get(e);t&&(t.disconnect(),this.originObservers.delete(e))}onMouseMove(e){if(!e)return;let t=this.data.cursor.velocityX,i=this.data.cursor.velocityY;if(t===0&&i===0)return;let n=this.data.cursor.targetX,s=this.data.cursor.targetY;for(let o of this.objects){let a=o.htmlElement.getBoundingClientRect();if(n>=a.left&&n<=a.right&&s>=a.top&&s<=a.bottom){{let h=a.width||1,p=Math.max(0,Math.min(1,(this.data.cursor.targetX-a.left)/h));this.events.emit(this.getObjectEventName(o,"object:impulse","side"),{value:p})}let c=o.getProperty("position-strength")||0;if(c!==0){let h=o.getProperty("continuous-push")??!0,p=o.getProperty("__push-latch")===!0;if(h||!p){let b=o.getProperty("velocity-x")||0,m=o.getProperty("velocity-y")||0;b+=t*c,m+=i*c,o.setProperty("velocity-x",b),o.setProperty("velocity-y",m),h||o.setProperty("__push-latch",!0)}}let d=o.getProperty("rotation-strength")??.75;if(d!==0){let h=o.getProperty("continuous-push")??!0,p=o.getProperty("__rotate-latch")===!0;if(h||!p){let{centerX:b,centerY:m}=this.getRotationOriginFromRect(o,a),g=n-b,v=s-m,y=g*i-v*t,f=o.getProperty("ang-vel-deg")||0;f+=y*d*.02,o.setProperty("ang-vel-deg",f),h||o.setProperty("__rotate-latch",!0)}}}}}cacheRotationOrigin(e){let t=e.getProperty("rotation-origin")??"center center",{x:i,y:n}=this.tools.originParser.toNormalized({value:t});e.setProperty("__rotation-origin-x",i),e.setProperty("__rotation-origin-y",n)}observeRotationOrigin(e){let t="string-rotation-origin",i="data-string-rotation-origin",n=new MutationObserver(s=>{for(let o of s)if(o.type==="attributes"&&(o.attributeName===t||o.attributeName===i)){let a=e.htmlElement.getAttribute(t)??e.htmlElement.getAttribute(i);a!==null&&e.setProperty("rotation-origin",a),this.cacheRotationOrigin(e);break}});n.observe(e.htmlElement,{attributes:!0,attributeFilter:[t,i]}),this.originObservers.set(e,n)}getRotationOriginFromRect(e,t){let i=e.getProperty("__rotation-origin-x")??.5,n=e.getProperty("__rotation-origin-y")??.5;return{centerX:t.left+t.width*i,centerY:t.top+t.height*n}}onFrame(e){let t=this.data.cursor.targetX,i=this.data.cursor.targetY;for(let n of this.objects){let s=n.htmlElement.getBoundingClientRect(),o=t>=s.left&&t<=s.right&&i>=s.top&&i<=s.bottom;!o&&n.getProperty("__push-latch")===!0&&n.setProperty("__push-latch",!1),!o&&n.getProperty("__rotate-latch")===!0&&n.setProperty("__rotate-latch",!1)}for(let n=0;n<this.objects.length;n++){let s=this.objects[n],o=s.getProperty("offset-x")||0,a=s.getProperty("offset-y")||0,l=s.getProperty("velocity-x")||0,c=s.getProperty("velocity-y")||0,d=s.getProperty("position-tension")??.05,h=s.getProperty("position-friction")??.15,p=s.getProperty("position-max-velocity")??120,b=s.getProperty("max-offset")??220;l-=d*o,c-=d*a;let m=1-h;l*=m,c*=m,l>p?l=p:l<-p&&(l=-p),c>p?c=p:c<-p&&(c=-p),o+=l,a+=c,o>b?o=b:o<-b&&(o=-b),a>b?a=b:a<-b&&(a=-b);let g=s.getProperty("angle-deg")||0,v=s.getProperty("ang-vel-deg")||0,y=s.getProperty("rotation-tension")??.06,f=s.getProperty("rotation-friction")??.18,S=s.getProperty("rotation-max-angular-velocity")??6,E=s.getProperty("rotation-max-angle")??18;v-=y*g,v*=1-f,v>S?v=S:v<-S&&(v=-S),g+=v,g>E?(g=E,v*=.35):g<-E&&(g=-E,v*=.35);let T=s.getProperty("sleep-epsilon")??.01,D=l*l+c*c<T*T&&o*o+a*a<T*T,R=Math.abs(v)<T&&Math.abs(g)<T;D?(l||c||o||a)&&(s.setProperty("offset-x",0),s.setProperty("offset-y",0),s.setProperty("velocity-x",0),s.setProperty("velocity-y",0),o=a=l=c=0):(s.setProperty("offset-x",o),s.setProperty("offset-y",a),s.setProperty("velocity-x",l),s.setProperty("velocity-y",c)),R?(g||v)&&(s.setProperty("angle-deg",0),s.setProperty("ang-vel-deg",0),g=v=0):(s.setProperty("angle-deg",g),s.setProperty("ang-vel-deg",v));let C=s.getProperty("position-update-threshold")??.1,I=s.getProperty("rotation-update-threshold")??.15,O=s.getProperty("__prev-css-x")||0,L=s.getProperty("__prev-css-y")||0,H=s.getProperty("__prev-css-rot")||0,w=Math.round(o*10)/10,A=Math.round(a*10)/10,F=Math.round(g*10)/10,k=Math.abs(w-O)>C||Math.abs(A-L)>C,N=Math.abs(F-H)>I;(k||N)&&(s.setProperty("__next-css-x",w),s.setProperty("__next-css-y",A),s.setProperty("__next-css-rot",F)),s.setProperty("__needs-position-update",k),s.setProperty("__needs-rotation-update",N)}}onMutate(){for(let e=0;e<this.objects.length;e++){let t=this.objects[e],i=t.getProperty("__needs-position-update")===!0,n=t.getProperty("__needs-rotation-update")===!0;if(!i&&!n)continue;let s=t.getProperty("__next-css-x")||0,o=t.getProperty("__next-css-y")||0,a=t.getProperty("__next-css-rot")||0;this.applyToElementAndConnects(t,l=>{i&&(M.setVar(l,"--push-x",s),M.setVar(l,"--push-y",o)),n&&M.setVar(l,"--push-rotation",a)}),i&&(t.setProperty("__prev-css-x",s),t.setProperty("__prev-css-y",o),this.events.emit(this.getObjectEventName(t,"object:impulse","move"),{x:s,y:o})),n&&(t.setProperty("__prev-css-rot",a),this.events.emit(this.getObjectEventName(t,"object:impulse","rotate"),{rotation:a})),t.setProperty("__needs-position-update",!1),t.setProperty("__needs-rotation-update",!1)}}};var kt=class{constructor(){this.measureQueue=[];this.mutateQueue=[];this.scheduled=!1}measure(r){this.measureQueue.push(r),this.schedule()}mutate(r){this.mutateQueue.push(r),this.schedule()}schedule(){this.scheduled||(this.scheduled=!0)}flush(){if(!this.scheduled)return;let r=this.measureQueue;this.measureQueue=[];for(let t=0;t<r.length;t++)try{r[t]()}catch(i){console.error("Error in frameDOM measure task:",i)}let e=this.mutateQueue;this.mutateQueue=[];for(let t=0;t<e.length;t++)try{e[t]()}catch(i){console.error("Error in frameDOM mutate task:",i)}this.scheduled=!1}},V=new kt;var br=20,q={MANUAL_COLS_KEY:"masonry-manual-cols",MANUAL_GAP_KEY:"masonry-manual-gap",DEFAULT_DURATION:600,DEFAULT_EASING:"cubic-bezier(0.25, 1, 0.5, 1)"};function Ut(u){if(!u)return q.DEFAULT_DURATION;let r=parseFloat(u);return isNaN(r)?q.DEFAULT_DURATION:r}function Qe(u,r){let e=[...u].sort((i,n)=>n.breakpoint-i.breakpoint),t=e.find(i=>r>=i.breakpoint);return t?t.value:e[e.length-1]?.value}var Ze=class extends x{constructor(e){super(e);this.states=new WeakMap;this.htmlKey="masonry",this.attributesToMap.push({key:"masonry-cols",type:"breakpoint-dimension",fallback:"2|640:3|1024:4"},{key:"masonry-gap",type:"breakpoint-dimension",fallback:"16|640:24|1024:32"},{key:"masonry-mode",type:"string",fallback:"auto"})}parseEasing(e){return this.tools.easingFunction.process({easing:e||q.DEFAULT_EASING})}onObjectConnected(e){super.onObjectConnected(e);let t=e.htmlElement;M.begin(),M.setProps(t,{position:"relative",boxSizing:"border-box"}),M.commit();let i=this.createState(e,t);this.states.set(e,i),this.attachImgLoaders(e,i,t),this.scheduleLayout(e,!1,"init");let n=e.id;this.events.on(`masonry:update:${n}`,s=>{s.mode&&e.setProperty("masonry-mode",s.mode),s.cols!==void 0&&e.setProperty(q.MANUAL_COLS_KEY,Number(s.cols)),s.gap!==void 0&&e.setProperty(q.MANUAL_GAP_KEY,Number(s.gap)),this.scheduleLayout(e,!0,"external-event")})}onFrame(e){let t=e.time.now;this.objectsOnPage.forEach(i=>{let n=this.states.get(i);if(!n||!n.isAnimating)return;let s=0;M.run(()=>{if(n.isAnimatingHeight){let o=t-n.heightStartTime,a=Math.min(1,o/n.heightDuration),l=n.heightEase(a),c=n.startHeight+(n.targetHeight-n.startHeight)*l;M.setProps(i.htmlElement,{height:`${c}px`}),a<1?s++:n.isAnimatingHeight=!1}n.items.forEach((o,a)=>{if(!o.isMoving)return;let l=t-o.startTime,c=l*o.invPosDur,d=c>1?1:c,h=o.posEase(d);o.cx=o.sx+o.dx*h,o.cy=o.sy+o.dy*h;let p=l*o.invSizeDur,b=p>1?1:p,m=o.sizeEase(b);o.cw=o.sw+o.dw*m,M.setProps(a,{transform:`translate3d(${o.cx}px, ${o.cy}px, 0)`,...Math.abs(o.dw)>.05?{width:`${o.cw}px`}:{},willChange:"transform, width"}),d<1||b<1?s++:(o.isMoving=!1,M.setProps(a,{transform:`translate3d(${o.tx}px, ${o.ty}px, 0)`,width:`${o.tw}px`,willChange:"auto"}),o.cx=o.tx,o.cy=o.ty,o.cw=o.tw)})}),s===0&&this.handleAnimationEnd(i,n,t)})}onResize(){this.data.system.suppressMasonryResize||this.objectsOnPage.forEach(e=>{this.states.has(e)&&this.scheduleLayout(e,!0,"window-resize")})}cleanupObject(e){let t=this.states.get(e);t&&(t.ro.disconnect(),t.mo.disconnect(),t.resizeDebounceId&&clearTimeout(t.resizeDebounceId),this.states.delete(e))}createState(e,t){let i=t.getBoundingClientRect(),n=a=>{if(!a.length)return;let l=a[0].contentRect,c=this.states.get(e);if(!c||Math.abs(l.width-c.lastObservedWidth)<=.5&&Math.abs(l.height-c.lastObservedHeight)<=.5)return;c.lastObservedWidth=l.width,c.lastObservedHeight=l.height;let d=getComputedStyle(t),h=parseFloat(d.paddingLeft)||0,p=parseFloat(d.paddingRight)||0,b=l.width-h-p;if(b<=0)return;let{columns:m,gap:g}=this.getGridSettings(e),v=(b-g*(m-1))/m;m===c.lastLayoutColumns&&g===c.lastLayoutGap&&Math.abs(v-c.lastLayoutColumnWidth)<=.5||(c.resizeDebounceId&&window.clearTimeout(c.resizeDebounceId),c.resizeDebounceId=window.setTimeout(()=>{c.isResizing=!0,this.scheduleLayout(e,!0,"resize-observer"),c.isResizing=!1},br))},s=a=>{let l=this.states.get(e);if(!l)return;let c=!1;for(let d of a)d.removedNodes.length&&d.removedNodes.forEach(h=>{if(h.nodeType===1){let p=h;this.cleanupImgListeners(l,p),l.items.delete(p),c=!0}}),d.addedNodes.length&&d.addedNodes.forEach(h=>{h.nodeType===1&&(this.attachImgLoaders(e,l,h),c=!0)});c&&this.scheduleLayout(e,!0,"mutation-observer")},o={ro:new ResizeObserver(n),mo:new MutationObserver(s),isResizing:!1,lastObservedWidth:i.width,lastObservedHeight:i.height,lastLayoutColumns:0,lastLayoutGap:0,lastLayoutColumnWidth:-1,lastChildrenHash:0,lastHeightsHash:0,childIds:new WeakMap,nextChildId:1,imgUnsubs:new WeakMap,layoutScheduled:!1,items:new Map,startHeight:t.offsetHeight,targetHeight:t.offsetHeight,heightStartTime:0,heightDuration:q.DEFAULT_DURATION,heightEase:this.parseEasing(null),isAnimatingHeight:!1,isAnimating:!1,pendingHeight:void 0,pendingHeightAnimate:!1,expectedEndTime:0};return o.ro.observe(t),o.mo.observe(t,{childList:!0}),o}handleAnimationEnd(e,t,i){if(t.pendingHeight!==void 0){let n=t.pendingHeight,s=t.pendingHeightAnimate;if(t.pendingHeight=void 0,t.pendingHeightAnimate=!1,s){t.startHeight=e.htmlElement.offsetHeight,t.targetHeight=n,t.heightStartTime=i,t.heightDuration=q.DEFAULT_DURATION,t.heightEase=this.parseEasing(null),t.isAnimatingHeight=!0,t.isAnimating=!0;return}M.run(()=>{M.setProps(e.htmlElement,{height:`${n}px`})})}t.isAnimating&&this.events.emit("masonry:shuffle:end",{object:e}),t.isAnimating=!1,this.objectManager.refreshLayoutForRoot(e.htmlElement),t.endTimerId&&(window.clearTimeout(t.endTimerId),t.endTimerId=void 0),requestAnimationFrame(()=>{this.events.emit("resize",!0)})}scheduleLayout(e,t,i){let n=this.states.get(e);!n||n.layoutScheduled||(n.layoutScheduled=!0,V.measure(()=>{n.layoutScheduled=!1,this.performSyncLayout(e,n,t,i)}))}performSyncLayout(e,t,i,n){let s=e.htmlElement,o=Array.from(s.children);if(o.length===0)return;let a=s.getBoundingClientRect(),l=getComputedStyle(s),c=parseFloat(l.paddingLeft)||0,d=parseFloat(l.paddingRight)||0,h=parseFloat(l.paddingTop)||0,p=a.width-c-d;if(p<=0)return;let{columns:b,gap:m}=this.getGridSettings(e),g=(p-m*(b-1))/b,y=(e.getProperty("masonry-mode")||"auto")==="auto"&&i&&!t.isResizing&&n!=="window-resize"&&n!=="resize-observer",f=b===t.lastLayoutColumns&&m===t.lastLayoutGap&&Math.abs(g-t.lastLayoutColumnWidth)<=.5,S=0;o.forEach(w=>{let A=t.childIds.get(w);A||(A=t.nextChildId++,t.childIds.set(w,A)),S=S*31+A>>>0}),t.lastLayoutColumns=b,t.lastLayoutGap=m,t.lastLayoutColumnWidth=g,t.lastChildrenHash=S;let E=new Map;i&&o.forEach(w=>{let A=t.items.get(w);A&&E.set(w,A.cw)}),M.begin(),o.forEach(w=>{M.setProps(w,{position:"absolute",top:"0",left:"0",width:`${g}px`})}),M.commit();let T=o.map(w=>w.offsetHeight),D=0;T.forEach(w=>D=D*31+Math.round(w*2)>>>0),t.lastHeightsHash=D,i&&E.size>0&&M.run(()=>{E.forEach((w,A)=>{M.setProps(A,{width:`${w}px`})})});let R=new Array(b).fill(0),C=performance.now(),I=!1,O=0;o.forEach((w,A)=>{let F=T[A],k=0,N=R[0];for(let U=1;U<b;U++)R[U]<N&&(N=R[U],k=U);let _=k*(g+m)+c,j=N+h,Y=g;R[k]=N+F+m;let ne=Ut(w.getAttribute("string-masonry-position-time")),Oe=Ut(w.getAttribute("string-masonry-size-time")),Vt=ne>0?1/ne:1e3,_t=Oe>0?1/Oe:1e3,zt=this.parseEasing(w.getAttribute("string-masonry-position-easing")),Bt=this.parseEasing(w.getAttribute("string-masonry-size-easing")),P=t.items.get(w);if(P)Math.abs(P.tx-_)+Math.abs(P.ty-j)+Math.abs(P.tw-Y)>.5&&(P.sx=P.cx,P.sy=P.cy,P.sw=P.cw,P.tx=_,P.ty=j,P.tw=Y,P.dx=P.tx-P.sx,P.dy=P.ty-P.sy,P.dw=P.tw-P.sw,P.posEase=zt,P.invPosDur=Vt,P.sizeEase=Bt,P.invSizeDur=_t,P.startTime=C,P.isMoving=!0,I=!0,O=Math.max(O,ne,Oe));else{let U=_,$t=i?j+30:j;P={sx:U,sy:$t,sw:Y,tx:_,ty:j,tw:Y,dx:0,dy:0,dw:0,cx:U,cy:$t,cw:Y,startTime:C,posEase:zt,invPosDur:Vt,sizeEase:Bt,invSizeDur:_t,isMoving:i},t.items.set(w,P),i?(P.dx=P.tx-P.sx,P.dy=P.ty-P.sy,P.dw=P.tw-P.sw,I=!0,O=Math.max(O,ne,Oe)):M.run(()=>{M.setProps(w,{transform:`translate3d(${_}px, ${j}px, 0)`,width:`${Y}px`,willChange:"auto"})})}});let L=Math.max(...R);if(Math.abs(t.targetHeight-L)>1)if(i){let w=s.getBoundingClientRect(),A=this.data.viewport.windowHeight;var H=!1;if(w.bottom>=-100&&w.bottom<=A+100){let F=w.top+L-A;if(Math.abs(F)>1&&L<s.offsetHeight){let k=w.top+this.data.scroll.current+L-A;this.events.emit("scrollTo",k),H=!0}}L>=t.targetHeight?(y?(t.startHeight=s.offsetHeight,t.heightStartTime=C,t.heightDuration=q.DEFAULT_DURATION,t.heightEase=this.parseEasing(null),t.isAnimatingHeight=!0):M.run(()=>{M.setProps(e.htmlElement,{height:`${L}px`}),requestAnimationFrame(()=>{this.events.emit("resize",!0)})}),t.targetHeight=L,t.pendingHeight=void 0):(t.pendingHeight=L,t.pendingHeightAnimate=y,t.targetHeight=L,H||M.run(()=>{M.setProps(e.htmlElement,{height:`${L}px`}),requestAnimationFrame(()=>{this.events.emit("resize",!0)})})),I=!0}else t.targetHeight=L,t.pendingHeight=void 0,M.run(()=>{M.setProps(e.htmlElement,{height:`${L}px`})});I&&(t.isAnimating||this.events.emit("masonry:shuffle:start",{object:e}),t.isAnimating=!0,O>0&&(t.expectedEndTime=C+O+32,t.endTimerId&&window.clearTimeout(t.endTimerId),t.endTimerId=window.setTimeout(()=>{t.isAnimating&&(t.pendingHeight!==void 0||t.isAnimatingHeight||(this.events.emit("masonry:shuffle:end",{object:e}),t.isAnimating=!1,t.endTimerId=void 0))},O+50)))}getGridSettings(e){let t=this.data.viewport.windowWidth;if((e.getProperty("masonry-mode")||"auto")==="manual"){let o=e.getProperty(q.MANUAL_COLS_KEY),a=e.getProperty(q.MANUAL_GAP_KEY),l=e.getProperty("masonry-cols")||[],c=e.getProperty("masonry-gap")||[];return{columns:Math.max(1,Math.round(o??Qe(l,t)??2)),gap:Math.max(0,a??Qe(c,t)??16)}}let n=e.getProperty("masonry-cols")||[{breakpoint:0,value:2}],s=e.getProperty("masonry-gap")||[{breakpoint:0,value:16}];return{columns:Math.max(1,Math.round(Qe(n,t)??2)),gap:Math.max(0,Qe(s,t)??16)}}attachImgLoaders(e,t,i){(i.tagName==="IMG"?[i]:Array.from(i.querySelectorAll("img"))).forEach(s=>{let o=s;if(o.complete||t.imgUnsubs.has(o))return;let a=()=>{this.scheduleLayout(e,!0,"img-load"),this.cleanupImgListeners(t,o)};o.addEventListener("load",a),o.addEventListener("error",a),t.imgUnsubs.set(o,()=>{o.removeEventListener("load",a),o.removeEventListener("error",a)})})}cleanupImgListeners(e,t){let i=n=>{let s=e.imgUnsubs.get(n);s&&(s(),e.imgUnsubs.delete(n))};t.tagName==="IMG"?i(t):t.querySelectorAll("img").forEach(n=>i(n))}};var Je=class extends x{constructor(r){super(r),this.htmlKey="magnetic",this._type=2,this.cssProperties=[{name:"--magnetic-x",syntax:"<number>",initialValue:"0",inherits:!0},{name:"--magnetic-y",syntax:"<number>",initialValue:"0",inherits:!0},{name:"--magnetic-target-x",syntax:"<number>",initialValue:"0",inherits:!0},{name:"--magnetic-target-y",syntax:"<number>",initialValue:"0",inherits:!0}],this.permissions.mobile.rebuild.height=!1,this.permissions.mobile.rebuild.width=!1,this.permissions.mobile.rebuild.scrollHeight=!1,this.attributesToMap=[...this.attributesToMap,{key:"strength",type:"number",fallback:this.settings.strength},{key:"radius",type:"number",fallback:this.settings.radius}]}initializeObject(r,e,t,i){super.initializeObject(r,e,t,i),e.isMagneting=!1,e.magneticTargetX=0,e.magneticTargetY=0,e.magneticX=0,e.magneticY=0,e.setProperty("magnetic-lerp",.1),e.eventMagneticName=this.getObjectEventName(e,"magnetic:move"),e.setProperty("__next-magnetic-x",0),e.setProperty("__next-magnetic-y",0),e.setProperty("__needs-magnetic-update",!1)}onMouseMove(r){for(let e=0;e<this.objects.length;e++){let t=this.objects[e],n=t.htmlElement.getBoundingClientRect(),s=n.left+n.width/2,o=n.top+n.height/2,a=r.clientX-s,l=r.clientY-o,c=Math.sqrt(a**2+l**2),d=t.getProperty("radius")??0,h=t.getProperty("strength")??0,p=this.tools.magneticPull.process({distance:c,radius:d,strength:h});t.magneticTargetX=a*p,t.magneticTargetY=l*p,p>0&&(t.isMagneting=!0)}}onFrame(r){for(let e=0;e<this.objects.length;e++){let t=this.objects[e];if(t.isMagneting){let i=t.magneticX,n=t.magneticY,s=t.getProperty("magnetic-lerp")??.1,o=t.magneticTargetX,a=t.magneticTargetY,l=this.tools.lerp.process({from:i,to:o,progress:s}),c=this.tools.lerp.process({from:n,to:a,progress:s});l>-.01&&l<.01&&(l=0,t.magneticX=t.magneticTargetX),c>-.01&&c<.01&&(c=0,t.magneticY=t.magneticTargetY),i+=l,n+=c,t.magneticX=i,t.magneticY=n,t.eventMagneticName&&this.events.emit(t.eventMagneticName,{x:i,y:n}),t.setProperty("__next-magnetic-x",i),t.setProperty("__next-magnetic-y",n),t.setProperty("__needs-magnetic-update",!0),t.magneticTargetX===i&&t.magneticTargetY===n&&(t.isMagneting=!1)}}}onMutate(){for(let r=0;r<this.objects.length;r++){let e=this.objects[r];if(!(e.getProperty("__needs-magnetic-update")===!0))continue;let i=e.getProperty("__next-magnetic-x")??e.magneticX,n=e.getProperty("__next-magnetic-y")??e.magneticY;this.applyToElementAndConnects(e,s=>{M.setVar(s,"--magnetic-x",i),M.setVar(s,"--magnetic-y",n)}),e.setProperty("__needs-magnetic-update",!1)}}};var ce=class extends x{constructor(e){super(e);this.nearOnly=!0;this.useAllObjects=!1;this.maxDistanceMultiplier=1;this.updateThreshold=.1;this.enabled=!0;this.scrollUpdateScheduled=!1;Xe()&&(this.enabled=!1)}onObjectConnected(e){this.enabled&&(super.onObjectConnected(e),this.centers.attach(e),this.hover.track(e))}removeObject(e){if(!this.enabled)return super.removeObject(e);let t=this.objectMapOnPage.get(e);t&&(this.centers.detach(t),this.hover.untrack(t)),super.removeObject(e)}onScroll(){this.enabled&&(this.centers.invalidateAll(),this.scheduleCursorUpdate())}onMouseMoveMeasure(e){this.enabled&&(super.onMouseMoveMeasure(e),this.refreshPointerState())}onScrollMeasure(e){this.enabled&&(super.onScrollMeasure(e),this.refreshPointerState())}getCursorTargets(e=!1){if(!this.enabled)return[];let t=this.hover.activeObjects();return this.nearOnly&&t.length?t:this.useAllObjects?this.objectsOnPage:this.objects.length>0?this.objects:e?this.objectsOnPage:this.objects}refreshPointerState(e,t=!1){if(!this.enabled)return;let i=this.data.cursor.targetX,n=this.data.cursor.targetY,s=e?[e]:this.getCursorTargets(t),o=!this.nearOnly&&this.maxDistanceMultiplier>0?Math.pow(this.data.viewport.windowWidth*this.maxDistanceMultiplier,2):null;for(let a of s){let{cx:l,cy:c}=this.centers.getCenter(a),d=i-l,h=n-c,p=d*d+h*h;if(this.nearOnly){if(p>this.data.viewport.windowWidth*this.data.viewport.windowWidth&&!this.hover.isActive(a))continue}else if(o!==null&&p>o)continue;a.setProperty("dx",d),a.setProperty("dy",h),a.setProperty("dist",Math.sqrt(p))}}scheduleCursorUpdate(){!this.enabled||this.scrollUpdateScheduled||(this.scrollUpdateScheduled=!0,V.measure(()=>{this.refreshPointerState(),V.mutate(()=>{this.scrollUpdateScheduled=!1,M.run(()=>{this.onCursorScrollUpdate()})})}))}onCursorScrollUpdate(){}};var Ft=Math.PI*2,vr=180/Math.PI,Xt=u=>u<0?0:u>1?1:u,yr=(u,r)=>{let e=(r-u)%Ft;return e>Math.PI&&(e-=Ft),e<-Math.PI&&(e+=Ft),u+e},Sr={computeStep(u,r,e,t,i,n,s,o,a,l,c,d,h,p,b,m,g){let v=a;(m===1||e>t)&&(v=Math.atan2(r,u));let y=i>0?Math.min(e,i):e,f=s,S=o;if(p===1)f=v,S=y;else{let R=yr(s,v),C=Xt(n);f+=(R-f)*C,S+=(y-S)*C}let E=f*vr-90,T=b===1||Number.isNaN(l)||Math.abs(E-l)>d,D=b===1||Number.isNaN(c)||Math.abs(S-c)>h;g.angle=f,g.dist=S,g.tAngle=v,g.tDist=y,g.degRaw=E,g.cssDeg=Math.round(E*10)/10,g.cssDist=Math.round(S*10)/10,g.angleChanged=T?1:0,g.distChanged=D?1:0}},Mr={bypassDeadzone:!0},Er={forceImmediate:!0,forceEmit:!0,bypassDeadzone:!0},Yt=new WeakMap,xr=u=>{let r=Yt.get(u);return r||(r={angle:0,dist:0,tAngle:0,tDist:0,prevDeg:NaN,prevDist:NaN},Yt.set(u,r)),r},et=class extends ce{constructor(e){super(e);this.stepResult={angle:0,dist:0,tAngle:0,tDist:0,degRaw:0,cssDeg:0,cssDist:0,angleChanged:0,distChanged:0};this.htmlKey="spotlight",this.cssProperties=[{name:"--spotlight-angle",syntax:"<number>",initialValue:"0",inherits:!0},{name:"--spotlight-distance",syntax:"<number>",initialValue:"0",inherits:!0}],this.nearOnly=!1,this.useAllObjects=!1,this.maxDistanceMultiplier=1,this.attributesToMap.push({key:"lerp",type:"number",fallback:this.settings.lerp,transform:t=>Xt(this.tools.adaptiveLerp.process({value:t,inMin:.1,inMax:1,outMin:.05,outMax:.65}))},{key:"angle-threshold",type:"number",fallback:.2},{key:"distance-threshold",type:"number",fallback:.5},{key:"deadzone",type:"number",fallback:4},{key:"dist-max",type:"number",fallback:0})}initializeObject(e,t,i,n){super.initializeObject(e,t,i,n),t.setProperty("spotlight-angle-rad",0),t.setProperty("spotlight-distance",0),t.setProperty("spotlight-angle-rad-target",0),t.setProperty("spotlight-distance-target",0),V.measure(()=>{this.refreshPointerState(t,!0),V.mutate(()=>{M.run(()=>{this.updateSpotlightState(t,Er)})})})}onMutate(e){if(this.enabled){super.onMutate(e);let t=this.getCursorTargets(!1),i=t.length>0?t:this.getCursorTargets(!0);for(let n=0;n<i.length;n++){let s=i[n];this.updateSpotlightState(s)}}}onCursorScrollUpdate(){let e=this.getCursorTargets(!1),t=e.length>0?e:this.getCursorTargets(!0);for(let i=0;i<t.length;i++){let n=t[i];this.updateSpotlightState(n,Mr)}}updateSpotlightState(e,t={}){let i=e.getProperty("dx"),n=e.getProperty("dy"),s=e.getProperty("dist");if(!Number.isFinite(i)||!Number.isFinite(n)||!Number.isFinite(s))return;let o=xr(e);Sr.computeStep(i,n,s,e.getProperty("deadzone")??4,e.getProperty("dist-max")??0,e.getProperty("lerp")??.15,o.angle,o.dist,o.tAngle,o.prevDeg,o.prevDist,e.getProperty("angle-threshold")??.2,e.getProperty("distance-threshold")??.5,t.forceImmediate===!0?1:0,t.forceEmit===!0?1:0,t.bypassDeadzone===!0?1:0,this.stepResult),o.angle=this.stepResult.angle,o.dist=this.stepResult.dist,o.tAngle=this.stepResult.tAngle,o.tDist=this.stepResult.tDist,e.setProperty("spotlight-distance-target",o.tDist),e.setProperty("spotlight-angle-rad-target",o.tAngle),e.setProperty("spotlight-angle-rad",o.angle),e.setProperty("spotlight-distance",o.dist),(this.stepResult.angleChanged===1||this.stepResult.distChanged===1)&&(this.writeSpotlightVars(e,this.stepResult.cssDeg,this.stepResult.cssDist),o.prevDeg=this.stepResult.degRaw,o.prevDist=o.dist,this.events.emit(this.getObjectEventName(e,"spotlight:update"),{distance:this.stepResult.cssDist,angleDeg:this.stepResult.cssDeg}))}writeSpotlightVars(e,t,i){let n=()=>{this.applyToElementAndConnects(e,s=>{M.setVar(s,"--spotlight-angle",t),M.setVar(s,"--spotlight-distance",i)})};if(M.isOpen){n();return}M.run(n)}};var Gt="-aspect-ready";function wr(u){if(!u)return!1;let r=u.toLowerCase();return!!(r.endsWith(".svg")||r.startsWith("data:image/svg"))}function Kt(u){let r=new DataView(u);return u.byteLength<28?{width:0,height:0}:r.getUint32(0)!==2303741511||r.getUint32(4)!==218765834?{width:0,height:0}:r.getUint32(8)!==13||r.getUint32(12)!==1229472850?{width:0,height:0}:{width:r.getUint32(16,!1),height:r.getUint32(20,!1)}}function Qt(u){let r=new DataView(u);if(r.getUint16(0)!==65496)return{width:0,height:0};let e=2;for(;e+9<u.byteLength;){let t=r.getUint16(e);if(e+=2,t===65498||t===65497)break;let i=r.getUint16(e);if(i<2||e+i>u.byteLength)break;if(t>=65472&&t<=65475||t>=65477&&t<=65479||t>=65481&&t<=65483||t>=65485&&t<=65487)return{height:r.getUint16(e+3),width:r.getUint16(e+5)};e+=i}return{width:0,height:0}}function Zt(u){let r=new DataView(u);if(u.byteLength<16)return{width:0,height:0};if(r.getUint32(0,!0)!==1179011410||r.getUint32(8,!0)!==1346520407)return{width:0,height:0};let e=12;for(;e+8<=u.byteLength;){let t=r.getUint32(e,!1),i=r.getUint32(e+4,!0),n=e+8;if(t===1448097880){let s=(r.getUint16(n+4,!0)|r.getUint8(n+6)<<16)+1,o=(r.getUint16(n+7,!0)|r.getUint8(n+9)<<16)+1;return{width:s,height:o}}if(t===1448097824&&n+10<=u.byteLength&&r.getUint8(n+3)===157&&r.getUint8(n+4)===1&&r.getUint8(n+5)===42){let s=r.getUint16(n+6,!0)&16383,o=r.getUint16(n+8,!0)&16383;return{width:s,height:o}}if(t===1448097868&&n+5<=u.byteLength&&r.getUint8(n)===47){let s=r.getUint8(n+1),o=r.getUint8(n+2),a=r.getUint8(n+3),l=r.getUint8(n+4),c=1+((o&63)<<8|s),d=1+((l&15)<<10|a<<2|(o&192)>>6);return{width:c,height:d}}e=n+i+(i&1)}return{width:0,height:0}}function Jt(u,r){let e=(r||"").toLowerCase();if(e.includes("png"))return Kt(u);if(e.includes("jpeg")||e.includes("jpg"))return Qt(u);if(e.includes("webp"))return Zt(u);let t=Kt(u);return t.width||(t=Qt(u),t.width)||(t=Zt(u),t.width)?t:{width:0,height:0}}async function Tr(u,r,e){let t=await fetch(u,{mode:"cors",credentials:r?.credentials??"omit",referrerPolicy:r?.referrerPolicy,signal:r?.signal,cache:"default"});if(!t.ok||!t.body)throw new Error(`HTTP ${t.status}`);let i=t.headers.get("content-type"),n=t.body.getReader(),s=1048576,o=4096,a=new Uint8Array(s),l=0,c=0,d=[],h=null,p=!1;for(;;){let{done:g,value:v}=await n.read();if(g)break;if(!v)continue;let y=v.buffer.slice(v.byteOffset,v.byteOffset+v.byteLength);if(d.push(y),!h&&l<s){let f=Math.min(v.byteLength,s-l);if(f>0&&(a.set(v.subarray(0,f),l),l+=f),l-c>=o){let S=l===a.byteLength?a:a.slice(0,l),E=Jt(S.buffer,i);E.width&&E.height&&(h=E,!p&&e&&(e(h),p=!0)),c=l}}}if(!h){let g=await new Response(new Blob(d)).arrayBuffer(),v=Jt(g,i);v.width&&v.height&&(h=v,!p&&e&&(e(h),p=!0))}let b=new Blob(d,{type:i||"application/octet-stream"}),m=URL.createObjectURL(b);return{dims:h,blobUrl:m,contentType:i}}var tt=class extends x{constructor(e){super(e);this.isStartLoaded=!1;this.loadingCount=0;this.imageStates=new WeakMap;this.htmlKey="lazy"}onInit(){document.querySelectorAll("img[string-lazy], img[data-string-lazy]").forEach(t=>this.ensureState(t)),this.isStartLoaded=!0}onObjectConnected(e){let t=e.htmlElement;if(!(t instanceof HTMLImageElement))return;t.getAttribute("src")||t.setAttribute("src","data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1' height='1' viewBox='0 0 1 1'%3E%3C/svg%3E");let i=this.ensureState(t);!i.aspectReady&&!i.aspectLoading&&this.prepareAspectRatio(t);let n=o=>{this.handleInView(t,i,!!o?.inView)};i.unsubscribe&&i.unsubscribe();let s=this.getObjectEventName(e,"object:inview");this.events.on(s,n),i.unsubscribe=()=>this.events.off(s,n),this.isStartLoaded&&(e.getProperty("is-inview")??!1)&&this.handleInView(t,i,!0)}onObjectDisconnected(e){let t=e.htmlElement;if(!(t instanceof HTMLImageElement))return;let i=this.imageStates.get(t);i&&(i.pendingActivation=!1,i.controller&&i.controller.abort(),i.blobUrl&&URL.revokeObjectURL(i.blobUrl),i.unsubscribe&&(i.unsubscribe(),i.unsubscribe=void 0))}ensureState(e){let t=this.imageStates.get(e);if(!t){let i=this.readSource(e);return t={src:i,aspectReady:!1,contentReady:!1,aspectLoading:!1,contentLoading:!1,pendingActivation:!1,rangeAttempted:!1,fetching:!1},this.imageStates.set(e,t),e.classList.contains("lazyLoad")||e.classList.add("lazyLoad"),e.dataset&&!e.dataset.stringLazySrc&&i&&(e.dataset.stringLazySrc=i),t}return t.src||(t.src=this.readSource(e)),t}readSource(e){let t=this.tools.domAttribute.process({element:e,key:this.htmlKey,fallback:""});return typeof t=="string"?t:t==null?"":String(t)}handleInView(e,t,i){t.pendingActivation=i,i&&(t.aspectReady?this.maybeActivateImage(e,t):t.aspectLoading||this.prepareAspectRatio(e))}async prepareAspectRatio(e){let t=this.ensureState(e);if(!t.src||t.aspectLoading||t.aspectReady)return;if(wr(t.src)){t.aspectReady=!0,t.allowSrcFallback=!0,this.maybeActivateImage(e,t);return}t.aspectLoading=!0,t.fetching=!0;let i=e.getAttribute("crossorigin"),n=e.getAttribute("referrerpolicy"),s=new AbortController;t.controller=s;try{let{blobUrl:o}=await Tr(t.src,{credentials:i==="use-credentials"?"include":"omit",referrerPolicy:n||void 0,signal:s.signal},a=>{a.width>0&&a.height>0&&!t.aspectReady&&(e.style.aspectRatio=`${a.width} / ${a.height}`,e.classList.add(Gt),t.width=a.width,t.height=a.height,t.aspectReady=!0)});t.blobUrl=o,!t.aspectReady&&t.width&&t.height&&(e.style.aspectRatio=`${t.width} / ${t.height}`,e.classList.add(Gt),t.aspectReady=!0)}catch{t.allowSrcFallback=!0,t.aspectReady=!0}finally{t.fetching=!1,t.aspectLoading=!1,this.maybeActivateImage(e,t)}}maybeActivateImage(e,t){!t.pendingActivation||t.contentReady||t.contentLoading||!t.aspectReady||!t.src||t.fetching&&!t.blobUrl||(t.blobUrl||t.allowSrcFallback)&&this.activateImage(e,t)}activateImage(e,t){t.contentLoading=!0,this.loadingCount++;let i=o=>{t.contentLoading&&(t.contentLoading=!1,t.pendingActivation=!1,this.loadingCount=Math.max(0,this.loadingCount-1),o&&(t.contentReady=!0,e.classList.add("-loaded")),this.loadingCount===0&&this.events.emit("image:load:all",null))},n=()=>i(!0),s=()=>i(!1);e.addEventListener("load",n,{once:!0}),e.addEventListener("error",s,{once:!0}),e.decoding="async",e.loading=e.loading||"lazy",t.blobUrl?(e.removeAttribute("srcset"),e.removeAttribute("sizes"),e.src=t.blobUrl):e.src=t.src,e.complete&&e.naturalWidth>0&&e.naturalHeight>0&&(e.removeEventListener("load",n),e.removeEventListener("error",s),i(!0))}};var rt=class extends x{constructor(e){super(e);this.loadingTimeout=0;this._type=2,this.loadingTimeout=this.settings.timeout}onInit(){setTimeout(()=>{document.documentElement.classList.add("-loaded")},this.loadingTimeout)}};var it=class extends x{constructor(r){super(r),this.htmlKey=""}canConnect(r){return r.keys[0]==null}};var ue=class{constructor(r){this.min=void 0;this.max=void 0;this.enable=!0;this.min=r?.min,this.max=r?.max,this.enable=r?.enable??!0}setEnable(r=!0){this.enable=r}setRange(r,e){this.min=r??void 0,this.max=e??void 0}get mediaQuery(){let r="screen";return this.min&&(r+=` and (min-width: ${this.min}px)`),this.max&&(r+=` and (max-width: ${this.max}px)`),r}},nt=class extends x{constructor(e){super(e);this.queries={0:new ue({max:359}),1:new ue({min:360,max:1023}),2:new ue({min:1024,max:1365}),3:new ue({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 e=this.settings.settings;e.mobile?(this.queries[0].enable=!0,this.queries[0].setRange(e.mobile.min==null?null:e.mobile.min,e.mobile.max??null),this.matchMedias[0]=window.matchMedia(this.queries[0].mediaQuery)):this.queries[0].enable=!1,e.tablet?(this.queries[1].enable=!0,this.queries[1].setRange(e.tablet.min==null?null:e.tablet.min,e.tablet.max??null),this.matchMedias[1]=window.matchMedia(this.queries[1].mediaQuery)):this.queries[1].enable=!1,e.laptop?(this.queries[2].enable=!0,this.queries[2].setRange(e.laptop.min==null?null:e.laptop.min,e.laptop.max??null),this.matchMedias[2]=window.matchMedia(this.queries[2].mediaQuery)):this.queries[2].enable=!1,e.desktop?(this.queries[3].enable=!0,this.queries[3].setRange(e.desktop.min==null?null:e.desktop.min,e.desktop.max??null),this.matchMedias[3]=window.matchMedia(this.queries[3].mediaQuery)):this.queries[3].enable=!1}this.updateElements()}onResize(){this.updateElements()}updateElements(){let e=this.matchMedias[0].matches&&this.queries[0].enable,t=this.matchMedias[1].matches&&this.queries[1].enable,i=this.matchMedias[2].matches&&this.queries[2].enable,n=this.matchMedias[3].matches&&this.queries[3].enable;this.isMobileMedia!=e&&this.events.emit("screen:mobile",e),this.isTabletMedia!=t&&this.events.emit("screen:tablet",t),this.isLaptopMedia!=i&&this.events.emit("screen:laptop",i),this.isDesktopMedia!=n&&this.events.emit("screen:desktop",n),this.isMobileMedia=e,this.isTabletMedia=t,this.isLaptopMedia=i,this.isDesktopMedia=n,document.querySelectorAll("[string-mobile], [string-tablet], [string-laptop], [string-desktop]").forEach(o=>{let a=!1;o.hasAttribute("string-mobile")&&e&&(a=!0),o.hasAttribute("string-tablet")&&t&&(a=!0),o.hasAttribute("string-laptop")&&i&&(a=!0),o.hasAttribute("string-desktop")&&n&&(a=!0),a?o.style.display=null:o.style.display="none"})}};var st=class extends x{constructor(r){super(r),this.htmlKey="anchor",this.attributesToMap=[...this.attributesToMap,{key:"anchor",type:"tuple",fallback:this.settings.anchor,transform:e=>{let[t,i]=e,n=this.tools.originParser.process({value:t}),s=this.tools.originParser.process({value:i});return{x:n,y:s}}}]}onObjectConnected(r){super.onObjectConnected(r);let e=r.getProperty("anchor");e&&this.applyToElementAndConnects(r,t=>{t.style.transformOrigin=`${e.x} ${e.y}`})}};var Cr=.05,Pr=.01,er=1,Lr=-1,Or=1,ot=class extends x{constructor(e){super(e);this.previousLerp=0;this.displacement=0;this.acceleration=0;this.velocityMultiplier=.00125;this.isInitialScroll=!0;this.baseVelocityMultiplier=.00125;this.reducedVelocityMultiplier=this.baseVelocityMultiplier/20;this.negativeVelocityMultiplier=-1e-4;this.maxDisplacementValue=0;this.setupItem=e=>{let t=-this.data.scroll.displacement*this.maxDisplacementValue*e.glide;e.eventGlideName&&this.events.emit(e.eventGlideName,t);let i=`translate3d(0, ${t}px, 0)`;e.setProperty("__next-glide-transform",i),e.setProperty("__needs-glide-transform-update",!0)};this.onUpdateDesktopEvent=()=>{for(let e=0;e<this.objects.length;e++)this.setupItem(this.objects[e])};this.onUpdateMobileEvent=()=>{};this.onUpdateEvent=this.onUpdateDesktopEvent;this.htmlKey="glide",this.cssProperties=[{name:"--glide",syntax:"<number>",initialValue:"0",inherits:!0}],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}]}initializeObject(e,t,i,n){super.initializeObject(e,t,i,n),t.glide=t.getProperty("glide")??0,t.eventGlideName=this.getObjectEventName(t,"object:glide"),t.setProperty("__next-glide",0),t.setProperty("__next-glide-transform","translate3d(0, 0px, 0)"),t.setProperty("__needs-glide-var-update",!1),t.setProperty("__needs-glide-transform-update",!1)}calcExpanderFactor(e){let t=e?this.data.scroll.lerped<this.previousLerp:this.data.scroll.lerped>this.previousLerp;this.velocityMultiplier=t?this.isInitialScroll?this.baseVelocityMultiplier:this.reducedVelocityMultiplier:this.negativeVelocityMultiplier,t||(this.isInitialScroll=!1)}onStart(){this.maxDisplacementValue=this.data.viewport.windowHeight*.1}onResize(){if(window.innerWidth>1024)this.maxDisplacementValue=this.data.viewport.windowHeight*.1,this.onUpdateEvent=this.onUpdateDesktopEvent;else{this.onUpdateEvent=this.onUpdateMobileEvent,this.resetState();for(let e=0;e<this.objects.length;e++){let t=this.objects[e];t.setProperty("__next-glide-transform","translate3d(0, 0px, 0)"),t.setProperty("__needs-glide-transform-update",!0),t.setProperty("__next-glide",0),t.setProperty("__needs-glide-var-update",!0)}this.flushPendingGlideStyles()}}resetState(){this.displacement=0,this.acceleration=0,this.isInitialScroll=!0,this.velocityMultiplier=this.baseVelocityMultiplier}onScrollStart(){this.resetState()}onScrollStop(){this.resetState(),this.previousLerp=0,this.data.scroll.displacement=0;let e=0;for(let t=0;t<this.objects.length;t++){let i=this.objects[t];i.setProperty("__next-glide-transform","translate3d(0, 0px, 0)"),i.setProperty("__needs-glide-transform-update",!0),i.setProperty("__next-glide",e),i.setProperty("__needs-glide-var-update",!0)}this.flushPendingGlideStyles()}onFrame(e){this.calcExpanderFactor(this.data.scroll.isScrollingDown===!1),this.acceleration=Math.min(er,this.acceleration+Cr),this.displacement=Math.max(Pr,Math.min(er,this.displacement+this.velocityMultiplier)),this.data.scroll.displacement=Math.min(Or,Math.max(Lr,this.data.scroll.lerped*this.displacement*this.acceleration));let t=this.data.scroll.displacement;for(let i=0;i<this.objects.length;i++){let n=this.objects[i];n.setProperty("__next-glide",t),n.setProperty("__needs-glide-var-update",!0)}this.previousLerp=this.data.scroll.lerped,this.onUpdateEvent()}onMutate(){this.applyPendingGlideStyles()}applyPendingGlideStyles(){for(let e=0;e<this.objects.length;e++){let t=this.objects[e],i=t.getProperty("__needs-glide-var-update")===!0,n=t.getProperty("__needs-glide-transform-update")===!0;if(!(!i&&!n)){if(i){let s=t.getProperty("__next-glide")??this.data.scroll.displacement;this.applyVarToElement(t,"--glide",s),this.applyVarToConnects(t,"--glide",s),t.setProperty("__needs-glide-var-update",!1)}if(n){let s=t.getProperty("__next-glide-transform")??"translate3d(0, 0px, 0)";this.applyPropToElement(t,"transform",s),t.setProperty("__needs-glide-transform-update",!1)}}}}flushPendingGlideStyles(){if(M.isOpen){this.applyPendingGlideStyles();return}M.run(()=>{this.applyPendingGlideStyles()})}};var at=class extends x{constructor(e){super(e);this.hasInitializedCSS=!1;this.htmlKey="lerp",this.cssProperties=[{name:"--lerp",syntax:"<number>",initialValue:"0",inherits:!0}],this.attributesToMap=[]}onObjectConnected(e){super.onObjectConnected(e),e.lerp=0,e.setProperty("lerp-applied",0),e.eventLerpName=this.getObjectEventName(e,"object:lerp")}onResize(){super.onResize(),!this.hasInitializedCSS&&this.objectsOnPage.length>0&&(this.hasInitializedCSS=!0,M.run(()=>{for(let e=0;e<this.objectsOnPage.length;e++)this.updateObjectLerp(this.objectsOnPage[e],!0)}))}onScrollStop(){for(let e=0;e<this.objects.length;e++)this.recomputeLerp(this.objects[e],0)}onFrame(e){let t=e.scroll.lerped;for(let i=0;i<this.objects.length;i++)this.recomputeLerp(this.objects[i],t)}recomputeLerp(e,t){e.lerp!==t&&(e.lerp=t,this.updateObjectLerp(e))}onMutate(){M.run(()=>{let e=this.objects.length;for(let t=0;t<e;t++)this.updateObjectLerp(this.objects[t])})}updateObjectLerp(e,t=!1){let i=e.lerp,n=e.getProperty("lerp-applied");if(!t&&n===i)return;e.setProperty("lerp-applied",i);let s=i?.toString()??"0";e.eventLerpName&&this.events.emit(e.eventLerpName,i),M.run(()=>{this.applyVarToElement(e,"--lerp",s),this.applyVarToConnects(e,"--lerp",s)})}onObjectDisconnected(e){super.onObjectDisconnected(e);let t=n=>{n.style.removeProperty("--lerp")};t(e.htmlElement);let i=e.mirrorObjects;for(let n=0;n<i.length;n++)t(i[n].htmlElement)}};var tr={computeRawProgress(u,r,e){if(e===0)return 0;let t=(u-r)/e;return t<=0?0:t>=1?1:t},computeRawProgressBatch(u,r,e,t,i){for(let n=0;n<i;n++){let s=e[n];if(s===0){t[n]=0;continue}let o=(u-r[n])/s;o<=0?t[n]=0:o>=1?t[n]=1:t[n]=o}}},de=class extends x{constructor(e){super(e);this.updateScheduled=!1;this.batchStarts=new Float64Array(0);this.batchDiffs=new Float64Array(0);this.batchOut=new Float64Array(0);this.htmlKey="progress",this.cssProperties=[{name:"--progress",syntax:"<number>",initialValue:"0",inherits:!0},{name:"--progress-slice",syntax:"<number>",initialValue:"0",inherits:!0}],this.attributesToMap=[...this.attributesToMap,{key:"easing",type:"easing",fallback:this.settings.easing}]}initializeObject(e,t,i,n){super.initializeObject(e,t,i,n)}sanitizeRawProgress(e){if(!Number.isFinite(e)||e<=0)return 0;if(e>=1)return 1;let t=1e-4;return e>1-t?e=1:e<t&&(e=0),e}applyRawProgress(e,t){let i=this.sanitizeRawProgress(t);if(e.progressRaw===i)return;e.progressRaw=i;let s=e.getProperty("easing"),o=typeof s=="function"?s(i):i;e.progress=o}recomputeProgress(e){let t=e.getProperty("start-position")??e.startPosition,i=e.getProperty("difference-position")??e.differencePosition;e.startPosition=t,e.differencePosition=i;let n=tr.computeRawProgress(this.data.scroll.transformedCurrent,t,i);this.applyRawProgress(e,n)}ensureBatchCapacity(e){this.batchStarts.length>=e||(this.batchStarts=new Float64Array(e),this.batchDiffs=new Float64Array(e),this.batchOut=new Float64Array(e))}calculatePositions(e,t){super.calculatePositions(e,t),e.startPosition=e.getProperty("start-position")??e.startPosition,e.differencePosition=e.getProperty("difference-position")??e.differencePosition,this.recomputeProgress(e)}onScroll(e){super.onScroll(e)}onObjectConnected(e){super.onObjectConnected(e)}onScrollMeasure(e){let t=this.objects.length;if(t!==0){this.ensureBatchCapacity(t);for(let i=0;i<t;i++){let n=this.objects[i],s=n.getProperty("start-position")??n.startPosition,o=n.getProperty("difference-position")??n.differencePosition;n.startPosition=s,n.differencePosition=o,this.batchStarts[i]=s,this.batchDiffs[i]=o}tr.computeRawProgressBatch(this.data.scroll.transformedCurrent,this.batchStarts,this.batchDiffs,this.batchOut,t);for(let i=0;i<t;i++)this.applyRawProgress(this.objects[i],this.batchOut[i])}}onMutate(){M.run(()=>{let e=this.objects.length;for(let t=0;t<e;t++)this.updateObjectProgress(this.objects[t])})}updateObjectProgress(e){let t=e.progress;if(e.getProperty("progress-applied")===t)return;let n=e.getProperty("key");e.setProperty("progress-applied",t);let s=e.progressRaw??t,o=e.getProperty("easing");e.eventProgressName&&this.events.emit(e.eventProgressName,t),n&&this.applyVarToElement(e,n,t);for(let a=0;a<e.mirrorObjects.length;a++){let l=e.mirrorObjects[a],c=l.applyProgress(s,typeof o=="function"?o:void 0);l.setProperty("progress",c),n&&this.tools.styleTxn.setVar(l.htmlElement,n,c)}}onObjectDisconnected(e){super.onObjectDisconnected(e);let t=e.getProperty("key");if(!t)return;let i=s=>{s.style.removeProperty(t)};i(e.htmlElement);let n=e.mirrorObjects;for(let s=0;s<n.length;s++)i(n[s].htmlElement)}};var lt=class extends de{constructor(e){super(e);this.updateScheduledTransform=!1;this.calculateDesktopParallax=e=>{let t=e.progress,i=e.getProperty("parallax")??0,n=e.getProperty("parallax-position-start")??0,s=e.getProperty("parallax-position-end")??1,o=e.getProperty("parallax-sign")??1,a=this.data.viewport.windowHeight/this.data.viewport.transformScale,l=o*i*(a*n+t*a*s);return this.events.emit(this.getObjectEventName(e,"object:parallax"),l),{transform:`translate3d(0, ${l}px, 0)`}};this.calculateMobileParallax=e=>(this.events.emit(this.getObjectEventName(e,"object:parallax"),0),{transform:"translate3d(0, 0px, 0)"});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"]}],this.calculateParallaxForObject=this.calculateDesktopParallax}initializeObject(e,t,i,n){super.initializeObject(e,t,i,n);let s=t.getProperty("parallax-bias")??0,o=Math.abs(t.getProperty("parallax")??.2);t.setProperty("parallax-sign",Math.sign(t.getProperty("parallax"))),t.setProperty("parallax",o),t.setProperty("parallax-position-start",-.5+.5*s),t.setProperty("parallax-position-end",.5+.5*(1-s));let a=this.data.viewport.windowHeight;t.setProperty("offset-top",o*a),t.setProperty("offset-bottom",o*a)}calculatePositions(e,t){super.calculatePositions(e,t),e.transformValue=this.calculateParallaxForObject(e)}onScroll(e){super.onScroll(e)}onResize(){let e=window.innerWidth>1024;this.calculateParallaxForObject=e?this.calculateDesktopParallax:this.calculateMobileParallax}onScrollMeasure(e){super.onScrollMeasure(e);for(let t=0;t<this.objects.length;t++){let i=this.objects[t];i.transformValue=this.calculateParallaxForObject(i)}}onMutate(){M.run(()=>{for(let e=0;e<this.objects.length;e++){let t=this.objects[e],i=t.transformValue;i&&(this.applyPropToElement(t,"transform",i.transform),this.applyPropToConnects(t,"transform",i.transform))}})}};var ct=class{constructor(r,e,t,i){this.isDragging=!1;this.startY=0;this.startScrollPosition=0;this.data=r,this.scrollbar=e,this.thumb=t,this.onScrollTo=i}onResize(){let r=this.data.viewport.contentWidth,e=this.data.viewport.windowWidth,t=e/r*e;this.thumb.style.setProperty("--size",t+"px"),r<=e?this.scrollbar.classList.add("-hide"):this.scrollbar.classList.remove("-hide")}updateThumb(){let r=this.data.viewport.contentWidth,e=this.data.viewport.windowWidth;this.thumb.style.setProperty("--position",`${this.data.scroll.current/r*e+"px"}`)}mouseDownEvent(r){this.startY=r.clientY,this.startScrollPosition=this.data.scroll.current}mouseMoveEvent(r){let e=r.clientY-this.startY,t=this.startScrollPosition+e/this.data.viewport.windowWidth*this.data.viewport.contentWidth;this.data.scroll.current=t,this.data.scroll.target=t,this.onScrollTo(t),this.updateThumb()}};var ut=class{constructor(r,e,t,i){this.isDragging=!1;this.startCoordinate=0;this.startScrollPosition=0;this.data=r,this.scrollbar=e,this.thumb=t,this.onScrollTo=i}onResize(){let r=this.data.viewport.contentHeight,e=this.data.viewport.windowHeight,t=e/r*e;this.thumb.style.setProperty("--height",t+"px"),r<=e?this.scrollbar.classList.add("-hide"):this.scrollbar.classList.remove("-hide")}updateThumb(){let r=this.data.viewport.contentHeight,e=this.data.viewport.windowHeight;this.thumb.style.setProperty("--position",`${this.data.scroll.current/r*e+"px"}`)}mouseDownEvent(r){this.startCoordinate=r.clientY,this.startScrollPosition=this.data.scroll.current}mouseMoveEvent(r){let e=r.clientY-this.startCoordinate,t=this.startScrollPosition+e/this.data.viewport.windowHeight*this.data.viewport.contentHeight,i=this.data.scroll.bottomPosition,n=Math.max(0,Math.min(t,i));this.data.scroll.current=n,this.data.scroll.target=n,this.onScrollTo(n),this.updateThumb()}};var dt=class extends x{constructor(e){super(e);this.isDragging=!1;this.scrollMode="smooth";this.mouseUpEventBind=this.mouseUpEvent.bind(this),this.mouseDownEventBind=this.mouseDownEvent.bind(this),this.mouseMoveEventBind=this.mouseMoveEvent.bind(this),this.requestScrollTo=t=>{this.events.emit("scrollTo",{position:t,immediate:!0})}}destructor(){document.removeEventListener("mouseup",this.mouseUpEventBind),this.thumb.removeEventListener("mousedown",this.mouseDownEventBind),document.removeEventListener("mousemove",this.mouseMoveEventBind)}onInit(){this.createScrollbar(),this.updateThumb(),this.addCustomStyles(),document.addEventListener("mouseup",this.mouseUpEventBind),this.thumb.addEventListener("mousedown",this.mouseDownEventBind),document.addEventListener("mousemove",this.mouseMoveEventBind),document.documentElement.classList.add("-no-scrollbar")}onScroll(e){this.updateThumb(),this.showScrollbar(),this.hideScrollbar()}onResize(){this.scrollbarState.onResize()}addCustomStyles(){let e=document.createElement("style");e.textContent=`
|
|
1
|
+
"use strict";var _e=Object.defineProperty;var Dr=Object.getOwnPropertyDescriptor;var kr=Object.getOwnPropertyNames;var Ar=Object.prototype.hasOwnProperty;var Ir=(u,e)=>{for(var t in e)_e(u,t,{get:e[t],enumerable:!0})},Rr=(u,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of kr(e))!Ar.call(u,i)&&i!==t&&_e(u,i,{get:()=>e[i],enumerable:!(r=Dr(e,i))||r.enumerable});return u};var Fr=u=>Rr(_e({},"__esModule",{value:!0}),u);var di={};Ir(di,{CursorReactiveModule:()=>ct,DOMBatcher:()=>at,GridAdapter:()=>Ne,ScrollController:()=>$,StringAnchor:()=>oe,StringCursor:()=>Kt,StringData:()=>ht,StringDelayLerpTracker:()=>fe,StringFPSTracker:()=>ve,StringForm:()=>we,StringGlide:()=>ae,StringImpulse:()=>Qt,StringLazy:()=>re,StringLerp:()=>le,StringLerpTracker:()=>be,StringLoading:()=>ie,StringMagnetic:()=>te,StringMasonry:()=>Jt,StringModule:()=>M,StringObject:()=>ot,StringParallax:()=>ce,StringPositionTracker:()=>ye,StringProgress:()=>dt,StringProgressPart:()=>Re,StringRandom:()=>Fe,StringResponsive:()=>se,StringScrollContainer:()=>Ie,StringScrollbar:()=>pe,StringScroller:()=>Ae,StringSequence:()=>Ee,StringSplit:()=>ge,StringSpotlight:()=>ee,StringTune:()=>Ge,StringVideoAutoplay:()=>xe,buildDevtoolsThemeBlock:()=>Ot,default:()=>Ge,ensureStringDevtoolsSharedStyles:()=>Oe,frameDOM:()=>_,resolveDevtoolsIcon:()=>Lr,styleTxn:()=>x});module.exports=Fr(di);var kt=class{constructor(e=.1,t){this.SETTLE_THRESHOLD=.1;this.lastMouseX=0;this.lastMouseY=0;this.lastMouseTime=0;this.smoothingFactor=e,this.context=t,this.onSettingsChange({isDesktop:t.data.viewport.windowWidth>1024,isForceRebuild:!1,widthChanged:!0,heightChanged:!0,scrollHeightChanged:!0})}onMouseMove(e){this.context.data.cursor.targetX=e.clientX,this.context.data.cursor.targetY=e.clientY;let t=performance.now(),r=t-this.lastMouseTime;r>0&&(this.context.data.cursor.velocityX=(e.clientX-this.lastMouseX)/r,this.context.data.cursor.velocityY=(e.clientY-this.lastMouseY)/r),this.lastMouseX=e.clientX,this.lastMouseY=e.clientY,this.lastMouseTime=t}onFrame(){let{targetX:e,targetY:t,smoothedX:r,smoothedY:i}=this.context.data.cursor,n=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}),o=this.getStepDistance(n,s);this.isSettled(o)?this.snapToTarget():this.applyStep(n,s)}onSettingsChange(e){let t=Number(this.context.settings["cursor-lerp"]);this.setLerpFactor(t)}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 st=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")}registerStateEvent(e,t){this.stateEvents.add(e),t!==void 0&&(this.lastPayloads[e]=t)}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 At=class{constructor(e){this.data=e;this.modules=[];this.uiModules=[];this.allModules=[]}register(e){if(e.type===1?this.modules.push(e):e.type===2&&this.uiModules.push(e),e.cssProperties&&e.cssProperties.length>0&&typeof window.CSS<"u"&&"registerProperty"in window.CSS)for(let t=0;t<e.cssProperties.length;t++)try{window.CSS.registerProperty(e.cssProperties[t])}catch{}e.onSubscribe(),this.rebuildAllModules()}find(e){for(let t=0;t<this.modules.length;t++){let r=this.modules[t];if(r instanceof e)return r}}onInit(){this.callAll("onInit")}onFrame(){this.callAll("onFrame")}onMutate(){this.callAll("onMutate")}onScrollMeasure(){this.callAll("onScrollMeasure")}onMouseMoveMeasure(){this.callAll("onMouseMoveMeasure")}onScroll(){this.callAll("onScroll")}onResizeWidth(){this.callAll("onResizeWidth")}onResize(){this.callAll("onResize")}onMouseMove(e){this.callAll("onMouseMove",e)}onWheel(e){this.callAll("onWheel",e)}onDirectionChange(){this.callAll("onDirectionChange")}onScrollStart(){this.callAll("onScrollStart")}onScrollStop(){this.callAll("onScrollStop")}onAxisChange(){this.callAll("onAxisChange")}onDeviceChange(){this.callAll("onDeviceChange")}onScrollConfigChange(){this.callAll("onScrollConfigChange")}onSettingsChange(e){this.callAll("onSettingsChange")}onDOMMutate(e,t){this.callAll("onDOMMutate",e,t)}destroy(){this.callAll("onUnsubscribe"),this.callAll("destroy"),this.modules=[],this.uiModules=[],this.allModules=[]}get all(){return this.allModules}get core(){return this.modules}get ui(){return this.uiModules}callAll(e,t,r){this.modules.length>0&&this.callLifecycleStrict(this.modules,e,t,r),this.uiModules.length>0&&this.callLifecycleStrict(this.uiModules,e,t,r)}callLifecycleStrict(e,t,r,i){let n=e.length;switch(t){case"onFrame":case"onMutate":case"onScrollMeasure":case"onMouseMoveMeasure":case"onScroll":for(let s=0;s<n;s++){let o=e[s];o&&o[t](this.data)}break;case"onDOMMutate":for(let s=0;s<n;s++){let o=e[s];o&&o[t](r,i)}break;case"onMouseMove":case"onWheel":for(let s=0;s<n;s++){let o=e[s];o&&o[t](r)}break;default:for(let s=0;s<n;s++){let o=e[s];o&&o[t]()}break}}rebuildAllModules(){this.allModules.length=0;for(let e=0;e<this.modules.length;e++)this.allModules.push(this.modules[e]);for(let e=0;e<this.uiModules.length;e++)this.allModules.push(this.uiModules[e])}};var It=class{constructor(e,t,r){this.parent=r;this.properties=new Map;this.id=e,this.htmlElement=t}get parentObject(){return this.parent}setProperty(e,t){this.properties.set(e,t)}getProperty(e){return this.properties.get(e)??null}setEasing(e){this.easingFn=e??void 0}getEasing(){return this.easingFn}applyProgress(e,t){let r=this.easingFn??t;return r?r(e):e}};var ot=class{constructor(e,t){this.id="";this.keys=[];this.mirrors=new Map;this.properties=new Map;this.eventNameCache=new Map;this.eventNameSuffixCache=new Map;this.progress=0;this.progressRaw=0;this.startPosition=0;this.differencePosition=0;this.transformValue=null;this.eventProgressName=null;this.lerp=0;this.glide=0;this.isMagneting=!1;this.magneticX=0;this.magneticY=0;this.magneticTargetX=0;this.magneticTargetY=0;this.eventLerpName=null;this.eventGlideName=null;this.eventMagneticName=null;this.modules=[];this.events=new st;this.htmlElement=t,this.id=e,this.eventProgressName=this.getScopedEventName("object:progress")}getScopedEventName(e,t){if(t==null){let s=this.eventNameCache.get(e);if(s)return s;let o=`${e}:${this.id}`;return this.eventNameCache.set(e,o),o}let r=this.eventNameSuffixCache.get(e);r||(r=new Map,this.eventNameSuffixCache.set(e,r));let i=r.get(t);if(i)return i;let n=`${e}:${this.id}:${t}`;return r.set(t,n),n}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)})}setInviewAutoBlocked(e){this.setProperty("inview-auto-blocked",e)}isInviewAutoBlocked(){return this.getProperty("inview-auto-blocked")===!0}syncInviewClass(){if(this.isInviewAutoBlocked()){this.htmlElement.classList.remove("-inview");return}if(this.getProperty("is-inview")===!0){this.htmlElement.classList.add("-inview");return}this.getProperty("repeat")&&this.htmlElement.classList.remove("-inview")}show(){this.isInviewAutoBlocked()||this.htmlElement.classList.add("-inview")}hide(){if(this.isInviewAutoBlocked()){this.htmlElement.classList.remove("-inview");return}this.getProperty("repeat")&&this.htmlElement.classList.remove("-inview")}connect(e){return this.modules.includes(e)?!1:(this.modules.push(e),!0)}addMirror(e){this.mirrors.set(e.id,e)}removeMirror(e){this.mirrors.delete(e)}get mirrorObjects(){return Array.from(this.mirrors.values())}get connects(){return this.mirrorObjects.map(e=>e.htmlElement)}};var at=class{constructor(){this.readQueue=[];this.writeQueue=[];this.computeQueue=[];this.isProcessing=!1;this.pendingFrame=null;this.rectCache=new WeakMap;this.dimensionCache=new WeakMap}scheduleRead(e,t=0){this.readQueue.push({priority:t,execute:e}),this.scheduleFlush()}scheduleCompute(e,t=0){this.computeQueue.push({priority:t,execute:e}),this.scheduleFlush()}scheduleWrite(e,t=0){this.writeQueue.push({priority:t,execute:e}),this.scheduleFlush()}batchModuleInitialization(e){e.forEach(({module:t,object:r,element:i,attributes:n,globalId:s})=>{this.scheduleRead(()=>{let o=i.getBoundingClientRect();this.rectCache.set(i,o),this.dimensionCache.set(i,{width:i.offsetWidth||i.clientWidth||o.width,height:i.offsetHeight||i.clientHeight||o.height}),t.initializeObject(s,r,i,n)},1)}),e.forEach(({module:t,object:r,windowSize:i})=>{this.scheduleCompute(()=>{t.calculatePositions(r,i)},2)}),e.forEach(({module:t,object:r})=>{this.scheduleWrite(()=>{t.connectObject(r),t.addObject(r.id,r)},3)})}getCachedRect(e){return this.rectCache.get(e)}getCachedDimensions(e){return this.dimensionCache.get(e)}scheduleFlush(){this.pendingFrame!==null||this.isProcessing||(this.pendingFrame=requestAnimationFrame(()=>{this.flush()}))}flush(){this.isProcessing=!0,this.pendingFrame=null;let e=(t,r)=>r.priority-t.priority;try{[...this.readQueue].sort(e).forEach(n=>{try{n.execute()}catch(s){console.error("[DOMBatcher] Read task error:",s)}}),this.readQueue=[],[...this.computeQueue].sort(e).forEach(n=>{try{n.execute()}catch(s){console.error("[DOMBatcher] Compute task error:",s)}}),this.computeQueue=[],[...this.writeQueue].sort(e).forEach(n=>{try{n.execute()}catch(s){console.error("[DOMBatcher] Write task error:",s)}}),this.writeQueue=[]}finally{this.rectCache=new WeakMap,this.dimensionCache=new WeakMap,this.isProcessing=!1}}flushSync(){this.pendingFrame!==null&&(cancelAnimationFrame(this.pendingFrame),this.pendingFrame=null),this.flush()}clear(){this.pendingFrame!==null&&(cancelAnimationFrame(this.pendingFrame),this.pendingFrame=null),this.readQueue=[],this.writeQueue=[],this.computeQueue=[],this.rectCache=new WeakMap,this.dimensionCache=new WeakMap}};var Rt=class{constructor(){this.desktop={rebuild:{width:!0,height:!0,scrollHeight:!0}};this.mobile={rebuild:{width:!0,height:!0,scrollHeight:!0}}}};var M=class{constructor(e){this.cssProperties=[];this.objectMapOnPage=new Map;this.objectsOnPage=[];this.objectMap=new Map;this.objects=[];this.htmlKey="";this._type=1;this.permissions=new Rt;this.tools=e.tools,this.data=e.data,this.settings=e.settings,this.events=e.events,this.centers=e.centers,this.hover=e.hover,this.objectManager=e.objectManager,this.attributesToMap=[{key:"active",type:"boolean",fallback:this.settings.active},{key:"fixed",type:"boolean",fallback:this.settings.fixed},{key:"outside-container",type:"boolean",fallback:this.settings["outside-container"]},{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 n=i.top;return Math.floor(n)+this.data.scroll.elementContainer.scrollTop*this.data.viewport.transformScale}},{key:"end",type:"number",fallback:(t,r,i)=>{let n=i.top,s=i.height;return n+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 n=this.tools.boundingClientRect.process({element:r});for(let{key:s,type:o,fallback:a,transform:l}of this.attributesToMap){let c=typeof a=="function"?a(r,t,n):a,d=i[s]??i[`string-${s}`]??i[`data-string-${s}`],p=this.tools.domAttribute.process({element:r,key:s,fallback:d??this.settings[s]??c}),h=this.parseAttribute(p,o,{element:r,boundingRect:n,viewportHeight:this.data.viewport.windowHeight,baseRem:this.data.viewport.baseRem});l&&(h=l(h)),t.setProperty(s,h)}this.cacheLayoutSnapshot(t,r)}cacheLayoutSnapshot(e,t){let r=this.data.scroll.container??document.body??document.documentElement,i=this.data.scroll.elementContainer??document.documentElement,n=this.tools.transformNullify.process({element:t}),s=window.getComputedStyle(t),o=this.getOffsetSize(t,s),a=0,l=0,c=n.width,d=n.height;if((!Number.isFinite(c)||c<=0)&&(c=o.width),(!Number.isFinite(d)||d<=0)&&(d=o.height),Number.isFinite(n.left)&&Number.isFinite(n.top)&&n.width>0&&n.height>0)if(r===document.body||r===document.documentElement)a=n.left+i.scrollLeft,l=n.top+i.scrollTop;else{let p=r.getBoundingClientRect();a=n.left-p.left+r.scrollLeft,l=n.top-p.top+r.scrollTop}else{let p=this.getOffsetChainPosition(t);if(r===document.body||r===document.documentElement)a=p.left,l=p.top;else{let h=this.getOffsetChainPosition(r);a=p.left-h.left+r.scrollLeft,l=p.top-h.top+r.scrollTop}}e.setProperty("layout-doc-left",a),e.setProperty("layout-doc-top",l),e.setProperty("layout-width",c),e.setProperty("layout-height",d),e.setProperty("layout-border-radius",s.borderRadius||"0px")}getOffsetSize(e,t){let r=parseFloat(t.width),i=parseFloat(t.height);return{width:e.offsetWidth||e.clientWidth||(Number.isFinite(r)?r:0),height:e.offsetHeight||e.clientHeight||(Number.isFinite(i)?i:0)}}getOffsetChainPosition(e){let t=0,r=0,i=e;for(;i;)t+=i.offsetLeft||0,r+=i.offsetTop||0,i=i.offsetParent;return{left:t,top:r}}calculatePositions(e,t){let r=e.getProperty("start"),i=e.getProperty("size"),n=e.getProperty("offset-bottom"),s=e.getProperty("offset-top"),o=e.getProperty("enter-el"),a=e.getProperty("enter-vp"),l=e.getProperty("exit-el"),c=e.getProperty("exit-vp"),d=0,p=0,h=0,v=0;o==="top"&&a==="top"||o==="left"&&a==="left"?(h=-t+1,d=r-n):o==="top"&&a==="bottom"||o==="left"&&a==="right"?d=r-t-n:o==="bottom"&&a==="top"||o==="right"&&a==="left"?(h=-t-i+1,d=r+i-n):(o==="bottom"&&a==="bottom"||o==="right"&&a==="right")&&(h=-i+1,d=r-t+i-n),l==="top"&&c==="top"||l==="left"&&c==="left"?(v=-i+1,p=r+s):l==="top"&&c==="bottom"||l==="left"&&c==="right"?(v=-t-i+1,p=r-t+s):l==="bottom"&&c==="top"||l==="right"&&c==="left"?p=r+i+s:(l==="bottom"&&c==="bottom"||l==="right"&&c==="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 m=e.getProperty("inview-top")??0,g=e.getProperty("inview-bottom")??0;e.setProperty("inview-start-position",e.getProperty("start-position")+m),e.setProperty("inview-end-position",e.getProperty("end-position")+g)}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;case"breakpoint-dimension":if(r.element!=null&&r.viewportHeight!=null&&r.baseRem!=null&&r.boundingRect!=null){let i=e.trim().split("|"),n=[];for(let s of i)if(s.includes(":")){let[o,a]=s.split(":");n.push({breakpoint:parseInt(o),value:this.tools.unitParser.process({value:`${a}|`,element:r.element,viewportHeight:r.viewportHeight,boundingRect:r.boundingRect,baseRem:r.baseRem})})}else n.push({breakpoint:0,value:this.tools.unitParser.process({value:s,element:r.element,viewportHeight:r.viewportHeight,boundingRect:r.boundingRect,baseRem:r.baseRem})});return n}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),this.onObjectDisconnected(t)}onObjectConnected(e){}onObjectDisconnected(e){}applyToElementAndConnects(e,t,r=t){e.getProperty("self-disable")!==!0&&t(e.htmlElement),e.mirrorObjects.forEach(i=>r(i.htmlElement,i))}applyVarToElement(e,t,r){e.getProperty("self-disable")!==!0&&this.tools.styleTxn.setVar(e.htmlElement,t,r)}applyPropToElement(e,t,r){e.getProperty("self-disable")!==!0&&this.tools.styleTxn.setProp(e.htmlElement,t,r)}applyVarToConnects(e,t,r){for(let i of e.mirrorObjects)this.tools.styleTxn.setVar(i.htmlElement,t,r)}applyPropToConnects(e,t,r){for(let i of e.mirrorObjects)this.tools.styleTxn.setProp(i.htmlElement,t,r)}getObjectEventName(e,t,r){return e.getScopedEventName(t,r)}destroy(){this.objects=[],this.objectMap=new Map}onInit(){}onSubscribe(){}onUnsubscribe(){}onFrame(e){}onMutate(e){}onScrollMeasure(e){}onMouseMoveMeasure(e){}onResize(){}onResizeWidth(){}onScroll(e){}onDirectionChange(){}onScrollStart(){}onScrollStop(){}onScrollDirectionChange(){}onAxisChange(){}onDeviceChange(){}onScrollConfigChange(){}onSettingsChange(){}onDOMRebuild(){}onMouseMove(e){}onWheel(e){}onDOMMutate(e,t){}};var Ft=class{constructor(e,t,r,i){this.data=e;this.modules=t;this.events=r;this.tools=i;this.objects=new Map;this.connectQueue=[];this.connectableModulesBuffer=[];this.mirrors=new Map;this.mirrorId=1;this.globalId=1;this.domBatcher=new at;this.domBatcherEnabled=!1;this.inviewStarts=[];this.inviewEnds=[];this.inviewActive=new Set;this.inviewStartIdx=0;this.inviewEndIdx=0;this.inviewIndexDirty=!0;this.lastInviewScrollPos=0;this.intersectionObserverEnabled=!0;this.domObserver=null}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 ot(t,e);e.setAttribute(r,i.id);let n=e.getAttribute("string")??e.getAttribute("data-string");n&&(i.keys=this.splitPipeAndTrim(n)),e.setAttribute("string-inited",""),this.objects.set(i.id,i);let s=this.getAllAttributes(e),o=this.modules.core;for(let c=0;c<o.length;c++){let d=o[c];"setupCoreProperties"in d&&typeof d.setupCoreProperties=="function"&&d.setupCoreProperties(i,e,s)}let a=this.connectableModulesBuffer;a.length=0;let l=this.modules.all;for(let c=0;c<l.length;c++){let d=l[c];d instanceof M&&d.canConnect(i)&&a.push(d)}if(this.domBatcherEnabled&&a.length>0){let c=new Array(a.length);for(let d=0;d<a.length;d++)c[d]={module:a[d],object:i,element:e,attributes:s,globalId:this.globalId,windowSize:this.data.viewport.windowHeight};this.domBatcher.batchModuleInitialization(c),this.domBatcher.scheduleWrite(()=>{this.initObservers(i,e),this.checkInviewForObject(i)})}else{for(let c=0;c<a.length;c++){let d=a[c];d.initializeObject(this.globalId,i,e,s),d.calculatePositions(i,this.data.viewport.windowHeight),d.connectObject(i),d.addObject(i.id,i)}this.initObservers(i,e),this.checkInviewForObject(i)}if(this.connectQueue.length>0){let c=0;for(let d=0;d<this.connectQueue.length;d++){let p=this.connectQueue[d];if(p.id===i.id){this.attachMirrorToObject(i,p.element);continue}this.connectQueue[c++]=p}this.connectQueue.length=c}a.length=0,this.inviewIndexDirty=!0}setDOMBatcherEnabled(e){this.domBatcherEnabled=e,e||this.domBatcher.flushSync()}setIntersectionObserverEnabled(e){if(this.intersectionObserverEnabled!==e){this.intersectionObserverEnabled=e;for(let t of this.objects.values())t.getProperty("observer-progress")?.disconnect(),e&&this.initObservers(t,t.htmlElement)}}invalidateInviewIndex(){this.inviewIndexDirty=!0}refreshLayoutForRoot(e){if(!e)return;let t=new Set,r=n=>{let s=n.getAttribute("string-id")??n.getAttribute("data-string-id");if(!s)return;let o=this.objects.get(s);o&&t.add(o)};if(e instanceof HTMLElement){r(e);let n=e.querySelectorAll("[string-id],[data-string-id]");for(let s=0;s<n.length;s++)r(n[s])}if(t.size===0)return;let i=this.data.viewport.windowHeight;for(let n of t){let s=n.htmlElement;if(!s||!s.isConnected)continue;let o=this.getAllAttributes(s),a=this.modules.all;for(let l=0;l<a.length;l++){let c=a[l];c instanceof M&&c.canConnect(n)&&(c.initializeObject(this.globalId,n,s,o),c.calculatePositions(n,i))}}this.inviewIndexDirty=!0,this.checkInview()}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(),t.mirrorObjects.forEach(r=>{let i=this.getMirrorIds(r.htmlElement);this.setMirrorIds(r.htmlElement,i.filter(s=>s!==r.id)),this.mirrors.delete(r.id);let n=r.htmlElement.getAttribute("string-copy-from")??r.htmlElement.getAttribute("data-string-copy-from");n&&this.enqueueConnection(n,r.htmlElement)}),this.objects.delete(e),this.inviewActive.delete(t),this.inviewIndexDirty=!0)}enqueueConnection(e,t){let r=this.splitPipeAndTrim(e);for(let i=0;i<r.length;i++){let n=r[i];this.connectQueue.some(s=>s.id===n&&s.element===t)||this.connectQueue.push({id:n,element:t})}}linkMirror(e,t){let r=this.splitPipeAndTrim(e);for(let i=0;i<r.length;i++){let n=r[i],s=this.objects.get(n);s?this.attachMirrorToObject(s,t):this.enqueueConnection(n,t)}}attachMirrorToObject(e,t){let r=this.getMirrorIds(t);for(let o of r){let a=this.mirrors.get(o);if(a&&a.parentObject===e)return a}let i=`string-mirror-${this.mirrorId++}`,n=new It(i,t,e);this.setMirrorIds(t,[...r,i]),e.addMirror(n),this.mirrors.set(i,n);let s=t.getAttribute("string-easing")??t.getAttribute("data-string-easing");return s&&s.trim().length>0&&(n.setEasing(this.tools.easingFunction.process({easing:s})),n.setProperty("easing",s)),n}detachMirrorByElement(e){let t=this.getMirrorIds(e);t.length!==0&&(t.forEach(r=>this.detachMirrorById(r)),this.clearMirrorIds(e))}detachMirrorById(e){let t=this.mirrors.get(e);t&&(t.parentObject.removeMirror(e),this.mirrors.delete(e))}getMirrorIds(e){let t=e.getAttribute("string-mirror-id")??e.getAttribute("data-string-mirror-id");return t?this.splitPipeAndTrim(t):[]}setMirrorIds(e,t){if(t.length===0){this.clearMirrorIds(e);return}e.setAttribute("string-mirror-id",t.join("|"))}clearMirrorIds(e){e.removeAttribute("string-mirror-id"),e.removeAttribute("data-string-mirror-id")}getAllAttributes(e){let t={},r=e.attributes;for(let i=0;i<r.length;i++){let n=r[i];t[n.name]=n.value}return t}initObservers(e,t){if(!this.intersectionObserverEnabled)return;let r=e.getProperty("offset-top")??0,i=e.getProperty("offset-bottom")??0;e.getProperty("observer-progress")?.disconnect();let n=h=>{h.forEach(v=>{this.events.emit(e.getScopedEventName("object:activate"),v.isIntersecting),v.isIntersecting?e.enter():e.leave()})},s=e.getProperty("outside-container"),o=t.getAttribute("string-outside-container")??t.getAttribute("data-string-outside-container"),a=o!=null?o.trim().toLowerCase():null,l=a===""||a==="true"||a==="1",c=s!=null?s===!0:l,d=this.data.scroll.container===document.body||c?null:this.data.scroll.container,p=new IntersectionObserver(n,{root:d,rootMargin:`${i+this.data.viewport.windowHeight}px 0px ${r+this.data.viewport.windowHeight}px 0px`,threshold:0});p.observe(t),e.setProperty("observer-progress",p)}observeDOM(){this.domObserver?.disconnect();let e=new MutationObserver(t=>{let r=!1;for(let i=0;i<t.length;i++){let n=t[i];if(n.type==="childList"){let s=!1;for(let o=0;o<n.removedNodes.length;o++){let a=n.removedNodes[o];if(a.nodeType!==Node.ELEMENT_NODE)continue;s=!0;let l=a;if(this.detachMirrorByElement(l),this.isFixed(l))continue;l.hasAttribute("string")&&this.handleRemoved(l);let c=l.querySelectorAll("[string],[data-string]");for(let p=0;p<c.length;p++){let h=c[p];this.isFixed(h)||this.handleRemoved(h)}let d=l.querySelectorAll("[string-copy-from],[data-string-copy-from]");for(let p=0;p<d.length;p++)this.detachMirrorByElement(d[p])}for(let o=0;o<n.addedNodes.length;o++){let a=n.addedNodes[o];if(a.nodeType!==Node.ELEMENT_NODE)continue;s=!0;let l=a;if(this.isFixed(l))continue;l.hasAttribute("string")&&!l.hasAttribute("string-inited")&&this.add(l);let c=l.querySelectorAll("[string]:not([string-inited]),[data-string]:not([string-inited])");for(let h=0;h<c.length;h++)this.add(c[h]);let d=l.getAttribute("string-copy-from")??l.getAttribute("data-string-copy-from");d&&this.linkMirror(d,l);let p=l.querySelectorAll("[string-copy-from],[data-string-copy-from]");for(let h=0;h<p.length;h++){let v=p[h],m=v.getAttribute("string-copy-from")??v.getAttribute("data-string-copy-from");m&&this.linkMirror(m,v)}}s&&(this.modules.onDOMMutate(n.addedNodes,n.removedNodes),r=!0)}}if(r){let i=this.modules.all;for(let n=0;n<i.length;n++)i[n].onDOMRebuild();this.events.emit("dom:changed",null)}});e.observe(document.body,{childList:!0,subtree:!0}),this.domObserver=e}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(e){for(let t of this.objects.values()){if(!t.htmlElement||!t.htmlElement.isConnected)continue;let r=null,i=this.modules.all;for(let n=0;n<i.length;n++){let s=i[n],o=!1;e.isDesktop?(s.permissions.desktop.rebuild.scrollHeight&&e.scrollHeightChanged&&(o=!0),s.permissions.desktop.rebuild.width&&e.widthChanged&&(o=!0),s.permissions.desktop.rebuild.height&&e.heightChanged&&(o=!0)):(s.permissions.mobile.rebuild.scrollHeight&&e.scrollHeightChanged&&(o=!0),s.permissions.mobile.rebuild.width&&e.widthChanged&&(o=!0),s.permissions.mobile.rebuild.height&&e.heightChanged&&(o=!0)),(o||e.isForceRebuild)&&s.canConnect(t)&&(r==null&&(r=this.getAllAttributes(t.htmlElement)),s.initializeObject(this.globalId,t,t.htmlElement,r),s.calculatePositions(t,this.data.viewport.windowHeight),s.connectObject(t))}}this.inviewIndexDirty=!0}isFixed(e){return e.hasAttribute("string-fixed")}checkInview(){let e=this.data.scroll.transformedCurrent;this.updateInviewWindow(e);for(let t of this.inviewActive)this.checkInviewForObject(t)}checkInviewForObject(e){let t=this.data.scroll.transformedCurrent;if(!this.intersectionObserverEnabled){let c=e.getProperty("start-position"),d=e.getProperty("end-position");if(c!=null&&d!=null){let p=Math.min(c,d),h=Math.max(c,d),v=e.getProperty("is-active")??!1,m=t>=p&&t<=h;m!==v&&(e.setProperty("is-active",m),this.events.emit(e.getScopedEventName("object:activate"),m),m?e.enter():e.leave())}}let r=e.getProperty("inview-start-position"),i=e.getProperty("inview-end-position"),n=e.getProperty("is-inview")??!1,s=Math.min(r,i),o=Math.max(r,i),a=t>=s&&t<=o,l=null;if(!n&&a){let c=Math.abs(t-s),d=Math.abs(o-t);l=c<=d?"enter-top":"enter-bottom"}else n&&!a&&(l=t<s?"exit-top":"exit-bottom");a!==n&&(e.setProperty("is-inview",a),this.events.emit(e.getScopedEventName("object:inview"),{inView:a,direction:l}),a?e.show():e.hide())}updateInviewWindow(e){let t=this.data.viewport.windowHeight,r=e-t,i=e+this.data.viewport.windowHeight+t;for((this.inviewIndexDirty||e<this.lastInviewScrollPos)&&this.rebuildInviewIndex(r,i);this.inviewStartIdx<this.inviewStarts.length&&this.inviewStarts[this.inviewStartIdx].pos<=i;)this.inviewActive.add(this.inviewStarts[this.inviewStartIdx].object),this.inviewStartIdx++;for(;this.inviewEndIdx<this.inviewEnds.length&&this.inviewEnds[this.inviewEndIdx].pos<r;)this.inviewActive.delete(this.inviewEnds[this.inviewEndIdx].object),this.inviewEndIdx++;this.lastInviewScrollPos=e}rebuildInviewIndex(e,t){this.inviewStarts=[],this.inviewEnds=[];for(let r of this.objects.values()){let i=r.getProperty("inview-start-position"),n=r.getProperty("inview-end-position");i==null||n==null||(this.inviewStarts.push({pos:Math.min(i,n),object:r}),this.inviewEnds.push({pos:Math.max(i,n),object:r}))}this.inviewStarts.sort((r,i)=>r.pos-i.pos),this.inviewEnds.sort((r,i)=>r.pos-i.pos),this.inviewActive.clear(),this.inviewStartIdx=this.upperBound(this.inviewStarts,t),this.inviewEndIdx=this.upperBound(this.inviewEnds,e-1);for(let r=0;r<this.inviewStartIdx;r++)this.inviewActive.add(this.inviewStarts[r].object);for(let r=0;r<this.inviewEndIdx;r++)this.inviewActive.delete(this.inviewEnds[r].object);this.inviewIndexDirty=!1}upperBound(e,t){let r=0,i=e.length;for(;r<i;){let n=r+i>>>1;e[n].pos<=t?r=n+1:i=n}return r}splitPipeAndTrim(e){let t=e.split("|"),r=[];for(let i=0;i<t.length;i++){let n=t[i].trim();n.length>0&&r.push(n)}return r}destroy(){this.domObserver?.disconnect(),this.domObserver=null,this.domBatcher.clear()}};var et={SCROLL_FORWARD:"-scroll-forward",SCROLL_BACKWARD:"-scroll-backward",SCROLLING_FORWARD:"-scrolling-forward",SCROLLING_BACKWARD:"-scrolling-backward"};var $=class{constructor(e){this.name="";this.isProg=!1;this.isParallaxEnabled=!1;this._scrollDirection="vertical";this.isBottomScrollDirection=null;this.isLastBottomScrollDirection=!0;this.scrollTriggerRules=[];this.isActive=!1;this.lastAppliedDirection=null;this.onChangeDirection=()=>{};this.onScrollStart=()=>{};this.onScrollStop=()=>{};this.onCalcUpdate=()=>{this.isActive&&(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.isActive&&(this.context.data.scroll.scrollContainer?.scrollTo(0,this.context.data.scroll.current),this.triggerScrollRules())}:this._scrollDirection==="horizontal"&&(this.onCalcUpdate=()=>{this.isActive&&this.context.data.scroll.scrollContainer?.scrollTo(this.context.data.scroll.current,0)})}onFrame(){}onWheel(e){}onScroll(e){}disableScrollEvents(){}enableScrollEvents(){}activate(){this.isActive||(this.isActive=!0,this.enableScrollEvents())}deactivate(){this.isActive&&(this.isActive=!1,this.disableScrollEvents(),this.isProg=!1,this.context.data.scroll.target=this.context.data.scroll.current,this.context.data.scroll.delta=0,this.context.data.scroll.lerped=0,this.context.data.scroll.displacement=0,this.clearScrollingClasses(),this.isBottomScrollDirection=null,this.lastAppliedDirection=null,this.onScrollStop())}destroy(){}updateScrollDirection(e){if(this.isLastBottomScrollDirection=e,this.isBottomScrollDirection===null){this.isBottomScrollDirection=e;return}this.context.data.scroll.isScrollingDown=e,this.onChangeDirection(),this.context.events.emit("scroll:direction:change",this.context.data.scroll.isScrollingDown),this.context.settings["global-class"]&&this.lastAppliedDirection!==e&&(document.documentElement.classList.toggle(et.SCROLLING_FORWARD,e),document.documentElement.classList.toggle(et.SCROLLING_BACKWARD,!e),document.documentElement.classList.toggle(et.SCROLL_FORWARD,e),document.documentElement.classList.toggle(et.SCROLL_BACKWARD,!e),this.lastAppliedDirection=e)}clearScrollingClasses(){document.documentElement.classList.remove(et.SCROLLING_BACKWARD,et.SCROLLING_FORWARD)}triggerScrollRules(){this.scrollTriggerRules.forEach(e=>{let t=(e.direction==="any"||this.isLastBottomScrollDirection&&e.direction==="forward")&&this.context.data.scroll.current>=e.offset;t&&!e.isActive?(e.onEnter?.(),e.toggleClass&&e.toggleClass.target.classList.add(e.toggleClass.className),e.isActive=!0):!t&&e.isActive&&(e.onLeave?.(),e.toggleClass&&e.toggleClass.target.classList.remove(e.toggleClass.className),e.isActive=!1)})}addScrollMark(e){this.scrollTriggerRules.push(e)}removeScrollMark(e){this.scrollTriggerRules=this.scrollTriggerRules.filter(t=>t.id!==e)}scrollTo(e,t){}};var Ht=class extends ${constructor(t){super(t);this.name="default";this.previousScrollTop=0;this.isScrolling=!1;this.lastScrollEventTime=0;this.scrollStopDelay=120}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.isScrolling&&(this.isScrolling=!1,this.onScrollStop(),this.clearScrollingClasses()))}this.isScrolling&&performance.now()-this.lastScrollEventTime>this.scrollStopDelay&&(this.isScrolling=!1,this.onScrollStop(),this.clearScrollingClasses())}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,r!==this.previousScrollTop&&(this.updateScrollDirection(r>this.previousScrollTop),this.previousScrollTop=r),this.lastScrollEventTime=performance.now(),this.isScrolling||(this.isScrolling=!0,this.onScrollStart())}onWheel(t){if(t.deltaY!==0){this.context.data.scroll.delta===0&&!this.isScrolling&&(this.isScrolling=!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,this.lastScrollEventTime=performance.now()}}deactivate(){super.deactivate(),this.isScrolling=!1,this.lastScrollEventTime=0,this.previousScrollTop=this.context.data.scroll.current}scrollTo(t,r){this.context.data.scroll.target=t,this.context.data.scroll.current=t,this.context.data.scroll.delta=0,this.context.data.scroll.lerped=0,this._scrollDirection==="vertical"?this.context.data.scroll.scrollContainer?.scrollTo({top:t,left:0,behavior:r?"auto":"smooth"}):this.context.data.scroll.scrollContainer?.scrollTo({left:t,top:0,behavior:r?"auto":"smooth"})}};var Nt=class extends ${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)}enableScrollEvents(){window.addEventListener("touchmove",this.onPreventScroll,{passive:!1}),window.addEventListener("keydown",this.onPreventKeyScroll)}disableScrollEvents(){window.removeEventListener("touchmove",this.onPreventScroll),window.removeEventListener("keydown",this.onPreventKeyScroll)}onFrame(){}onWheel(t){t.preventDefault()}onScroll(t){t.preventDefault()}};var Vt=class extends ${constructor(t){super(t);this.name="smooth";this.isScrollbarManipulation=!1;this.scrollForce=0;this.wheelImpulse=0;this.previousCurrent=0;this.velocityThreshold=.1;this.stepResult={current:0,target:0,delta:0,lerped:0,scrollForce:0,absVelocity:0}}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(),this.clearScrollingClasses(),this.isBottomScrollDirection=null,this.lastAppliedDirection=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}this.context.data.scroll.delta!==0&&(this.computeStep(this.context.data.scroll.current,this.context.data.scroll.target,this.context.data.scroll.delta,this.context.data.scroll.speed,this.context.data.scroll.speedAccelerate,this.context.data.scroll.bottomPosition,this.stepResult),this.scrollForce=this.stepResult.scrollForce,this.context.data.scroll.target=this.stepResult.target,this.context.data.scroll.delta=this.stepResult.delta,this.context.data.scroll.lerped=this.stepResult.lerped,this.context.data.scroll.current=this.stepResult.current,this.context.data.scroll.transformedCurrent=this.context.data.scroll.current*this.context.data.viewport.transformScale,this.updateScrollDirection(this.context.data.scroll.lerped>0),this.stepResult.absVelocity<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,n=this.context.data.scroll.target===this.context.data.scroll.bottomPosition&&r>0;i||n||(this.context.data.scroll.delta+=this.wheelImpulse)}onScroll(t){this.isProg||(this.isScrollbarManipulation=!0)}deactivate(){super.deactivate(),this.isScrollbarManipulation=!1,this.scrollForce=0,this.wheelImpulse=0,this.previousCurrent=this.context.data.scroll.current}scrollTo(t,r){if(r){this.context.data.scroll.current=t,this.context.data.scroll.target=t,this.context.data.scroll.delta=0,this.context.data.scroll.lerped=0,this.context.data.scroll.transformedCurrent=this.context.data.scroll.current*this.context.data.viewport.transformScale,this.onCalcUpdate();return}this.context.data.scroll.target=t,this.context.data.scroll.delta=1}computeStep(t,r,i,n,s,o,a){let l=i*s,c=Math.min(Math.max(0,r+l),o),d=i-l,p=(c-t)*n,h=p>0?Math.ceil(t+p):Math.floor(t+p);a.current=h,a.target=c,a.delta=d,a.lerped=p,a.scrollForce=l,a.absVelocity=Math.abs(p)}};var _t=class{constructor(e){this.context=e;this.modes=new Map;this.boundEvents=null;this.scrollMarks=[];this.registerMode("smooth",new Vt(e)),this.registerMode("default",new Ht(e)),this.registerMode("disable",new Nt(e)),this.updateResponsiveMode()}registerMode(e,t){let r=this.context.data.scroll.mode===e,i=this.modes.get(e);i&&(r&&i.deactivate(),i.destroy()),t.name||(t.name=String(e)),this.modes.set(e,t),this.boundEvents&&(t.onScrollStart=this.boundEvents.onScrollStart,t.onScrollStop=this.boundEvents.onScrollStop,t.onChangeDirection=this.boundEvents.onDirectionChange),this.scrollMarks.length>0&&this.scrollMarks.forEach(n=>t.addScrollMark(n)),r&&t.activate()}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<1024?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}if(this.context.data.scroll.mode===e){this.get().activate();return}this.get().deactivate(),this.context.data.scroll.mode=e,this.get().activate()}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.boundEvents=e,this.modes.forEach(t=>{t.onScrollStart=e.onScrollStart,t.onScrollStop=e.onScrollStop,t.onChangeDirection=e.onDirectionChange})}addScrollMark(e){this.scrollMarks.push(e),this.modes.forEach(t=>{t.addScrollMark(e)})}removeScrollMark(e){this.scrollMarks=this.scrollMarks.filter(t=>t.id!==e),this.modes.forEach(t=>{t.removeScrollMark(e)})}destroy(){this.modes.forEach(e=>{e.deactivate(),e.destroy()})}};var Wt=class{constructor(){this.targetX=0;this.targetY=0;this.smoothedX=0;this.smoothedY=0;this.stepX=0;this.stepY=0;this.velocityX=0;this.velocityY=0}};var zt=class{constructor(){this.threeInstance=null}};var Bt=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 $t=class{constructor(){this.fpsTracker=!1;this.positionTracker=!1;this.suppressMasonryResize=!1}};var jt=class{constructor(){this.now=0;this.previous=0;this.delta=0;this.elapsed=0}};var Ut=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 ht=class{constructor(){this.scroll=new Bt;this.viewport=new Ut;this.cursor=new Wt;this.render=new zt;this.time=new jt;this.system=new $t}};var mt=class{process({element:e}){return e.getBoundingClientRect()}};var gt=class{process({element:e,key:t,fallback:r=null}){return e.getAttribute(`string-${t}`)??e.getAttribute(`data-string-${t}`)??r}};var ft=class{process({record:e,name:t,fallback:r=null}){return e[t]??e[`data-${t}`]??r}};var rt=class{process({element:e}){let t=e.getBoundingClientRect(),i=getComputedStyle(e).transform.match(/-?[\d.]+/g)?.map(parseFloat)??[];if(i.length===6){let[n,s,o,a,l,c]=i,d=n*a-s*o;return{width:t.width/(n||1),height:t.height/(a||1),left:(t.left*a-t.top*o+o*c-l*a)/d,top:(-t.left*s+t.top*n+l*s-n*c)/d}}return t}};var vt=class{constructor(e=new rt){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 bt=class{process({from:e,to:t,progress:r}){return(t-e)*r}};var yt=class{process({value:e,element:t,viewportHeight:r,baseRem:i,boundingRect:n}){let s=e.split("|").map(a=>a.trim()).filter(Boolean),o=0;for(let a of s){let l=a,c=!1;l.startsWith("-")&&(c=!0,l=l.slice(1));let d=0;l==="selfHeight"?d=t.offsetHeight:l.endsWith("px")?d=parseFloat(l):l.endsWith("%")?d=parseFloat(l)/100*r:l.endsWith("rem")?d=parseFloat(l)*i:l.endsWith("sh")?d=parseFloat(l)*n.height/100:d=parseFloat(l),o+=c?-d:d}return o}};var St=class{process({value:e,inMin:t=.1,inMax:r=1,outMin:i=.05,outMax:n=.65}){if(e<t)return n;if(e>1&&(e=1),e<=r){let s=(e-t)/(r-t);return n-s*(n-i)}return i}};var G={left:0,center:.5,right:1},X={top:0,center:.5,bottom:1},xt=class{process({value:e}){if(!e)return"center";let t=e.trim();if(t.startsWith("random(")&&t.endsWith(")")){let r=t.slice(7,-1).split(",").map(n=>n.trim()).filter(Boolean),i=Math.floor(Math.random()*r.length);return r[i]}return t}toNormalized({value:e}){let r=this.process({value:e}).toLowerCase().split(/\s+/).filter(Boolean);if(r.length===0)return{x:.5,y:.5};if(r.length===1){let a=r[0],l=this.parseValue(a);return a in G&&!(a in X)?{x:l,y:.5}:a in X&&!(a in G)?{x:.5,y:l}:{x:l,y:l}}let[i,n]=r,s=i in X&&!(i in G),o=n in G&&!(n in X);return s||o?{x:this.parseValue(n,"horizontal"),y:this.parseValue(i,"vertical")}:{x:this.parseValue(i,"horizontal"),y:this.parseValue(n,"vertical")}}parseValue(e,t){if(t==="horizontal"&&e in G)return G[e];if(t==="vertical"&&e in X)return X[e];if(e in G)return G[e];if(e in X)return X[e];if(e.endsWith("%")){let i=parseFloat(e);if(!isNaN(i))return i/100}let r=parseFloat(e);return isNaN(r)?.5:r>1?r/100:r}};var Et=class{process({value:e}){let t=e.trim().toLowerCase();if(t.startsWith("#")){let n=t.slice(1);n.length===3&&(n=n.split("").map(c=>c+c).join(""));let s=parseInt(n.slice(0,2),16),o=parseInt(n.slice(2,4),16),a=parseInt(n.slice(4,6),16),l=n.length===8?parseInt(n.slice(6,8),16)/255:1;return{r:s,g:o,b:a,a:l}}let r=t.match(/rgba?\(([^)]+)\)/);if(r){let[n,s,o,a=1]=r[1].split(",").map(l=>parseFloat(l.trim()));return{r:n,g:s,b:o,a}}let i=t.match(/hsla?\(([^)]+)\)/);if(i){let[n,s,o,a="1"]=i[1].split(",").map(p=>p.trim()),[l,c,d]=this.hslToRgb(parseFloat(n),parseFloat(s),parseFloat(o));return{r:l,g:c,b:d,a:parseFloat(a)}}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=(c,d,p)=>(p<0&&(p+=1),p>1&&(p-=1),p<1/6?c+(d-c)*6*p:p<1/2?d:p<2/3?c+(d-c)*(2/3-p)*6:c),n=r<.5?r*(1+t):r+t-r*t,s=2*r-n,o=Math.round(i(s,n,e+1/3)*255),a=Math.round(i(s,n,e)*255),l=Math.round(i(s,n,e-1/3)*255);return[o,a,l]}};var Mt=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,n,s,o]=r.slice(1).map(Number);return this.cubicBezier(i,n,s,o)}return i=>i}cubicBezier(e,t,r,i){let n=3*e,s=3*(r-e)-n,o=1-n-s,a=3*t,l=3*(i-t)-a,c=1-a-l;function d(m){return((o*m+s)*m+n)*m}function p(m){return((c*m+l)*m+a)*m}function h(m){return(3*o*m+2*s)*m+n}function v(m,g=1e-5){let b,y,f=m,S,E,T;for(T=0;T<8;T++){if(S=d(f)-m,Math.abs(S)<g)return f;if(E=h(f),Math.abs(E)<1e-6)break;f=f-S/E}for(b=0,y=1,f=m;b<y;){if(S=d(f)-m,Math.abs(S)<g)return f;S>0?y=f:b=f,f=(y+b)/2}return f}return function(m){return p(v(m))}}};var wt=class{process({distance:e,radius:t,strength:r}){if(e>=t)return 0;let i=(t-e)/t;return r*i}};var Tt=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 Ct=class{process({from:e,to:t,progress:r}){return{x:(t.x-e.x)*r,y:(t.y-e.y)*r}}};var Pt=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 n=i[1].split(",").map(s=>parseFloat(s.trim()));if(n.length>=1&&!isNaN(n[0]))return n[0]}}if(r.startsWith("scale(")){let i=r.match(/scale\(([^)]+)\)/);if(i&&i[1]){let n=i[1].split(",").map(s=>parseFloat(s.trim()));if(n.length>=1&&!isNaN(n[0]))return n[0]}}if(r.startsWith("scaleX(")){let i=r.match(/scaleX\(([^)]+)\)/);if(i&&i[1]){let n=parseFloat(i[1].trim());if(!isNaN(n))return n}}if(r.startsWith("scale3d(")){let i=r.match(/scale3d\(([^)]+)\)/);if(i&&i[1]){let n=i[1].split(",").map(s=>parseFloat(s.trim()));if(n.length>=1&&!isNaN(n[0]))return n[0]}}if(r.startsWith("matrix3d(")){let i=r.match(/matrix3d\(([^)]+)\)/);if(i&&i[1]){let n=i[1].split(",").map(s=>parseFloat(s.trim()));if(n.length>=1&&!isNaN(n[0]))return n[0]}}}catch(i){return console.error(`Error parsing transform string "${r}":`,i),1}return 1}};var qt=class{process({attributeValue:e}){let t={line:[],word:[],char:[],charLine:[],charWord:[],wordLine:[],fit:!1};return e&&e.split("|").forEach(i=>{let n=i.trim();if(!n)return;let s=n.match(/^(\w+-)?(\w+)(\[(.*?)\])?$/);if(s){let o=s[1]||"",a=s[2],l=this.toCamelCase(o+a),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;case"fit":t.fit=!0;break;default:console.warn(`SplitOptionsParserTool: Unrecognized option type "${l}" in part "${n}"`);break}}else console.warn(`SplitOptionsParserTool: Could not parse part format "${n}"`)}),t}toCamelCase(e){return e.replace(/-([a-z])/g,(t,r)=>r.toUpperCase())}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 Lt=class{process({value:e}){let t=[],r="",i=0;for(let n=0;n<e.length;n++){let s=e[n];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(n=>{let s=n.match(/^(\w+)(?:\((.*)\))?$/);if(s){let[,a,l]=s;return l?{key:a,params:l.split(",").map(c=>c.trim())}:{key:a}}let o=n.indexOf(":");if(o!==-1){let a=n.slice(0,o).trim(),l=n.slice(o+1).trim(),c=l?l.split(",").map(d=>d.trim()):void 0;return{key:a,params:c}}return{key:n}})}};var Yt=class{constructor(){this.inputValidators={required:e=>e!=null&&String(e).trim()!=="",min:(e,t)=>typeof e=="string"&&e.length>=Number(t?.[0]??0),max:(e,t)=>typeof e=="string"&&e.length<=Number(t?.[0]??Number.MAX_SAFE_INTEGER),checked:e=>{if(Array.isArray(e))return e.length>0;if(e===!0||e==="true"||e===1||e==="1")return!0;if(typeof e=="string"){let t=e.trim().toLowerCase();return t==="false"||t==="0"?!1:t.length>0}return!!e},email:e=>typeof e=="string"&&/^[^\s@]+@([a-z0-9-]+\.)+[a-z]{2,}$/i.test(e),phone:e=>{if(typeof e!="string")return!1;let t=e.trim();if(t===""||!/^[0-9()\s+-.]+$/.test(t))return!1;let r=t.replace(/\D/g,"").length;return r>=7&&r<=15},number:e=>typeof e=="string"&&/^-?\d+(\.\d+)?$/.test(e),integer:e=>typeof e=="string"&&/^-?\d+$/.test(e),url:e=>typeof e=="string"&&/^(https?:\/\/)?([\w\-]+\.)+[\w\-]+(\/[\w\-._~:\/?#[\]@!$&'()*+,;=]*)?$/.test(e),regex:(e,t)=>this.testByRegex(e,t?.[0]),alpha:e=>this.testByRegex(e,"^[A-Za-z]+$",!0),alpha_num:e=>this.testByRegex(e,"^[A-Za-z0-9]+$",!0),alpha_dash:e=>this.testByRegex(e,"^[A-Za-z0-9_-]+$",!0),same:(e,t,r)=>{let i=t?.[0],n=this.getContextValue(r,i);return i&&n===void 0?!1:this.areValuesEqual(e,n)},different:(e,t,r)=>{let i=t?.[0],n=this.getContextValue(r,i);return i&&n===void 0?!1:!this.areValuesEqual(e,n)},range:(e,t)=>{if(e==null||e==="")return!0;let r=Number(e),i=Number(t?.[0]),n=Number(t?.[1]);return Number.isNaN(r)||Number.isNaN(i)||Number.isNaN(n)?!1:r>=i&&r<=n},digits:(e,t)=>{if(typeof e!="string")return!1;let r=Number(t?.[0]??0);return r<=0?!1:new RegExp(`^\\d{${r}}$`).test(e)},ip:e=>typeof e=="string"&&(this.isIPv4(e)||this.isIPv6(e)),mimes:(e,t)=>this.validateMimes(e,t),max_size:(e,t)=>{let r=Number(t?.[0]);return!r||r<=0?!0:this.validateMaxSize(e,r)},after:(e,t,r)=>this.compareDates(e,t,r,"after"),before:(e,t,r)=>this.compareDates(e,t,r,"before")};this.beforeInputValidators={number:e=>/^-?\d*\.?\d*$/.test(e),integer:e=>/^-?\d*$/.test(e),email:e=>/^[\w@.\-+]*$/.test(e),phone:e=>/^[0-9()\s+-.]*$/.test(e),letters:e=>/^[a-zA-Z]*$/.test(e),lettersSpaces:e=>/^[a-zA-Z\s]*$/.test(e),lettersNumbers:e=>/^[a-zA-Z0-9]*$/.test(e),alpha:e=>/^[A-Za-z]*$/.test(e),alpha_num:e=>/^[A-Za-z0-9]*$/.test(e),alpha_dash:e=>/^[A-Za-z0-9_-]*$/.test(e),digits:(e,t)=>{let r=Number(t?.[0]??0);return r<=0?/^\d*$/.test(e):new RegExp(`^\\d{0,${r}}$`).test(e)},url:e=>/^[a-zA-Z0-9\-._~:\/?#\[\]@!$&'()*+,;=%]*$/.test(e),pattern:(e,t)=>{try{return new RegExp(t?.[0]||"").test(e)}catch{return!0}}}}process({rules:e,value:t,type:r="input",context:i}){let n=[];for(let c of e){var s=null,o=null,a=!0,l=!0;r=="input"&&(o=this.inputValidators[c.key],!o)||r=="beforeinput"&&(s=this.beforeInputValidators[c.key],!s)||(o&&(a=o(t,c.params,i)),s&&(l=s(t,c.params,i)),l||n.push(this.getErrorMessage(c.key,c.params)),a||n.push(this.getErrorMessage(c.key,c.params)))}return{valid:n.length===0,errors:n}}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"integer":return"Only whole numbers are allowed";case"url":return"Invalid URL address";case"checked":return"You must accept";case"regex":return"Value does not match the required pattern";case"alpha":return"Only letters are allowed";case"alpha_num":return"Only letters and numbers are allowed";case"alpha_dash":return"Only letters, numbers, dashes, and underscores are allowed";case"same":return"Values do not match";case"different":return"Values must be different";case"range":return`Value must be between ${t?.[0]} and ${t?.[1]}`;case"digits":return`Value must contain exactly ${t?.[0]} digits`;case"ip":return"Invalid IP address";case"mimes":return`Allowed file types: ${t?.join(", ")}`;case"max_size":return`File must be smaller than ${t?.[0]} KB`;case"after":return`Date must be after ${t?.[0]}`;case"before":return`Date must be before ${t?.[0]}`;default:return"Invalid value"}}validateMimes(e,t){if(!t||t.length===0)return!0;let r=this.extractFiles(e);if(r.length===0)return!0;let i=t.map(n=>n.trim().toLowerCase());return r.every(n=>this.isMimeAllowed(n,i))}validateMaxSize(e,t){let r=this.extractFiles(e);if(r.length===0)return!0;let i=t*1024;return r.every(n=>typeof n.size!="number"?!0:n.size<=i)}extractFiles(e){if(!e)return[];let t=[];return typeof File<"u"&&e instanceof File?(t.push(e),t):typeof FileList<"u"&&e instanceof FileList?Array.from(e):Array.isArray(e)?(e.forEach(r=>{t.push(...this.extractFiles(r))}),t):typeof e=="object"&&("name"in e||"size"in e||"type"in e)?(t.push(e),t):(typeof e=="string"&&e!==""&&t.push({name:e}),t)}isMimeAllowed(e,t){let r=(e.type||"").toLowerCase(),i=this.getFileExtension(e.name);return t.some(n=>{let s=n.replace(/^\./,"").toLowerCase();return s?s.includes("/")?r===s:i===s:!1})}getFileExtension(e){if(!e)return"";let t=e.split(".");return t.length<=1?"":(t.pop()||"").toLowerCase()}compareDates(e,t,r,i){if(e==null||e==="")return!0;let n=t?.[0];if(!n)return!0;let s=this.toDate(e),o=this.resolveDateReference(n,r);return!s||!o?!1:i==="after"?s.getTime()>o.getTime():s.getTime()<o.getTime()}resolveDateReference(e,t){let r=this.getContextValue(t,e);if(r!==void 0)return this.toDate(r);if(e.toLowerCase()==="now")return new Date;if(e.toLowerCase()==="today"){let i=new Date;return i.setHours(0,0,0,0),i}return this.toDate(e)}toDate(e){if(e==null||e==="")return null;if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;if(typeof e=="number"){let t=new Date(e);return Number.isNaN(t.getTime())?null:t}if(typeof e=="string"){let t=Date.parse(e);if(!Number.isNaN(t))return new Date(t)}return null}testByRegex(e,t,r=!1){if(t==null||t==="")return!0;let i=typeof e=="string"?e:e==null?"":String(e);if(r&&i==="")return!0;try{let{source:n,flags:s}=this.normalizeRegex(t);return new RegExp(n,s).test(i)}catch{return!0}}normalizeRegex(e){let t=e.trim();if(t.startsWith("/")&&t.lastIndexOf("/")>0){let r=t.lastIndexOf("/"),i=t.slice(1,r),n=t.slice(r+1);return{source:i,flags:n}}return{source:t,flags:""}}getContextValue(e,t){if(!(!e||!t)){if(e.values&&Object.prototype.hasOwnProperty.call(e.values,t))return e.values[t];if(e.getValue)return e.getValue(t)}}areValuesEqual(e,t){return Array.isArray(e)||Array.isArray(t)?JSON.stringify(e)===JSON.stringify(t):e===t}isIPv4(e){let t=e.split(".");return t.length!==4?!1:t.every(r=>{if(!/^\d+$/.test(r))return!1;let i=Number(r);return i>=0&&i<=255})}isIPv6(e){if(!e)return!1;if(e==="::")return!0;let t=e.split("::");if(t.length>2)return!1;let r=/^[0-9a-fA-F]{1,4}$/,i=e.split(":");return t.length===2?i.every(n=>n===""||r.test(n))&&i.length<=8:i.length===8&&i.every(n=>r.test(n))}};var We=class{constructor(){this.pendingVars=new Map;this.pendingProps=new Map;this.isOpen=!1}canUseTypedOM(e){return"attributeStyleMap"in e&&typeof CSS<"u"&&typeof CSS.number=="function"&&typeof CSS.px=="function"}writeVar(e,t,r){let i=e.style;if(this.canUseTypedOM(e)&&typeof r=="number"&&Number.isFinite(r))try{e.attributeStyleMap.set(t,CSS.number(r));return}catch{}i.setProperty(t,String(r))}begin(){this.isOpen||(this.isOpen=!0)}setVars(e,t){if(!this.isOpen){console.warn("StyleTxn: call begin() first to set custom properties.");return}let r=this.pendingVars.get(e)??{};for(let[i,n]of Object.entries(t))r[i]!==n&&(r[i]=n);this.pendingVars.set(e,r)}setVar(e,t,r){if(!this.isOpen){console.warn("StyleTxn: call begin() first to set custom properties.");return}let i=this.pendingVars.get(e)??{};i[t]!==r&&(i[t]=r,this.pendingVars.set(e,i))}setVarDirect(e,t,r){this.writeVar(e,t,r)}setProps(e,t){if(!this.isOpen){console.warn("StyleTxn: call begin() first to set standard properties.");return}let r=this.pendingProps.get(e)??{};for(let[i,n]of Object.entries(t))r[i]!==n&&(r[i]=n);this.pendingProps.set(e,r)}setProp(e,t,r){if(!this.isOpen){console.warn("StyleTxn: call begin() first to set standard properties.");return}let i=this.pendingProps.get(e)??{};i[t]!==r&&(i[t]=r,this.pendingProps.set(e,i))}run(e){let t=this.isOpen;t||this.begin();try{e(),t||this.commit()}catch(r){throw t||this.cancel(),r}}commit(){if(this.isOpen){this.isOpen=!1;for(let[e,t]of this.pendingVars)for(let[r,i]of Object.entries(t))this.writeVar(e,r,i);this.pendingVars.clear();for(let[e,t]of this.pendingProps){let r=e.style;for(let[i,n]of Object.entries(t))r[i]=String(n)}this.pendingProps.clear()}}cancel(){this.pendingVars.clear(),this.pendingProps.clear(),this.isOpen=!1}},x=new We;var Gt=class{constructor(){this.domAttribute=new gt;this.recordAttribute=new ft;this.transformNullify=new rt;this.boundingClientRect=new mt;this.relativePosition=new vt(this.transformNullify);this.unitParser=new yt;this.lerp=new bt;this.adaptiveLerp=new St;this.originParser=new xt;this.colorParser=new Et;this.validation=new Yt;this.easingFunction=new Mt;this.magneticPull=new wt;this.lerpColor=new Tt;this.lerpVector=new Ct;this.transformScaleParser=new Pt;this.optionsParser=new qt;this.ruleParser=new Lt;this.styleTxn=x}};function Xt(){let u=typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)").matches:!1,e=typeof navigator<"u"?(navigator.maxTouchPoints||0)>0:!1,t=typeof window<"u"?window.innerWidth<=768:!1;return u||e||t}var tr=new WeakMap,V=5e-4,lt="default",ze="[string-cursor],[data-string-cursor]",er="[string-cursor-content],[data-string-cursor-content]",Be=1/240,z=(u,e)=>{let t=Math.pow(10,e);return Math.round(u*t)/t};function Hr(u){let e=tr.get(u);return e||(e={prevX:Number.NaN,prevY:Number.NaN},tr.set(u,e)),e}var Kt=class extends M{constructor(t){super(t);this.cursorPrev={x:Number.NaN,y:Number.NaN,stepX:Number.NaN,stepY:Number.NaN};this.cursorPortals=new Map;this.hoveredObjects=new Set;this.globalListenersBound=!1;this.boundBeforeUnload=()=>this.cleanupHoverTargets();this.boundPageHide=()=>this.cleanupHoverTargets();this.boundVisibilityChange=()=>{document.hidden&&this.cleanupHoverTargets()};this.enabled=!0;this.lastFrameTime=0;this.htmlKey="cursor",this.cssProperties=[{name:"--x",syntax:"<number>",initialValue:"0",inherits:!0},{name:"--y",syntax:"<number>",initialValue:"0",inherits:!0},{name:"--x-lerp",syntax:"<number>",initialValue:"0",inherits:!0},{name:"--y-lerp",syntax:"<number>",initialValue:"0",inherits:!0},{name:"--x-px",syntax:"<number>",initialValue:"0",inherits:!0},{name:"--y-px",syntax:"<number>",initialValue:"0",inherits:!0},{name:"--dx",syntax:"<number>",initialValue:"0",inherits:!0},{name:"--dy",syntax:"<number>",initialValue:"0",inherits:!0},{name:"--angle",syntax:"<number>",initialValue:"0",inherits:!0},{name:"--angle-deg",syntax:"<number>",initialValue:"0",inherits:!0}],this.permissions.mobile.rebuild.height=!1,this.permissions.mobile.rebuild.width=!1,this.permissions.mobile.rebuild.scrollHeight=!1,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:"cursor-target",type:"string",fallback:this.settings["cursor-target"]??lt},{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:"cursor-enter",type:{type:"enum",values:["snap","smooth"]},fallback:"snap"},{key:"cursor-leave",type:{type:"enum",values:["snap","smooth"]},fallback:"smooth"},{key:"cursor-leave-hold",type:"boolean",fallback:!1},{key:"lerp",type:"number",fallback:this.settings.lerp,transform:r=>this.tools.adaptiveLerp.process({value:r,inMin:.1,inMax:1,outMin:.05,outMax:.65})},{key:"cursor-float",type:"number",fallback:2},{key:"cursor-vars",type:"string",fallback:""}],Xt()&&(this.enabled=!1),this.collectCursorPortals(),this.enabled&&this.bindGlobalLifecycleListeners()}initializeObject(t,r,i,n){super.initializeObject(t,r,i,n),r.setProperty("mouse-x",0),r.setProperty("mouse-y",0),r.setProperty("mouse-pixel-x",0),r.setProperty("mouse-pixel-y",0),r.setProperty("is-mouse-over",!1),r.setProperty("is-mouse-move",!1),r.setProperty("__cursor-vars",this.parseCursorVars(r.getProperty("cursor-vars")));let s=i.getBoundingClientRect();r.setProperty("cached-width",s.width||i.offsetWidth||1),r.setProperty("cached-height",s.height||i.offsetHeight||1)}onResize(){super.onResize(),this.objects.forEach(t=>{let r=t.htmlElement.getBoundingClientRect();t.setProperty("cached-width",r.width||t.htmlElement.offsetWidth||1),t.setProperty("cached-height",r.height||t.htmlElement.offsetHeight||1)})}onMutate(t){if(!this.enabled)return;let r=performance.now(),i=this.lastFrameTime?(r-this.lastFrameTime)/1e3:.016;this.lastFrameTime=r,i>.1&&(i=.1),i<Be&&(i=Be);let n=this.data.cursor.targetX,s=this.data.cursor.targetY;if(this.objects.forEach(o=>{let a=o.getProperty("is-mouse-over"),l=o.getProperty("cursor-target-disable"),c=o.getProperty("lerp")??.15,d=this.getFrameAdjustedLerp(c,i),p=this.getObjectDimensions(o),{halfWidth:h,halfHeight:v,width:m,height:g}=p;if(a&&!l){let{cx:b,cy:y}=this.centers.getCenter(o),f=n-(b-h),S=s-(y-v),E=o.getProperty("mouse-pixel-x")??0,T=o.getProperty("mouse-pixel-y")??0,k=E-f,I=T-S;if(k*k+I*I>1e-4){let A=o.getProperty("is-mouse-move")??!1,O=o.getProperty("cursor-enter")??"snap",L=o.getProperty("alignment")??"center";if(!A){if(o.setProperty("is-mouse-move",!0),O==="snap")o.setProperty("mouse-pixel-x",f),o.setProperty("mouse-pixel-y",S),o.setProperty("mouse-x",f),o.setProperty("mouse-y",S),E=f,T=S;else{let Y=o.getProperty("mouse-x")??0,nt=o.getProperty("mouse-y")??0;E=this.reverseOffset(L,Y,m),T=this.reverseOffset(L,nt,g),o.setProperty("mouse-pixel-x",E),o.setProperty("mouse-pixel-y",T)}this.events.emit(this.getObjectEventName(o,"cursor:start"),null)}let H=this.tools.lerp.process({from:E,to:f,progress:d}),w=this.tools.lerp.process({from:T,to:S,progress:d}),D=E+H,F=T+w,R=Math.abs(D-E)>V||Math.abs(F-T)>V;o.setProperty("mouse-pixel-x",D),o.setProperty("mouse-pixel-y",F);let N=this.calculateOffset(L,D,m),W=this.calculateOffset(L,F,g);o.setProperty("mouse-x",N),o.setProperty("mouse-y",W),this.setMouseCoordinates(o,N,W,D,F)&&this.events.emit(this.getObjectEventName(o,"cursor:move"),{x:N,y:W}),R&&this.events.emit(this.getObjectEventName(o,"cursor:pixel"),{x:D,y:F})}else{o.setProperty("mouse-pixel-x",f),o.setProperty("mouse-pixel-y",S),o.getProperty("is-mouse-move")&&(o.setProperty("is-mouse-move",!1),this.events.emit(this.getObjectEventName(o,"cursor:end"),null));let A=o.getProperty("alignment")??"center",O=this.calculateOffset(A,f,m),L=this.calculateOffset(A,S,g);this.setMouseCoordinates(o,O,L,f,S)}}else{if(o.getProperty("cursor-leave-hold")??!1){o.getProperty("is-mouse-move")&&(o.setProperty("is-mouse-move",!1),this.events.emit(this.getObjectEventName(o,"cursor:end"),null));return}if((o.getProperty("cursor-leave")??"smooth")==="snap"){o.setProperty("is-mouse-move",!1),o.setProperty("mouse-x",0),o.setProperty("mouse-y",0),o.setProperty("mouse-pixel-x",0),o.setProperty("mouse-pixel-y",0),this.setMouseCoordinates(o,0,0,0,0);return}let f=o.getProperty("mouse-x")??0,S=o.getProperty("mouse-y")??0;if(f!==0||S!==0){o.setProperty("is-mouse-move",!1);let E=this.calculateOffset("center",h,m),T=this.calculateOffset("center",v,g),k=f+this.tools.lerp.process({from:f,to:E,progress:d}),I=S+this.tools.lerp.process({from:S,to:T,progress:d});o.setProperty("mouse-x",k),o.setProperty("mouse-y",I),Math.abs(k)<.001&&Math.abs(I)<.001?(o.setProperty("mouse-x",0),o.setProperty("mouse-y",0),o.setProperty("mouse-pixel-x",0),o.setProperty("mouse-pixel-y",0),this.setMouseCoordinates(o,0,0,0,0)):this.setMouseCoordinates(o,k,I)}}}),this.cursorPortals.size>0){let{stepX:o,stepY:a,smoothedX:l,smoothedY:c}=this.data.cursor,d=this.cursorPrev;(!Number.isFinite(d.x)||Math.abs(l-d.x)>V||Math.abs(c-d.y)>V||Math.abs(o-d.stepX)>V||Math.abs(a-d.stepY)>V)&&(this.events.emit("cursor",{stepX:o,stepY:a,x:l,y:c}),this.cursorPrev={x:l,y:c,stepX:o,stepY:a});let h=this.data.cursor.targetX,v=this.data.cursor.targetY;this.cursorPortals.forEach(m=>{m.forEach(g=>{this.updatePortalPosition(g,h,v,i)})})}}onObjectConnected(t){let r=t.htmlElement;this.centers.attach(t),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){if(!document.contains(t.htmlElement))return;t.setProperty("is-mouse-over",!0),this.hoveredObjects.add(t);let r=this.getCursorClass(t);this.withPortalsForObject(t,i=>{r&&i.element.classList.add(r),this.incrementPortalHover(i)}),t.htmlElement.addEventListener("mouseleave",t.getProperty("mouseleave"))}onMouseLeave(t){t.setProperty("is-mouse-over",!1),this.hoveredObjects.delete(t);let r=this.getCursorClass(t);this.withPortalsForObject(t,i=>{r&&i.element.classList.remove(r),this.decrementPortalHover(i)}),document.contains(t.htmlElement)&&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"))}safariNavigationCleanup(t){t.getProperty("is-mouse-over")&&this.onMouseLeave(t)}onElementRemovedFromDOM(t){t.getProperty("is-mouse-over")&&this.onMouseLeave(t)}onObjectDisconnected(t){t.getProperty("is-mouse-over")&&this.onMouseLeave(t)}onDOMRebuild(){this.enabled&&this.collectCursorPortals()}onDOMMutate(t,r){this.enabled&&((this.shouldRefreshPortals(t)||this.shouldRefreshPortals(r))&&this.collectCursorPortals(),r.length>0&&this.handleRemovedNodes(r))}collectCursorPortals(){this.cursorPortals.clear(),document.querySelectorAll(ze).forEach(r=>{if(!(r instanceof HTMLElement))return;let i=this.resolvePortalId(r),n=this.resolvePortalLerp(r),s=r.matches(er)?r:r.querySelector(er),o=this.data.cursor.targetX,a=this.data.cursor.targetY,l={id:i,element:r,content:s,prev:{x:o,y:a,stepX:0,stepY:0},hoverCount:0,showTimer:null,lerp:n},c=this.cursorPortals.get(i);c?c.push(l):this.cursorPortals.set(i,[l])})}resolvePortalId(t){let r=[t.getAttribute("data-string-cursor"),t.getAttribute("string-cursor"),t.getAttribute("data-string-cursor-id"),t.getAttribute("string-cursor-id")];for(let i of r)if(i&&i.trim().length>0)return i.trim();return lt}resolvePortalLerp(t){let r=t.getAttribute("data-string-cursor-lerp")??t.getAttribute("string-cursor-lerp")??this.settings["cursor-lerp"];if(!r)return null;let i=parseFloat(r);if(!Number.isFinite(i))return null;let n=Math.min(1,Math.max(.01,i));return this.tools.adaptiveLerp.process({value:n,inMin:.1,inMax:1,outMin:.05,outMax:.65})}shouldRefreshPortals(t){for(let r of Array.from(t))if(r instanceof Element&&(r.matches(ze)||r.querySelector(ze)))return!0;return!1}withPortalsForObject(t,r){this.getPortalsForObject(t).forEach(n=>r(n))}getPortalsForObject(t){if(this.cursorPortals.size===0)return[];let r=this.extractPortalIds(t),i=[];if(r.forEach(n=>{if(n==="*"){this.cursorPortals.forEach(a=>{a.forEach(l=>i.push(l))});return}let s=n.length>0?n:lt,o=this.cursorPortals.get(s);o&&o.forEach(a=>i.push(a))}),i.length===0){let n=this.cursorPortals.get(lt)??this.cursorPortals.values().next().value;n&&n.length>0&&n.forEach(s=>i.push(s))}return i}extractPortalIds(t){if(!t)return[lt];let r=t.getProperty("cursor-target");return typeof r!="string"||r.trim().length===0?[lt]:r.split(/[,|]/).map(i=>i.trim()).filter(Boolean)}incrementPortalHover(t){t.hoverCount++,t.element.classList.remove("-show"),this.restartPortalShowTimer(t)}decrementPortalHover(t){t.hoverCount=Math.max(0,t.hoverCount-1),t.hoverCount===0&&(this.clearPortalShowTimer(t),t.element.classList.remove("-show"))}restartPortalShowTimer(t){if(this.clearPortalShowTimer(t),!t.element.isConnected){t.showTimer=null;return}t.element.classList.add("-show"),t.showTimer=null}clearPortalShowTimer(t){t.showTimer&&(clearTimeout(t.showTimer),t.showTimer=null)}updatePortalPosition(t,r,i,n){if(!t.element.isConnected)return;let s=t.prev,o=Number.isFinite(s.x)?s.x:r,a=Number.isFinite(s.y)?s.y:i,l=t.lerp??.1,c=this.getFrameAdjustedLerp(l,n),d=(r-o)*c,p=(i-a)*c,h=n>1e-4?n:1/60,v=d/(h*60),m=p/(h*60);if(Math.abs(d)<V&&Math.abs(p)<V)return;let g=o+d,b=a+p;this.writePortalVars(t.element,{"--x":z(g,2),"--y":z(b,2),"--x-lerp":z(v,3),"--y-lerp":z(m,3)}),s.x=g,s.y=b,s.stepX=d,s.stepY=p}handleRemovedNodes(t){this.hoveredObjects.size!==0&&Array.from(this.hoveredObjects).forEach(r=>{r.htmlElement.isConnected||this.onElementRemovedFromDOM(r)})}cleanupHoverTargets(){this.hoveredObjects.size!==0&&Array.from(this.hoveredObjects).forEach(t=>this.safariNavigationCleanup(t))}bindGlobalLifecycleListeners(){this.globalListenersBound||(window.addEventListener("beforeunload",this.boundBeforeUnload),window.addEventListener("pagehide",this.boundPageHide),document.addEventListener("visibilitychange",this.boundVisibilityChange),this.globalListenersBound=!0)}unbindGlobalLifecycleListeners(){this.globalListenersBound&&(window.removeEventListener("beforeunload",this.boundBeforeUnload),window.removeEventListener("pagehide",this.boundPageHide),document.removeEventListener("visibilitychange",this.boundVisibilityChange),this.globalListenersBound=!1)}setMouseCoordinates(t,r,i,n,s){if(t.getProperty("cursor-target-style-disable"))return!1;let o=Hr(t),a=t.getProperty("cursor-float")??2,l=Math.pow(10,a),c=Math.abs(r)<V&&Number.isFinite(o.prevX)&&Math.abs(o.prevX)<V?o.prevX:Math.round(r*l)/l,d=Math.abs(i)<V&&Number.isFinite(o.prevY)&&Math.abs(o.prevY)<V?o.prevY:Math.round(i*l)/l;if(Number.isFinite(o.prevX)&&Math.abs(c-o.prevX)<=V&&Number.isFinite(o.prevY)&&Math.abs(d-o.prevY)<=V)return!1;o.prevX=c,o.prevY=d;let p=t.getProperty("__cursor-vars"),h={"--x":z(c,a),"--y":z(d,a)};if(p&&p.size>0){let m=Number.isFinite(n)?n:t.getProperty("mouse-pixel-x"),g=Number.isFinite(s)?s:t.getProperty("mouse-pixel-y"),b=t.getProperty("__prev-x-px"),y=t.getProperty("__prev-y-px"),f=Number.isFinite(b)?m-b:0,S=Number.isFinite(y)?g-y:0;t.setProperty("__prev-x-px",m),t.setProperty("__prev-y-px",g);let E=f===0&&S===0?0:Math.atan2(S,f),T=E*180/Math.PI;p.has("xpx")&&(h["--x-px"]=z(m,2)),p.has("ypx")&&(h["--y-px"]=z(g,2)),p.has("dx")&&(h["--dx"]=z(f,3)),p.has("dy")&&(h["--dy"]=z(S,3)),p.has("angle")&&(h["--angle"]=z(E,4)),p.has("angle-deg")&&(h["--angle-deg"]=z(T,2))}let v=()=>{this.applyToElementAndConnects(t,m=>{x.setVars(m,h)})};return x.isOpen?v():x.run(v),!0}writePortalVars(t,r){if(x.isOpen){x.setVars(t,r);return}x.run(()=>{x.setVars(t,r)})}parseCursorVars(t){return t?new Set(t.split(/[|,]/).map(r=>r.trim().toLowerCase()).filter(r=>r.length>0)):new Set}getFrameAdjustedLerp(t,r){let i=Math.min(.99,Math.max(.001,t));if(!Number.isFinite(r)||r<=0)return i;let s=Math.max(r,Be)*60,o=1-Math.pow(1-i,s);return Math.min(.999,Math.max(1e-4,o))}getObjectDimensions(t){let r=t.getProperty("cached-width"),i=t.getProperty("cached-height");if(typeof r=="number"&&typeof i=="number"&&r>0&&i>0){let v=r/2,m=i/2;return{width:r,height:i,halfWidth:v,halfHeight:m}}let n=t.htmlElement,s=n.offsetWidth||n.clientWidth||n.scrollWidth||1,o=n.offsetHeight||n.clientHeight||n.scrollHeight||1,a=t.getProperty("half-width"),l=t.getProperty("half-height"),c=typeof a=="number"&&Number.isFinite(a)?a:s/2,d=typeof l=="number"&&Number.isFinite(l)?l:o/2,p=c>0?c*2:s,h=d>0?d*2:o;return t.setProperty("cached-width",p),t.setProperty("cached-height",h),{width:p,height:h,halfWidth:c,halfHeight:d}}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)}}reverseOffset(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}}removeObject(t){if(!this.enabled)return super.removeObject(t);let r=this.objectMapOnPage.get(t);r&&this.centers.detach(r),super.removeObject(t)}destroy(){this.unbindGlobalLifecycleListeners(),this.hoveredObjects.clear(),super.destroy()}};var Qt=class extends M{constructor(t){super(t);this.originObservers=new WeakMap;this.htmlKey="impulse",this.cssProperties=[{name:"--push-x",syntax:"<number>",initialValue:"0",inherits:!0},{name:"--push-y",syntax:"<number>",initialValue:"0",inherits:!0},{name:"--push-rotation",syntax:"<number>",initialValue:"0",inherits:!0}],this.attributesToMap.push({key:"position-strength",type:"number",fallback:this.settings["position-strength"]},{key:"position-tension",type:"number",fallback:this.settings["position-tension"]},{key:"position-friction",type:"number",fallback:this.settings["position-friction"]},{key:"position-max-velocity",type:"number",fallback:this.settings["position-max-velocity"]},{key:"position-update-threshold",type:"number",fallback:this.settings["position-update-threshold"]},{key:"rotation-strength",type:"number",fallback:this.settings["rotation-strength"]},{key:"rotation-tension",type:"number",fallback:this.settings["rotation-tension"]},{key:"rotation-friction",type:"number",fallback:this.settings["rotation-friction"]},{key:"rotation-max-angular-velocity",type:"number",fallback:this.settings["rotation-max-angular-velocity"]},{key:"rotation-max-angle",type:"number",fallback:this.settings["rotation-max-angle"]},{key:"rotation-update-threshold",type:"number",fallback:this.settings["rotation-update-threshold"]},{key:"max-offset",type:"number",fallback:this.settings["max-offset"]},{key:"sleep-epsilon",type:"number",fallback:this.settings["sleep-epsilon"]},{key:"continuous-push",type:"boolean",fallback:this.settings["continuous-push"]},{key:"rotation-origin",type:"string",fallback:this.settings["rotation-origin"]??"center center"})}onObjectConnected(t){super.onObjectConnected(t),t.setProperty("offset-x",0),t.setProperty("offset-y",0),t.setProperty("velocity-x",0),t.setProperty("velocity-y",0),t.setProperty("angle-deg",0),t.setProperty("ang-vel-deg",0),t.setProperty("__prev-css-x",0),t.setProperty("__prev-css-y",0),t.setProperty("__prev-css-rot",0),t.setProperty("__push-latch",!1),t.setProperty("__rotate-latch",!1),this.cacheRotationOrigin(t),this.observeRotationOrigin(t),this.hover.track(t),this.centers.attach(t)}onObjectDisconnected(t){this.hover.untrack(t),this.centers.detach(t);let r=this.originObservers.get(t);r&&(r.disconnect(),this.originObservers.delete(t))}onMouseMove(t){if(!t)return;let r=this.data.cursor.velocityX,i=this.data.cursor.velocityY;if(r===0&&i===0)return;let n=this.data.cursor.targetX,s=this.data.cursor.targetY;for(let o of this.objects){let a=o.htmlElement.getBoundingClientRect();if(n>=a.left&&n<=a.right&&s>=a.top&&s<=a.bottom){{let p=a.width||1,h=Math.max(0,Math.min(1,(this.data.cursor.targetX-a.left)/p));this.events.emit(this.getObjectEventName(o,"object:impulse","side"),{value:h})}let c=o.getProperty("position-strength")||0;if(c!==0){let p=o.getProperty("continuous-push")??!0,h=o.getProperty("__push-latch")===!0;if(p||!h){let v=o.getProperty("velocity-x")||0,m=o.getProperty("velocity-y")||0;v+=r*c,m+=i*c,o.setProperty("velocity-x",v),o.setProperty("velocity-y",m),p||o.setProperty("__push-latch",!0)}}let d=o.getProperty("rotation-strength")??.75;if(d!==0){let p=o.getProperty("continuous-push")??!0,h=o.getProperty("__rotate-latch")===!0;if(p||!h){let{centerX:v,centerY:m}=this.getRotationOriginFromRect(o,a),g=n-v,b=s-m,y=g*i-b*r,f=o.getProperty("ang-vel-deg")||0;f+=y*d*.02,o.setProperty("ang-vel-deg",f),p||o.setProperty("__rotate-latch",!0)}}}}}cacheRotationOrigin(t){let r=t.getProperty("rotation-origin")??"center center",{x:i,y:n}=this.tools.originParser.toNormalized({value:r});t.setProperty("__rotation-origin-x",i),t.setProperty("__rotation-origin-y",n)}observeRotationOrigin(t){let r="string-rotation-origin",i="data-string-rotation-origin",n=new MutationObserver(s=>{for(let o of s)if(o.type==="attributes"&&(o.attributeName===r||o.attributeName===i)){let a=t.htmlElement.getAttribute(r)??t.htmlElement.getAttribute(i);a!==null&&t.setProperty("rotation-origin",a),this.cacheRotationOrigin(t);break}});n.observe(t.htmlElement,{attributes:!0,attributeFilter:[r,i]}),this.originObservers.set(t,n)}getRotationOriginFromRect(t,r){let i=t.getProperty("__rotation-origin-x")??.5,n=t.getProperty("__rotation-origin-y")??.5;return{centerX:r.left+r.width*i,centerY:r.top+r.height*n}}onFrame(t){let r=this.data.cursor.targetX,i=this.data.cursor.targetY;for(let n of this.objects){let s=n.htmlElement.getBoundingClientRect(),o=r>=s.left&&r<=s.right&&i>=s.top&&i<=s.bottom;!o&&n.getProperty("__push-latch")===!0&&n.setProperty("__push-latch",!1),!o&&n.getProperty("__rotate-latch")===!0&&n.setProperty("__rotate-latch",!1)}for(let n=0;n<this.objects.length;n++){let s=this.objects[n],o=s.getProperty("offset-x")||0,a=s.getProperty("offset-y")||0,l=s.getProperty("velocity-x")||0,c=s.getProperty("velocity-y")||0,d=s.getProperty("position-tension")??.05,p=s.getProperty("position-friction")??.15,h=s.getProperty("position-max-velocity")??120,v=s.getProperty("max-offset")??220;l-=d*o,c-=d*a;let m=1-p;l*=m,c*=m,l>h?l=h:l<-h&&(l=-h),c>h?c=h:c<-h&&(c=-h),o+=l,a+=c,o>v?o=v:o<-v&&(o=-v),a>v?a=v:a<-v&&(a=-v);let g=s.getProperty("angle-deg")||0,b=s.getProperty("ang-vel-deg")||0,y=s.getProperty("rotation-tension")??.06,f=s.getProperty("rotation-friction")??.18,S=s.getProperty("rotation-max-angular-velocity")??6,E=s.getProperty("rotation-max-angle")??18;b-=y*g,b*=1-f,b>S?b=S:b<-S&&(b=-S),g+=b,g>E?(g=E,b*=.35):g<-E&&(g=-E,b*=.35);let T=s.getProperty("sleep-epsilon")??.01,k=l*l+c*c<T*T&&o*o+a*a<T*T,I=Math.abs(b)<T&&Math.abs(g)<T;k?(l||c||o||a)&&(s.setProperty("offset-x",0),s.setProperty("offset-y",0),s.setProperty("velocity-x",0),s.setProperty("velocity-y",0),o=a=l=c=0):(s.setProperty("offset-x",o),s.setProperty("offset-y",a),s.setProperty("velocity-x",l),s.setProperty("velocity-y",c)),I?(g||b)&&(s.setProperty("angle-deg",0),s.setProperty("ang-vel-deg",0),g=b=0):(s.setProperty("angle-deg",g),s.setProperty("ang-vel-deg",b));let C=s.getProperty("position-update-threshold")??.1,A=s.getProperty("rotation-update-threshold")??.15,O=s.getProperty("__prev-css-x")||0,L=s.getProperty("__prev-css-y")||0,H=s.getProperty("__prev-css-rot")||0,w=Math.round(o*10)/10,D=Math.round(a*10)/10,F=Math.round(g*10)/10,R=Math.abs(w-O)>C||Math.abs(D-L)>C,N=Math.abs(F-H)>A;(R||N)&&(s.setProperty("__next-css-x",w),s.setProperty("__next-css-y",D),s.setProperty("__next-css-rot",F)),s.setProperty("__needs-position-update",R),s.setProperty("__needs-rotation-update",N)}}onMutate(){for(let t=0;t<this.objects.length;t++){let r=this.objects[t],i=r.getProperty("__needs-position-update")===!0,n=r.getProperty("__needs-rotation-update")===!0;if(!i&&!n)continue;let s=r.getProperty("__next-css-x")||0,o=r.getProperty("__next-css-y")||0,a=r.getProperty("__next-css-rot")||0;this.applyToElementAndConnects(r,l=>{i&&(x.setVar(l,"--push-x",s),x.setVar(l,"--push-y",o)),n&&x.setVar(l,"--push-rotation",a)}),i&&(r.setProperty("__prev-css-x",s),r.setProperty("__prev-css-y",o),this.events.emit(this.getObjectEventName(r,"object:impulse","move"),{x:s,y:o})),n&&(r.setProperty("__prev-css-rot",a),this.events.emit(this.getObjectEventName(r,"object:impulse","rotate"),{rotation:a})),r.setProperty("__needs-position-update",!1),r.setProperty("__needs-rotation-update",!1)}}};var $e=class{constructor(){this.measureQueue=[];this.mutateQueue=[];this.scheduled=!1}measure(e){this.measureQueue.push(e),this.schedule()}mutate(e){this.mutateQueue.push(e),this.schedule()}schedule(){this.scheduled||(this.scheduled=!0)}flush(){if(!this.scheduled)return;let e=this.measureQueue;this.measureQueue=[];for(let r=0;r<e.length;r++)try{e[r]()}catch(i){console.error("Error in frameDOM measure task:",i)}let t=this.mutateQueue;this.mutateQueue=[];for(let r=0;r<t.length;r++)try{t[r]()}catch(i){console.error("Error in frameDOM mutate task:",i)}this.scheduled=!1}},_=new $e;var Nr=20,U={MANUAL_COLS_KEY:"masonry-manual-cols",MANUAL_GAP_KEY:"masonry-manual-gap",DEFAULT_DURATION:600,DEFAULT_EASING:"cubic-bezier(0.25, 1, 0.5, 1)"};function rr(u){if(!u)return U.DEFAULT_DURATION;let e=parseFloat(u);return isNaN(e)?U.DEFAULT_DURATION:e}function Zt(u,e){let t=[...u].sort((i,n)=>n.breakpoint-i.breakpoint),r=t.find(i=>e>=i.breakpoint);return r?r.value:t[t.length-1]?.value}var Jt=class extends M{constructor(t){super(t);this.states=new WeakMap;this.htmlKey="masonry",this.attributesToMap.push({key:"masonry-cols",type:"breakpoint-dimension",fallback:"2|640:3|1024:4"},{key:"masonry-gap",type:"breakpoint-dimension",fallback:"16|640:24|1024:32"},{key:"masonry-mode",type:"string",fallback:"auto"})}parseEasing(t){return this.tools.easingFunction.process({easing:t||U.DEFAULT_EASING})}onObjectConnected(t){super.onObjectConnected(t);let r=t.htmlElement;x.begin(),x.setProps(r,{position:"relative",boxSizing:"border-box"}),x.commit();let i=this.createState(t,r);this.states.set(t,i),this.attachImgLoaders(t,i,r),this.scheduleLayout(t,!1,"init");let n=t.id;this.events.on(`masonry:update:${n}`,s=>{s.mode&&t.setProperty("masonry-mode",s.mode),s.cols!==void 0&&t.setProperty(U.MANUAL_COLS_KEY,Number(s.cols)),s.gap!==void 0&&t.setProperty(U.MANUAL_GAP_KEY,Number(s.gap)),this.scheduleLayout(t,!0,"external-event")})}onFrame(t){let r=t.time.now;this.objectsOnPage.forEach(i=>{let n=this.states.get(i);if(!n||!n.isAnimating)return;let s=0;x.run(()=>{if(n.isAnimatingHeight){let o=r-n.heightStartTime,a=Math.min(1,o/n.heightDuration),l=n.heightEase(a),c=n.startHeight+(n.targetHeight-n.startHeight)*l;x.setProps(i.htmlElement,{height:`${c}px`}),a<1?s++:n.isAnimatingHeight=!1}n.items.forEach((o,a)=>{if(!o.isMoving)return;let l=r-o.startTime,c=l*o.invPosDur,d=c>1?1:c,p=o.posEase(d);o.cx=o.sx+o.dx*p,o.cy=o.sy+o.dy*p;let h=l*o.invSizeDur,v=h>1?1:h,m=o.sizeEase(v);o.cw=o.sw+o.dw*m,x.setProps(a,{transform:`translate3d(${o.cx}px, ${o.cy}px, 0)`,...Math.abs(o.dw)>.05?{width:`${o.cw}px`}:{},willChange:"transform, width"}),d<1||v<1?s++:(o.isMoving=!1,x.setProps(a,{transform:`translate3d(${o.tx}px, ${o.ty}px, 0)`,width:`${o.tw}px`,willChange:"auto"}),o.cx=o.tx,o.cy=o.ty,o.cw=o.tw)})}),s===0&&this.handleAnimationEnd(i,n,r)})}onResize(){this.data.system.suppressMasonryResize||this.objectsOnPage.forEach(t=>{this.states.has(t)&&this.scheduleLayout(t,!0,"window-resize")})}cleanupObject(t){let r=this.states.get(t);r&&(r.ro.disconnect(),r.mo.disconnect(),r.resizeDebounceId&&clearTimeout(r.resizeDebounceId),this.states.delete(t))}createState(t,r){let i=r.getBoundingClientRect(),n=a=>{if(!a.length)return;let l=a[0].contentRect,c=this.states.get(t);if(!c||Math.abs(l.width-c.lastObservedWidth)<=.5&&Math.abs(l.height-c.lastObservedHeight)<=.5)return;c.lastObservedWidth=l.width,c.lastObservedHeight=l.height;let d=getComputedStyle(r),p=parseFloat(d.paddingLeft)||0,h=parseFloat(d.paddingRight)||0,v=l.width-p-h;if(v<=0)return;let{columns:m,gap:g}=this.getGridSettings(t),b=(v-g*(m-1))/m;m===c.lastLayoutColumns&&g===c.lastLayoutGap&&Math.abs(b-c.lastLayoutColumnWidth)<=.5||(c.resizeDebounceId&&window.clearTimeout(c.resizeDebounceId),c.resizeDebounceId=window.setTimeout(()=>{c.isResizing=!0,this.scheduleLayout(t,!0,"resize-observer"),c.isResizing=!1},Nr))},s=a=>{let l=this.states.get(t);if(!l)return;let c=!1;for(let d of a)d.removedNodes.length&&d.removedNodes.forEach(p=>{if(p.nodeType===1){let h=p;this.cleanupImgListeners(l,h),l.items.delete(h),c=!0}}),d.addedNodes.length&&d.addedNodes.forEach(p=>{p.nodeType===1&&(this.attachImgLoaders(t,l,p),c=!0)});c&&this.scheduleLayout(t,!0,"mutation-observer")},o={ro:new ResizeObserver(n),mo:new MutationObserver(s),isResizing:!1,lastObservedWidth:i.width,lastObservedHeight:i.height,lastLayoutColumns:0,lastLayoutGap:0,lastLayoutColumnWidth:-1,lastChildrenHash:0,lastHeightsHash:0,childIds:new WeakMap,nextChildId:1,imgUnsubs:new WeakMap,layoutScheduled:!1,items:new Map,startHeight:r.offsetHeight,targetHeight:r.offsetHeight,heightStartTime:0,heightDuration:U.DEFAULT_DURATION,heightEase:this.parseEasing(null),isAnimatingHeight:!1,isAnimating:!1,pendingHeight:void 0,pendingHeightAnimate:!1,expectedEndTime:0};return o.ro.observe(r),o.mo.observe(r,{childList:!0}),o}handleAnimationEnd(t,r,i){if(r.pendingHeight!==void 0){let n=r.pendingHeight,s=r.pendingHeightAnimate;if(r.pendingHeight=void 0,r.pendingHeightAnimate=!1,s){r.startHeight=t.htmlElement.offsetHeight,r.targetHeight=n,r.heightStartTime=i,r.heightDuration=U.DEFAULT_DURATION,r.heightEase=this.parseEasing(null),r.isAnimatingHeight=!0,r.isAnimating=!0;return}x.run(()=>{x.setProps(t.htmlElement,{height:`${n}px`})})}r.isAnimating&&this.events.emit("masonry:shuffle:end",{object:t}),r.isAnimating=!1,this.objectManager.refreshLayoutForRoot(t.htmlElement),r.endTimerId&&(window.clearTimeout(r.endTimerId),r.endTimerId=void 0),requestAnimationFrame(()=>{this.events.emit("resize",!0)})}scheduleLayout(t,r,i){let n=this.states.get(t);!n||n.layoutScheduled||(n.layoutScheduled=!0,_.measure(()=>{n.layoutScheduled=!1,this.performSyncLayout(t,n,r,i)}))}performSyncLayout(t,r,i,n){let s=t.htmlElement,o=Array.from(s.children);if(o.length===0)return;let a=s.getBoundingClientRect(),l=getComputedStyle(s),c=parseFloat(l.paddingLeft)||0,d=parseFloat(l.paddingRight)||0,p=parseFloat(l.paddingTop)||0,h=a.width-c-d;if(h<=0)return;let{columns:v,gap:m}=this.getGridSettings(t),g=(h-m*(v-1))/v,y=(t.getProperty("masonry-mode")||"auto")==="auto"&&i&&!r.isResizing&&n!=="window-resize"&&n!=="resize-observer",f=v===r.lastLayoutColumns&&m===r.lastLayoutGap&&Math.abs(g-r.lastLayoutColumnWidth)<=.5,S=0;o.forEach(w=>{let D=r.childIds.get(w);D||(D=r.nextChildId++,r.childIds.set(w,D)),S=S*31+D>>>0}),r.lastLayoutColumns=v,r.lastLayoutGap=m,r.lastLayoutColumnWidth=g,r.lastChildrenHash=S;let E=new Map;i&&o.forEach(w=>{let D=r.items.get(w);D&&E.set(w,D.cw)}),x.begin(),o.forEach(w=>{x.setProps(w,{position:"absolute",top:"0",left:"0",width:`${g}px`})}),x.commit();let T=o.map(w=>w.offsetHeight),k=0;T.forEach(w=>k=k*31+Math.round(w*2)>>>0),r.lastHeightsHash=k,i&&E.size>0&&x.run(()=>{E.forEach((w,D)=>{x.setProps(D,{width:`${w}px`})})});let I=new Array(v).fill(0),C=performance.now(),A=!1,O=0;o.forEach((w,D)=>{let F=T[D],R=0,N=I[0];for(let q=1;q<v;q++)I[q]<N&&(N=I[q],R=q);let W=R*(g+m)+c,j=N+p,Y=g;I[R]=N+F+m;let nt=rr(w.getAttribute("string-masonry-position-time")),Dt=rr(w.getAttribute("string-masonry-size-time")),Xe=nt>0?1/nt:1e3,Ke=Dt>0?1/Dt:1e3,Qe=this.parseEasing(w.getAttribute("string-masonry-position-easing")),Ze=this.parseEasing(w.getAttribute("string-masonry-size-easing")),P=r.items.get(w);if(P)Math.abs(P.tx-W)+Math.abs(P.ty-j)+Math.abs(P.tw-Y)>.5&&(P.sx=P.cx,P.sy=P.cy,P.sw=P.cw,P.tx=W,P.ty=j,P.tw=Y,P.dx=P.tx-P.sx,P.dy=P.ty-P.sy,P.dw=P.tw-P.sw,P.posEase=Qe,P.invPosDur=Xe,P.sizeEase=Ze,P.invSizeDur=Ke,P.startTime=C,P.isMoving=!0,A=!0,O=Math.max(O,nt,Dt));else{let q=W,Je=i?j+30:j;P={sx:q,sy:Je,sw:Y,tx:W,ty:j,tw:Y,dx:0,dy:0,dw:0,cx:q,cy:Je,cw:Y,startTime:C,posEase:Qe,invPosDur:Xe,sizeEase:Ze,invSizeDur:Ke,isMoving:i},r.items.set(w,P),i?(P.dx=P.tx-P.sx,P.dy=P.ty-P.sy,P.dw=P.tw-P.sw,A=!0,O=Math.max(O,nt,Dt)):x.run(()=>{x.setProps(w,{transform:`translate3d(${W}px, ${j}px, 0)`,width:`${Y}px`,willChange:"auto"})})}});let L=Math.max(...I);if(Math.abs(r.targetHeight-L)>1)if(i){let w=s.getBoundingClientRect(),D=this.data.viewport.windowHeight;var H=!1;if(w.bottom>=-100&&w.bottom<=D+100){let F=w.top+L-D;if(Math.abs(F)>1&&L<s.offsetHeight){let R=w.top+this.data.scroll.current+L-D;this.events.emit("scrollTo",R),H=!0}}L>=r.targetHeight?(y?(r.startHeight=s.offsetHeight,r.heightStartTime=C,r.heightDuration=U.DEFAULT_DURATION,r.heightEase=this.parseEasing(null),r.isAnimatingHeight=!0):x.run(()=>{x.setProps(t.htmlElement,{height:`${L}px`}),requestAnimationFrame(()=>{this.events.emit("resize",!0)})}),r.targetHeight=L,r.pendingHeight=void 0):(r.pendingHeight=L,r.pendingHeightAnimate=y,r.targetHeight=L,H||x.run(()=>{x.setProps(t.htmlElement,{height:`${L}px`}),requestAnimationFrame(()=>{this.events.emit("resize",!0)})})),A=!0}else r.targetHeight=L,r.pendingHeight=void 0,x.run(()=>{x.setProps(t.htmlElement,{height:`${L}px`})});A&&(r.isAnimating||this.events.emit("masonry:shuffle:start",{object:t}),r.isAnimating=!0,O>0&&(r.expectedEndTime=C+O+32,r.endTimerId&&window.clearTimeout(r.endTimerId),r.endTimerId=window.setTimeout(()=>{r.isAnimating&&(r.pendingHeight!==void 0||r.isAnimatingHeight||(this.events.emit("masonry:shuffle:end",{object:t}),r.isAnimating=!1,r.endTimerId=void 0))},O+50)))}getGridSettings(t){let r=this.data.viewport.windowWidth;if((t.getProperty("masonry-mode")||"auto")==="manual"){let o=t.getProperty(U.MANUAL_COLS_KEY),a=t.getProperty(U.MANUAL_GAP_KEY),l=t.getProperty("masonry-cols")||[],c=t.getProperty("masonry-gap")||[];return{columns:Math.max(1,Math.round(o??Zt(l,r)??2)),gap:Math.max(0,a??Zt(c,r)??16)}}let n=t.getProperty("masonry-cols")||[{breakpoint:0,value:2}],s=t.getProperty("masonry-gap")||[{breakpoint:0,value:16}];return{columns:Math.max(1,Math.round(Zt(n,r)??2)),gap:Math.max(0,Zt(s,r)??16)}}attachImgLoaders(t,r,i){(i.tagName==="IMG"?[i]:Array.from(i.querySelectorAll("img"))).forEach(s=>{let o=s;if(o.complete||r.imgUnsubs.has(o))return;let a=()=>{this.scheduleLayout(t,!0,"img-load"),this.cleanupImgListeners(r,o)};o.addEventListener("load",a),o.addEventListener("error",a),r.imgUnsubs.set(o,()=>{o.removeEventListener("load",a),o.removeEventListener("error",a)})})}cleanupImgListeners(t,r){let i=n=>{let s=t.imgUnsubs.get(n);s&&(s(),t.imgUnsubs.delete(n))};r.tagName==="IMG"?i(r):r.querySelectorAll("img").forEach(n=>i(n))}};var te=class extends M{constructor(e){super(e),this.htmlKey="magnetic",this._type=2,this.cssProperties=[{name:"--magnetic-x",syntax:"<number>",initialValue:"0",inherits:!0},{name:"--magnetic-y",syntax:"<number>",initialValue:"0",inherits:!0},{name:"--magnetic-target-x",syntax:"<number>",initialValue:"0",inherits:!0},{name:"--magnetic-target-y",syntax:"<number>",initialValue:"0",inherits:!0}],this.permissions.mobile.rebuild.height=!1,this.permissions.mobile.rebuild.width=!1,this.permissions.mobile.rebuild.scrollHeight=!1,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.isMagneting=!1,t.magneticTargetX=0,t.magneticTargetY=0,t.magneticX=0,t.magneticY=0,t.setProperty("magnetic-lerp",.1),t.eventMagneticName=this.getObjectEventName(t,"magnetic:move"),t.setProperty("__next-magnetic-x",0),t.setProperty("__next-magnetic-y",0),t.setProperty("__needs-magnetic-update",!1)}onMouseMove(e){for(let t=0;t<this.objects.length;t++){let r=this.objects[t],n=r.htmlElement.getBoundingClientRect(),s=n.left+n.width/2,o=n.top+n.height/2,a=e.clientX-s,l=e.clientY-o,c=Math.sqrt(a**2+l**2),d=r.getProperty("radius")??0,p=r.getProperty("strength")??0,h=this.tools.magneticPull.process({distance:c,radius:d,strength:p});r.magneticTargetX=a*h,r.magneticTargetY=l*h,h>0&&(r.isMagneting=!0)}}onFrame(e){for(let t=0;t<this.objects.length;t++){let r=this.objects[t];if(r.isMagneting){let i=r.magneticX,n=r.magneticY,s=r.getProperty("magnetic-lerp")??.1,o=r.magneticTargetX,a=r.magneticTargetY,l=this.tools.lerp.process({from:i,to:o,progress:s}),c=this.tools.lerp.process({from:n,to:a,progress:s});l>-.01&&l<.01&&(l=0,r.magneticX=r.magneticTargetX),c>-.01&&c<.01&&(c=0,r.magneticY=r.magneticTargetY),i+=l,n+=c,r.magneticX=i,r.magneticY=n,r.eventMagneticName&&this.events.emit(r.eventMagneticName,{x:i,y:n}),r.setProperty("__next-magnetic-x",i),r.setProperty("__next-magnetic-y",n),r.setProperty("__needs-magnetic-update",!0),r.magneticTargetX===i&&r.magneticTargetY===n&&(r.isMagneting=!1)}}}onMutate(){for(let e=0;e<this.objects.length;e++){let t=this.objects[e];if(!(t.getProperty("__needs-magnetic-update")===!0))continue;let i=t.getProperty("__next-magnetic-x")??t.magneticX,n=t.getProperty("__next-magnetic-y")??t.magneticY;this.applyToElementAndConnects(t,s=>{x.setVar(s,"--magnetic-x",i),x.setVar(s,"--magnetic-y",n)}),t.setProperty("__needs-magnetic-update",!1)}}};var ct=class extends M{constructor(t){super(t);this.nearOnly=!0;this.useAllObjects=!1;this.maxDistanceMultiplier=1;this.updateThreshold=.1;this.enabled=!0;this.scrollUpdateScheduled=!1;Xt()&&(this.enabled=!1)}onObjectConnected(t){this.enabled&&(super.onObjectConnected(t),this.centers.attach(t),this.hover.track(t))}removeObject(t){if(!this.enabled)return super.removeObject(t);let r=this.objectMapOnPage.get(t);r&&(this.centers.detach(r),this.hover.untrack(r)),super.removeObject(t)}onScroll(){this.enabled&&(this.centers.invalidateAll(),this.scheduleCursorUpdate())}onMouseMoveMeasure(t){this.enabled&&(super.onMouseMoveMeasure(t),this.refreshPointerState())}onScrollMeasure(t){this.enabled&&(super.onScrollMeasure(t),this.refreshPointerState())}getCursorTargets(t=!1){if(!this.enabled)return[];let r=this.hover.activeObjects();return this.nearOnly&&r.length?r:this.useAllObjects?this.objectsOnPage:this.objects.length>0?this.objects:t?this.objectsOnPage:this.objects}refreshPointerState(t,r=!1){if(!this.enabled)return;let i=this.data.cursor.targetX,n=this.data.cursor.targetY,s=t?[t]:this.getCursorTargets(r),o=!this.nearOnly&&this.maxDistanceMultiplier>0?Math.pow(this.data.viewport.windowWidth*this.maxDistanceMultiplier,2):null;for(let a of s){let{cx:l,cy:c}=this.centers.getCenter(a),d=i-l,p=n-c,h=d*d+p*p;if(this.nearOnly){if(h>this.data.viewport.windowWidth*this.data.viewport.windowWidth&&!this.hover.isActive(a))continue}else if(o!==null&&h>o)continue;a.setProperty("dx",d),a.setProperty("dy",p),a.setProperty("dist",Math.sqrt(h))}}scheduleCursorUpdate(){!this.enabled||this.scrollUpdateScheduled||(this.scrollUpdateScheduled=!0,_.measure(()=>{this.refreshPointerState(),_.mutate(()=>{this.scrollUpdateScheduled=!1,x.run(()=>{this.onCursorScrollUpdate()})})}))}onCursorScrollUpdate(){}};var je=Math.PI*2,Vr=180/Math.PI,nr=u=>u<0?0:u>1?1:u,_r=(u,e)=>{let t=(e-u)%je;return t>Math.PI&&(t-=je),t<-Math.PI&&(t+=je),u+t},Wr={computeStep(u,e,t,r,i,n,s,o,a,l,c,d,p,h,v,m,g){let b=a;(m===1||t>r)&&(b=Math.atan2(e,u));let y=i>0?Math.min(t,i):t,f=s,S=o;if(h===1)f=b,S=y;else{let I=_r(s,b),C=nr(n);f+=(I-f)*C,S+=(y-S)*C}let E=f*Vr-90,T=v===1||Number.isNaN(l)||Math.abs(E-l)>d,k=v===1||Number.isNaN(c)||Math.abs(S-c)>p;g.angle=f,g.dist=S,g.tAngle=b,g.tDist=y,g.degRaw=E,g.cssDeg=Math.round(E*10)/10,g.cssDist=Math.round(S*10)/10,g.angleChanged=T?1:0,g.distChanged=k?1:0}},zr={bypassDeadzone:!0},Br={forceImmediate:!0,forceEmit:!0,bypassDeadzone:!0},ir=new WeakMap,$r=u=>{let e=ir.get(u);return e||(e={angle:0,dist:0,tAngle:0,tDist:0,prevDeg:NaN,prevDist:NaN},ir.set(u,e)),e},ee=class extends ct{constructor(t){super(t);this.stepResult={angle:0,dist:0,tAngle:0,tDist:0,degRaw:0,cssDeg:0,cssDist:0,angleChanged:0,distChanged:0};this.htmlKey="spotlight",this.cssProperties=[{name:"--spotlight-angle",syntax:"<number>",initialValue:"0",inherits:!0},{name:"--spotlight-distance",syntax:"<number>",initialValue:"0",inherits:!0}],this.nearOnly=!1,this.useAllObjects=!1,this.maxDistanceMultiplier=1,this.attributesToMap.push({key:"lerp",type:"number",fallback:this.settings.lerp,transform:r=>nr(this.tools.adaptiveLerp.process({value:r,inMin:.1,inMax:1,outMin:.05,outMax:.65}))},{key:"angle-threshold",type:"number",fallback:.2},{key:"distance-threshold",type:"number",fallback:.5},{key:"deadzone",type:"number",fallback:4},{key:"dist-max",type:"number",fallback:0})}initializeObject(t,r,i,n){super.initializeObject(t,r,i,n),r.setProperty("spotlight-angle-rad",0),r.setProperty("spotlight-distance",0),r.setProperty("spotlight-angle-rad-target",0),r.setProperty("spotlight-distance-target",0),_.measure(()=>{this.refreshPointerState(r,!0),_.mutate(()=>{x.run(()=>{this.updateSpotlightState(r,Br)})})})}onMutate(t){if(this.enabled){super.onMutate(t);let r=this.getCursorTargets(!1),i=r.length>0?r:this.getCursorTargets(!0);for(let n=0;n<i.length;n++){let s=i[n];this.updateSpotlightState(s)}}}onCursorScrollUpdate(){let t=this.getCursorTargets(!1),r=t.length>0?t:this.getCursorTargets(!0);for(let i=0;i<r.length;i++){let n=r[i];this.updateSpotlightState(n,zr)}}updateSpotlightState(t,r={}){let i=t.getProperty("dx"),n=t.getProperty("dy"),s=t.getProperty("dist");if(!Number.isFinite(i)||!Number.isFinite(n)||!Number.isFinite(s))return;let o=$r(t);Wr.computeStep(i,n,s,t.getProperty("deadzone")??4,t.getProperty("dist-max")??0,t.getProperty("lerp")??.15,o.angle,o.dist,o.tAngle,o.prevDeg,o.prevDist,t.getProperty("angle-threshold")??.2,t.getProperty("distance-threshold")??.5,r.forceImmediate===!0?1:0,r.forceEmit===!0?1:0,r.bypassDeadzone===!0?1:0,this.stepResult),o.angle=this.stepResult.angle,o.dist=this.stepResult.dist,o.tAngle=this.stepResult.tAngle,o.tDist=this.stepResult.tDist,t.setProperty("spotlight-distance-target",o.tDist),t.setProperty("spotlight-angle-rad-target",o.tAngle),t.setProperty("spotlight-angle-rad",o.angle),t.setProperty("spotlight-distance",o.dist),(this.stepResult.angleChanged===1||this.stepResult.distChanged===1)&&(this.writeSpotlightVars(t,this.stepResult.cssDeg,this.stepResult.cssDist),o.prevDeg=this.stepResult.degRaw,o.prevDist=o.dist,this.events.emit(this.getObjectEventName(t,"spotlight:update"),{distance:this.stepResult.cssDist,angleDeg:this.stepResult.cssDeg}))}writeSpotlightVars(t,r,i){let n=()=>{this.applyToElementAndConnects(t,s=>{x.setVar(s,"--spotlight-angle",r),x.setVar(s,"--spotlight-distance",i)})};if(x.isOpen){n();return}x.run(n)}};var sr="-aspect-ready";function jr(u){if(!u)return!1;let e=u.toLowerCase();return!!(e.endsWith(".svg")||e.startsWith("data:image/svg"))}function or(u){let e=new DataView(u);return u.byteLength<28?{width:0,height:0}:e.getUint32(0)!==2303741511||e.getUint32(4)!==218765834?{width:0,height:0}:e.getUint32(8)!==13||e.getUint32(12)!==1229472850?{width:0,height:0}:{width:e.getUint32(16,!1),height:e.getUint32(20,!1)}}function ar(u){let e=new DataView(u);if(e.getUint16(0)!==65496)return{width:0,height:0};let t=2;for(;t+9<u.byteLength;){let r=e.getUint16(t);if(t+=2,r===65498||r===65497)break;let i=e.getUint16(t);if(i<2||t+i>u.byteLength)break;if(r>=65472&&r<=65475||r>=65477&&r<=65479||r>=65481&&r<=65483||r>=65485&&r<=65487)return{height:e.getUint16(t+3),width:e.getUint16(t+5)};t+=i}return{width:0,height:0}}function lr(u){let e=new DataView(u);if(u.byteLength<16)return{width:0,height:0};if(e.getUint32(0,!0)!==1179011410||e.getUint32(8,!0)!==1346520407)return{width:0,height:0};let t=12;for(;t+8<=u.byteLength;){let r=e.getUint32(t,!1),i=e.getUint32(t+4,!0),n=t+8;if(r===1448097880){let s=(e.getUint16(n+4,!0)|e.getUint8(n+6)<<16)+1,o=(e.getUint16(n+7,!0)|e.getUint8(n+9)<<16)+1;return{width:s,height:o}}if(r===1448097824&&n+10<=u.byteLength&&e.getUint8(n+3)===157&&e.getUint8(n+4)===1&&e.getUint8(n+5)===42){let s=e.getUint16(n+6,!0)&16383,o=e.getUint16(n+8,!0)&16383;return{width:s,height:o}}if(r===1448097868&&n+5<=u.byteLength&&e.getUint8(n)===47){let s=e.getUint8(n+1),o=e.getUint8(n+2),a=e.getUint8(n+3),l=e.getUint8(n+4),c=1+((o&63)<<8|s),d=1+((l&15)<<10|a<<2|(o&192)>>6);return{width:c,height:d}}t=n+i+(i&1)}return{width:0,height:0}}function cr(u,e){let t=(e||"").toLowerCase();if(t.includes("png"))return or(u);if(t.includes("jpeg")||t.includes("jpg"))return ar(u);if(t.includes("webp"))return lr(u);let r=or(u);return r.width||(r=ar(u),r.width)||(r=lr(u),r.width)?r:{width:0,height:0}}async function Ur(u,e,t){let r=await fetch(u,{mode:"cors",credentials:e?.credentials??"omit",referrerPolicy:e?.referrerPolicy,signal:e?.signal,cache:"default"});if(!r.ok||!r.body)throw new Error(`HTTP ${r.status}`);let i=r.headers.get("content-type"),n=r.body.getReader(),s=1048576,o=4096,a=new Uint8Array(s),l=0,c=0,d=[],p=null,h=!1;for(;;){let{done:g,value:b}=await n.read();if(g)break;if(!b)continue;let y=b.buffer.slice(b.byteOffset,b.byteOffset+b.byteLength);if(d.push(y),!p&&l<s){let f=Math.min(b.byteLength,s-l);if(f>0&&(a.set(b.subarray(0,f),l),l+=f),l-c>=o){let S=l===a.byteLength?a:a.slice(0,l),E=cr(S.buffer,i);E.width&&E.height&&(p=E,!h&&t&&(t(p),h=!0)),c=l}}}if(!p){let g=await new Response(new Blob(d)).arrayBuffer(),b=cr(g,i);b.width&&b.height&&(p=b,!h&&t&&(t(p),h=!0))}let v=new Blob(d,{type:i||"application/octet-stream"}),m=URL.createObjectURL(v);return{dims:p,blobUrl:m,contentType:i}}var re=class extends M{constructor(t){super(t);this.isStartLoaded=!1;this.loadingCount=0;this.imageStates=new WeakMap;this.htmlKey="lazy"}onInit(){document.querySelectorAll("img[string-lazy], img[data-string-lazy]").forEach(r=>this.ensureState(r)),this.isStartLoaded=!0}onObjectConnected(t){let r=t.htmlElement;if(!(r instanceof HTMLImageElement))return;r.getAttribute("src")||r.setAttribute("src","data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1' height='1' viewBox='0 0 1 1'%3E%3C/svg%3E");let i=this.ensureState(r);!i.aspectReady&&!i.aspectLoading&&this.prepareAspectRatio(r);let n=o=>{this.handleInView(r,i,!!o?.inView)};i.unsubscribe&&i.unsubscribe();let s=this.getObjectEventName(t,"object:inview");this.events.on(s,n),i.unsubscribe=()=>this.events.off(s,n),this.isStartLoaded&&(t.getProperty("is-inview")??!1)&&this.handleInView(r,i,!0)}onObjectDisconnected(t){let r=t.htmlElement;if(!(r instanceof HTMLImageElement))return;let i=this.imageStates.get(r);i&&(i.pendingActivation=!1,i.controller&&i.controller.abort(),i.blobUrl&&URL.revokeObjectURL(i.blobUrl),i.unsubscribe&&(i.unsubscribe(),i.unsubscribe=void 0))}ensureState(t){let r=this.imageStates.get(t);if(!r){let i=this.readSource(t);return r={src:i,aspectReady:!1,contentReady:!1,aspectLoading:!1,contentLoading:!1,pendingActivation:!1,rangeAttempted:!1,fetching:!1},this.imageStates.set(t,r),t.classList.contains("lazyLoad")||t.classList.add("lazyLoad"),t.dataset&&!t.dataset.stringLazySrc&&i&&(t.dataset.stringLazySrc=i),r}return r.src||(r.src=this.readSource(t)),r}readSource(t){let r=this.tools.domAttribute.process({element:t,key:this.htmlKey,fallback:""});return typeof r=="string"?r:r==null?"":String(r)}handleInView(t,r,i){r.pendingActivation=i,i&&(r.aspectReady?this.maybeActivateImage(t,r):r.aspectLoading||this.prepareAspectRatio(t))}async prepareAspectRatio(t){let r=this.ensureState(t);if(!r.src||r.aspectLoading||r.aspectReady)return;if(jr(r.src)){r.aspectReady=!0,r.allowSrcFallback=!0,this.maybeActivateImage(t,r);return}r.aspectLoading=!0,r.fetching=!0;let i=t.getAttribute("crossorigin"),n=t.getAttribute("referrerpolicy"),s=new AbortController;r.controller=s;try{let{blobUrl:o}=await Ur(r.src,{credentials:i==="use-credentials"?"include":"omit",referrerPolicy:n||void 0,signal:s.signal},a=>{a.width>0&&a.height>0&&!r.aspectReady&&(t.style.aspectRatio=`${a.width} / ${a.height}`,t.classList.add(sr),r.width=a.width,r.height=a.height,r.aspectReady=!0)});r.blobUrl=o,!r.aspectReady&&r.width&&r.height&&(t.style.aspectRatio=`${r.width} / ${r.height}`,t.classList.add(sr),r.aspectReady=!0)}catch{r.allowSrcFallback=!0,r.aspectReady=!0}finally{r.fetching=!1,r.aspectLoading=!1,this.maybeActivateImage(t,r)}}maybeActivateImage(t,r){!r.pendingActivation||r.contentReady||r.contentLoading||!r.aspectReady||!r.src||r.fetching&&!r.blobUrl||(r.blobUrl||r.allowSrcFallback)&&this.activateImage(t,r)}activateImage(t,r){r.contentLoading=!0,this.loadingCount++;let i=o=>{r.contentLoading&&(r.contentLoading=!1,r.pendingActivation=!1,this.loadingCount=Math.max(0,this.loadingCount-1),o&&(r.contentReady=!0,t.classList.add("-loaded")),this.loadingCount===0&&this.events.emit("image:load:all",null))},n=()=>i(!0),s=()=>i(!1);t.addEventListener("load",n,{once:!0}),t.addEventListener("error",s,{once:!0}),t.decoding="async",t.loading=t.loading||"lazy",r.blobUrl?(t.removeAttribute("srcset"),t.removeAttribute("sizes"),t.src=r.blobUrl):t.src=r.src,t.complete&&t.naturalWidth>0&&t.naturalHeight>0&&(t.removeEventListener("load",n),t.removeEventListener("error",s),i(!0))}};var ie=class extends M{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 ne=class extends M{constructor(e){super(e),this.htmlKey=""}canConnect(e){return e.keys[0]==null}};var ut=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}},se=class extends M{constructor(t){super(t);this.queries={0:new ut({max:359}),1:new ut({min:360,max:1023}),2:new ut({min:1024,max:1365}),3:new ut({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,n=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!=n&&this.events.emit("screen:desktop",n),this.isMobileMedia=t,this.isTabletMedia=r,this.isLaptopMedia=i,this.isDesktopMedia=n,document.querySelectorAll("[string-mobile], [string-tablet], [string-laptop], [string-desktop]").forEach(o=>{let a=!1;o.hasAttribute("string-mobile")&&t&&(a=!0),o.hasAttribute("string-tablet")&&r&&(a=!0),o.hasAttribute("string-laptop")&&i&&(a=!0),o.hasAttribute("string-desktop")&&n&&(a=!0),a?o.style.display=null:o.style.display="none"})}};var oe=class extends M{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,n=this.tools.originParser.process({value:r}),s=this.tools.originParser.process({value:i});return{x:n,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 qr=.05,Yr=.01,ur=1,Gr=-1,Xr=1,ae=class extends M{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=-this.data.scroll.displacement*this.maxDisplacementValue*t.glide;t.eventGlideName&&this.events.emit(t.eventGlideName,r);let i=`translate3d(0, ${r}px, 0)`;t.setProperty("__next-glide-transform",i),t.setProperty("__needs-glide-transform-update",!0)};this.onUpdateDesktopEvent=()=>{for(let t=0;t<this.objects.length;t++)this.setupItem(this.objects[t])};this.onUpdateMobileEvent=()=>{};this.onUpdateEvent=this.onUpdateDesktopEvent;this.htmlKey="glide",this.cssProperties=[{name:"--glide",syntax:"<number>",initialValue:"0",inherits:!0}],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}]}initializeObject(t,r,i,n){super.initializeObject(t,r,i,n),r.glide=r.getProperty("glide")??0,r.eventGlideName=this.getObjectEventName(r,"object:glide"),r.setProperty("__next-glide",0),r.setProperty("__next-glide-transform","translate3d(0, 0px, 0)"),r.setProperty("__needs-glide-var-update",!1),r.setProperty("__needs-glide-transform-update",!1)}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(){if(window.innerWidth>1024)this.maxDisplacementValue=this.data.viewport.windowHeight*.1,this.onUpdateEvent=this.onUpdateDesktopEvent;else{this.onUpdateEvent=this.onUpdateMobileEvent,this.resetState();for(let t=0;t<this.objects.length;t++){let r=this.objects[t];r.setProperty("__next-glide-transform","translate3d(0, 0px, 0)"),r.setProperty("__needs-glide-transform-update",!0),r.setProperty("__next-glide",0),r.setProperty("__needs-glide-var-update",!0)}this.flushPendingGlideStyles()}}resetState(){this.displacement=0,this.acceleration=0,this.isInitialScroll=!0,this.velocityMultiplier=this.baseVelocityMultiplier}onScrollStart(){this.resetState()}onScrollStop(){this.resetState(),this.previousLerp=0,this.data.scroll.displacement=0;let t=0;for(let r=0;r<this.objects.length;r++){let i=this.objects[r];i.setProperty("__next-glide-transform","translate3d(0, 0px, 0)"),i.setProperty("__needs-glide-transform-update",!0),i.setProperty("__next-glide",t),i.setProperty("__needs-glide-var-update",!0)}this.flushPendingGlideStyles()}onFrame(t){this.calcExpanderFactor(this.data.scroll.isScrollingDown===!1),this.acceleration=Math.min(ur,this.acceleration+qr),this.displacement=Math.max(Yr,Math.min(ur,this.displacement+this.velocityMultiplier)),this.data.scroll.displacement=Math.min(Xr,Math.max(Gr,this.data.scroll.lerped*this.displacement*this.acceleration));let r=this.data.scroll.displacement;for(let i=0;i<this.objects.length;i++){let n=this.objects[i];n.setProperty("__next-glide",r),n.setProperty("__needs-glide-var-update",!0)}this.previousLerp=this.data.scroll.lerped,this.onUpdateEvent()}onMutate(){this.applyPendingGlideStyles()}applyPendingGlideStyles(){for(let t=0;t<this.objects.length;t++){let r=this.objects[t],i=r.getProperty("__needs-glide-var-update")===!0,n=r.getProperty("__needs-glide-transform-update")===!0;if(!(!i&&!n)){if(i){let s=r.getProperty("__next-glide")??this.data.scroll.displacement;this.applyVarToElement(r,"--glide",s),this.applyVarToConnects(r,"--glide",s),r.setProperty("__needs-glide-var-update",!1)}if(n){let s=r.getProperty("__next-glide-transform")??"translate3d(0, 0px, 0)";this.applyPropToElement(r,"transform",s),r.setProperty("__needs-glide-transform-update",!1)}}}}flushPendingGlideStyles(){if(x.isOpen){this.applyPendingGlideStyles();return}x.run(()=>{this.applyPendingGlideStyles()})}};var le=class extends M{constructor(t){super(t);this.hasInitializedCSS=!1;this.htmlKey="lerp",this.cssProperties=[{name:"--lerp",syntax:"<number>",initialValue:"0",inherits:!0}],this.attributesToMap=[]}onObjectConnected(t){super.onObjectConnected(t),t.lerp=0,t.setProperty("lerp-applied",0),t.eventLerpName=this.getObjectEventName(t,"object:lerp")}onResize(){super.onResize(),!this.hasInitializedCSS&&this.objectsOnPage.length>0&&(this.hasInitializedCSS=!0,x.run(()=>{for(let t=0;t<this.objectsOnPage.length;t++)this.updateObjectLerp(this.objectsOnPage[t],!0)}))}onScrollStop(){for(let t=0;t<this.objects.length;t++)this.recomputeLerp(this.objects[t],0)}onFrame(t){let r=t.scroll.lerped;for(let i=0;i<this.objects.length;i++)this.recomputeLerp(this.objects[i],r)}recomputeLerp(t,r){t.lerp!==r&&(t.lerp=r,this.updateObjectLerp(t))}onMutate(){x.run(()=>{let t=this.objects.length;for(let r=0;r<t;r++)this.updateObjectLerp(this.objects[r])})}updateObjectLerp(t,r=!1){let i=t.lerp,n=t.getProperty("lerp-applied");if(!r&&n===i)return;t.setProperty("lerp-applied",i);let s=i?.toString()??"0";t.eventLerpName&&this.events.emit(t.eventLerpName,i),x.run(()=>{this.applyVarToElement(t,"--lerp",s),this.applyVarToConnects(t,"--lerp",s)})}onObjectDisconnected(t){super.onObjectDisconnected(t);let r=n=>{n.style.removeProperty("--lerp")};r(t.htmlElement);let i=t.mirrorObjects;for(let n=0;n<i.length;n++)r(i[n].htmlElement)}};var dr="__string-dev-progress-override",pr={computeRawProgress(u,e,t){if(t===0)return 0;let r=(u-e)/t;return r<=0?0:r>=1?1:r},computeRawProgressBatch(u,e,t,r,i){for(let n=0;n<i;n++){let s=t[n];if(s===0){r[n]=0;continue}let o=(u-e[n])/s;o<=0?r[n]=0:o>=1?r[n]=1:r[n]=o}}},dt=class extends M{constructor(t){super(t);this.updateScheduled=!1;this.batchStarts=new Float64Array(0);this.batchDiffs=new Float64Array(0);this.batchOut=new Float64Array(0);this.htmlKey="progress",this.cssProperties=[{name:"--progress",syntax:"<number>",initialValue:"0",inherits:!0},{name:"--progress-slice",syntax:"<number>",initialValue:"0",inherits:!0}],this.attributesToMap=[...this.attributesToMap,{key:"easing",type:"easing",fallback:this.settings.easing}]}initializeObject(t,r,i,n){super.initializeObject(t,r,i,n)}sanitizeRawProgress(t){if(!Number.isFinite(t)||t<=0)return 0;if(t>=1)return 1;let r=1e-4;return t>1-r?t=1:t<r&&(t=0),t}resolveRawProgress(t,r,i,n){let s=t.getProperty(dr);return s!=null?this.sanitizeRawProgress(s):pr.computeRawProgress(r,i,n)}applyRawProgress(t,r){let i=this.sanitizeRawProgress(r);if(t.progressRaw===i)return;t.progressRaw=i;let s=t.getProperty("easing"),o=typeof s=="function"?s(i):i;t.progress=o}recomputeProgress(t){let r=t.getProperty("start-position")??t.startPosition,i=t.getProperty("difference-position")??t.differencePosition;t.startPosition=r,t.differencePosition=i;let n=this.resolveRawProgress(t,this.data.scroll.transformedCurrent,r,i);this.applyRawProgress(t,n)}ensureBatchCapacity(t){this.batchStarts.length>=t||(this.batchStarts=new Float64Array(t),this.batchDiffs=new Float64Array(t),this.batchOut=new Float64Array(t))}calculatePositions(t,r){super.calculatePositions(t,r),t.startPosition=t.getProperty("start-position")??t.startPosition,t.differencePosition=t.getProperty("difference-position")??t.differencePosition,this.recomputeProgress(t)}onScroll(t){super.onScroll(t)}onObjectConnected(t){super.onObjectConnected(t)}onScrollMeasure(t){let r=this.objects.length;if(r!==0){this.ensureBatchCapacity(r);for(let i=0;i<r;i++){let n=this.objects[i],s=n.getProperty("start-position")??n.startPosition,o=n.getProperty("difference-position")??n.differencePosition;n.startPosition=s,n.differencePosition=o,this.batchStarts[i]=s,this.batchDiffs[i]=o}pr.computeRawProgressBatch(this.data.scroll.transformedCurrent,this.batchStarts,this.batchDiffs,this.batchOut,r);for(let i=0;i<r;i++){let n=this.objects[i],s=n.getProperty(dr),o=s!=null?this.sanitizeRawProgress(s):this.batchOut[i];this.applyRawProgress(n,o)}}}onMutate(){x.run(()=>{let t=this.objects.length;for(let r=0;r<t;r++)this.updateObjectProgress(this.objects[r])})}updateObjectProgress(t){let r=t.progress;if(t.getProperty("progress-applied")===r)return;let n=t.getProperty("key");t.setProperty("progress-applied",r);let s=t.progressRaw??r,o=t.getProperty("easing");t.eventProgressName&&this.events.emit(t.eventProgressName,r),n&&this.applyVarToElement(t,n,r);for(let a=0;a<t.mirrorObjects.length;a++){let l=t.mirrorObjects[a],c=l.applyProgress(s,typeof o=="function"?o:void 0);l.setProperty("progress",c),n&&this.tools.styleTxn.setVar(l.htmlElement,n,c)}}onObjectDisconnected(t){super.onObjectDisconnected(t);let r=t.getProperty("key");if(!r)return;let i=s=>{s.style.removeProperty(r)};i(t.htmlElement);let n=t.mirrorObjects;for(let s=0;s<n.length;s++)i(n[s].htmlElement)}};var ce=class extends dt{constructor(t){super(t);this.updateScheduledTransform=!1;this.calculateDesktopParallax=t=>{let r=t.progress,i=t.getProperty("parallax")??0,n=t.getProperty("parallax-position-start")??0,s=t.getProperty("parallax-position-end")??1,o=t.getProperty("parallax-sign")??1,a=this.data.viewport.windowHeight/this.data.viewport.transformScale,l=o*i*(a*n+r*a*s);return this.events.emit(this.getObjectEventName(t,"object:parallax"),l),{transform:`translate3d(0, ${l}px, 0)`}};this.calculateMobileParallax=t=>(this.events.emit(this.getObjectEventName(t,"object:parallax"),0),{transform:"translate3d(0, 0px, 0)"});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"]}],this.calculateParallaxForObject=this.calculateDesktopParallax}initializeObject(t,r,i,n){super.initializeObject(t,r,i,n);let s=r.getProperty("parallax-bias")??0,o=Math.abs(r.getProperty("parallax")??.2);r.setProperty("parallax-sign",Math.sign(r.getProperty("parallax"))),r.setProperty("parallax",o),r.setProperty("parallax-position-start",-.5+.5*s),r.setProperty("parallax-position-end",.5+.5*(1-s));let a=this.data.viewport.windowHeight;r.setProperty("offset-top",o*a),r.setProperty("offset-bottom",o*a)}calculatePositions(t,r){super.calculatePositions(t,r),t.transformValue=this.calculateParallaxForObject(t)}onScroll(t){super.onScroll(t)}onResize(){let t=window.innerWidth>1024;this.calculateParallaxForObject=t?this.calculateDesktopParallax:this.calculateMobileParallax}onScrollMeasure(t){super.onScrollMeasure(t);for(let r=0;r<this.objects.length;r++){let i=this.objects[r];i.transformValue=this.calculateParallaxForObject(i)}}onMutate(){x.run(()=>{for(let t=0;t<this.objects.length;t++){let r=this.objects[t],i=r.transformValue;i&&(this.applyPropToElement(r,"transform",i.transform),this.applyPropToConnects(r,"transform",i.transform))}})}};var ue=class{constructor(e,t,r,i){this.isDragging=!1;this.startY=0;this.startScrollPosition=0;this.data=e,this.scrollbar=t,this.thumb=r,this.onScrollTo=i}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,this.onScrollTo(r),this.updateThumb()}};var de=class{constructor(e,t,r,i){this.isDragging=!1;this.startCoordinate=0;this.startScrollPosition=0;this.data=e,this.scrollbar=t,this.thumb=r,this.onScrollTo=i}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,n=Math.max(0,Math.min(r,i));this.data.scroll.current=n,this.data.scroll.target=n,this.onScrollTo(n),this.updateThumb()}};var pe=class extends M{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),this.requestScrollTo=r=>{this.events.emit("scrollTo",{position:r,immediate:!0})}}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,13 +16,622 @@
|
|
|
16
16
|
-ms-overflow-style: none; /* IE and Edge */
|
|
17
17
|
scrollbar-width: none; /* Firefox */
|
|
18
18
|
}
|
|
19
|
-
`,document.head.appendChild(e)}createScrollbar(){this.scrollbar=document.createElement("div"),this.scrollbar.classList.add("scrollbar"),this.thumb=document.createElement("div"),this.thumb.classList.add("thumb"),this.scrollbar.appendChild(this.thumb),document.body.appendChild(this.scrollbar),this.scrollbarStateHorizontal=new ct(this.data,this.scrollbar,this.thumb,this.requestScrollTo),this.scrollbarStateVertical=new ut(this.data,this.scrollbar,this.thumb,this.requestScrollTo),this.scrollbarState=this.scrollbarStateVertical}updateThumb(){this.scrollbarState.updateThumb()}mouseDownEvent(e){this.isDragging=!0,this.scrollbarState.mouseDownEvent(e),document.body.style.userSelect="none",this.scrollbar.classList.add("-touch")}mouseMoveEvent(e){this.isDragging&&this.scrollbarState.mouseMoveEvent(e)}mouseUpEvent(){this.isDragging=!1,document.body.style.userSelect="",this.hideScrollbar(),this.scrollbar.classList.remove("-touch")}showScrollbar(){this.scrollbar.classList.add("-scroll")}hideScrollbar(){this.scrollTimeout&&clearTimeout(this.scrollTimeout),this.scrollTimeout=setTimeout(()=>{this.scrollbar.classList.remove("-scroll")},1e3)}};var ie={BEFORE_ELEMENT:"-before-element",AFTER_ELEMENT:"-after-element"};function Ar(u){if(!u||!Array.isArray(u.chars)||u.chars.length===0)return[];let r=u.chars[0].splitClass??[];if(r.length===0)return[];for(let e of u.chars){let t=e.splitClass??[];if(t.length!==r.length)return[];for(let i=0;i<t.length;i++)if(t[i]!==r[i])return[]}return r}function Dr(u){return u.chars[0]?.token?.meta?.wrappers??[]}function rr(u,r,e){let t=document.createDocumentFragment(),i=0,n=B(r,"line")||B(r,"charLine")||B(r,"wordLine"),s=B(r,"char")||B(r,"charLine")||B(r,"charWord"),o=0;u.forEach(h=>o+=h.words.length),o--;let a=0;u.forEach(h=>h.words.forEach(p=>a+=p.chars.length));let l=u.length,c=o+1,d=new Map;return u.forEach((h,p)=>{let b=p===u.length-1,m=t,g=[];n&&(m=document.createElement("span"),m.setAttribute("aria-hidden","true"),m.classList.add("-s-line"),h.isBeforeElement&&m.classList.add(ie.BEFORE_ELEMENT),h.isAfterElement&&m.classList.add(ie.AFTER_ELEMENT),m.style.setProperty("--line-index",String(h.lineIndex)),m.style.setProperty("--word-total",String(h.words.length)),h.fitFontSize!==void 0&&m.style.setProperty("--fit-font-size",String(h.fitFontSize)),Ht(m,h.calculatedValues,r));let v=[],y=m;if(h.words.forEach((f,S)=>{n&&(o=h.words.length-1);let E=S===o,T=Dr(f),D=0;for(;D<v.length&&D<T.length&&v[D].info.id===T[D].id;)D++;for(;v.length>D;)v.pop();y=v.length>0?v[v.length-1].element:m;for(let w=D;w<T.length;w++){let A=T[w],F=document.createElement(A.tag);for(let[k,N]of A.attributes)F.setAttribute(k,N);y.appendChild(F),v.push({info:A,element:F}),y=F}if(f.chars.length===1&&f.chars[0].token.type==="element"){let w=f.chars[0].token.node.cloneNode(!0);y.appendChild(w);return}let C=f.chars.map(w=>w.char).join("");C&&g.push(C);let I=B(r,"word")||B(r,"charWord")||B(r,"wordLine"),O=I?document.createElement("span"):y,L=Ar(f);if(I&&(O.setAttribute("aria-hidden","true"),O.classList.add("-s-word"),f.isBeforeElement&&O.classList.add(ie.BEFORE_ELEMENT),f.isAfterElement&&O.classList.add(ie.AFTER_ELEMENT),O.style.setProperty("--word-index",String(f.wordIndexGlobal)),O.style.setProperty("--char-total",String(f.chars.length)),O.setAttribute("data-split-content",C),Ht(O,f.calculatedValues,r),L.length&&O.classList.add(...L)),s)f.chars.forEach((w,A)=>{if(w.char===" "||w.char===" ")return;let F=document.createElement("span");F.setAttribute("aria-hidden","true");let k=F;k.classList.add("-s-char"),w.isBeforeElement&&k.classList.add(ie.BEFORE_ELEMENT),w.isAfterElement&&k.classList.add(ie.AFTER_ELEMENT),k.textContent=w.char,k.setAttribute("data-split-content",w.char),k.style.setProperty("--char-index",String(i++));let N=f.chars[A+1];if(N){let j=e.getKerning(w.char,N.char);Math.abs(j)>.01&&(k.style.setProperty("--kerning",`${j.toFixed(2)}px`),k.style.marginRight="var(--kerning)")}Ht(k,w.calculatedValues,r);let _=w.splitClass??[];_.length&&!L.length&&k.classList.add(..._),O.appendChild(F)});else{let w=document.createTextNode(C);O.appendChild(w)}I&&y.appendChild(O);let H=h.words[S+1]?.noSpaceBefore;n?E?b||m.appendChild(document.createElement("br")):H||O.appendChild(document.createTextNode("\xA0")):!E&&!H&&O.appendChild(document.createTextNode("\xA0"))}),n){let f=g.join(" ");m.setAttribute("data-split-content",f),t.appendChild(m)}}),s&&d.set("--char-global-total",String(a)),(B(r,"word")||B(r,"charWord")||B(r,"wordLine"))&&d.set("--word-global-total",String(c)),n&&d.set("--line-global-total",String(l)),{fragment:t,extraProps:d}}function Ht(u,r,e){if(r)for(let t of r){if(!Ir(t.type,t.align,e))continue;let i=Rr(t.type,t.align);u.style.setProperty(i,String(t.value))}}function Ir(u,r,e){let t=e[u]??[];return Array.isArray(t)&&t.some(i=>r.startsWith("random")?i.align.startsWith("random"):i.align===r)}function Rr(u,r){let e=r.startsWith("random")?"random":r;return`--${u}-${e}`}function B(u,r){return Array.isArray(u[r])&&u[r].length>0}var kr=new Set(["img","video","audio","canvas","iframe","object","svg","input","textarea","select","button","area","base","col","embed","hr","link","meta","param","source","track","wbr","picture","table"]);function Fr(u){let r=[];for(let e=0;e<u.attributes.length;e++){let t=u.attributes[e];r.push([t.name,t.value])}return r}var he=0;function ir(u){he=0;let r=[],e=(i,n)=>{n&&Object.keys(n).length&&(i.meta={...i.meta||{},...n}),r.push(i)},t=(i,n)=>{if(i.nodeType===Node.ELEMENT_NODE){let s=i,o=s.tagName.toLowerCase();if(o==="split-class"){let a=(s.getAttribute("class")??"").split(/\s+/).filter(Boolean),l={...n||{},splitClass:[...n?.splitClass??[],...a]};s.childNodes.forEach(c=>t(c,l));return}if(o==="br"){e({type:"br",id:`br_${he++}`,node:s,tagName:"br"},n);return}if(!kr.has(o)&&s.childNodes.length>0){let a={id:`wrapper_${he++}`,tag:o,attributes:Fr(s)},l=n?.wrappers??[],c={...n||{},wrappers:[...l,a]};s.childNodes.forEach(d=>t(d,c));return}e({type:"element",id:`el_${he++}`,node:s,tagName:o},n);return}if(i.nodeType===Node.TEXT_NODE){let s=i.nodeValue??"",o=`text_${he++}`;s.trim()?e({type:"text",id:o,node:i,content:s},n):e({type:"space",id:o,node:i,content:s},n);return}e({type:"other",id:`node_${he++}`,node:i},n)};return u.forEach(i=>t(i)),r}var ht=class{constructor(r){this.font="";this.cache={kerning:new Map,charWidth:new Map};let e=document.createElement("canvas");this.ctx=e.getContext("2d"),this.setFontFromElement(r)}setFontFromElement(r){let e=window.getComputedStyle(r),t=`${e.fontStyle} ${e.fontVariant} ${e.fontWeight} ${e.fontSize}/${e.lineHeight} ${e.fontFamily}`;t!==this.font&&(this.font=t,this.ctx.font=this.font,this.cache.kerning.clear(),this.cache.charWidth.clear())}getCharWidth(r){if(this.cache.charWidth.has(r))return this.cache.charWidth.get(r);let e=this.ctx.measureText(r).width;return this.cache.charWidth.set(r,e),e}getKerning(r,e){let t=`${r}${e}`,i=`${this.font}|${t}`;if(this.cache.kerning.has(i))return this.cache.kerning.get(i);let n=this.ctx.measureText(t).width,s=this.getCharWidth(r)+this.getCharWidth(e),o=n-s;return this.cache.kerning.set(i,o),o}measureWord(r){let e=0;for(let t=0;t<r.length;t++){let i=r[t];if(e+=this.getCharWidth(i),t>0){let n=r[t-1];e+=this.getKerning(n,i)}}return e}};function Hr(u,r){return!u?.length&&!r?.length?!0:!u||!r||u.length!==r.length?!1:u.every((e,t)=>e.id===r[t].id)}function Nr(u){let r=[],e=[];for(let t of u)t.type==="br"?(e.length&&r.push(e),r.push([t]),e=[]):e.push(t);return e.length&&r.push(e),r}function nr(u,r,e){let t=document.createElement("div"),i=window.getComputedStyle(r);t.style.position="absolute",t.style.visibility="hidden",t.style.pointerEvents="none",t.style.width=r.clientWidth+"px",t.style.padding=i.padding,t.style.font=i.font,t.style.letterSpacing=i.letterSpacing,t.style.lineHeight=i.lineHeight,t.style.fontVariant=i.fontVariant,t.style.fontStretch=i.fontStretch,t.style.wordBreak=i.wordBreak,t.style.wordWrap=i.wordWrap,t.style.whiteSpace=i.whiteSpace,t.style.textTransform=i.textTransform;let n=document.createElement("span");n.textContent="\xA0",t.appendChild(n);let s=n.getBoundingClientRect().width;t.removeChild(n),t.style.width=r.clientWidth+s+"px",t.style.boxSizing="border-box",r.appendChild(t);let o=[],a=Nr(u),l=!1,c=!1,d=!1,h;for(let p of a){if(p.length===1&&p[0].type==="br"){o.push({token:p[0],rect:new DOMRect(0,0,0,0)});continue}if(p.length===0)continue;t.innerHTML="";let b=[],m=[];p.forEach(g=>{switch(g.type){case"text":{let v=g.content,y=/^\s/.test(v),f=/\s$/.test(v),S=g.meta?.wrappers??[],E=v.trim().split(/\s+/).filter(T=>T.length>0);E.forEach((T,D)=>{let R=document.createElement("span");if(R.style.display="inline-block",S.length>0){let O=R;for(let L of S){let H=document.createElement(L.tag);for(let[w,A]of L.attributes)H.setAttribute(w,A);O.appendChild(H),O=H}O.textContent=T}else R.textContent=T;t.appendChild(R),(D<E.length-1||f)&&t.appendChild(document.createTextNode(" "));let C=D===0&&!y&&!c&&d,I=D>0||Hr(h,S);b.push(R),m.push({token:{type:"text",id:"",node:g.node,content:T,meta:{...g.meta||{},joinPrev:C&&I,noSpaceBefore:C&&!I}},wordIndex:b.length-1,hadLeadingSpace:y,hadTrailingSpace:f})}),c=f,d=!0,h=S;break}case"element":{let v=g.node.cloneNode(!0),y=document.createElement("span");y.style.display="inline-block",y.appendChild(v),t.appendChild(y),b.push(y),m.push({token:g,wordIndex:b.length-1}),l=!0,d=!1,c=!1;break}case"space":c=!0;break;case"other":d=!1,c=!1;break}}),t.offsetHeight,m.forEach((g,v)=>{if(g.wordIndex!==void 0){let f=b[g.wordIndex].getBoundingClientRect(),S;if(g.token.type==="text"){let T=e.measureWord(g.token.content);S=new DOMRect(f.x,f.y,T,f.height)}else S=f;let E={token:g.token,rect:S,browserWidth:f.width};if(l&&g.token.type==="text"&&(l=!1,E.token.meta={...E.token.meta||{},isAfterElement:!0}),o.push(E),g.token.type==="element"){let T=o[o.length-2];T?.token.type==="text"&&(T.token.meta={...T.token.meta||{},isBeforeElement:!0})}}})}return r.removeChild(t),o}var sr=5;function or(u,r,e){let t=[],i=null,n=0,s=0,o=0,a=0;return u.forEach(l=>{let c=l.token,d=c.meta?.isBeforeElement??!1,h=c.meta?.isAfterElement??!1;if(c.type==="br"){i=null;return}if(c.type==="text"){let p=c.content,b=c.meta?.splitClass??[],m=!!c.meta?.joinPrev,g=[],v=0;for(let C=0;C<p.length;C++){let I=p[C],O=C>0?p[C-1]:null,L=e.getCharWidth(I),H=O?e.getKerning(O,I):0;v+=H;let w=new DOMRect(l.rect.left+v,l.rect.top,L,l.rect.height),A={char:I,rect:w,token:c,charIndexInWord:C,charIndexInLine:0,charIndexGlobal:s++};b.length&&(A.splitClass=b),g.push(A),v+=L}if(g.length>0){let C=g[g.length-1];d&&(C.isBeforeElement=!0),h&&(C.isAfterElement=!0)}let y=Math.round(l.rect.top),f=Math.round(n);if((!i||Math.abs(y-f)>sr)&&(n=y,i={words:[],rect:l.rect,lineIndex:t.length},a=0,t.push(i)),!i)return;let E=l.rect.left+(l.browserWidth??l.rect.width);if(m&&i.words.length>0){let C=i.words[i.words.length-1],I=i.words.reduce((L,H)=>L+H.chars.length,0),O=C.chars.length;g.forEach((L,H)=>{L.charIndexInLine=I+H,L.charIndexInWord=O+H}),C.chars.push(...g),C.rect=pt([C.rect,l.rect]),i.rect=pt(i.words.map(L=>L.rect)),a=Math.max(a,E),i.fitWidth=a-i.rect.left,i.browserWordWidthSum=(i.browserWordWidthSum??0)+(l.browserWidth??l.rect.width),d&&(C.isBeforeElement=!0),h&&(C.isAfterElement=!0);return}let T=i.words.length,D=i.words.reduce((C,I)=>C+I.chars.length,0);g.forEach((C,I)=>C.charIndexInLine=D+I);let R={chars:g,rect:l.rect,wordIndexGlobal:o++,wordIndexInLine:T,isBeforeElement:d,isAfterElement:h,noSpaceBefore:!!c.meta?.noSpaceBefore};i.words.push(R),i.rect=pt(i.words.map(C=>C.rect)),a=Math.max(a,E),i.fitWidth=a-i.rect.left,i.browserWordWidthSum=(i.browserWordWidthSum??0)+(l.browserWidth??l.rect.width),d&&(i.isBeforeElement=!0),h&&(i.isAfterElement=!0);return}if(c.type==="element"){let p=l.rect,b=Math.round(p.top),m=Math.round(n);if((!i||Math.abs(b-m)>sr)&&(n=b,i={words:[],rect:p,lineIndex:t.length},a=0,t.push(i)),!i)return;let v=i.words.length,y=i.words.reduce((E,T)=>E+T.chars.length,0),S={chars:[{char:"[E]",rect:p,token:c,charIndexInWord:0,charIndexInLine:y,charIndexGlobal:s++}],rect:p,wordIndexGlobal:o++,wordIndexInLine:v,isBeforeElement:!1,isAfterElement:!1};i.words.push(S),i.rect=pt(i.words.map(E=>E.rect)),a=Math.max(a,l.rect.left+(l.browserWidth??l.rect.width)),i.fitWidth=a-i.rect.left,i.browserWordWidthSum=(i.browserWordWidthSum??0)+(l.browserWidth??l.rect.width)}}),t}function pt(u){if(u.length===0)return new DOMRect(0,0,0,0);let r=Math.min(...u.map(n=>n.left)),e=Math.min(...u.map(n=>n.top)),t=Math.max(...u.map(n=>n.right)),i=Math.max(...u.map(n=>n.bottom));return new DOMRect(r,e,t-r,i-e)}var mt=class extends x{constructor(r){super(r),this.htmlKey="split",this.permissions.mobile.rebuild.height=!1,this.permissions.mobile.rebuild.width=!1}onResizeWidth(){this.objectsOnPage.forEach(r=>{this.onObjectConnected(r)})}onObjectConnected(r){let e=r.htmlElement;if(!e)return;let t=e.classList.contains("-splitted"),i=e.getAttribute("string-split-original");(!t||i===null)&&(i=this.escapeAttribute(e.innerHTML),e.setAttribute("string-split-original",i),e.classList.add("-splitted")),r.htmlElement.innerHTML=i;let n=e.getAttribute("string-split")??e.getAttribute("data-string-split")??"",s=this.tools.optionsParser.process({attributeValue:n}),{fragment:o,result:a,extraProps:l}=this.split(e,s);r.setProperty("nodes",o.childNodes),e.setAttribute("aria-label",i),e.innerHTML="",e.appendChild(a),l.forEach((d,h)=>{e.style.setProperty(h,d)});let c=e.getAttribute("string-split-restore-after");c&&!isNaN(Number(c))&&setTimeout(()=>{e.innerHTML=i,e.classList.add("-restored")},Number(c))}split(r,e){let t=new ht(r),i=document.createDocumentFragment();r.childNodes.forEach(d=>i.appendChild(d.cloneNode(!0)));let n=ir(i.childNodes),s=nr(n,r,t),o=or(s,r,t),a=e.fit?this.getFitContext(o,r):null,l=a?this.applyFit(o,e,a):new Map;this.applyCalculatedValues(o,e);let c=rr(o,e,t);return l.forEach((d,h)=>c.extraProps.set(h,d)),a&&this.refineFitFontSize(r,c.fragment,c.extraProps,o,e,a),{fragment:i,result:c.fragment,extraProps:c.extraProps}}getFitContext(r,e){let t=window.getComputedStyle(e),i=parseFloat(t.fontSize);if(!i)return null;let n=e.clientWidth-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0);if(n<=0)return null;let s=0;for(let l of r){let c=l.fitWidth??l.rect.width;c>s&&(s=c)}if(s<=0)return null;let o=n;if(Math.abs(n-s)<2&&e.parentElement){let l=window.getComputedStyle(e.parentElement),c=e.parentElement.clientWidth-(parseFloat(l.paddingLeft)||0)-(parseFloat(l.paddingRight)||0);c>n&&(o=c)}let a=parseFloat(t.lineHeight)||0;return{currentFontSize:i,contentWidth:o,lineHeightPx:a}}applyFit(r,e,t){let i=new Map,{currentFontSize:n,contentWidth:s}=t,o=(e.line?.length??0)>0||(e.wordLine?.length??0)>0||(e.charLine?.length??0)>0,a=(e.char?.length??0)>0||(e.charLine?.length??0)>0||(e.charWord?.length??0)>0;if(o)for(let l of r){let c=l.fitWidth??l.rect.width;c>0&&(l.fitFontSize=this.computeFitFontSize(n,s,c,a?l.browserWordWidthSum:void 0))}else{let l=r.reduce((h,p)=>(p.fitWidth??p.rect.width)>(h.fitWidth??h.rect.width)?p:h,r[0]),c=l.fitWidth??l.rect.width,d=this.computeFitFontSize(n,s,c,a?l.browserWordWidthSum:void 0);i.set("--fit-font-size",String(Math.floor(d)))}return i}refineFitFontSize(r,e,t,i,n,s){let o=(n.line?.length??0)>0||(n.wordLine?.length??0)>0||(n.charLine?.length??0)>0,a=(n.char?.length??0)>0||(n.charLine?.length??0)>0||(n.charWord?.length??0)>0,l=r.innerHTML;try{if(r.innerHTML="",r.appendChild(e.cloneNode(!0)),o){let c=Array.from(r.querySelectorAll(".-s-line")),d=Array.from(e.querySelectorAll(".-s-line"));c.forEach((h,p)=>{let b=d[p];if(!b)return;let m=parseFloat(b.style.getPropertyValue("--fit-font-size"));if(!m)return;let g=this.solveRenderedFitFontSize(h,s.currentFontSize,m,s.contentWidth,a);g&&(i[p].fitFontSize=g,b.style.setProperty("--fit-font-size",String(Math.floor(g))))})}else{let c=parseFloat(t.get("--fit-font-size")??"");if(!c)return;let d=this.solveRenderedFitFontSize(r,s.currentFontSize,c,s.contentWidth,a);if(!d)return;let h=Math.floor(d);t.set("--fit-font-size",String(h));let{lineHeightPx:p,currentFontSize:b,contentWidth:m}=s;if(p>0&&b>0){let g=p*(h/b);g>0&&(t.set("--fit-scale-y",String(window.innerHeight/g)),t.set("--fit-aspect-ratio",String(m/g)))}}}finally{r.innerHTML=l}}solveRenderedFitFontSize(r,e,t,i,n){if(!Number.isFinite(e)||!Number.isFinite(t)||e<=0||t<=0)return null;let s=this.measureScopeAtFontSize(r,n,e);if(s<=0)return null;if(Math.abs(i-s)<.01)return e;let o=Math.abs(t-e)<.01?s:this.measureScopeAtFontSize(r,n,t);if(o<=0)return e*(i/s);let a=(o-s)/(t-e);if(!Number.isFinite(a)||Math.abs(a)<1e-4)return e*(i/s);let l=e+(i-s)/a;return!Number.isFinite(l)||l<=0?null:l}measureScopeAtFontSize(r,e,t){if(e){let s=Array.from(r.querySelectorAll(".-s-char")),o=s.map(l=>l.style.fontSize);s.forEach(l=>{l.style.fontSize=`${t}px`}),r.offsetWidth;let a=this.measureCharScopeWidth(r);return s.forEach((l,c)=>{l.style.fontSize=o[c]}),a}let i=r.style.fontSize;r.style.fontSize=`${t}px`,r.offsetWidth;let n=this.measureContentWidth(r);return r.style.fontSize=i,n}measureCharScopeWidth(r){let e=0;Array.from(r.querySelectorAll(".-s-char")).forEach(o=>{let a=o.getBoundingClientRect(),l=window.getComputedStyle(o);e+=a.width+(parseFloat(l.marginLeft)||0)+(parseFloat(l.marginRight)||0)});let i=document.createTreeWalker(r,NodeFilter.SHOW_TEXT),n=i.nextNode();for(;n;){let o=n.parentElement,a=!!o?.closest(".-s-char"),l=!!o&&!o.classList.contains("-s-char")&&!o.classList.contains("-s-word")&&!o.classList.contains("-s-line")&&!o.querySelector(".-s-char, .-s-word, .-s-line");if(!a&&!l&&n.textContent?.length){let c=document.createRange();c.selectNodeContents(n),e+=c.getBoundingClientRect().width}n=i.nextNode()}return Array.from(r.querySelectorAll("*")).filter(o=>{let a=o;return!a.classList.contains("-s-char")&&!a.classList.contains("-s-word")&&!a.classList.contains("-s-line")&&!a.querySelector(".-s-char, .-s-word, .-s-line")}).forEach(o=>{e+=o.getBoundingClientRect().width}),e}measureContentWidth(r){if(!r.childNodes.length)return r.getBoundingClientRect().width;let e=document.createRange();return e.selectNodeContents(r),e.getBoundingClientRect().width}computeFitFontSize(r,e,t,i){let n=i!==void 0?t-i:0,s=t-n;return s<=0?r*(e/t):r*(e-n)/s}computeValue(r,e,t){if(r.align.startsWith("random")){let i=r.random?.min??0,n=r.random?.max??t-1;return Math.floor(Math.random()*(n-i+1))+i}switch(r.align){case"start":return e;case"end":return t-e-1;case"center":{let i=Math.floor((t-1)/2);return Math.abs(e-i)}default:return e}}applyCalculatedValues(r,e){let t=s=>s.words.reduce((o,a)=>o+a.chars.length,0),i=r.reduce((s,o)=>s+o.words.length,0),n=r.reduce((s,o)=>s+o.words.reduce((a,l)=>a+l.chars.length,0),0);r.forEach((s,o)=>{e.line&&(s.calculatedValues=e.line.map(a=>({type:"line",align:a.align,value:this.computeValue(a,o,r.length)}))),s.words.forEach(a=>{e.word&&(a.calculatedValues=e.word.map(c=>({type:"word",align:c.align,value:this.computeValue(c,a.wordIndexGlobal,i)}))),e.wordLine&&(a.calculatedValues??(a.calculatedValues=[]),a.calculatedValues.push(...e.wordLine.map(c=>({type:"wordLine",align:c.align,value:this.computeValue(c,a.wordIndexInLine,s.words.length)}))));let l=t(s);a.chars.forEach(c=>{let d=[];e.char&&d.push(...e.char.map(h=>({type:"char",align:h.align,value:this.computeValue(h,c.charIndexGlobal,n)}))),e.charWord&&d.push(...e.charWord.map(h=>({type:"charWord",align:h.align,value:this.computeValue(h,c.charIndexInWord,a.chars.length)}))),e.charLine&&d.push(...e.charLine.map(h=>({type:"charLine",align:h.align,value:this.computeValue(h,c.charIndexInLine,l)}))),c.calculatedValues=d})})})}escapeAttribute(r){return r.replace(/src="(https?:\/\/[^"\s]+)"/g,"src=$1")}};var gt=class extends x{constructor(e){super(e);this.history=[];this.maxPoints=0;this.height=0;this.value=0;this.target=0;this._type=2}onInit(){this.initCanvas(),this.maxPoints=this.canvas.width}onScroll(e){let t=Math.abs(e.scroll.displacement);this.value=t,this.history.push(t),this.history.length>this.maxPoints&&this.history.shift(),this.draw()}draw(){let e=this.context,t=this.canvas.width,i=this.canvas.height;e.clearRect(0,0,t,i),e.strokeStyle="red",e.lineWidth=2,e.beginPath(),this.history.forEach((n,s)=>{let o=s,a=i-n*this.height;s===0?e.moveTo(o,a):e.lineTo(o,a)}),e.stroke()}initCanvas(){let e=document.createElement("canvas"),t=window.innerWidth*.5;this.height=window.innerHeight/15-20,e.width=t,e.height=this.height,Object.assign(e.style,{position:"fixed",bottom:`${window.innerHeight/20+10}px`,left:"50%",transform:"translateX(-50%)",backgroundColor:"#000000",border:"1px solid rgba(255, 255, 255, 0.2)",zIndex:"1000",pointerEvents:"none"}),this.canvas=e,this.context=e.getContext("2d"),document.body.appendChild(e)}setTarget(e){this.target=e}clear(){this.canvas.remove(),this.history=[]}};var K="data-fps",ft=class extends x{constructor(e){super(e);this.displayElement=null;this.intervalId=0;this.frameCount=0;this.fpsElements=new Set;this.observer=null;this.lastFps=-1;this._type=2}onInit(){this.data.system.fpsTracker&&this.createDisplayElement(),this.events.on("tracker:fps:visible",this.onVisibilityChange.bind(this)),this.scanElements(),this.observeDOM(),this.intervalId=window.setInterval(()=>{this.updateFPS(this.frameCount),this.frameCount=0},1e3)}onFrame(e){this.frameCount++}destroy(){clearInterval(this.intervalId),this.observer?.disconnect(),this.removeDisplayElement(),this.fpsElements.clear()}onVisibilityChange(e){e?this.createDisplayElement():this.removeDisplayElement()}removeDisplayElement(){this.displayElement?.remove(),this.displayElement=null}updateFPS(e){if(e===this.lastFps)return;this.lastFps=e;let t=String(e);for(let i of this.fpsElements)i.isConnected&&i.setAttribute(K,t);this.displayElement&&this.displayElement.setAttribute(K,t),this.events.emit("fps",e)}scanElements(){this.fpsElements.clear(),document.querySelectorAll(`[${K}]`).forEach(e=>{e!==this.displayElement&&this.fpsElements.add(e)})}observeDOM(){this.observer=new MutationObserver(e=>{let t=!1;for(let i of e){for(let n of Array.from(i.addedNodes))if(n.nodeType===Node.ELEMENT_NODE){let s=n;s.hasAttribute(K)&&(t=!0),s.querySelector(`[${K}]`)&&(t=!0)}for(let n of Array.from(i.removedNodes))n.nodeType===Node.ELEMENT_NODE&&this.fpsElements.delete(n)}t&&this.scanElements()}),this.observer.observe(document.body,{childList:!0,subtree:!0})}createDisplayElement(){if(this.displayElement)return;let e=document.createElement("div");Object.assign(e.style,{position:"fixed",bottom:"10px",right:"10px",backgroundColor:"#000",color:"#fff",padding:"4px 8px",fontSize:"12px",fontFamily:"monospace",border:"1px solid rgba(255,255,255,0.2)",zIndex:"1000",pointerEvents:"none"}),e.setAttribute(K,"0"),document.body.appendChild(e);let t="string-fps-tracker-style";if(!document.getElementById(t)){let i=document.createElement("style");i.id=t,i.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 ue(this.data,this.scrollbar,this.thumb,this.requestScrollTo),this.scrollbarStateVertical=new de(this.data,this.scrollbar,this.thumb,this.requestScrollTo),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 it={BEFORE_ELEMENT:"-before-element",AFTER_ELEMENT:"-after-element"};function Kr(u){if(!u||!Array.isArray(u.chars)||u.chars.length===0)return[];let e=u.chars[0].splitClass??[];if(e.length===0)return[];for(let t of u.chars){let r=t.splitClass??[];if(r.length!==e.length)return[];for(let i=0;i<r.length;i++)if(r[i]!==e[i])return[]}return e}function Qr(u){return u.chars[0]?.token?.meta?.wrappers??[]}function hr(u,e,t){let r=document.createDocumentFragment(),i=0,n=B(e,"line")||B(e,"charLine")||B(e,"wordLine"),s=B(e,"char")||B(e,"charLine")||B(e,"charWord"),o=0;u.forEach(p=>o+=p.words.length),o--;let a=0;u.forEach(p=>p.words.forEach(h=>a+=h.chars.length));let l=u.length,c=o+1,d=new Map;return u.forEach((p,h)=>{let v=h===u.length-1,m=r,g=[];n&&(m=document.createElement("span"),m.setAttribute("aria-hidden","true"),m.classList.add("-s-line"),p.isBeforeElement&&m.classList.add(it.BEFORE_ELEMENT),p.isAfterElement&&m.classList.add(it.AFTER_ELEMENT),m.style.setProperty("--line-index",String(p.lineIndex)),m.style.setProperty("--word-total",String(p.words.length)),p.fitFontSize!==void 0&&m.style.setProperty("--fit-font-size",String(p.fitFontSize)),Ue(m,p.calculatedValues,e));let b=[],y=m;if(p.words.forEach((f,S)=>{n&&(o=p.words.length-1);let E=S===o,T=Qr(f),k=0;for(;k<b.length&&k<T.length&&b[k].info.id===T[k].id;)k++;for(;b.length>k;)b.pop();y=b.length>0?b[b.length-1].element:m;for(let w=k;w<T.length;w++){let D=T[w],F=document.createElement(D.tag);for(let[R,N]of D.attributes)F.setAttribute(R,N);y.appendChild(F),b.push({info:D,element:F}),y=F}if(f.chars.length===1&&f.chars[0].token.type==="element"){let w=f.chars[0].token.node.cloneNode(!0);y.appendChild(w);return}let C=f.chars.map(w=>w.char).join("");C&&g.push(C);let A=B(e,"word")||B(e,"charWord")||B(e,"wordLine"),O=A?document.createElement("span"):y,L=Kr(f);if(A&&(O.setAttribute("aria-hidden","true"),O.classList.add("-s-word"),f.isBeforeElement&&O.classList.add(it.BEFORE_ELEMENT),f.isAfterElement&&O.classList.add(it.AFTER_ELEMENT),O.style.setProperty("--word-index",String(f.wordIndexGlobal)),O.style.setProperty("--char-total",String(f.chars.length)),O.setAttribute("data-split-content",C),Ue(O,f.calculatedValues,e),L.length&&O.classList.add(...L)),s)f.chars.forEach((w,D)=>{if(w.char===" "||w.char===" ")return;let F=document.createElement("span");F.setAttribute("aria-hidden","true");let R=F;R.classList.add("-s-char"),w.isBeforeElement&&R.classList.add(it.BEFORE_ELEMENT),w.isAfterElement&&R.classList.add(it.AFTER_ELEMENT),R.textContent=w.char,R.setAttribute("data-split-content",w.char),R.style.setProperty("--char-index",String(i++));let N=f.chars[D+1];if(N){let j=t.getKerning(w.char,N.char);Math.abs(j)>.01&&(R.style.setProperty("--kerning",`${j.toFixed(2)}px`),R.style.marginRight="var(--kerning)")}Ue(R,w.calculatedValues,e);let W=w.splitClass??[];W.length&&!L.length&&R.classList.add(...W),O.appendChild(F)});else{let w=document.createTextNode(C);O.appendChild(w)}A&&y.appendChild(O);let H=p.words[S+1]?.noSpaceBefore;n?E?v||m.appendChild(document.createElement("br")):H||O.appendChild(document.createTextNode("\xA0")):!E&&!H&&O.appendChild(document.createTextNode("\xA0"))}),n){let f=g.join(" ");m.setAttribute("data-split-content",f),r.appendChild(m)}}),s&&d.set("--char-global-total",String(a)),(B(e,"word")||B(e,"charWord")||B(e,"wordLine"))&&d.set("--word-global-total",String(c)),n&&d.set("--line-global-total",String(l)),{fragment:r,extraProps:d}}function Ue(u,e,t){if(e)for(let r of e){if(!Zr(r.type,r.align,t))continue;let i=Jr(r.type,r.align);u.style.setProperty(i,String(r.value))}}function Zr(u,e,t){let r=t[u]??[];return Array.isArray(r)&&r.some(i=>e.startsWith("random")?i.align.startsWith("random"):i.align===e)}function Jr(u,e){let t=e.startsWith("random")?"random":e;return`--${u}-${t}`}function B(u,e){return Array.isArray(u[e])&&u[e].length>0}var ti=new Set(["img","video","audio","canvas","iframe","object","svg","input","textarea","select","button","area","base","col","embed","hr","link","meta","param","source","track","wbr","picture","table"]);function ei(u){let e=[];for(let t=0;t<u.attributes.length;t++){let r=u.attributes[t];e.push([r.name,r.value])}return e}var pt=0;function mr(u){pt=0;let e=[],t=(i,n)=>{n&&Object.keys(n).length&&(i.meta={...i.meta||{},...n}),e.push(i)},r=(i,n)=>{if(i.nodeType===Node.ELEMENT_NODE){let s=i,o=s.tagName.toLowerCase();if(o==="split-class"){let a=(s.getAttribute("class")??"").split(/\s+/).filter(Boolean),l={...n||{},splitClass:[...n?.splitClass??[],...a]};s.childNodes.forEach(c=>r(c,l));return}if(o==="br"){t({type:"br",id:`br_${pt++}`,node:s,tagName:"br"},n);return}if(!ti.has(o)&&s.childNodes.length>0){let a={id:`wrapper_${pt++}`,tag:o,attributes:ei(s)},l=n?.wrappers??[],c={...n||{},wrappers:[...l,a]};s.childNodes.forEach(d=>r(d,c));return}t({type:"element",id:`el_${pt++}`,node:s,tagName:o},n);return}if(i.nodeType===Node.TEXT_NODE){let s=i.nodeValue??"",o=`text_${pt++}`;s.trim()?t({type:"text",id:o,node:i,content:s},n):t({type:"space",id:o,node:i,content:s},n);return}t({type:"other",id:`node_${pt++}`,node:i},n)};return u.forEach(i=>r(i)),e}var he=class{constructor(e){this.font="";this.cache={kerning:new Map,charWidth:new Map};let t=document.createElement("canvas");this.ctx=t.getContext("2d"),this.setFontFromElement(e)}setFontFromElement(e){let t=window.getComputedStyle(e),r=`${t.fontStyle} ${t.fontVariant} ${t.fontWeight} ${t.fontSize}/${t.lineHeight} ${t.fontFamily}`;r!==this.font&&(this.font=r,this.ctx.font=this.font,this.cache.kerning.clear(),this.cache.charWidth.clear())}getCharWidth(e){if(this.cache.charWidth.has(e))return this.cache.charWidth.get(e);let t=this.ctx.measureText(e).width;return this.cache.charWidth.set(e,t),t}getKerning(e,t){let r=`${e}${t}`,i=`${this.font}|${r}`;if(this.cache.kerning.has(i))return this.cache.kerning.get(i);let n=this.ctx.measureText(r).width,s=this.getCharWidth(e)+this.getCharWidth(t),o=n-s;return this.cache.kerning.set(i,o),o}measureWord(e){let t=0;for(let r=0;r<e.length;r++){let i=e[r];if(t+=this.getCharWidth(i),r>0){let n=e[r-1];t+=this.getKerning(n,i)}}return t}};function ri(u,e){return!u?.length&&!e?.length?!0:!u||!e||u.length!==e.length?!1:u.every((t,r)=>t.id===e[r].id)}function ii(u){let e=[],t=[];for(let r of u)r.type==="br"?(t.length&&e.push(t),e.push([r]),t=[]):t.push(r);return t.length&&e.push(t),e}function gr(u,e,t){let r=document.createElement("div"),i=window.getComputedStyle(e);r.style.position="absolute",r.style.visibility="hidden",r.style.pointerEvents="none",r.style.width=e.clientWidth+"px",r.style.padding=i.padding,r.style.font=i.font,r.style.letterSpacing=i.letterSpacing,r.style.lineHeight=i.lineHeight,r.style.fontVariant=i.fontVariant,r.style.fontStretch=i.fontStretch,r.style.wordBreak=i.wordBreak,r.style.wordWrap=i.wordWrap,r.style.whiteSpace=i.whiteSpace,r.style.textTransform=i.textTransform;let n=document.createElement("span");n.textContent="\xA0",r.appendChild(n);let s=n.getBoundingClientRect().width;r.removeChild(n),r.style.width=e.clientWidth+s+"px",r.style.boxSizing="border-box",e.appendChild(r);let o=[],a=ii(u),l=!1,c=!1,d=!1,p;for(let h of a){if(h.length===1&&h[0].type==="br"){o.push({token:h[0],rect:new DOMRect(0,0,0,0)});continue}if(h.length===0)continue;r.innerHTML="";let v=[],m=[];h.forEach(g=>{switch(g.type){case"text":{let b=g.content,y=/^\s/.test(b),f=/\s$/.test(b),S=g.meta?.wrappers??[],E=b.trim().split(/\s+/).filter(T=>T.length>0);E.forEach((T,k)=>{let I=document.createElement("span");if(I.style.display="inline-block",S.length>0){let O=I;for(let L of S){let H=document.createElement(L.tag);for(let[w,D]of L.attributes)H.setAttribute(w,D);O.appendChild(H),O=H}O.textContent=T}else I.textContent=T;r.appendChild(I),(k<E.length-1||f)&&r.appendChild(document.createTextNode(" "));let C=k===0&&!y&&!c&&d,A=k>0||ri(p,S);v.push(I),m.push({token:{type:"text",id:"",node:g.node,content:T,meta:{...g.meta||{},joinPrev:C&&A,noSpaceBefore:C&&!A}},wordIndex:v.length-1,hadLeadingSpace:y,hadTrailingSpace:f})}),c=f,d=!0,p=S;break}case"element":{let b=g.node.cloneNode(!0),y=document.createElement("span");y.style.display="inline-block",y.appendChild(b),r.appendChild(y),v.push(y),m.push({token:g,wordIndex:v.length-1}),l=!0,d=!1,c=!1;break}case"space":c=!0;break;case"other":d=!1,c=!1;break}}),r.offsetHeight,m.forEach((g,b)=>{if(g.wordIndex!==void 0){let f=v[g.wordIndex].getBoundingClientRect(),S;if(g.token.type==="text"){let T=t.measureWord(g.token.content);S=new DOMRect(f.x,f.y,T,f.height)}else S=f;let E={token:g.token,rect:S,browserWidth:f.width};if(l&&g.token.type==="text"&&(l=!1,E.token.meta={...E.token.meta||{},isAfterElement:!0}),o.push(E),g.token.type==="element"){let T=o[o.length-2];T?.token.type==="text"&&(T.token.meta={...T.token.meta||{},isBeforeElement:!0})}}})}return e.removeChild(r),o}var fr=5;function vr(u,e,t){let r=[],i=null,n=0,s=0,o=0,a=0;return u.forEach(l=>{let c=l.token,d=c.meta?.isBeforeElement??!1,p=c.meta?.isAfterElement??!1;if(c.type==="br"){i=null;return}if(c.type==="text"){let h=c.content,v=c.meta?.splitClass??[],m=!!c.meta?.joinPrev,g=[],b=0;for(let C=0;C<h.length;C++){let A=h[C],O=C>0?h[C-1]:null,L=t.getCharWidth(A),H=O?t.getKerning(O,A):0;b+=H;let w=new DOMRect(l.rect.left+b,l.rect.top,L,l.rect.height),D={char:A,rect:w,token:c,charIndexInWord:C,charIndexInLine:0,charIndexGlobal:s++};v.length&&(D.splitClass=v),g.push(D),b+=L}if(g.length>0){let C=g[g.length-1];d&&(C.isBeforeElement=!0),p&&(C.isAfterElement=!0)}let y=Math.round(l.rect.top),f=Math.round(n);if((!i||Math.abs(y-f)>fr)&&(n=y,i={words:[],rect:l.rect,lineIndex:r.length},a=0,r.push(i)),!i)return;let E=l.rect.left+(l.browserWidth??l.rect.width);if(m&&i.words.length>0){let C=i.words[i.words.length-1],A=i.words.reduce((L,H)=>L+H.chars.length,0),O=C.chars.length;g.forEach((L,H)=>{L.charIndexInLine=A+H,L.charIndexInWord=O+H}),C.chars.push(...g),C.rect=me([C.rect,l.rect]),i.rect=me(i.words.map(L=>L.rect)),a=Math.max(a,E),i.fitWidth=a-i.rect.left,i.browserWordWidthSum=(i.browserWordWidthSum??0)+(l.browserWidth??l.rect.width),d&&(C.isBeforeElement=!0),p&&(C.isAfterElement=!0);return}let T=i.words.length,k=i.words.reduce((C,A)=>C+A.chars.length,0);g.forEach((C,A)=>C.charIndexInLine=k+A);let I={chars:g,rect:l.rect,wordIndexGlobal:o++,wordIndexInLine:T,isBeforeElement:d,isAfterElement:p,noSpaceBefore:!!c.meta?.noSpaceBefore};i.words.push(I),i.rect=me(i.words.map(C=>C.rect)),a=Math.max(a,E),i.fitWidth=a-i.rect.left,i.browserWordWidthSum=(i.browserWordWidthSum??0)+(l.browserWidth??l.rect.width),d&&(i.isBeforeElement=!0),p&&(i.isAfterElement=!0);return}if(c.type==="element"){let h=l.rect,v=Math.round(h.top),m=Math.round(n);if((!i||Math.abs(v-m)>fr)&&(n=v,i={words:[],rect:h,lineIndex:r.length},a=0,r.push(i)),!i)return;let b=i.words.length,y=i.words.reduce((E,T)=>E+T.chars.length,0),S={chars:[{char:"[E]",rect:h,token:c,charIndexInWord:0,charIndexInLine:y,charIndexGlobal:s++}],rect:h,wordIndexGlobal:o++,wordIndexInLine:b,isBeforeElement:!1,isAfterElement:!1};i.words.push(S),i.rect=me(i.words.map(E=>E.rect)),a=Math.max(a,l.rect.left+(l.browserWidth??l.rect.width)),i.fitWidth=a-i.rect.left,i.browserWordWidthSum=(i.browserWordWidthSum??0)+(l.browserWidth??l.rect.width)}}),r}function me(u){if(u.length===0)return new DOMRect(0,0,0,0);let e=Math.min(...u.map(n=>n.left)),t=Math.min(...u.map(n=>n.top)),r=Math.max(...u.map(n=>n.right)),i=Math.max(...u.map(n=>n.bottom));return new DOMRect(e,t,r-e,i-t)}var ge=class extends M{constructor(e){super(e),this.htmlKey="split",this.permissions.mobile.rebuild.height=!1,this.permissions.mobile.rebuild.width=!1}onInit(){let e=()=>{this.objectsOnPage.forEach(t=>{this.onObjectConnected(t)})};document.fonts.ready.then(e),document.fonts.addEventListener("loadingdone",e)}onResizeWidth(){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 n=t.getAttribute("string-split")??t.getAttribute("data-string-split")??"",s=this.tools.optionsParser.process({attributeValue:n}),{fragment:o,result:a,extraProps:l}=this.split(t,s);e.setProperty("nodes",o.childNodes),t.setAttribute("aria-label",i),t.innerHTML="",t.appendChild(a),l.forEach((d,p)=>{t.style.setProperty(p,d)});let c=t.getAttribute("string-split-restore-after");c&&!isNaN(Number(c))&&setTimeout(()=>{t.innerHTML=i,t.classList.add("-restored")},Number(c))}split(e,t){let r=new he(e),i=document.createDocumentFragment();e.childNodes.forEach(d=>i.appendChild(d.cloneNode(!0)));let n=mr(i.childNodes),s=gr(n,e,r),o=vr(s,e,r),a=t.fit?this.getFitContext(o,e):null,l=a?this.applyFit(o,t,a):new Map;this.applyCalculatedValues(o,t);let c=hr(o,t,r);return l.forEach((d,p)=>c.extraProps.set(p,d)),a&&this.refineFitFontSize(e,c.fragment,c.extraProps,o,t,a),{fragment:i,result:c.fragment,extraProps:c.extraProps}}getFitContext(e,t){let r=window.getComputedStyle(t),i=parseFloat(r.fontSize);if(!i)return null;let n=t.clientWidth-(parseFloat(r.paddingLeft)||0)-(parseFloat(r.paddingRight)||0);if(n<=0)return null;let s=0;for(let l of e){let c=l.fitWidth??l.rect.width;c>s&&(s=c)}if(s<=0)return null;let o=n;if(Math.abs(n-s)<2&&t.parentElement){let l=window.getComputedStyle(t.parentElement),c=t.parentElement.clientWidth-(parseFloat(l.paddingLeft)||0)-(parseFloat(l.paddingRight)||0);c>n&&(o=c)}let a=parseFloat(r.lineHeight)||0;return{currentFontSize:i,contentWidth:o,lineHeightPx:a}}applyFit(e,t,r){let i=new Map,{currentFontSize:n,contentWidth:s}=r,o=(t.line?.length??0)>0||(t.wordLine?.length??0)>0||(t.charLine?.length??0)>0,a=(t.char?.length??0)>0||(t.charLine?.length??0)>0||(t.charWord?.length??0)>0;if(o)for(let l of e){let c=l.fitWidth??l.rect.width;c>0&&(l.fitFontSize=this.computeFitFontSize(n,s,c,a?l.browserWordWidthSum:void 0))}else{let l=e.reduce((p,h)=>(h.fitWidth??h.rect.width)>(p.fitWidth??p.rect.width)?h:p,e[0]),c=l.fitWidth??l.rect.width,d=this.computeFitFontSize(n,s,c,a?l.browserWordWidthSum:void 0);i.set("--fit-font-size",String(Math.floor(d)))}return i}refineFitFontSize(e,t,r,i,n,s){let o=(n.line?.length??0)>0||(n.wordLine?.length??0)>0||(n.charLine?.length??0)>0,a=(n.char?.length??0)>0||(n.charLine?.length??0)>0||(n.charWord?.length??0)>0,l=e.innerHTML;try{if(e.innerHTML="",e.appendChild(t.cloneNode(!0)),o){let c=Array.from(e.querySelectorAll(".-s-line")),d=Array.from(t.querySelectorAll(".-s-line"));c.forEach((p,h)=>{let v=d[h];if(!v)return;let m=parseFloat(v.style.getPropertyValue("--fit-font-size"));if(!m)return;let g=this.solveRenderedFitFontSize(p,s.currentFontSize,m,s.contentWidth,a);g&&(i[h].fitFontSize=g,v.style.setProperty("--fit-font-size",String(Math.floor(g))))})}else{let c=parseFloat(r.get("--fit-font-size")??"");if(!c)return;let d=this.solveRenderedFitFontSize(e,s.currentFontSize,c,s.contentWidth,a);if(!d)return;let p=Math.floor(d);r.set("--fit-font-size",String(p));let{lineHeightPx:h,currentFontSize:v,contentWidth:m}=s;if(h>0&&v>0){let g=h*(p/v);g>0&&(r.set("--fit-scale-y",String(window.innerHeight/g)),r.set("--fit-aspect-ratio",String(m/g)))}}}finally{e.innerHTML=l}}solveRenderedFitFontSize(e,t,r,i,n){if(!Number.isFinite(t)||!Number.isFinite(r)||t<=0||r<=0)return null;let s=this.measureScopeAtFontSize(e,n,t);if(s<=0)return null;if(Math.abs(i-s)<.01)return t;let o=Math.abs(r-t)<.01?s:this.measureScopeAtFontSize(e,n,r);if(o<=0)return t*(i/s);let a=(o-s)/(r-t);if(!Number.isFinite(a)||Math.abs(a)<1e-4)return t*(i/s);let l=t+(i-s)/a;return!Number.isFinite(l)||l<=0?null:l}measureScopeAtFontSize(e,t,r){if(t){let s=Array.from(e.querySelectorAll(".-s-char")),o=s.map(l=>l.style.fontSize);s.forEach(l=>{l.style.fontSize=`${r}px`}),e.offsetWidth;let a=this.measureCharScopeWidth(e);return s.forEach((l,c)=>{l.style.fontSize=o[c]}),a}let i=e.style.fontSize;e.style.fontSize=`${r}px`,e.offsetWidth;let n=this.measureContentWidth(e);return e.style.fontSize=i,n}measureCharScopeWidth(e){let t=0;Array.from(e.querySelectorAll(".-s-char")).forEach(o=>{let a=o.getBoundingClientRect(),l=window.getComputedStyle(o);t+=a.width+(parseFloat(l.marginLeft)||0)+(parseFloat(l.marginRight)||0)});let i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=i.nextNode();for(;n;){let o=n.parentElement,a=!!o?.closest(".-s-char"),l=!!o&&!o.classList.contains("-s-char")&&!o.classList.contains("-s-word")&&!o.classList.contains("-s-line")&&!o.querySelector(".-s-char, .-s-word, .-s-line");if(!a&&!l&&n.textContent?.length){let c=document.createRange();c.selectNodeContents(n),t+=c.getBoundingClientRect().width}n=i.nextNode()}return Array.from(e.querySelectorAll("*")).filter(o=>{let a=o;return!a.classList.contains("-s-char")&&!a.classList.contains("-s-word")&&!a.classList.contains("-s-line")&&!a.querySelector(".-s-char, .-s-word, .-s-line")}).forEach(o=>{t+=o.getBoundingClientRect().width}),t}measureContentWidth(e){if(!e.childNodes.length)return e.getBoundingClientRect().width;let t=document.createRange();return t.selectNodeContents(e),t.getBoundingClientRect().width}computeFitFontSize(e,t,r,i){let n=i!==void 0?r-i:0,s=r-n;return s<=0?e*(t/r):e*(t-n)/s}computeValue(e,t,r){if(e.align.startsWith("random")){let i=e.random?.min??0,n=e.random?.max??r-1;return Math.floor(Math.random()*(n-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((o,a)=>o+a.chars.length,0),i=e.reduce((s,o)=>s+o.words.length,0),n=e.reduce((s,o)=>s+o.words.reduce((a,l)=>a+l.chars.length,0),0);e.forEach((s,o)=>{t.line&&(s.calculatedValues=t.line.map(a=>({type:"line",align:a.align,value:this.computeValue(a,o,e.length)}))),s.words.forEach(a=>{t.word&&(a.calculatedValues=t.word.map(c=>({type:"word",align:c.align,value:this.computeValue(c,a.wordIndexGlobal,i)}))),t.wordLine&&(a.calculatedValues??(a.calculatedValues=[]),a.calculatedValues.push(...t.wordLine.map(c=>({type:"wordLine",align:c.align,value:this.computeValue(c,a.wordIndexInLine,s.words.length)}))));let l=r(s);a.chars.forEach(c=>{let d=[];t.char&&d.push(...t.char.map(p=>({type:"char",align:p.align,value:this.computeValue(p,c.charIndexGlobal,n)}))),t.charWord&&d.push(...t.charWord.map(p=>({type:"charWord",align:p.align,value:this.computeValue(p,c.charIndexInWord,a.chars.length)}))),t.charLine&&d.push(...t.charLine.map(p=>({type:"charLine",align:p.align,value:this.computeValue(p,c.charIndexInLine,l)}))),c.calculatedValues=d})})})}escapeAttribute(e){return e.replace(/src="(https?:\/\/[^"\s]+)"/g,"src=$1")}};var fe=class extends M{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((n,s)=>{let o=s,a=i-n*this.height;s===0?t.moveTo(o,a):t.lineTo(o,a)}),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 K="data-fps",ve=class extends M{constructor(t){super(t);this.displayElement=null;this.intervalId=0;this.frameCount=0;this.fpsElements=new Set;this.observer=null;this.lastFps=-1;this._type=2}onInit(){this.data.system.fpsTracker&&this.createDisplayElement(),this.events.on("tracker:fps:visible",this.onVisibilityChange.bind(this)),this.scanElements(),this.observeDOM(),this.intervalId=window.setInterval(()=>{this.updateFPS(this.frameCount),this.frameCount=0},1e3)}onFrame(t){this.frameCount++}destroy(){clearInterval(this.intervalId),this.observer?.disconnect(),this.removeDisplayElement(),this.fpsElements.clear()}onVisibilityChange(t){t?this.createDisplayElement():this.removeDisplayElement()}removeDisplayElement(){this.displayElement?.remove(),this.displayElement=null}updateFPS(t){if(t===this.lastFps)return;this.lastFps=t;let r=String(t);for(let i of this.fpsElements)i.isConnected&&i.setAttribute(K,r);this.displayElement&&this.displayElement.setAttribute(K,r),this.events.emit("fps",t)}scanElements(){this.fpsElements.clear(),document.querySelectorAll(`[${K}]`).forEach(t=>{t!==this.displayElement&&this.fpsElements.add(t)})}observeDOM(){this.observer=new MutationObserver(t=>{let r=!1;for(let i of t){for(let n of Array.from(i.addedNodes))if(n.nodeType===Node.ELEMENT_NODE){let s=n;s.hasAttribute(K)&&(r=!0),s.querySelector(`[${K}]`)&&(r=!0)}for(let n of Array.from(i.removedNodes))n.nodeType===Node.ELEMENT_NODE&&this.fpsElements.delete(n)}r&&this.scanElements()}),this.observer.observe(document.body,{childList:!0,subtree:!0})}createDisplayElement(){if(this.displayElement)return;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.setAttribute(K,"0"),document.body.appendChild(t);let r="string-fps-tracker-style";if(!document.getElementById(r)){let i=document.createElement("style");i.id=r,i.innerHTML=`
|
|
20
20
|
[${K}]::before {
|
|
21
21
|
content: 'FPS: ' attr(${K});
|
|
22
22
|
}
|
|
23
|
-
`,document.head.appendChild(i)}this.displayElement=
|
|
23
|
+
`,document.head.appendChild(i)}this.displayElement=t}};var be=class extends M{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((n,s)=>{let o=s,a=i-n/2;s===0?t.moveTo(o,a):t.lineTo(o,a)}),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 Q="data-val",Z="data-val-pct",J="data-dir",ye=class extends M{constructor(t){super(t);this.displayElement=null;this.valElements=new Set;this.valPctElements=new Set;this.dirElements=new Set;this.observer=null;this.lastVal=-1;this.lastValPct=-1;this.lastDir="";this.previousCurrent=0;this.idleTimeout=null;this._type=2}onInit(){this.data.system.positionTracker&&this.createDisplayElement(),this.events.on("tracker:position:visible",this.onVisibilityChange.bind(this)),this.scanElements(),this.observeDOM()}onScroll(t){let r=t.scroll.current,i=t.scroll.target,n=t.viewport.contentHeight,s=t.viewport.windowHeight,o=Math.round(r),a=Math.max(1,n-s),l=Math.round(r/a*100),c;if(r!==i?c=r<i?"\u2193":"\u2191":r!==this.previousCurrent?c=r>this.previousCurrent?"\u2193":"\u2191":c=this.lastDir||"\u2022",this.previousCurrent=r,this.idleTimeout&&clearTimeout(this.idleTimeout),c!=="\u2022"&&(this.idleTimeout=setTimeout(()=>{this.setDirection("\u2022")},150)),o!==this.lastVal){this.lastVal=o;let d=String(o);for(let p of this.valElements)p.isConnected&&p.setAttribute(Q,d);this.displayElement&&this.displayElement.setAttribute(Q,d)}if(l!==this.lastValPct){this.lastValPct=l;let d=String(l);for(let p of this.valPctElements)p.isConnected&&p.setAttribute(Z,d);this.displayElement&&this.displayElement.setAttribute(Z,d)}this.setDirection(c),this.events.emit("scroll-position",{val:o,valPct:l,direction:c})}setDirection(t){if(t!==this.lastDir){this.lastDir=t;for(let r of this.dirElements)r.isConnected&&r.setAttribute(J,t);this.displayElement&&this.displayElement.setAttribute(J,t)}}destroy(){this.idleTimeout&&clearTimeout(this.idleTimeout),this.observer?.disconnect(),this.removeDisplayElement(),this.valElements.clear(),this.valPctElements.clear(),this.dirElements.clear()}onVisibilityChange(t){t?this.createDisplayElement():this.removeDisplayElement()}removeDisplayElement(){this.displayElement?.remove(),this.displayElement=null}scanElements(){this.valElements.clear(),this.valPctElements.clear(),this.dirElements.clear(),document.querySelectorAll(`[${Q}]`).forEach(t=>{t!==this.displayElement&&this.valElements.add(t)}),document.querySelectorAll(`[${Z}]`).forEach(t=>{t!==this.displayElement&&this.valPctElements.add(t)}),document.querySelectorAll(`[${J}]`).forEach(t=>{t!==this.displayElement&&this.dirElements.add(t)})}observeDOM(){this.observer=new MutationObserver(t=>{let r=!1;for(let i of t){for(let n of Array.from(i.addedNodes))if(n.nodeType===Node.ELEMENT_NODE){let s=n;this.hasTrackingAttr(s)&&(r=!0),s.querySelector(`[${Q}],[${Z}],[${J}]`)&&(r=!0)}for(let n of Array.from(i.removedNodes))if(n.nodeType===Node.ELEMENT_NODE){let s=n;this.valElements.delete(s),this.valPctElements.delete(s),this.dirElements.delete(s)}}r&&this.scanElements()}),this.observer.observe(document.body,{childList:!0,subtree:!0})}hasTrackingAttr(t){return t.hasAttribute(Q)||t.hasAttribute(Z)||t.hasAttribute(J)}createDisplayElement(){if(this.displayElement)return;let t=document.createElement("div");Object.assign(t.style,{position:"fixed",bottom:"10px",left:"10px",backgroundColor:"#000",color:"#fff",border:"1px solid rgba(255,255,255,0.2)",padding:"5px 8px",fontSize:"12px",fontFamily:"monospace",zIndex:"1000",pointerEvents:"none"}),t.setAttribute(J,"\u2022"),t.setAttribute(Q,"0"),t.setAttribute(Z,"0"),document.body.appendChild(t);let r="string-position-tracker-style";if(!document.getElementById(r)){let i=document.createElement("style");i.id=r,i.innerHTML=`
|
|
24
24
|
[${J}][${Q}][${Z}]::before {
|
|
25
25
|
content: attr(${J}) ' | ' attr(${Q}) 'px (' attr(${Z}) '%)';
|
|
26
26
|
}
|
|
27
|
-
`,document.head.appendChild(i)}this.displayElement=e}};function ar(u,r){let e=null;return function(...t){let i=this;e&&clearTimeout(e),e=setTimeout(()=>{u.apply(i,t),e=null},r)}}var yt=class{constructor(){this.fps=0;this.isAnimationStarted=!1;this.fpsInterval=0;this.then=0;this.requestAnimationId=0;this.onFrameCallback=r=>{};this.animate=()=>{};this.onVisibilityChangeBind=this.onVisibilityChange.bind(this)}onVisibilityChange(){document.hidden?(this.stop(),this.isAnimationStarted=!1):this.start(this.fps)}start(r){this.fps=r,!this.isAnimationStarted&&(this.fpsInterval=1e3/r,this.then=performance.now(),this.isAnimationStarted=!0,r===0?this.animate=()=>{let e=performance.now();this.requestAnimationId=requestAnimationFrame(this.animate),this.onFrameCallback(e)}:this.animate=()=>{let e=performance.now(),t=e-this.then;t>this.fpsInterval&&(this.then=e-t%this.fpsInterval,this.onFrameCallback(e)),this.requestAnimationId=requestAnimationFrame(this.animate)},this.animate())}stop(){this.isAnimationStarted&&(cancelAnimationFrame(this.requestAnimationId),this.requestAnimationId=0,this.isAnimationStarted=!1)}setOnFrame(r){this.onFrameCallback=r}destructor(){this.stop()}};var St=class extends x{constructor(r){super(r),this.htmlKey="autoplay",this.attributesToMap=[...this.attributesToMap,{key:"src",type:"string",fallback:""}]}onObjectConnected(r){r.setProperty("onEnterEvent",this.onEnterObject.bind(this)),r.events.on("enter",r.getProperty("onEnterEvent")),r.setProperty("onLeaveEvent",this.onLeaveObject.bind(this)),r.events.on("leave",r.getProperty("onLeaveEvent"));let e=r.htmlElement,t=this.tools.domAttribute.process({element:e,key:"string-started",fallback:null})!==null;e.tagName.toLowerCase()==="video"&&!t&&(e.setAttribute("string-started",""),e.muted=!0,e.setAttribute("muted","muted"),e.setAttribute("playsinline",""),e.setAttribute("loop",""),e.setAttribute("autoplay",""),e.src=r.getProperty("src"),e.load(),e.addEventListener("canplay",()=>{}))}onEnterObject(r){let e=r.htmlElement;this.tryPlay(e)}onLeaveObject(r){r.htmlElement.pause()}tryPlay(r){r.play().catch(e=>console.warn("[StringVideoAutoplay] Autoplay failed:",e))}};var Nt=(i=>(i.ACTIVE="-active",i.ENTERING="-entering",i.LEAVING="-leaving",i.DISABLED="-disabled",i))(Nt||{}),lr={PROGRESS:"--sequence-progress",DIRECTION:"--sequence-direction"};var Et=class Et extends x{constructor(e){super(e);this.activeStep=new Map;this.leavingStep=new Map;this.transitions=new Map;this.elementIndex=new Map;this.triggerElements=new Map;this.globalSettings=new Map;this.stateRegistered=new Set;this.lastEnteredStep=new Map;this.initialized=!1;this.onTriggerClick=e=>{let t=this.triggerElements.get(e.currentTarget);if(!t)return;let i=this.activeStep.get(t.slider)??0,n=this.getMaxStep(t.slider),s,o;if(t.step==="next"){if(s=i+1,o=1,!this.elementIndex.has(`${t.slider}[${s}]`))if(t.loop&&n>=0)s=0;else return}else if(t.step==="prev"){if(s=i-1,o=-1,s<0)if(t.loop&&n>=0)s=n;else return;if(!this.elementIndex.has(`${t.slider}[${s}]`))return}else{if(s=t.step,i===s)return;o=s>i?1:-1}this.startTransition(t.slider,s,o)};this.htmlKey="sequence",this.defaultDuration=this.settings["sequence-duration"]??600,this.attributesToMap=[...this.attributesToMap,{key:"sequence",type:"string",fallback:""},{key:"sequence-trigger",type:"string",fallback:""},{key:"entering-easing",type:"string",fallback:""},{key:"leaving-easing",type:"string",fallback:""},{key:"entering-duration",type:"string",fallback:""},{key:"leaving-duration",type:"string",fallback:""},{key:"sequence-duration",type:"string",fallback:""},{key:"active-step",type:"string",fallback:""}]}onInit(){super.onInit(),this.events.on("sequence",this.onSequenceEvent.bind(this)),this.scanStandaloneTriggers()}scanStandaloneTriggers(){let e=document.querySelectorAll("[string-sequence-trigger]:not([string-inited])");for(let t of Array.from(e)){let i=t.getAttribute("string-sequence-trigger"),n=i?this.parseTriggerKey(i):null;n&&(this.triggerElements.set(t,n),t.addEventListener("click",this.onTriggerClick))}}parseGlobalSettingsFromObject(e){let t=n=>e.getProperty(n),i=t("sequence-duration");this.tryParseGlobalSetting(i,"enteringDuration"),this.tryParseGlobalSetting(i,"leavingDuration"),this.tryParseGlobalSetting(t("entering-duration"),"enteringDuration"),this.tryParseGlobalSetting(t("leaving-duration"),"leavingDuration"),this.tryParseGlobalSetting(t("entering-easing"),"enteringEasing"),this.tryParseGlobalSetting(t("leaving-easing"),"leavingEasing"),this.tryParseGlobalSetting(t("active-step"),"activeStep")}tryParseGlobalSetting(e,t){if(!e)return;let i=e.match(/^(.+)\[(.+)\]$/);if(!i)return;let[,n,s]=i,o=this.globalSettings.get(n)??{};this.globalSettings.set(n,o),o[t]=t==="enteringEasing"||t==="leavingEasing"?s:parseFloat(s),this.applyGlobalSettingsToExistingObjects(n)}applyGlobalSettingsToExistingObjects(e){let t=this.globalSettings.get(e);if(t){for(let[i,n]of this.elementIndex)if(this.parseSequenceKey(i)?.slider===e){t.enteringDuration!==void 0&&(n.enteringDuration=t.enteringDuration),t.leavingDuration!==void 0&&(n.leavingDuration=t.leavingDuration);for(let o of n.objects)this.resolveEasings(o,i)}}}initializeSliders(){let e=new Set;for(let t of this.elementIndex.keys()){let i=this.parseSequenceKey(t);i&&e.add(i.slider)}for(let t of e){if(this.activeStep.has(t))continue;let n=this.globalSettings.get(t)?.activeStep??0;this.elementIndex.has(`${t}[${n}]`)||(n=0),this.switchInstant(t,n,1)}}tryApplyPendingActiveStep(e){if(this.activeStep.has(e))return;let t=this.globalSettings.get(e)?.activeStep;t!==void 0&&this.elementIndex.has(`${e}[${t}]`)&&this.switchInstant(e,t,1)}canConnect(e){return e.keys.includes("sequence")||e.keys.includes("sequence-trigger")}onObjectConnected(e){super.onObjectConnected(e),this.parseGlobalSettingsFromObject(e);let t=e.getProperty("sequence"),i=e.getProperty("sequence-trigger");if(!t&&i){let n=this.parseTriggerKey(i);n&&typeof n.step=="number"&&(t=`${n.slider}[${n.step}]`,e.setProperty("sequence",t))}if(t){let n=this.parseSequenceKey(t);if(n){this.ensureStateEventRegistered(n.slider);let s=this.elementIndex.get(t);if(!s){let{enteringDuration:a,leavingDuration:l}=this.resolveDurations(e,t);s={objects:[],enteringDuration:a,leavingDuration:l},this.elementIndex.set(t,s)}s.objects.push(e),this.resolveEasings(e,t);let o=this.activeStep.get(n.slider);this.setState(e,o===n.step?"-active":"-disabled",o===n.step?1:0,1),this.tryApplyPendingActiveStep(n.slider)}}if(i){let n=this.parseTriggerKey(i);n&&(this.triggerElements.set(e.htmlElement,n),e.htmlElement.addEventListener("click",this.onTriggerClick))}}ensureStateEventRegistered(e){this.stateRegistered.has(e)||(this.stateRegistered.add(e),this.events.registerStateEvent?.(`sequence:active:${e}`))}parseTriggerKey(e){let t=e.match(/^(.+)\[(next|prev|\d+)(\|loop)?\]$/);if(!t)return null;let i=t[2]==="next"||t[2]==="prev"?t[2]:parseInt(t[2],10);return{slider:t[1],step:i,loop:t[3]==="|loop"}}getMaxStep(e){let t=-1;for(let i of this.elementIndex.keys()){let n=this.parseSequenceKey(i);n?.slider===e&&n.step>t&&(t=n.step)}return t}resolveDuration(e,t,i,n){let s=e.getProperty(n),o=e.getProperty("sequence-duration"),a=this.globalSettings.get(t)?.[i];if(s&&!s.includes("[")){let l=parseFloat(s);if(!isNaN(l))return l}if(o&&!o.includes("[")){let l=parseFloat(o);if(!isNaN(l))return l}return a??this.defaultDuration}resolveDurations(e,t){let i=this.parseSequenceKey(t)?.slider??"";return{enteringDuration:this.resolveDuration(e,i,"enteringDuration","entering-duration"),leavingDuration:this.resolveDuration(e,i,"leavingDuration","leaving-duration")}}resolveEasing(e,t,i,n){let s=e.getProperty(n);(!s||typeof s=="string"&&s.includes("["))&&(s=this.globalSettings.get(t)?.[i]??this.settings.easing??"ease-out"),typeof s=="string"&&e.setProperty(n,this.tools.easingFunction.process({easing:s}))}resolveEasings(e,t){let i=this.parseSequenceKey(t)?.slider;i&&(this.resolveEasing(e,i,"enteringEasing","entering-easing"),this.resolveEasing(e,i,"leavingEasing","leaving-easing"))}onObjectDisconnected(e){super.onObjectDisconnected(e);let t=e.getProperty("sequence");if(t){let i=this.elementIndex.get(t);if(i){let n=i.objects.indexOf(e);n!==-1&&i.objects.splice(n,1),i.objects.length||this.elementIndex.delete(t)}}this.triggerElements.has(e.htmlElement)&&(e.htmlElement.removeEventListener("click",this.onTriggerClick),this.triggerElements.delete(e.htmlElement))}parseSequenceKey(e){let t=e.match(/^(.+)\[(\d+)\]$/);return t?{slider:t[1],step:parseInt(t[2],10)}:null}onSequenceEvent(e){let{slider:t,step:i,transitionProgress:n,direction:s=1,duration:o,instant:a}=e;this.activeStep.get(t)===i&&n===void 0||(n!==void 0?this.handleScrub(t,i,n,s):a?this.switchInstant(t,i,s):this.startTransition(t,i,s,o))}startTransition(e,t,i,n){let s=this.activeStep.get(e),o=this.leavingStep.get(e);this.ensureStateEventRegistered(e),o!==void 0&&o!==s&&this.setStepState(e,o,"-disabled",0,i);let a=this.elementIndex.get(`${e}[${t}]`),l=s!==void 0?this.elementIndex.get(`${e}[${s}]`):null;s!==void 0&&this.leavingStep.set(e,s),this.activeStep.set(e,t),this.emitActiveState(e,t);let c={fromStep:s??t,toStep:t,direction:i,startTime:this.data.time.now,enteringDuration:n??a?.enteringDuration??this.defaultDuration,leavingDuration:n??l?.leavingDuration??this.defaultDuration};this.transitions.set(e,c),this.emitTransitionStart(e,c)}handleScrub(e,t,i,n){this.transitions.delete(e);let s=this.activeStep.get(e);if(s!==t){let a=this.leavingStep.get(e);a!==void 0&&this.setStepState(e,a,"-disabled",0,n),s!==void 0&&this.leavingStep.set(e,s),this.activeStep.set(e,t),this.emitActiveState(e,t)}let o=this.leavingStep.get(e)??s??t;this.applyProgress(e,o,t,i,i,n)}switchInstant(e,t,i){this.transitions.delete(e);let n=this.activeStep.get(e),s=this.leavingStep.get(e);s!==void 0&&this.setStepState(e,s,"-disabled",0,i),n!==void 0&&n!==t&&this.setStepState(e,n,"-disabled",0,i),this.activeStep.set(e,t),this.leavingStep.delete(e),this.setStepState(e,t,"-active",1,i),this.emitActiveState(e,t),s!==void 0&&s!==t?this.emitStepLeave(e,s,i,!0):n!==void 0&&n!==t&&this.emitStepLeave(e,n,i,!0),this.emitStepEnter(e,t,i,!0);let o={fromStep:n??t,toStep:t,direction:i,startTime:this.data.time.now,enteringDuration:0,leavingDuration:0};this.emitTransitionStart(e,o),this.emitTransitionEnd(e,t,n??t,i,!0)}applyProgress(e,t,i,n,s,o){let a=this.activeStep.get(e),l=this.leavingStep.get(e);this.setStepState(e,a,n>=1?"-active":"-entering",n,o),l!==void 0&&l!==a&&(s>=1?(this.setStepState(e,l,"-disabled",0,o),this.leavingStep.delete(e),this.emitStepLeave(e,l,o,!1)):this.setStepState(e,l,"-leaving",s,o)),this.emitTransitionProgress(e,t,i,n,s,o),n>=1&&this.emitStepEnter(e,a,o,!1)}setStepState(e,t,i,n,s){let o=this.elementIndex.get(`${e}[${t}]`);if(o)for(let a of o.objects)this.setState(a,i,n,s)}setState(e,t,i,n){let s=e.htmlElement,o=e.getProperty("_state"),a=e.getProperty("_direction"),l=e.getProperty(t==="-leaving"?"leaving-easing":"entering-easing"),c=typeof l=="function"?l(i):i;o!==t&&(s.classList.remove(...Et.ALL_STATES),s.classList.add(t),e.setProperty("_state",t)),a!==n&&(e.setProperty("_direction",n),M.run(()=>M.setVars(s,{[lr.DIRECTION]:n.toString()})))}onFrame(e){super.onFrame(e),this.initialized||(this.initialized=!0,this.initializeSliders());for(let[t,i]of this.transitions){let n=e.time.now-i.startTime,s=Math.min(1,n/i.enteringDuration),o=Math.min(1,n/i.leavingDuration);this.applyProgress(t,i.fromStep,i.toStep,s,o,i.direction),s>=1&&o>=1&&(this.emitTransitionEnd(t,i.toStep,i.fromStep,i.direction,!1),this.transitions.delete(t))}}emitTransitionStart(e,t){let i={slider:e,from:t.fromStep,to:t.toStep,direction:t.direction,enteringDuration:t.enteringDuration,leavingDuration:t.leavingDuration,startedAt:t.startTime};this.events.emit("sequence:transition:start",i),this.events.emit(`sequence:transition:start:${e}`,i)}emitTransitionProgress(e,t,i,n,s,o){let a={slider:e,from:t,to:i,entering:n,leaving:s,direction:o};this.events.emit("sequence:transition:progress",a),this.events.emit(`sequence:transition:progress:${e}`,a)}emitTransitionEnd(e,t,i,n,s){let o={slider:e,from:i,to:t,direction:n,instant:s};this.events.emit("sequence:transition:end",o),this.events.emit(`sequence:transition:end:${e}`,o)}emitStepEnter(e,t,i,n){if(!n&&this.lastEnteredStep.get(e)===t)return;this.lastEnteredStep.set(e,t);let s={slider:e,step:t,direction:i,instant:n};this.events.emit("sequence:step:enter",s),this.events.emit(`sequence:step:enter:${e}`,s)}emitStepLeave(e,t,i,n){if(t==null)return;let s={slider:e,step:t,direction:i,instant:n};this.events.emit("sequence:step:leave",s),this.events.emit(`sequence:step:leave:${e}`,s)}emitActiveState(e,t){let i={slider:e,step:t};this.events.emit("sequence:active",i),this.events.emit(`sequence:active:${e}`,i)}};Et.ALL_STATES=Object.values(Nt);var Mt=Et;var ee=class ee extends x{constructor(r){super(r),this.htmlKey="form"}initializeObject(r,e,t,i){super.initializeObject(r,e,t,i);let n=e.getProperty("form-events")??[];n.forEach(c=>{c.eventElement.removeEventListener(c.eventType,c.eventCallback)}),n.length=0,e.setProperty("form-events",n),super.onObjectConnected(e);let s=e.htmlElement,o=[],a={};this.getInteractiveFields(s).forEach((c,d)=>this.registerField(c,s,o,a,n,d));let l=c=>{c.preventDefault();let d=!0,h={},p=new Set;for(let b of o){let m=b.field;if(!m.isConnected||!this.shouldValidateField(m))continue;if(this.isRadioField(m)){if(p.has(b.key))continue;p.add(b.key)}let{key:g,rules:v,needsContext:y}=b,f=this.getFieldValue(m);h[g]=f,a[g]=f;let{valid:S,errors:E}=this.tools.validation.process({rules:v,value:f,context:this.buildContext(y,g,a)});this.applyValidationState(s,m,g,S,E,"submit"),S||(d=!1)}if(d)this.events.emit(`form:submit:${e.id}`,h);else{let b=new Set,m=o.find(g=>{let v=g.field;if(!v.isConnected||!this.shouldValidateField(v))return!1;if(this.isRadioField(v)){if(b.has(g.key))return!1;b.add(g.key)}let{key:y,rules:f,needsContext:S}=g,E=this.getFieldValue(v);a[y]=E;let{valid:T}=this.tools.validation.process({rules:f,value:E,context:this.buildContext(S,y,a)});return!T});m?.field&&typeof m.field.focus=="function"&&m.field.focus(),this.events.emit(`form:invalid:${e.id}`)}};s.addEventListener("submit",l),n.push({eventElement:s,eventType:"submit",eventCallback:l}),e.setProperty("form-field-entries",o),e.setProperty("form-field-values",a)}onObjectConnected(r){}onDOMMutate(r,e){this.objects.length!==0&&(r.length>0&&this.handleMutationAdditions(r),e.length>0&&this.handleMutationRemovals(e))}applyValidationState(r,e,t,i,n,s){let o=r.querySelector(`[string-input="error[${t}]"]`),a=r.querySelector(`[string-input="group[${t}]"]`);o&&(o.innerHTML="",n.forEach(c=>{let d=document.createElement("span");d.textContent=c,o.appendChild(d)})),s==="live"?(e.classList.toggle("-invalid",!i),e.classList.remove("-error")):(e.classList.remove("-invalid"),e.classList.toggle("-error",!i)),e.classList.toggle("-valid",i),a&&(s==="live"?(a.classList.toggle("-invalid",!i),a.classList.remove("-error")):(a.classList.remove("-invalid"),a.classList.toggle("-error",!i)),a.classList.toggle("-valid",i));let l=i?"valid":s==="live"?"invalid":"error";this.events.emit(`form:field:${l}:${t}`,{key:t,field:e,errors:n,phase:s,valid:i})}getInteractiveFields(r){return Array.from(r.querySelectorAll("[string-input]")).filter(e=>!this.isServiceFieldAttribute(e.getAttribute("string-input")||"")).filter(e=>this.isFormFieldElement(e)).map(e=>e)}getFieldRules(r){let e=this.tools.domAttribute.process({element:r,key:"input"})??"";return this.tools.ruleParser.process({value:e})}registerField(r,e,t,i,n,s){if(!this.isFormFieldElement(r)||r.closest("form")!==e||t.some(m=>m.field===r))return;let o=this.registerFieldIndex(r,s??t.length),a=this.getInputKey(r,o),l=this.getFieldRules(r),c=this.supportsBeforeInputValidation(l),d=this.requiresContext(l),h=this.getInputEventType(r),p={field:r,key:a,rules:l,supportsRealtime:c,needsContext:d,inputEventType:h,inputHandler:()=>{}},b=m=>{let g=m.currentTarget||m.target;if(!g||!g.isConnected||!this.shouldValidateField(g))return;let v=this.getFieldValue(g);i[p.key]=v;let y=this.buildContext(p.needsContext,p.key,i),{valid:f,errors:S}=this.tools.validation.process({rules:p.rules,value:v,context:y});this.applyValidationState(e,g,p.key,f,S,"live")};if(p.inputHandler=b,r.addEventListener(h,b),n.push({eventElement:r,eventType:h,eventCallback:b}),c&&(r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement)){let m=g=>{let v=g;if(v.isComposing||v.inputType?.startsWith("insertComposition"))return;let y=g.currentTarget||g.target;if(!y||!(y instanceof HTMLInputElement||y instanceof HTMLTextAreaElement)||!y.isConnected)return;let f=y.selectionStart??0,S=y.selectionEnd??0,E=y.value;switch(v.inputType){case"deleteContentBackward":E=f===S&&f>0?y.value.slice(0,f-1)+y.value.slice(S):y.value.slice(0,f)+y.value.slice(S);break;case"deleteContentForward":E=f===S&&f<y.value.length?y.value.slice(0,f)+y.value.slice(f+1):y.value.slice(0,f)+y.value.slice(S);break;case"insertFromPaste":case"insertFromDrop":case"insertReplacementText":E=y.value.slice(0,f)+(v.data||"")+y.value.slice(S);break;default:typeof v.data=="string"&&(E=y.value.slice(0,f)+v.data+y.value.slice(S))}let{errors:T}=this.tools.validation.process({rules:p.rules,value:E,type:"beforeinput",context:this.buildContext(p.needsContext,p.key,i,{applied:!0,value:E})});T.length>0&&g.cancelable&&g.preventDefault()};p.beforeInputHandler=m,r.addEventListener("beforeinput",m),n.push({eventElement:r,eventType:"beforeinput",eventCallback:m})}r.classList.add("-inited"),t.push(p),i[a]=this.getFieldValue(r)}unregisterField(r,e,t,i){let n=e.findIndex(o=>o.field===r);if(n===-1)return;let s=e[n];s.inputHandler&&r.removeEventListener(s.inputEventType,s.inputHandler),s.beforeInputHandler&&r.removeEventListener("beforeinput",s.beforeInputHandler),delete t[s.key],e.splice(n,1);for(let o=i.length-1;o>=0;o--){let a=i[o];a.eventElement===r&&(a.eventCallback===s.inputHandler||s.beforeInputHandler&&a.eventCallback===s.beforeInputHandler)&&i.splice(o,1)}r.classList.remove("-inited")}collectInteractiveFieldsFromNode(r){let e=[];return r instanceof Element?(r.hasAttribute("string-input")&&e.push(r),e.push(...Array.from(r.querySelectorAll("[string-input]")))):r instanceof DocumentFragment&&e.push(...Array.from(r.querySelectorAll("[string-input]"))),e.filter(t=>!this.isServiceFieldAttribute(t.getAttribute("string-input")||"")).filter(t=>this.isFormFieldElement(t))}isRadioField(r){return r instanceof HTMLInputElement&&r.type==="radio"}handleMutationAdditions(r){r.forEach(e=>{this.collectInteractiveFieldsFromNode(e).forEach(i=>{let n=this.getFormStateByContainment(i);n&&this.registerField(i,n.form,n.entries,n.values,n.events)})})}handleMutationRemovals(r){r.forEach(e=>{this.collectInteractiveFieldsFromNode(e).forEach(i=>{let n=this.getFormStateByReference(i);n&&this.unregisterField(i,n.entries,n.values,n.events)})})}getFormStateByContainment(r){let e=this.objects.find(t=>t.htmlElement instanceof HTMLFormElement&&t.htmlElement.contains(r));return e?this.buildFormState(e):null}getFormStateByReference(r){for(let e of this.objects){let t=e.getProperty("form-field-entries");if(t&&t.some(i=>i.field===r))return this.buildFormState(e,t)}return null}buildFormState(r,e){let t=r.htmlElement;if(!(t instanceof HTMLFormElement))return null;let i=e??r.getProperty("form-field-entries"),n=r.getProperty("form-field-values"),s=r.getProperty("form-events");return!i||!n||!s?null:{object:r,form:t,entries:i,values:n,events:s}}registerFieldIndex(r,e){let t=r.getAttribute("data-string-form-index");return t!==null?Number(t):(r.setAttribute("data-string-form-index",String(e)),e)}getFieldIndex(r,e){let t=r.getAttribute("data-string-form-index");if(t!==null){let i=Number(t);return Number.isNaN(i)?e:i}return this.registerFieldIndex(r,e)}shouldValidateField(r){return!(r.disabled||r instanceof HTMLInputElement&&r.type==="hidden")}supportsBeforeInputValidation(r){return r.some(e=>ee.beforeInputRuleKeys.has(e.key))}requiresContext(r){return r.some(e=>ee.crossFieldRuleKeys.has(e.key))}buildContext(r,e,t,i){if(!r)return{fieldKey:e};let n=!!i?.applied,s=n?{...t,[e]:i.value}:t;return{fieldKey:e,values:s,getValue:o=>n&&o===e?i.value:s[o]}}getInputKey(r,e){return this.tools.domAttribute.process({element:r,key:"id"})||r.getAttribute("name")||r.getAttribute("id")||`input-${e}`}getFieldValue(r){if(r instanceof HTMLInputElement){if(r.type==="checkbox"){if(r.name){let e=r.form||r.closest("form"),t=e?Array.from(e.querySelectorAll(`input[type="checkbox"][name="${r.name}"]:checked`)):[r];return t.length>1?t.map(i=>i.value):t.length===1?t[0].value:""}return r.checked}if(r.type==="radio"){if(r.name){let t=(r.form||r.closest("form"))?.querySelector(`input[type="radio"][name="${r.name}"]:checked`);return t?t.value:""}return r.checked?r.value:""}return r.type==="file"&&r.files&&r.files.length>0?r.multiple?Array.from(r.files):r.files[0]:r.value}return r instanceof HTMLSelectElement?r.multiple?Array.from(r.selectedOptions).map(e=>e.value):r.value:r instanceof HTMLTextAreaElement?r.value:""}isServiceFieldAttribute(r){return ee.serviceAttributePrefixes.some(e=>r.startsWith(`${e}[`))}isFormFieldElement(r){return r instanceof HTMLInputElement||r instanceof HTMLSelectElement||r instanceof HTMLTextAreaElement}getInputEventType(r){return r instanceof HTMLSelectElement||r instanceof HTMLInputElement&&(r.type==="checkbox"||r.type==="radio")?"change":"input"}};ee.beforeInputRuleKeys=new Set(["number","integer","email","phone","letters","lettersSpaces","lettersNumbers","alpha","alpha_num","alpha_dash","digits","url","pattern"]),ee.crossFieldRuleKeys=new Set(["same","different","after","before"]),ee.serviceAttributePrefixes=["error","group"];var xt=ee;var wt=class{constructor(){this.map=new WeakMap;this.all=new Set}attach(r){if(this.map.has(r))return;let e=r.htmlElement,t={cx:0,cy:0,valid:!1,el:e};t.ro=new ResizeObserver(()=>{t.valid=!1}),t.ro.observe(e),this.map.set(r,t),this.all.add(r)}detach(r){let e=this.map.get(r);e&&(e.ro?.disconnect(),this.map.delete(r),this.all.delete(r))}invalidate(r){this.all.forEach(e=>{if(e.id===r){let t=this.map.get(e);t&&(t.valid=!1)}})}invalidateAll(){this.all.forEach(r=>{let e=this.map.get(r);e&&(e.valid=!1)})}getCenter(r){let e=this.map.get(r);if(!e||!e.el)return{cx:0,cy:0};if(!e.valid){let t=e.el.getBoundingClientRect();e.cx=t.left+t.width/2,e.cy=t.top+t.height/2,e.valid=!0}return{cx:e.cx,cy:e.cy}}};var Tt=class{constructor(){this.active=new Set;this.subs=new WeakMap}track(r){if(this.subs.has(r))return;let e=r.htmlElement,t=()=>this.active.add(r),i=()=>this.active.delete(r);e.addEventListener("pointerenter",t),e.addEventListener("pointerleave",i),this.subs.set(r,{enter:t,leave:i})}untrack(r){let e=this.subs.get(r);if(!e)return;let t=r.htmlElement;e.enter&&t.removeEventListener("pointerenter",e.enter),e.leave&&t.removeEventListener("pointerleave",e.leave),this.active.delete(r),this.subs.delete(r)}isActive(r){return this.active.has(r)}activeObjects(){return Array.from(this.active)}};var Ct=class extends x{constructor(r){super(r),this.htmlKey="scroller"}onObjectConnected(r){let e=r.getProperty("scroller-inited");if(e==null||e==""){r.setProperty("scroller-inited","inited");let t=i=>{this.events.emit("wheel",i)};r.setProperty("scroller-wheel-event",t),r.htmlElement.addEventListener("wheel",t)}}onObjectDisconnected(r){r.setProperty("scroller-inited",""),r.htmlElement.removeEventListener("wheel",r.getProperty("scroller-wheel-event"))}};var Pt=class extends x{constructor(e){super(e);this.states=new WeakMap;this.htmlKey="scroll-container",this.attributesToMap.push({key:"lerp",type:"number",fallback:.1})}onObjectConnected(e){super.onObjectConnected(e);let t=e.htmlElement;getComputedStyle(t).overflowY==="visible"&&(t.style.overflowY="auto");let i={current:t.scrollTop,target:t.scrollTop,maxScroll:t.scrollHeight-t.clientHeight,velocity:0,lerp:e.getProperty("lerp")||.1,isDragging:!1,isActive:!1};this.states.set(t,i),t.addEventListener("wheel",n=>this.handleWheel(n,t,i),{passive:!1}),t.addEventListener("scroll",n=>this.onNativeScroll(n,t,i),{passive:!0}),this.measure(t,i)}onObjectDisconnected(e){this.states.delete(e.htmlElement)}onFrame(e){for(let t of this.objectsOnPage){let i=t.htmlElement,n=this.states.get(i);n&&n.isActive&&!n.isDragging&&this.updateScroll(i,n)}}onResize(){for(let e of this.objectsOnPage){let t=e.htmlElement,i=this.states.get(t);i&&this.measure(t,i)}}measure(e,t){t.maxScroll=e.scrollHeight-e.clientHeight}handleWheel(e,t,i){let n=e.deltaY,s=n<0,o=n>0,a=i.target<=.1,l=i.target>=i.maxScroll-.1;s&&a||o&&l||(e.preventDefault(),e.stopPropagation(),i.target+=n,i.target=Math.max(0,Math.min(i.target,i.maxScroll)),i.isActive=!0,i.isDragging=!1)}onWheel(e){}onNativeScroll(e,t,i){i.isActive||(i.current=t.scrollTop,i.target=t.scrollTop)}updateScroll(e,t){let i=t.target-t.current;Math.abs(i)<.1?(t.current=t.target,t.isActive=!1):t.current+=i*t.lerp,e.scrollTop=t.current}};function cr(u){let r=u.match(/([^[]+)\[([\d.]+)-([\d.]+)\]/);return r?{id:r[1],start:parseFloat(r[2]),end:parseFloat(r[3])}:null}function Wr(u,r,e,t,i){return t+(i-t)*(u-r)/(e-r)}var Lt=class extends x{constructor(r){super(r),this.htmlKey="progress-part",this.attributesToMap=[...this.attributesToMap,{key:"part-of",type:"string",fallback:""}]}onObjectConnected(r){let e=r.getProperty("part-of"),t=cr(e);if(t){r.setProperty("part-of-id",t.id),r.setProperty("start",t.start),r.setProperty("end",t.end);let i=n=>{if(t){let s=Wr(n,t?.start,t?.end,0,1),o=Math.max(0,Math.min(1,s));r.htmlElement.style.setProperty("--progress-slice",o.toString()),this.events.emit(this.getObjectEventName(r,"object:progress-slice"),o)}};r.setProperty("progress-event",i),this.events.on(`object:progress:${t.id}`,i)}}onObjectDisconnected(r){let e=r.getProperty("part-of-id");e&&this.events.off(`object:progress:${e}`,r.getProperty("progress-event"))}};var Vr=(u,r)=>{let e=Math.min(u,r),t=Math.max(u,r);return e+Math.random()*(t-e)},_r=(u,r)=>{let e=Math.ceil(Math.min(u,r)),t=Math.floor(Math.max(u,r));return t<e?e:Math.floor(Math.random()*(t-e+1))+e},zr=u=>{if(Array.isArray(u)&&u.length>=2){let r=Number(u[0]),e=Number(u[1]);if(Number.isFinite(r)&&Number.isFinite(e))return[r,e]}return typeof u=="number"&&Number.isFinite(u)?[0,u]:[0,1]},Ot=class extends x{constructor(r){super(r),this.htmlKey="random",this.attributesToMap.push({key:"random-number",type:"json",fallback:"[0,1]"}),this.attributesToMap.push({key:"random-type",type:"string",fallback:"int"})}onObjectConnected(r){let e=r.htmlElement,t=zr(r.getProperty("random-number")),n=String(r.getProperty("random-type")??"float").toLowerCase()==="int"?_r(t[0],t[1]):Vr(t[0],t[1]);M.run(()=>{M.setVars(e,{"--random":n})})}};function Br(){return"ontouchstart"in window||navigator.maxTouchPoints>0}var Wt=class u{constructor(){this.pendingScroll=!1;this.lastScrollEmitted=NaN;this.observerContainerMutation=null;this.pendingResizeRaf=null;this.pendingResizeForce=!1;this.prevWidth=0;this.prevHeight=0;this.loop=new yt;this.observerContainerResize=null;this.canRebuild=!0;this.debouncedResize=ar(()=>{this.queueResize(!1)},30);this.root=document.body,this.window=window,this.tools=new Ye,this.data=new pe,this.eventManager=new se,this.moduleManager=new De(this.data),this.objectManager=new ke(this.data,this.moduleManager,this.eventManager,this.tools),this.centers=new wt,this.hoverManager=new Tt,this.context={events:this.eventManager,data:this.data,tools:this.tools,settings:{},centers:this.centers,hover:this.hoverManager,objectManager:this.objectManager},this.cursorController=new Ae(1,this.context),this.scrollManager=new We(this.context),this.setupSettings({"global-class":!1,"offset-top":"0%","offset-bottom":"0%",key:"--progress","inview-top":"0%","inview-bottom":"0%","enter-el":"top","enter-vp":"bottom","exit-el":"bottom","exit-vp":"top","parallax-bias":"0.0",parallax:"0.2",lerp:"0.2","cursor-lerp":"0.75",radius:"150",strength:"0.3",glide:"1",anchor:"center center",timeout:900,alignment:"center","target-disable":"false","target-style-disable":"false","target-class":"",active:"false",fixed:"false",repeat:"false","self-disable":"false",abs:"false",easing:"cubic-bezier(0.25, 0.25, 0.25, 0.25)","glide-base-velocity":.00125,"glide-reduce-velocity":625e-7,"glide-negative-velocity":-1e-4,"position-strength":3,"position-tension":.05,"position-friction":.15,"position-max-velocity":10,"position-update-threshold":.1,"rotation-strength":.75,"rotation-tension":.06,"rotation-friction":.18,"rotation-max-angular-velocity":6,"rotation-max-angle":18,"rotation-update-threshold":.15,"max-offset":220,"sleep-epsilon":.01,"continuous-push":!0}),this.onContainerTransitionEndBind=this.onContainerTransitionEnd.bind(this),this.onResizeObserverBind=this.onResizeObserverEvent.bind(this),this.observerContainerResize=new ResizeObserver(this.onResizeObserverBind),this.observerContainerResize.observe(this.context.data.scroll.container),this.onWheelBind=this.onWheelEvent.bind(this),this.onScrollBind=this.onScrollEvent.bind(this),this.onResizeBind=()=>{this.queueResize(!1)},this.onMouseMoveBind=this.onMouseMoveEvent.bind(this),this.onScrollStartBind=this.onScrollStart.bind(this),this.onScrollStopBind=this.onScrollStop.bind(this),this.onDirectionChangeBind=this.onDirectionChange.bind(this),this.onScrollToBind=this.scrollTo.bind(this),this.onDOMChangedBind=this.onDOMChanged.bind(this),this.eventManager.on("wheel",this.onWheelBind),this.eventManager.on("resize",this.onResizeBind),this.eventManager.on("scrollTo",this.onScrollToBind),this.eventManager.on("dom:changed",this.onDOMChangedBind),this.scrollManager.bindEvents({onScrollStart:this.onScrollStartBind,onScrollStop:this.onScrollStopBind,onDirectionChange:this.onDirectionChangeBind}),this.loop.setOnFrame(r=>{this.data.time.delta=r-this.data.time.now,this.data.time.previous=this.data.time.now,this.data.time.now=r,this.data.time.elapsed+=this.data.time.delta,this.onUpdateEvent()}),this.on("image:load:all",()=>{this.onResize()}),this.scrollContainer=window}set scrollPosition(r){this.data.scroll.current=r,this.data.scroll.target=r,this.data.scroll.transformedCurrent=this.data.scroll.current*this.data.viewport.transformScale,this.data.scroll.delta=0,this.data.scroll.lerped=0,this.scrollManager.updatePosition(),this.moduleManager.onScroll(),this.objectManager.checkInview()}set scrollContainer(r){this.observerContainerResize?.unobserve(this.context.data.scroll.container),this.data.scroll.elementContainer.removeEventListener("transitionend",this.onContainerTransitionEndBind),r instanceof Window?(this.data.scroll.container=document.body,this.data.scroll.elementContainer=document.documentElement,this.data.scroll.scrollContainer=r):r instanceof HTMLElement?(this.data.scroll.container=r,this.data.scroll.elementContainer=r,this.data.scroll.scrollContainer=r):(this.data.scroll.container=document.body,this.data.scroll.elementContainer=document.documentElement,this.data.scroll.scrollContainer=r),this.data.scroll.elementContainer.addEventListener("transitionend",this.onContainerTransitionEndBind),this.observerContainerResize?.observe(this.context.data.scroll.container),this.observeContainerMutations(),this.queueResize(!0)}get scrollPosition(){return this.data.scroll.current}get scrollHeight(){return this.data.viewport.contentHeight}get containerHeight(){return this.data.viewport.windowHeight}set speed(r){this.data.scroll.speed=r}set speedAccelerate(r){this.data.scroll.speedAccelerate=.1+(.5-.1)*r}set scrollDesktopMode(r){this.scrollManager.setDesktopMode(r)}set scrollMobileMode(r){this.scrollManager.setMobileMode(r)}set FPSTrackerVisible(r){this.data.system.fpsTracker=r,this.eventManager.emit("tracker:fps:visible",r)}set PositionTrackerVisible(r){this.data.system.positionTracker=r,this.eventManager.emit("tracker:position:visible",r)}set domBatcherEnabled(r){this.objectManager.setDOMBatcherEnabled(r)}set intersectionObserverEnabled(r){this.objectManager.setIntersectionObserverEnabled(r)}static getInstance(){return u.i||(u.i=new u),u.i}reuse(r){return this.moduleManager.find(r)}use(r,e=null){let t={...this.context.settings,...e},i=new r({events:this.eventManager,data:this.data,tools:this.tools,settings:t,centers:this.centers,hover:this.hoverManager,objectManager:this.objectManager});this.moduleManager.register(i)}registerScrollMode(r,e){let t;if(typeof e=="function"&&e.prototype instanceof $){let i=e;t=new i(this.context)}else t=e(this.context);t.name||(t.name=r),this.scrollManager.registerMode(r,t)}on(r,e,t=""){this.eventManager.on(r,e,t)}emit(r,e){this.eventManager.emit(r,e)}off(r,e,t=""){this.eventManager.off(r,e,t)}addScrollMark(r){this.scrollManager.addScrollMark(r)}removeScrollMark(r){this.scrollManager.removeScrollMark(r)}start(r){this.data.scroll.scrollContainer?.addEventListener("scroll",this.onScrollBind),this.data.scroll.container?.addEventListener("wheel",this.onWheelBind,{passive:!1}),window.addEventListener("resize",this.onResizeBind),this.root.addEventListener("mousemove",this.onMouseMoveBind),this.observeContainerMutations(),this.use(it);let e=window.getComputedStyle(document.documentElement).fontSize,t=parseFloat(e);this.context.data.viewport.baseRem=t,document.documentElement.classList.add("-string"),this.moduleManager.onInit(),this.onResize(),this.initObjects(),this.objectManager.observeDOM(),this.loop.start(r),this.eventManager.emit("start",null)}initObjects(){document.querySelectorAll("[string],[data-string]").forEach(r=>{this.objectManager.add(r)}),document.querySelectorAll("[string-copy-from],[data-string-copy-from]").forEach(r=>{let e=this.tools.domAttribute.process({element:r,key:"copy-from",fallback:""});e&&e.length>0&&this.objectManager.linkMirror(e,r)}),this.moduleManager.onResize(),this.moduleManager.onScroll(),this.moduleManager.onFrame()}setupSettings(r){this.context.settings={...this.context.settings,...r},this.onSettingsChange({isDesktop:this.data.viewport.windowWidth>1024,widthChanged:!0,heightChanged:!0,scrollHeightChanged:!0,isForceRebuild:!1})}onResizeObserverEvent(){this.debouncedResize()}onContainerTransitionEnd(r){r.target===this.context.data.scroll.container&&this.queueResize(!0)}onDOMChanged(){this.queueResize(!1),this.debouncedResize()}observeContainerMutations(){this.observerContainerMutation?.disconnect();let r=this.context.data.scroll.container;r&&(this.observerContainerMutation=new MutationObserver(e=>{for(let t=0;t<e.length;t++){let i=e[t];if(i.type==="attributes"&&(i.attributeName==="style"||i.attributeName==="class")){this.queueResize(!1),this.debouncedResize();break}}}),this.observerContainerMutation.observe(r,{attributes:!0,attributeFilter:["style","class"]}))}queueResize(r=!1){r&&(this.pendingResizeForce=!0),this.pendingResizeRaf==null&&(this.pendingResizeRaf=requestAnimationFrame(()=>{this.pendingResizeRaf=null;let e=this.pendingResizeForce;this.pendingResizeForce=!1,this.onResize(e)}))}onMouseMoveEvent(r){this.cursorController.onMouseMove(r),this.moduleManager.onMouseMove(r),V.measure(()=>{this.moduleManager.onMouseMoveMeasure()})}onWheelEvent(r){r.target.closest("[string-isolation],[data-string-isolation]")==null&&(this.scrollManager.get().onWheel(r),this.moduleManager.onWheel(r))}onScrollStart(){this.moduleManager.onScrollStart(),this.eventManager.emit("scroll:start",null)}onScrollStop(){this.moduleManager.onScrollStop(),this.eventManager.emit("scroll:stop",null)}onDirectionChange(){this.moduleManager.onDirectionChange()}onSettingsChange(r){this.cursorController.onSettingsChange(r),this.objectManager.onSettingsChange(r),this.moduleManager.onSettingsChange(r)}onScrollEvent(r){return r.preventDefault(),this.context.centers.invalidateAll(),this.scrollManager.get().onScroll(r),this.pendingScroll=!0,!1}onUpdateEvent(){this.cursorController.onFrame(),this.scrollManager.get().onFrame(),this.moduleManager.onFrame(),(this.pendingScroll||this.data.scroll.current!==this.lastScrollEmitted)&&(this.pendingScroll=!1,this.moduleManager.onScroll(),this.objectManager.checkInview(),this.eventManager.emit("lerp",this.data.scroll.lerped),this.eventManager.emit("scroll",this.data.scroll.current),V.measure(()=>{this.moduleManager.onScrollMeasure()}),this.lastScrollEmitted=this.data.scroll.current),V.mutate(()=>{M.begin(),this.moduleManager.onMutate(),M.commit()}),this.eventManager.emit("update",null),V.flush()}onResize(r=!1){if(this.canRebuild==!1)return;let e=this.data.scroll.container,t=this.context.data.scroll,i=0,n=0;var s,o=0;let a=e.getBoundingClientRect();e.tagName=="BODY"?(i=window.innerWidth,n=window.innerHeight):(i=a.width,n=a.height),o=e.tagName==="BODY"?0:a.top,s=t.container.scrollHeight;let l=this.tools.transformScaleParser.process({value:window.getComputedStyle(e).transform});this.context.data.viewport.transformScale=window.getComputedStyle(e).scale=="none"?l:Number(window.getComputedStyle(e).scale),this.context.data.scroll.transformedCurrent=this.context.data.scroll.current*this.context.data.viewport.transformScale;let c=Br(),d=i>1024,h=this.prevWidth!==i,p=this.prevHeight!==n,b=Math.abs(this.prevHeight-n),m=this.context.data.viewport.contentHeight!==s,g=h||!c&&p||c&&b>150||m;this.context.data.scroll.topPosition=Math.floor(o),this.context.data.viewport.contentWidth=i,this.context.data.viewport.contentHeight=s,this.prevWidth=i,this.prevHeight=n,this.context.data.viewport.windowWidth=i,this.context.data.viewport.windowHeight=n;let v=window.getComputedStyle(document.documentElement).fontSize,y=parseFloat(v);if(this.context.data.viewport.baseRem=y*l,t.bottomPosition=this.context.data.viewport.contentHeight-n,(h||typeof r=="boolean"&&r)&&this.moduleManager.onResizeWidth(),g||typeof r=="boolean"&&r){let f=this.context.data.scroll.elementContainer.scrollTop;f>0&&(this.context.data.scroll.current=f,this.context.data.scroll.target=f),this.moduleManager.onResize(),this.scrollManager&&this.scrollManager.updateResponsiveMode(),this.onSettingsChange({isDesktop:d,widthChanged:h,heightChanged:p,scrollHeightChanged:m,isForceRebuild:r===!0}),this.objectManager.invalidateInviewIndex(),this.moduleManager.onScroll(),this.moduleManager.onScrollMeasure(),this.moduleManager.onFrame()}this.objectManager.checkInview()}invalidateCenter(r){this.objectManager.all.get(r)&&this.centers.invalidate(r)}scrollTo(r){if(typeof r=="number"){this.scrollManager.get().scrollTo(r);return}let e=r.position,t=r.immediate===!0;this.scrollManager.get().scrollTo(e,t)}destroy(){this.data.scroll.scrollContainer?.removeEventListener("scroll",this.onScrollBind),this.data.scroll.container?.removeEventListener("wheel",this.onWheelBind),window.removeEventListener("resize",this.onResizeBind),this.root.removeEventListener("mousemove",this.onMouseMoveBind),this.eventManager.off("dom:changed",this.onDOMChangedBind),this.observerContainerMutation?.disconnect(),this.observerContainerMutation=null,this.pendingResizeRaf!=null&&(cancelAnimationFrame(this.pendingResizeRaf),this.pendingResizeRaf=null),this.objectManager.destroy(),this.scrollManager.destroy()}};0&&(module.exports={CursorReactiveModule,DOMBatcher,ScrollController,StringAnchor,StringCursor,StringData,StringDelayLerpTracker,StringFPSTracker,StringForm,StringGlide,StringImpulse,StringLazy,StringLerp,StringLerpTracker,StringLoading,StringMagnetic,StringMasonry,StringModule,StringObject,StringParallax,StringPositionTracker,StringProgress,StringProgressPart,StringRandom,StringResponsive,StringScrollContainer,StringScrollbar,StringScroller,StringSequence,StringSplit,StringSpotlight,StringTune,StringVideoAutoplay,frameDOM,styleTxn});
|
|
27
|
+
`,document.head.appendChild(i)}this.displayElement=t}};function br(u,e){let t=null;return function(...r){let i=this;t&&clearTimeout(t),t=setTimeout(()=>{u.apply(i,r),t=null},e)}}var Se=class{constructor(){this.fps=0;this.isAnimationStarted=!1;this.fpsInterval=0;this.then=0;this.requestAnimationId=0;this.onFrameCallback=e=>{};this.animate=()=>{};this.onVisibilityChangeBind=this.onVisibilityChange.bind(this)}onVisibilityChange(){document.hidden?(this.stop(),this.isAnimationStarted=!1):this.start(this.fps)}start(e){this.fps=e,!this.isAnimationStarted&&(this.fpsInterval=1e3/e,this.then=performance.now(),this.isAnimationStarted=!0,e===0?this.animate=()=>{let t=performance.now();this.requestAnimationId=requestAnimationFrame(this.animate),this.onFrameCallback(t)}:this.animate=()=>{let t=performance.now(),r=t-this.then;r>this.fpsInterval&&(this.then=t-r%this.fpsInterval,this.onFrameCallback(t)),this.requestAnimationId=requestAnimationFrame(this.animate)},this.animate())}stop(){this.isAnimationStarted&&(cancelAnimationFrame(this.requestAnimationId),this.requestAnimationId=0,this.isAnimationStarted=!1)}setOnFrame(e){this.onFrameCallback=e}destructor(){this.stop()}};var xe=class extends M{constructor(e){super(e),this.htmlKey="autoplay",this.attributesToMap=[...this.attributesToMap,{key:"src",type:"string",fallback:""}]}onObjectConnected(e){e.setProperty("onEnterEvent",this.onEnterObject.bind(this)),e.events.on("enter",e.getProperty("onEnterEvent")),e.setProperty("onLeaveEvent",this.onLeaveObject.bind(this)),e.events.on("leave",e.getProperty("onLeaveEvent"));let t=e.htmlElement,r=this.tools.domAttribute.process({element:t,key:"string-started",fallback:null})!==null;t.tagName.toLowerCase()==="video"&&!r&&(t.setAttribute("string-started",""),t.muted=!0,t.setAttribute("muted","muted"),t.setAttribute("playsinline",""),t.setAttribute("loop",""),t.setAttribute("autoplay",""),t.src=e.getProperty("src"),t.load(),t.addEventListener("canplay",()=>{}))}onEnterObject(e){let t=e.htmlElement;this.tryPlay(t)}onLeaveObject(e){e.htmlElement.pause()}tryPlay(e){e.play().catch(t=>console.warn("[StringVideoAutoplay] Autoplay failed:",t))}};var qe=(i=>(i.ACTIVE="-active",i.ENTERING="-entering",i.LEAVING="-leaving",i.DISABLED="-disabled",i))(qe||{}),yr={PROGRESS:"--sequence-progress",DIRECTION:"--sequence-direction"};var Me=class Me extends M{constructor(t){super(t);this.activeStep=new Map;this.leavingStep=new Map;this.transitions=new Map;this.elementIndex=new Map;this.triggerElements=new Map;this.globalSettings=new Map;this.stateRegistered=new Set;this.lastEnteredStep=new Map;this.initialized=!1;this.onTriggerClick=t=>{let r=this.triggerElements.get(t.currentTarget);if(!r)return;let i=this.activeStep.get(r.slider)??0,n=this.getMaxStep(r.slider),s,o;if(r.step==="next"){if(s=i+1,o=1,!this.elementIndex.has(`${r.slider}[${s}]`))if(r.loop&&n>=0)s=0;else return}else if(r.step==="prev"){if(s=i-1,o=-1,s<0)if(r.loop&&n>=0)s=n;else return;if(!this.elementIndex.has(`${r.slider}[${s}]`))return}else{if(s=r.step,i===s)return;o=s>i?1:-1}this.startTransition(r.slider,s,o)};this.htmlKey="sequence",this.defaultDuration=this.settings["sequence-duration"]??600,this.attributesToMap=[...this.attributesToMap,{key:"sequence",type:"string",fallback:""},{key:"sequence-trigger",type:"string",fallback:""},{key:"entering-easing",type:"string",fallback:""},{key:"leaving-easing",type:"string",fallback:""},{key:"entering-duration",type:"string",fallback:""},{key:"leaving-duration",type:"string",fallback:""},{key:"sequence-duration",type:"string",fallback:""},{key:"active-step",type:"string",fallback:""}]}onInit(){super.onInit(),this.events.on("sequence",this.onSequenceEvent.bind(this)),this.scanStandaloneTriggers()}scanStandaloneTriggers(){let t=document.querySelectorAll("[string-sequence-trigger]:not([string-inited])");for(let r of Array.from(t)){let i=r.getAttribute("string-sequence-trigger"),n=i?this.parseTriggerKey(i):null;n&&(this.triggerElements.set(r,n),r.addEventListener("click",this.onTriggerClick))}}parseGlobalSettingsFromObject(t){let r=n=>t.getProperty(n),i=r("sequence-duration");this.tryParseGlobalSetting(i,"enteringDuration"),this.tryParseGlobalSetting(i,"leavingDuration"),this.tryParseGlobalSetting(r("entering-duration"),"enteringDuration"),this.tryParseGlobalSetting(r("leaving-duration"),"leavingDuration"),this.tryParseGlobalSetting(r("entering-easing"),"enteringEasing"),this.tryParseGlobalSetting(r("leaving-easing"),"leavingEasing"),this.tryParseGlobalSetting(r("active-step"),"activeStep")}tryParseGlobalSetting(t,r){if(!t)return;let i=t.match(/^(.+)\[(.+)\]$/);if(!i)return;let[,n,s]=i,o=this.globalSettings.get(n)??{};this.globalSettings.set(n,o),o[r]=r==="enteringEasing"||r==="leavingEasing"?s:parseFloat(s),this.applyGlobalSettingsToExistingObjects(n)}applyGlobalSettingsToExistingObjects(t){let r=this.globalSettings.get(t);if(r){for(let[i,n]of this.elementIndex)if(this.parseSequenceKey(i)?.slider===t){r.enteringDuration!==void 0&&(n.enteringDuration=r.enteringDuration),r.leavingDuration!==void 0&&(n.leavingDuration=r.leavingDuration);for(let o of n.objects)this.resolveEasings(o,i)}}}initializeSliders(){let t=new Set;for(let r of this.elementIndex.keys()){let i=this.parseSequenceKey(r);i&&t.add(i.slider)}for(let r of t){if(this.activeStep.has(r))continue;let n=this.globalSettings.get(r)?.activeStep??0;this.elementIndex.has(`${r}[${n}]`)||(n=0),this.switchInstant(r,n,1)}}tryApplyPendingActiveStep(t){if(this.activeStep.has(t))return;let r=this.globalSettings.get(t)?.activeStep;r!==void 0&&this.elementIndex.has(`${t}[${r}]`)&&this.switchInstant(t,r,1)}canConnect(t){return t.keys.includes("sequence")||t.keys.includes("sequence-trigger")}onObjectConnected(t){super.onObjectConnected(t),this.parseGlobalSettingsFromObject(t);let r=t.getProperty("sequence"),i=t.getProperty("sequence-trigger");if(!r&&i){let n=this.parseTriggerKey(i);n&&typeof n.step=="number"&&(r=`${n.slider}[${n.step}]`,t.setProperty("sequence",r))}if(r){let n=this.parseSequenceKey(r);if(n){this.ensureStateEventRegistered(n.slider);let s=this.elementIndex.get(r);if(!s){let{enteringDuration:a,leavingDuration:l}=this.resolveDurations(t,r);s={objects:[],enteringDuration:a,leavingDuration:l},this.elementIndex.set(r,s)}s.objects.push(t),this.resolveEasings(t,r);let o=this.activeStep.get(n.slider);this.setState(t,o===n.step?"-active":"-disabled",o===n.step?1:0,1),this.tryApplyPendingActiveStep(n.slider)}}if(i){let n=this.parseTriggerKey(i);n&&(this.triggerElements.set(t.htmlElement,n),t.htmlElement.addEventListener("click",this.onTriggerClick))}}ensureStateEventRegistered(t){this.stateRegistered.has(t)||(this.stateRegistered.add(t),this.events.registerStateEvent?.(`sequence:active:${t}`))}parseTriggerKey(t){let r=t.match(/^(.+)\[(next|prev|\d+)(\|loop)?\]$/);if(!r)return null;let i=r[2]==="next"||r[2]==="prev"?r[2]:parseInt(r[2],10);return{slider:r[1],step:i,loop:r[3]==="|loop"}}getMaxStep(t){let r=-1;for(let i of this.elementIndex.keys()){let n=this.parseSequenceKey(i);n?.slider===t&&n.step>r&&(r=n.step)}return r}resolveDuration(t,r,i,n){let s=t.getProperty(n),o=t.getProperty("sequence-duration"),a=this.globalSettings.get(r)?.[i];if(s&&!s.includes("[")){let l=parseFloat(s);if(!isNaN(l))return l}if(o&&!o.includes("[")){let l=parseFloat(o);if(!isNaN(l))return l}return a??this.defaultDuration}resolveDurations(t,r){let i=this.parseSequenceKey(r)?.slider??"";return{enteringDuration:this.resolveDuration(t,i,"enteringDuration","entering-duration"),leavingDuration:this.resolveDuration(t,i,"leavingDuration","leaving-duration")}}resolveEasing(t,r,i,n){let s=t.getProperty(n);(!s||typeof s=="string"&&s.includes("["))&&(s=this.globalSettings.get(r)?.[i]??this.settings.easing??"ease-out"),typeof s=="string"&&t.setProperty(n,this.tools.easingFunction.process({easing:s}))}resolveEasings(t,r){let i=this.parseSequenceKey(r)?.slider;i&&(this.resolveEasing(t,i,"enteringEasing","entering-easing"),this.resolveEasing(t,i,"leavingEasing","leaving-easing"))}onObjectDisconnected(t){super.onObjectDisconnected(t);let r=t.getProperty("sequence");if(r){let i=this.elementIndex.get(r);if(i){let n=i.objects.indexOf(t);n!==-1&&i.objects.splice(n,1),i.objects.length||this.elementIndex.delete(r)}}this.triggerElements.has(t.htmlElement)&&(t.htmlElement.removeEventListener("click",this.onTriggerClick),this.triggerElements.delete(t.htmlElement))}parseSequenceKey(t){let r=t.match(/^(.+)\[(\d+)\]$/);return r?{slider:r[1],step:parseInt(r[2],10)}:null}onSequenceEvent(t){let{slider:r,step:i,transitionProgress:n,direction:s=1,duration:o,instant:a}=t;this.activeStep.get(r)===i&&n===void 0||(n!==void 0?this.handleScrub(r,i,n,s):a?this.switchInstant(r,i,s):this.startTransition(r,i,s,o))}startTransition(t,r,i,n){let s=this.activeStep.get(t),o=this.leavingStep.get(t);this.ensureStateEventRegistered(t),o!==void 0&&o!==s&&this.setStepState(t,o,"-disabled",0,i);let a=this.elementIndex.get(`${t}[${r}]`),l=s!==void 0?this.elementIndex.get(`${t}[${s}]`):null;s!==void 0&&this.leavingStep.set(t,s),this.activeStep.set(t,r),this.emitActiveState(t,r);let c={fromStep:s??r,toStep:r,direction:i,startTime:this.data.time.now,enteringDuration:n??a?.enteringDuration??this.defaultDuration,leavingDuration:n??l?.leavingDuration??this.defaultDuration};this.transitions.set(t,c),this.emitTransitionStart(t,c)}handleScrub(t,r,i,n){this.transitions.delete(t);let s=this.activeStep.get(t);if(s!==r){let a=this.leavingStep.get(t);a!==void 0&&this.setStepState(t,a,"-disabled",0,n),s!==void 0&&this.leavingStep.set(t,s),this.activeStep.set(t,r),this.emitActiveState(t,r)}let o=this.leavingStep.get(t)??s??r;this.applyProgress(t,o,r,i,i,n)}switchInstant(t,r,i){this.transitions.delete(t);let n=this.activeStep.get(t),s=this.leavingStep.get(t);s!==void 0&&this.setStepState(t,s,"-disabled",0,i),n!==void 0&&n!==r&&this.setStepState(t,n,"-disabled",0,i),this.activeStep.set(t,r),this.leavingStep.delete(t),this.setStepState(t,r,"-active",1,i),this.emitActiveState(t,r),s!==void 0&&s!==r?this.emitStepLeave(t,s,i,!0):n!==void 0&&n!==r&&this.emitStepLeave(t,n,i,!0),this.emitStepEnter(t,r,i,!0);let o={fromStep:n??r,toStep:r,direction:i,startTime:this.data.time.now,enteringDuration:0,leavingDuration:0};this.emitTransitionStart(t,o),this.emitTransitionEnd(t,r,n??r,i,!0)}applyProgress(t,r,i,n,s,o){let a=this.activeStep.get(t),l=this.leavingStep.get(t);this.setStepState(t,a,n>=1?"-active":"-entering",n,o),l!==void 0&&l!==a&&(s>=1?(this.setStepState(t,l,"-disabled",0,o),this.leavingStep.delete(t),this.emitStepLeave(t,l,o,!1)):this.setStepState(t,l,"-leaving",s,o)),this.emitTransitionProgress(t,r,i,n,s,o),n>=1&&this.emitStepEnter(t,a,o,!1)}setStepState(t,r,i,n,s){let o=this.elementIndex.get(`${t}[${r}]`);if(o)for(let a of o.objects)this.setState(a,i,n,s)}setState(t,r,i,n){let s=t.htmlElement,o=t.getProperty("_state"),a=t.getProperty("_direction"),l=t.getProperty(r==="-leaving"?"leaving-easing":"entering-easing"),c=typeof l=="function"?l(i):i;o!==r&&(s.classList.remove(...Me.ALL_STATES),s.classList.add(r),t.setProperty("_state",r)),a!==n&&(t.setProperty("_direction",n),x.run(()=>x.setVars(s,{[yr.DIRECTION]:n.toString()})))}onFrame(t){super.onFrame(t),this.initialized||(this.initialized=!0,this.initializeSliders());for(let[r,i]of this.transitions){let n=t.time.now-i.startTime,s=Math.min(1,n/i.enteringDuration),o=Math.min(1,n/i.leavingDuration);this.applyProgress(r,i.fromStep,i.toStep,s,o,i.direction),s>=1&&o>=1&&(this.emitTransitionEnd(r,i.toStep,i.fromStep,i.direction,!1),this.transitions.delete(r))}}emitTransitionStart(t,r){let i={slider:t,from:r.fromStep,to:r.toStep,direction:r.direction,enteringDuration:r.enteringDuration,leavingDuration:r.leavingDuration,startedAt:r.startTime};this.events.emit("sequence:transition:start",i),this.events.emit(`sequence:transition:start:${t}`,i)}emitTransitionProgress(t,r,i,n,s,o){let a={slider:t,from:r,to:i,entering:n,leaving:s,direction:o};this.events.emit("sequence:transition:progress",a),this.events.emit(`sequence:transition:progress:${t}`,a)}emitTransitionEnd(t,r,i,n,s){let o={slider:t,from:i,to:r,direction:n,instant:s};this.events.emit("sequence:transition:end",o),this.events.emit(`sequence:transition:end:${t}`,o)}emitStepEnter(t,r,i,n){if(!n&&this.lastEnteredStep.get(t)===r)return;this.lastEnteredStep.set(t,r);let s={slider:t,step:r,direction:i,instant:n};this.events.emit("sequence:step:enter",s),this.events.emit(`sequence:step:enter:${t}`,s)}emitStepLeave(t,r,i,n){if(r==null)return;let s={slider:t,step:r,direction:i,instant:n};this.events.emit("sequence:step:leave",s),this.events.emit(`sequence:step:leave:${t}`,s)}emitActiveState(t,r){let i={slider:t,step:r};this.events.emit("sequence:active",i),this.events.emit(`sequence:active:${t}`,i)}};Me.ALL_STATES=Object.values(qe);var Ee=Me;var tt=class tt extends M{constructor(e){super(e),this.htmlKey="form"}initializeObject(e,t,r,i){super.initializeObject(e,t,r,i);let n=t.getProperty("form-events")??[];n.forEach(c=>{c.eventElement.removeEventListener(c.eventType,c.eventCallback)}),n.length=0,t.setProperty("form-events",n),super.onObjectConnected(t);let s=t.htmlElement,o=[],a={};this.getInteractiveFields(s).forEach((c,d)=>this.registerField(c,s,o,a,n,d));let l=c=>{c.preventDefault();let d=!0,p={},h=new Set;for(let v of o){let m=v.field;if(!m.isConnected||!this.shouldValidateField(m))continue;if(this.isRadioField(m)){if(h.has(v.key))continue;h.add(v.key)}let{key:g,rules:b,needsContext:y}=v,f=this.getFieldValue(m);p[g]=f,a[g]=f;let{valid:S,errors:E}=this.tools.validation.process({rules:b,value:f,context:this.buildContext(y,g,a)});this.applyValidationState(s,m,g,S,E,"submit"),S||(d=!1)}if(d)this.events.emit(`form:submit:${t.id}`,p);else{let v=new Set,m=o.find(g=>{let b=g.field;if(!b.isConnected||!this.shouldValidateField(b))return!1;if(this.isRadioField(b)){if(v.has(g.key))return!1;v.add(g.key)}let{key:y,rules:f,needsContext:S}=g,E=this.getFieldValue(b);a[y]=E;let{valid:T}=this.tools.validation.process({rules:f,value:E,context:this.buildContext(S,y,a)});return!T});m?.field&&typeof m.field.focus=="function"&&m.field.focus(),this.events.emit(`form:invalid:${t.id}`)}};s.addEventListener("submit",l),n.push({eventElement:s,eventType:"submit",eventCallback:l}),t.setProperty("form-field-entries",o),t.setProperty("form-field-values",a)}onObjectConnected(e){}onDOMMutate(e,t){this.objects.length!==0&&(e.length>0&&this.handleMutationAdditions(e),t.length>0&&this.handleMutationRemovals(t))}applyValidationState(e,t,r,i,n,s){let o=e.querySelector(`[string-input="error[${r}]"]`),a=e.querySelector(`[string-input="group[${r}]"]`);o&&(o.innerHTML="",n.forEach(c=>{let d=document.createElement("span");d.textContent=c,o.appendChild(d)})),s==="live"?(t.classList.toggle("-invalid",!i),t.classList.remove("-error")):(t.classList.remove("-invalid"),t.classList.toggle("-error",!i)),t.classList.toggle("-valid",i),a&&(s==="live"?(a.classList.toggle("-invalid",!i),a.classList.remove("-error")):(a.classList.remove("-invalid"),a.classList.toggle("-error",!i)),a.classList.toggle("-valid",i));let l=i?"valid":s==="live"?"invalid":"error";this.events.emit(`form:field:${l}:${r}`,{key:r,field:t,errors:n,phase:s,valid:i})}getInteractiveFields(e){return Array.from(e.querySelectorAll("[string-input]")).filter(t=>!this.isServiceFieldAttribute(t.getAttribute("string-input")||"")).filter(t=>this.isFormFieldElement(t)).map(t=>t)}getFieldRules(e){let t=this.tools.domAttribute.process({element:e,key:"input"})??"";return this.tools.ruleParser.process({value:t})}registerField(e,t,r,i,n,s){if(!this.isFormFieldElement(e)||e.closest("form")!==t||r.some(m=>m.field===e))return;let o=this.registerFieldIndex(e,s??r.length),a=this.getInputKey(e,o),l=this.getFieldRules(e),c=this.supportsBeforeInputValidation(l),d=this.requiresContext(l),p=this.getInputEventType(e),h={field:e,key:a,rules:l,supportsRealtime:c,needsContext:d,inputEventType:p,inputHandler:()=>{}},v=m=>{let g=m.currentTarget||m.target;if(!g||!g.isConnected||!this.shouldValidateField(g))return;let b=this.getFieldValue(g);i[h.key]=b;let y=this.buildContext(h.needsContext,h.key,i),{valid:f,errors:S}=this.tools.validation.process({rules:h.rules,value:b,context:y});this.applyValidationState(t,g,h.key,f,S,"live")};if(h.inputHandler=v,e.addEventListener(p,v),n.push({eventElement:e,eventType:p,eventCallback:v}),c&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)){let m=g=>{let b=g;if(b.isComposing||b.inputType?.startsWith("insertComposition"))return;let y=g.currentTarget||g.target;if(!y||!(y instanceof HTMLInputElement||y instanceof HTMLTextAreaElement)||!y.isConnected)return;let f=y.selectionStart??0,S=y.selectionEnd??0,E=y.value;switch(b.inputType){case"deleteContentBackward":E=f===S&&f>0?y.value.slice(0,f-1)+y.value.slice(S):y.value.slice(0,f)+y.value.slice(S);break;case"deleteContentForward":E=f===S&&f<y.value.length?y.value.slice(0,f)+y.value.slice(f+1):y.value.slice(0,f)+y.value.slice(S);break;case"insertFromPaste":case"insertFromDrop":case"insertReplacementText":E=y.value.slice(0,f)+(b.data||"")+y.value.slice(S);break;default:typeof b.data=="string"&&(E=y.value.slice(0,f)+b.data+y.value.slice(S))}let{errors:T}=this.tools.validation.process({rules:h.rules,value:E,type:"beforeinput",context:this.buildContext(h.needsContext,h.key,i,{applied:!0,value:E})});T.length>0&&g.cancelable&&g.preventDefault()};h.beforeInputHandler=m,e.addEventListener("beforeinput",m),n.push({eventElement:e,eventType:"beforeinput",eventCallback:m})}e.classList.add("-inited"),r.push(h),i[a]=this.getFieldValue(e)}unregisterField(e,t,r,i){let n=t.findIndex(o=>o.field===e);if(n===-1)return;let s=t[n];s.inputHandler&&e.removeEventListener(s.inputEventType,s.inputHandler),s.beforeInputHandler&&e.removeEventListener("beforeinput",s.beforeInputHandler),delete r[s.key],t.splice(n,1);for(let o=i.length-1;o>=0;o--){let a=i[o];a.eventElement===e&&(a.eventCallback===s.inputHandler||s.beforeInputHandler&&a.eventCallback===s.beforeInputHandler)&&i.splice(o,1)}e.classList.remove("-inited")}collectInteractiveFieldsFromNode(e){let t=[];return e instanceof Element?(e.hasAttribute("string-input")&&t.push(e),t.push(...Array.from(e.querySelectorAll("[string-input]")))):e instanceof DocumentFragment&&t.push(...Array.from(e.querySelectorAll("[string-input]"))),t.filter(r=>!this.isServiceFieldAttribute(r.getAttribute("string-input")||"")).filter(r=>this.isFormFieldElement(r))}isRadioField(e){return e instanceof HTMLInputElement&&e.type==="radio"}handleMutationAdditions(e){e.forEach(t=>{this.collectInteractiveFieldsFromNode(t).forEach(i=>{let n=this.getFormStateByContainment(i);n&&this.registerField(i,n.form,n.entries,n.values,n.events)})})}handleMutationRemovals(e){e.forEach(t=>{this.collectInteractiveFieldsFromNode(t).forEach(i=>{let n=this.getFormStateByReference(i);n&&this.unregisterField(i,n.entries,n.values,n.events)})})}getFormStateByContainment(e){let t=this.objects.find(r=>r.htmlElement instanceof HTMLFormElement&&r.htmlElement.contains(e));return t?this.buildFormState(t):null}getFormStateByReference(e){for(let t of this.objects){let r=t.getProperty("form-field-entries");if(r&&r.some(i=>i.field===e))return this.buildFormState(t,r)}return null}buildFormState(e,t){let r=e.htmlElement;if(!(r instanceof HTMLFormElement))return null;let i=t??e.getProperty("form-field-entries"),n=e.getProperty("form-field-values"),s=e.getProperty("form-events");return!i||!n||!s?null:{object:e,form:r,entries:i,values:n,events:s}}registerFieldIndex(e,t){let r=e.getAttribute("data-string-form-index");return r!==null?Number(r):(e.setAttribute("data-string-form-index",String(t)),t)}getFieldIndex(e,t){let r=e.getAttribute("data-string-form-index");if(r!==null){let i=Number(r);return Number.isNaN(i)?t:i}return this.registerFieldIndex(e,t)}shouldValidateField(e){return!(e.disabled||e instanceof HTMLInputElement&&e.type==="hidden")}supportsBeforeInputValidation(e){return e.some(t=>tt.beforeInputRuleKeys.has(t.key))}requiresContext(e){return e.some(t=>tt.crossFieldRuleKeys.has(t.key))}buildContext(e,t,r,i){if(!e)return{fieldKey:t};let n=!!i?.applied,s=n?{...r,[t]:i.value}:r;return{fieldKey:t,values:s,getValue:o=>n&&o===t?i.value:s[o]}}getInputKey(e,t){return this.tools.domAttribute.process({element:e,key:"id"})||e.getAttribute("name")||e.getAttribute("id")||`input-${t}`}getFieldValue(e){if(e instanceof HTMLInputElement){if(e.type==="checkbox"){if(e.name){let t=e.form||e.closest("form"),r=t?Array.from(t.querySelectorAll(`input[type="checkbox"][name="${e.name}"]:checked`)):[e];return r.length>1?r.map(i=>i.value):r.length===1?r[0].value:""}return e.checked}if(e.type==="radio"){if(e.name){let r=(e.form||e.closest("form"))?.querySelector(`input[type="radio"][name="${e.name}"]:checked`);return r?r.value:""}return e.checked?e.value:""}return e.type==="file"&&e.files&&e.files.length>0?e.multiple?Array.from(e.files):e.files[0]:e.value}return e instanceof HTMLSelectElement?e.multiple?Array.from(e.selectedOptions).map(t=>t.value):e.value:e instanceof HTMLTextAreaElement?e.value:""}isServiceFieldAttribute(e){return tt.serviceAttributePrefixes.some(t=>e.startsWith(`${t}[`))}isFormFieldElement(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement}getInputEventType(e){return e instanceof HTMLSelectElement||e instanceof HTMLInputElement&&(e.type==="checkbox"||e.type==="radio")?"change":"input"}};tt.beforeInputRuleKeys=new Set(["number","integer","email","phone","letters","lettersSpaces","lettersNumbers","alpha","alpha_num","alpha_dash","digits","url","pattern"]),tt.crossFieldRuleKeys=new Set(["same","different","after","before"]),tt.serviceAttributePrefixes=["error","group"];var we=tt;var Te=class{constructor(){this.map=new WeakMap;this.all=new Set}attach(e){if(this.map.has(e))return;let t=e.htmlElement,r={cx:0,cy:0,valid:!1,el:t};r.ro=new ResizeObserver(()=>{r.valid=!1}),r.ro.observe(t),this.map.set(e,r),this.all.add(e)}detach(e){let t=this.map.get(e);t&&(t.ro?.disconnect(),this.map.delete(e),this.all.delete(e))}invalidate(e){this.all.forEach(t=>{if(t.id===e){let r=this.map.get(t);r&&(r.valid=!1)}})}invalidateAll(){this.all.forEach(e=>{let t=this.map.get(e);t&&(t.valid=!1)})}getCenter(e){let t=this.map.get(e);if(!t||!t.el)return{cx:0,cy:0};if(!t.valid){let r=t.el.getBoundingClientRect();t.cx=r.left+r.width/2,t.cy=r.top+r.height/2,t.valid=!0}return{cx:t.cx,cy:t.cy}}};var Ce=class{constructor(){this.active=new Set;this.subs=new WeakMap}track(e){if(this.subs.has(e))return;let t=e.htmlElement,r=()=>this.active.add(e),i=()=>this.active.delete(e);t.addEventListener("pointerenter",r),t.addEventListener("pointerleave",i),this.subs.set(e,{enter:r,leave:i})}untrack(e){let t=this.subs.get(e);if(!t)return;let r=e.htmlElement;t.enter&&r.removeEventListener("pointerenter",t.enter),t.leave&&r.removeEventListener("pointerleave",t.leave),this.active.delete(e),this.subs.delete(e)}isActive(e){return this.active.has(e)}activeObjects(){return Array.from(this.active)}};var Pe=`
|
|
28
|
+
<svg viewBox="0 0 22 24" aria-hidden="true">
|
|
29
|
+
<path
|
|
30
|
+
d="M4.17 10.42L3.08 1.53C2.95.45 3.87-.46 4.94-.33l7.31.91 7.81-.74"
|
|
31
|
+
transform="matrix(0.707107 0.707107 -0.707107 0.707107 8.37011 3.33333)"
|
|
32
|
+
fill="none"
|
|
33
|
+
stroke="currentColor"
|
|
34
|
+
stroke-width="1.6"
|
|
35
|
+
stroke-linejoin="bevel"
|
|
36
|
+
/>
|
|
37
|
+
<path
|
|
38
|
+
d="M0 2.5L3.3333333 0"
|
|
39
|
+
transform="matrix(-4.37114e-08 -1 1 -4.37114e-08 15.0368 6.25)"
|
|
40
|
+
fill="none"
|
|
41
|
+
stroke="currentColor"
|
|
42
|
+
stroke-width="0.6"
|
|
43
|
+
stroke-miterlimit="10"
|
|
44
|
+
/>
|
|
45
|
+
<path
|
|
46
|
+
d="M0 2.5L3.3333333 0"
|
|
47
|
+
transform="matrix(-4.37114e-08 -1 1 -4.37114e-08 17.5368 5)"
|
|
48
|
+
fill="none"
|
|
49
|
+
stroke="currentColor"
|
|
50
|
+
stroke-width="0.6"
|
|
51
|
+
stroke-miterlimit="10"
|
|
52
|
+
/>
|
|
53
|
+
</svg>`,Sr=`
|
|
54
|
+
<svg viewBox="0 0 20 20" aria-hidden="true">
|
|
55
|
+
<path
|
|
56
|
+
d="M6.4 0h3.2c2.24021 0 3.36031 0 4.21596.43597a4 4 0 0 1 1.74806 1.74807C16 3.03969 16 4.15979 16 6.4v3.2c0 2.24021 0 3.36031-.43598 4.21596a4 4 0 0 1-1.74806 1.74806C12.96031 16 11.84021 16 9.6 16H6.4c-2.24021 0-3.36031 0-4.21596-.43598a4 4 0 0 1-1.74807-1.74806C0 12.96031 0 11.84021 0 9.6V6.4c0-2.24021 0-3.36031.43597-4.21596A4 4 0 0 1 2.18404.43597C3.03969 0 4.15979 0 6.4 0Z"
|
|
57
|
+
transform="translate(2 2)"
|
|
58
|
+
fill="none"
|
|
59
|
+
stroke="currentColor"
|
|
60
|
+
stroke-width="1.5"
|
|
61
|
+
stroke-miterlimit="10"
|
|
62
|
+
fill-rule="evenodd"
|
|
63
|
+
/>
|
|
64
|
+
<path d="M0.5 0L0.5 20" transform="translate(5.5 0)" fill="none" stroke="currentColor" stroke-width="1" stroke-dasharray="1 1" />
|
|
65
|
+
<path d="M0.5 0L0.5 20" transform="translate(9.5 0)" fill="none" stroke="currentColor" stroke-width="1" stroke-dasharray="1 1" />
|
|
66
|
+
<path d="M0.5 0L0.5 20" transform="translate(13.5 0)" fill="none" stroke="currentColor" stroke-width="1" stroke-dasharray="1 1" />
|
|
67
|
+
</svg>`,xr=`
|
|
68
|
+
<svg viewBox="0 0 20 20" aria-hidden="true">
|
|
69
|
+
<path
|
|
70
|
+
d="M10.36197.32698A4 4 0 0 1 11.67302 1.63803c.2394.46984.25416.75823.4174 1.06004a4 4 0 0 0 1.21135 1.2114c.30177.16324.59023.17804 1.0602.41751A4 4 0 0 1 15.67302 5.63803C16 6.27976 16 7.11984 16 8.8v2.4c0 1.68016 0 2.52024-.32698 3.16197a4 4 0 0 1-1.31105 1.31105C13.72024 16 12.88016 16 11.2 16H8.8c-1.68016 0-2.52024 0-3.16197-.32698a4 4 0 0 1-1.31105-1.31105c-.23941-.46987-.25415-.75828-.41748-1.06022a4 4 0 0 0-1.2114-1.2113c-.30182-.16326-.59021-.17803-1.06007-.41743A4 4 0 0 1 .32698 10.36197C0 9.72024 0 8.88016 0 7.2V4.8c0-1.68016 0-2.52024.32698-3.16197A4 4 0 0 1 1.63803.32698C2.27976 0 3.11984 0 4.8 0h2.4C8.88016 0 9.72024 0 10.36197.32698Z"
|
|
71
|
+
transform="translate(2 2)"
|
|
72
|
+
fill="none"
|
|
73
|
+
stroke="currentColor"
|
|
74
|
+
stroke-width="1.5"
|
|
75
|
+
stroke-miterlimit="10"
|
|
76
|
+
fill-rule="evenodd"
|
|
77
|
+
/>
|
|
78
|
+
<path
|
|
79
|
+
d="M4.8 0h2.4C8.88016 0 9.72024 0 10.36197.32698A4 4 0 0 1 11.67302 1.63803C12 2.27976 12 3.11984 12 4.8v2.4c0 1.68016 0 2.52024-.32698 3.16197a4 4 0 0 1-1.31105 1.31105C9.72024 12 8.88016 12 7.2 12H4.8c-1.68016 0-2.52024 0-3.16197-.32698A4 4 0 0 1 .32698 10.36197C0 9.72024 0 8.88016 0 7.2V4.8c0-1.68016 0-2.52024.32698-3.16197A4 4 0 0 1 1.63803.32698C2.27976 0 3.11984 0 4.8 0Z"
|
|
80
|
+
transform="translate(2 2)"
|
|
81
|
+
fill="none"
|
|
82
|
+
stroke="currentColor"
|
|
83
|
+
stroke-width="1.3"
|
|
84
|
+
fill-rule="evenodd"
|
|
85
|
+
/>
|
|
86
|
+
<path
|
|
87
|
+
d="M4.8 0h2.4C8.88016 0 9.72024 0 10.36197.32698A4 4 0 0 1 11.67302 1.63803C12 2.27976 12 3.11984 12 4.8v2.4c0 1.68016 0 2.52024-.32698 3.16197a4 4 0 0 1-1.31105 1.31105C9.72024 12 8.88016 12 7.2 12H4.8c-1.68016 0-2.52024 0-3.16197-.32698A4 4 0 0 1 .32698 10.36197C0 9.72024 0 8.88016 0 7.2V4.8c0-1.68016 0-2.52024.32698-3.16197A4 4 0 0 1 1.63803.32698C2.27976 0 3.11984 0 4.8 0Z"
|
|
88
|
+
transform="translate(6 6)"
|
|
89
|
+
fill="none"
|
|
90
|
+
stroke="currentColor"
|
|
91
|
+
stroke-width="1.3"
|
|
92
|
+
fill-rule="evenodd"
|
|
93
|
+
/>
|
|
94
|
+
<circle cx="10" cy="10" r="2" fill="currentColor" />
|
|
95
|
+
</svg>`,Er=`
|
|
96
|
+
<svg viewBox="0 0 20 20" aria-hidden="true">
|
|
97
|
+
<path
|
|
98
|
+
d="M5 3v9.4c0 .56005 0 .84008-.109 1.05399a2 2 0 0 1-.43702.56201 2 2 0 0 1-.56202.437c-.21391.109-.49394.109-1.05398.109H3c-.93188 0-1.39782 0-1.76537-.15224a3 3 0 0 1-1.01664-.93978C0 13.14553 0 12.58547 0 11.46537V3.2c0-1.1201 0-1.68016.21799-2.10798A3 3 0 0 1 1.09202.21799C1.51984 0 2.0799 0 3.2 0h7.6c1.1201 0 1.68016 0 2.10798.21799a3 3 0 0 1 .93978 1.01664C14 1.60218 14 2.06812 14 3v.4c0 .56005 0 .84008-.109 1.05399a2 2 0 0 1-.43701.56202c-.21392.109-.49395.109-1.05399.109H7"
|
|
99
|
+
transform="translate(3 3)"
|
|
100
|
+
fill="none"
|
|
101
|
+
stroke="currentColor"
|
|
102
|
+
stroke-width="1.5"
|
|
103
|
+
stroke-miterlimit="10"
|
|
104
|
+
fill-rule="evenodd"
|
|
105
|
+
/>
|
|
106
|
+
<path d="M2 0.5H0" transform="translate(6 7.5)" fill="none" stroke="currentColor" stroke-width="1" />
|
|
107
|
+
<path d="M2 0.5H0" transform="translate(6 12.5)" fill="none" stroke="currentColor" stroke-width="1" />
|
|
108
|
+
<path d="M0.5 2V0" transform="translate(12.5 6)" fill="none" stroke="currentColor" stroke-width="1" />
|
|
109
|
+
</svg>`,Mr=`
|
|
110
|
+
<svg viewBox="0 0 20 20" aria-hidden="true">
|
|
111
|
+
<path d="M4 7.5H16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
|
|
112
|
+
<path d="M4 12.5H16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
|
|
113
|
+
<path d="M10 2.5V17.5" fill="none" stroke="currentColor" stroke-width="1" stroke-dasharray="1.4 1.4" />
|
|
114
|
+
<path d="M7.5 4.5L10 2L12.5 4.5" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" />
|
|
115
|
+
<path d="M7.5 15.5L10 18L12.5 15.5" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" />
|
|
116
|
+
</svg>`,wr=`
|
|
117
|
+
<svg viewBox="0 0 16 16" aria-hidden="true">
|
|
118
|
+
<path d="M5 3.5H11" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" />
|
|
119
|
+
<path d="M5 12.5H11" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" />
|
|
120
|
+
<path d="M8 1.5V14.5" fill="none" stroke="currentColor" stroke-width="1" stroke-dasharray="1.2 1.2" />
|
|
121
|
+
<path d="M6.2 5.2L8 3.4L9.8 5.2" fill="none" stroke="currentColor" stroke-width="1.1" stroke-linecap="round" stroke-linejoin="round" />
|
|
122
|
+
<path d="M6.2 10.8L8 12.6L9.8 10.8" fill="none" stroke="currentColor" stroke-width="1.1" stroke-linecap="round" stroke-linejoin="round" />
|
|
123
|
+
</svg>`,Tr=`
|
|
124
|
+
<svg viewBox="0 0 20 20" aria-hidden="true">
|
|
125
|
+
<path
|
|
126
|
+
d="M6.4 0h3.2c2.24021 0 3.36031 0 4.21596.43597a4 4 0 0 1 1.74806 1.74807C16 3.03969 16 4.15979 16 6.4v3.2c0 2.24021 0 3.36031-.43598 4.21596a4 4 0 0 1-1.74806 1.74806C12.96031 16 11.84021 16 9.6 16H6.4c-2.24021 0-3.36031 0-4.21596-.43598a4 4 0 0 1-1.74807-1.74806C0 12.96031 0 11.84021 0 9.6V6.4c0-2.24021 0-3.36031.43597-4.21596A4 4 0 0 1 2.18404.43597C3.03969 0 4.15979 0 6.4 0Z"
|
|
127
|
+
transform="translate(2 2)"
|
|
128
|
+
fill="none"
|
|
129
|
+
stroke="currentColor"
|
|
130
|
+
stroke-width="1.5"
|
|
131
|
+
stroke-miterlimit="10"
|
|
132
|
+
fill-rule="evenodd"
|
|
133
|
+
/>
|
|
134
|
+
<path
|
|
135
|
+
d="M0 6.5L2.9 4.2L5.3 5.8L8.6 2.1"
|
|
136
|
+
transform="translate(5.6 7)"
|
|
137
|
+
fill="none"
|
|
138
|
+
stroke="currentColor"
|
|
139
|
+
stroke-width="1.3"
|
|
140
|
+
stroke-linecap="round"
|
|
141
|
+
stroke-linejoin="round"
|
|
142
|
+
/>
|
|
143
|
+
<path
|
|
144
|
+
d="M0 0.5H9.5"
|
|
145
|
+
transform="translate(5.25 13.25)"
|
|
146
|
+
fill="none"
|
|
147
|
+
stroke="currentColor"
|
|
148
|
+
stroke-width="1.1"
|
|
149
|
+
stroke-linecap="round"
|
|
150
|
+
/>
|
|
151
|
+
</svg>`,Le=`
|
|
152
|
+
<svg viewBox="0 0 12 12" aria-hidden="true">
|
|
153
|
+
<path
|
|
154
|
+
d="M2.25 7.5L6 4.25L9.75 7.5"
|
|
155
|
+
fill="none"
|
|
156
|
+
stroke="currentColor"
|
|
157
|
+
stroke-width="1.5"
|
|
158
|
+
stroke-linecap="round"
|
|
159
|
+
stroke-linejoin="round"
|
|
160
|
+
/>
|
|
161
|
+
</svg>`;var ni={"--string-dev-panel-bg":"#ffffff","--string-dev-panel-border":"1px solid #e0e0e0","--string-dev-panel-radius":"16px","--string-dev-panel-shadow":"0 16px 24px rgba(0, 0, 0, 0.1)","--string-dev-panel-backdrop":"blur(12px)","--string-dev-panel-padding":"4px","--string-dev-panel-font-family":'-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',"--string-dev-panel-font-size":"12px","--string-dev-panel-text":"#111111","--string-dev-panel-muted":"rgba(17, 17, 17, 0.6)","--string-dev-panel-subtle":"rgba(17, 17, 17, 0.72)","--string-dev-panel-divider":"rgba(17, 17, 17, 0.08)","--string-dev-header-font-size":"10px","--string-dev-header-font-weight":"500","--string-dev-header-letter-spacing":"0","--string-dev-header-padding":"8px 8px 8px","--string-dev-header-margin-bottom":"4px","--string-dev-accent":"#FF4F36","--string-dev-accent-soft":"rgba(255, 79, 54, 0.12)","--string-dev-accent-soft-hover":"rgba(255, 79, 54, 0.18)","--string-dev-focus-color":"rgba(255, 79, 54, 0.68)","--string-dev-focus-shadow":"0 0 0 2px rgba(255, 79, 54, 0.18)","--string-dev-field-bg":"rgba(221, 221, 221, 0.4)","--string-dev-field-border":"rgba(255, 255, 255, 0.96)","--string-dev-field-radius":"8px","--string-dev-input-height":"32px","--string-dev-button-height":"32px","--string-dev-chip-size":"24px","--string-dev-icon-button-size":"20px","--string-dev-icon-button-radius":"8px","--string-dev-chip-active-bg":"rgba(221, 221, 221, 0.54)","--string-dev-chip-muted":"rgba(17, 17, 17, 0.22)","--string-dev-chip-resolved":"rgba(17, 17, 17, 0.78)","--string-dev-icon-button-hover-bg":"rgba(17, 17, 17, 0.08)"};function si(u,e){return u.trim().split(`
|
|
162
|
+
`).map(t=>`${e}${t}`).join(`
|
|
163
|
+
`)}function Ot(u,e={}){let t=Array.isArray(u)?u.join(`,
|
|
164
|
+
`):u,r={...ni,...e},i=Object.entries(r).map(([n,s])=>`${n}: ${s};`).join(`
|
|
165
|
+
`);return`${t} {
|
|
166
|
+
${si(i," ")}
|
|
167
|
+
}`}function Oe(){if(typeof document>"u")return null;let u="string-devtools-shared-styles",e=document.getElementById(u);if(e instanceof HTMLStyleElement)return e;let t=document.createElement("style");return t.id=u,t.textContent=`
|
|
168
|
+
${Ot("[data-string-devtools-theme]")}
|
|
169
|
+
|
|
170
|
+
[data-string-devtools-panel],
|
|
171
|
+
[data-string-devtools-button],
|
|
172
|
+
[data-string-devtools-icon-button],
|
|
173
|
+
[data-string-devtools-chip],
|
|
174
|
+
[data-string-devtools-text-input] {
|
|
175
|
+
box-sizing: border-box;
|
|
176
|
+
font-family: var(--string-dev-panel-font-family);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
[data-string-devtools-panel] {
|
|
180
|
+
position: relative;
|
|
181
|
+
background: var(--string-dev-panel-bg);
|
|
182
|
+
backdrop-filter: var(--string-dev-panel-backdrop);
|
|
183
|
+
border: var(--string-dev-panel-border);
|
|
184
|
+
border-radius: var(--string-dev-panel-radius);
|
|
185
|
+
padding: var(--string-dev-panel-padding);
|
|
186
|
+
font-size: var(--string-dev-panel-font-size);
|
|
187
|
+
color: var(--string-dev-panel-text);
|
|
188
|
+
box-shadow: var(--string-dev-panel-shadow);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
[data-string-devtools-panel-header] {
|
|
192
|
+
display: grid;
|
|
193
|
+
grid-template-columns: 16px minmax(0, 1fr) 16px;
|
|
194
|
+
align-items: center;
|
|
195
|
+
column-gap: 8px;
|
|
196
|
+
padding: var(--string-dev-header-padding);
|
|
197
|
+
margin-bottom: var(--string-dev-header-margin-bottom);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
[data-string-devtools-panel-title] {
|
|
201
|
+
display: block;
|
|
202
|
+
grid-column: 2;
|
|
203
|
+
justify-self: center;
|
|
204
|
+
min-width: 0;
|
|
205
|
+
font-size: var(--string-dev-header-font-size);
|
|
206
|
+
font-weight: var(--string-dev-header-font-weight);
|
|
207
|
+
color: var(--string-dev-panel-text);
|
|
208
|
+
letter-spacing: var(--string-dev-header-letter-spacing);
|
|
209
|
+
line-height: 1.2;
|
|
210
|
+
text-align: center;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
[data-string-devtools-panel-icon] {
|
|
214
|
+
width: 16px;
|
|
215
|
+
height: 16px;
|
|
216
|
+
display: inline-flex;
|
|
217
|
+
align-items: center;
|
|
218
|
+
justify-content: center;
|
|
219
|
+
color: var(--string-dev-panel-text);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
[data-string-devtools-panel-icon] svg {
|
|
223
|
+
width: 16px;
|
|
224
|
+
height: 16px;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
[data-string-devtools-icon-button] {
|
|
228
|
+
width: var(--string-dev-icon-button-size);
|
|
229
|
+
height: var(--string-dev-icon-button-size);
|
|
230
|
+
padding: 0;
|
|
231
|
+
border: 0;
|
|
232
|
+
border-radius: var(--string-dev-icon-button-radius);
|
|
233
|
+
background: transparent;
|
|
234
|
+
color: var(--string-dev-panel-muted);
|
|
235
|
+
display: inline-flex;
|
|
236
|
+
align-items: center;
|
|
237
|
+
justify-content: center;
|
|
238
|
+
appearance: none;
|
|
239
|
+
cursor: pointer;
|
|
240
|
+
transition:
|
|
241
|
+
background 0.15s ease,
|
|
242
|
+
color 0.15s ease,
|
|
243
|
+
opacity 0.15s ease,
|
|
244
|
+
box-shadow 0.15s ease;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
[data-string-devtools-icon-button] svg {
|
|
248
|
+
width: 16px;
|
|
249
|
+
height: 16px;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
[data-string-devtools-icon-button]:hover,
|
|
253
|
+
[data-string-devtools-icon-button]:focus-visible {
|
|
254
|
+
background: var(--string-dev-icon-button-hover-bg);
|
|
255
|
+
color: var(--string-dev-panel-text);
|
|
256
|
+
outline: none;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
[data-string-devtools-button] {
|
|
260
|
+
min-height: var(--string-dev-button-height);
|
|
261
|
+
width: auto;
|
|
262
|
+
padding: 0 8px;
|
|
263
|
+
border: 1px solid var(--string-dev-field-border);
|
|
264
|
+
border-radius: var(--string-dev-field-radius);
|
|
265
|
+
background: var(--string-dev-field-bg);
|
|
266
|
+
color: var(--string-dev-panel-text);
|
|
267
|
+
font-size: var(--string-dev-panel-font-size);
|
|
268
|
+
font-weight: 500;
|
|
269
|
+
display: inline-flex;
|
|
270
|
+
align-items: center;
|
|
271
|
+
justify-content: center;
|
|
272
|
+
gap: 8px;
|
|
273
|
+
appearance: none;
|
|
274
|
+
cursor: pointer;
|
|
275
|
+
transition:
|
|
276
|
+
background 0.15s ease,
|
|
277
|
+
color 0.15s ease,
|
|
278
|
+
border-color 0.15s ease,
|
|
279
|
+
box-shadow 0.15s ease;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
[data-string-devtools-button][data-full-width="true"] {
|
|
283
|
+
width: 100%;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
[data-string-devtools-button]:hover,
|
|
287
|
+
[data-string-devtools-button]:focus-visible {
|
|
288
|
+
background: color-mix(in srgb, var(--string-dev-field-bg) 78%, #ffffff 22%);
|
|
289
|
+
border-color: color-mix(in srgb, var(--string-dev-field-border) 72%, var(--string-dev-panel-text) 28%);
|
|
290
|
+
outline: none;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
[data-string-devtools-button]:focus-visible {
|
|
294
|
+
box-shadow: var(--string-dev-focus-shadow);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
[data-string-devtools-text-input] {
|
|
298
|
+
min-height: var(--string-dev-input-height);
|
|
299
|
+
width: 100%;
|
|
300
|
+
padding: 0 10px;
|
|
301
|
+
border: 1px solid var(--string-dev-field-border);
|
|
302
|
+
border-radius: var(--string-dev-field-radius);
|
|
303
|
+
background: var(--string-dev-field-bg);
|
|
304
|
+
color: var(--string-dev-panel-text);
|
|
305
|
+
font-size: var(--string-dev-panel-font-size);
|
|
306
|
+
font-weight: 500;
|
|
307
|
+
outline: none;
|
|
308
|
+
appearance: none;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
[data-string-devtools-text-input]:focus {
|
|
312
|
+
border-color: var(--string-dev-focus-color);
|
|
313
|
+
box-shadow: var(--string-dev-focus-shadow);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
[data-string-devtools-chip] {
|
|
317
|
+
width: var(--string-dev-chip-size);
|
|
318
|
+
height: var(--string-dev-chip-size);
|
|
319
|
+
padding: 0;
|
|
320
|
+
border: 0;
|
|
321
|
+
border-radius: var(--string-dev-field-radius);
|
|
322
|
+
background: transparent;
|
|
323
|
+
color: var(--string-dev-chip-muted);
|
|
324
|
+
display: inline-flex;
|
|
325
|
+
align-items: center;
|
|
326
|
+
justify-content: center;
|
|
327
|
+
appearance: none;
|
|
328
|
+
cursor: pointer;
|
|
329
|
+
transition: background 0.15s ease, color 0.15s ease;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
[data-string-devtools-chip] svg {
|
|
333
|
+
width: 18px;
|
|
334
|
+
height: 18px;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
[data-string-devtools-chip]:hover,
|
|
338
|
+
[data-string-devtools-chip]:focus-visible {
|
|
339
|
+
background: var(--string-dev-icon-button-hover-bg);
|
|
340
|
+
color: var(--string-dev-panel-text);
|
|
341
|
+
outline: none;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
[data-string-devtools-chip][data-selected="true"],
|
|
345
|
+
[data-string-devtools-chip][data-open="true"],
|
|
346
|
+
[data-string-devtools-chip][data-active="true"] {
|
|
347
|
+
background: var(--string-dev-chip-active-bg);
|
|
348
|
+
color: var(--string-dev-accent);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
[data-string-devtools-chip][data-selected="false"][data-resolved="true"] {
|
|
352
|
+
color: var(--string-dev-chip-resolved);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/* Standardized Overlay HUD System */
|
|
356
|
+
[data-string-devtools-overlay-chrome] {
|
|
357
|
+
position: absolute;
|
|
358
|
+
top: 0;
|
|
359
|
+
left: 0;
|
|
360
|
+
width: 28px;
|
|
361
|
+
height: 28px;
|
|
362
|
+
pointer-events: none;
|
|
363
|
+
overflow: visible;
|
|
364
|
+
z-index: 10010;
|
|
365
|
+
will-change: transform;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
[data-string-devtools-overlay-chrome][hidden],
|
|
369
|
+
[data-string-devtools-overlay-badge][hidden] {
|
|
370
|
+
display: none !important;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
[data-string-devtools-overlay-badge] {
|
|
374
|
+
position: absolute;
|
|
375
|
+
top: 0;
|
|
376
|
+
left: 0;
|
|
377
|
+
width: 28px;
|
|
378
|
+
height: 28px;
|
|
379
|
+
padding: 0;
|
|
380
|
+
border: 1px solid rgba(255, 255, 255, 0.92);
|
|
381
|
+
border-radius: 6px;
|
|
382
|
+
background: rgba(255, 255, 255, 0.85);
|
|
383
|
+
color: var(--string-dev-panel-text);
|
|
384
|
+
backdrop-filter: blur(4px);
|
|
385
|
+
-webkit-backdrop-filter: blur(4px);
|
|
386
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
|
|
387
|
+
display: flex;
|
|
388
|
+
align-items: center;
|
|
389
|
+
justify-content: center;
|
|
390
|
+
cursor: pointer;
|
|
391
|
+
pointer-events: auto;
|
|
392
|
+
transition: background 0.15s ease, opacity 0.2s ease, box-shadow 0.15s ease, color 0.15s ease;
|
|
393
|
+
will-change: transform;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
[data-string-devtools-overlay-badge]:hover,
|
|
397
|
+
[data-string-devtools-overlay-badge]:focus-visible {
|
|
398
|
+
background: rgba(255, 255, 255, 1);
|
|
399
|
+
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
|
|
400
|
+
outline: none;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
[data-string-devtools-overlay-badge]:focus-visible {
|
|
404
|
+
border-color: var(--string-dev-focus-color);
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
[data-string-devtools-overlay-badge][data-active="false"] {
|
|
408
|
+
background: rgba(236, 236, 236, 0.5);
|
|
409
|
+
border-color: rgba(236, 236, 236, 0.65);
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
[data-string-devtools-overlay-badge] svg {
|
|
413
|
+
width: 16px;
|
|
414
|
+
height: 16px;
|
|
415
|
+
display: block;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
[data-string-devtools-overlay-panel] {
|
|
419
|
+
position: absolute;
|
|
420
|
+
top: 0;
|
|
421
|
+
left: calc(100% + 8px);
|
|
422
|
+
width: 208px;
|
|
423
|
+
opacity: 0;
|
|
424
|
+
transform: translateY(4px);
|
|
425
|
+
pointer-events: none;
|
|
426
|
+
transition: opacity 0.2s ease, transform 0.2s ease;
|
|
427
|
+
z-index: 10;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
[data-string-devtools-overlay-panel][data-open="true"] {
|
|
431
|
+
opacity: 1;
|
|
432
|
+
transform: translateY(0);
|
|
433
|
+
pointer-events: auto;
|
|
434
|
+
}
|
|
435
|
+
`,document.head.appendChild(t),t}var Cr="string-devtools:dock",De=class{constructor(){this.entries=new Map;this.collapsed=!1;Oe(),this.preferences=this.loadPreferences(),this.injectStyles(),this.root=document.createElement("div"),this.root.setAttribute("data-string-devtools-dock",""),this.root.setAttribute("data-string-devtools-theme",""),this.root.setAttribute("data-collapsed",this.preferences.collapsed?"true":"false"),this.mainButton=this.createMainButton(),this.itemsWrap=document.createElement("div"),this.itemsWrap.setAttribute("data-string-devtools-items",""),this.fpsElement=document.createElement("div"),this.fpsElement.setAttribute("data-string-devtools-fps",""),this.fpsElement.title="Current FPS",this.fpsElement.textContent="0",this.root.appendChild(this.mainButton),this.itemsWrap.appendChild(this.fpsElement),this.root.appendChild(this.itemsWrap),(document.body??document.documentElement).appendChild(this.root),this.setCollapsed(this.preferences.collapsed,!1)}add(e){if(this.entries.has(e.id))return;this.applyStoredActiveState(e);let t=document.createElement("button");t.type="button",t.setAttribute("data-string-devtools-item",""),t.setAttribute("data-string-devtools-icon-button",""),t.setAttribute("data-devtool-id",e.id),t.setAttribute("aria-label",e.label),t.innerHTML=e.icon,t.title=e.label,t.addEventListener("click",()=>{let n=!e.getState().active;if(e.setActive(n),!e.subscribe){let s=e.getState();this.renderButton(t,e.label,s),this.persistActiveState(e.id,s.active)}});let r=e.subscribe?e.subscribe(n=>{this.renderButton(t,e.label,n),this.persistActiveState(e.id,n.active)}):null;this.entries.set(e.id,{definition:e,button:t,unsubscribe:r}),this.itemsWrap.appendChild(t),this.sortButtons();let i=e.getState();this.renderButton(t,e.label,i),this.persistActiveState(e.id,i.active)}remove(e){let t=this.entries.get(e);t&&(t.unsubscribe?.(),t.button.remove(),this.entries.delete(e))}destroy(){for(let e of this.entries.values())e.unsubscribe?.(),e.button.remove();this.entries.clear(),this.root.remove()}setFPS(e){this.fpsElement.textContent=String(Math.max(0,Math.round(e)))}sortButtons(){let e=Array.from(this.entries.values()).sort((t,r)=>{let i=t.definition.order??0,n=r.definition.order??0;return i!==n?i-n:t.definition.label.localeCompare(r.definition.label)});for(let t of e)this.itemsWrap.appendChild(t.button);this.itemsWrap.appendChild(this.fpsElement)}createMainButton(){let e=document.createElement("button");return e.type="button",e.setAttribute("data-string-devtools-main",""),e.setAttribute("data-string-devtools-icon-button",""),e.setAttribute("aria-label","Collapse developer tools"),e.innerHTML=`
|
|
436
|
+
<span data-string-devtools-main-icon="">${Pe}</span>
|
|
437
|
+
<span data-string-devtools-main-chevron="">${Le}</span>
|
|
438
|
+
`,e.addEventListener("click",()=>{this.setCollapsed(!this.collapsed)}),e}setCollapsed(e,t=!0){this.collapsed=e,this.root.setAttribute("data-collapsed",e?"true":"false"),this.mainButton.setAttribute("aria-label",e?"Expand developer tools":"Collapse developer tools"),t&&(this.preferences.collapsed=e,this.savePreferences())}renderButton(e,t,r){e.setAttribute("data-active",r.active?"true":"false"),e.title=`${t}: ${r.active?"On":"Off"}`}applyStoredActiveState(e){let t=this.preferences.active[e.id];typeof t!="boolean"||t===e.getState().active||e.setActive(t)}persistActiveState(e,t){this.preferences.active[e]=t,this.savePreferences()}loadPreferences(){try{let e=localStorage.getItem(Cr);if(!e)return{collapsed:!1,active:{}};let t=JSON.parse(e);return{collapsed:t.collapsed===!0,active:t.active&&typeof t.active=="object"?t.active:{}}}catch{return{collapsed:!1,active:{}}}}savePreferences(){try{localStorage.setItem(Cr,JSON.stringify(this.preferences))}catch{}}injectStyles(){let e="string-devtools-dock-styles";if(document.getElementById(e))return;let t=document.createElement("style");t.id=e,t.textContent=`
|
|
439
|
+
${Ot("[data-string-devtools-dock]")}
|
|
440
|
+
|
|
441
|
+
[data-string-devtools-dock] {
|
|
442
|
+
font-family: var(--string-dev-panel-font-family);
|
|
443
|
+
--string-devtools-dock-width: 40px;
|
|
444
|
+
--string-devtools-main-size: 30px;
|
|
445
|
+
--string-devtools-top-padding: 5px;
|
|
446
|
+
--string-devtools-bottom-padding: 5px;
|
|
447
|
+
position: fixed;
|
|
448
|
+
left: 24px;
|
|
449
|
+
top: calc(50% - (var(--string-devtools-top-padding) + (var(--string-devtools-main-size) / 2)));
|
|
450
|
+
z-index: 10030;
|
|
451
|
+
display: flex;
|
|
452
|
+
flex-direction: column;
|
|
453
|
+
align-items: center;
|
|
454
|
+
width: var(--string-devtools-dock-width);
|
|
455
|
+
min-height: 40px;
|
|
456
|
+
padding: var(--string-devtools-top-padding) 0 var(--string-devtools-bottom-padding);
|
|
457
|
+
box-shadow: 0 0 0 1px rgba(255, 255, 255, 1) , 0 12px 16px 0 rgba(0, 0, 0, 0.05);
|
|
458
|
+
border-radius: 16px;
|
|
459
|
+
background-color: rgba(255, 255, 255, 1.0);
|
|
460
|
+
|
|
461
|
+
opacity: 0.5;
|
|
462
|
+
|
|
463
|
+
transition:
|
|
464
|
+
opacity 0.3s ease,
|
|
465
|
+
box-shadow 0.3s ease;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
[data-string-devtools-dock]:hover {
|
|
469
|
+
opacity: 1
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
[data-string-devtools-main] {
|
|
473
|
+
width: var(--string-devtools-main-size);
|
|
474
|
+
height: var(--string-devtools-main-size);
|
|
475
|
+
padding: 0;
|
|
476
|
+
border: 0;
|
|
477
|
+
background: transparent;
|
|
478
|
+
color: #101214;
|
|
479
|
+
display: inline-flex;
|
|
480
|
+
align-items: center;
|
|
481
|
+
justify-content: center;
|
|
482
|
+
position: relative;
|
|
483
|
+
cursor: pointer;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
[data-string-devtools-main] svg {
|
|
487
|
+
width: 22px;
|
|
488
|
+
height: 24px;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
[data-string-devtools-main-icon],
|
|
492
|
+
[data-string-devtools-main-chevron] {
|
|
493
|
+
position: absolute;
|
|
494
|
+
inset: 0;
|
|
495
|
+
display: inline-flex;
|
|
496
|
+
align-items: center;
|
|
497
|
+
justify-content: center;
|
|
498
|
+
transition: opacity 0.16s ease, transform 0.16s ease, color 0.16s ease;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
[data-string-devtools-main-icon] {
|
|
502
|
+
opacity: 1;
|
|
503
|
+
transform: scale(1);
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
[data-string-devtools-main-chevron] {
|
|
507
|
+
opacity: 0;
|
|
508
|
+
color: #ff5b4d;
|
|
509
|
+
transform: scale(0.8) translateY(1px);
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
[data-string-devtools-main-chevron] svg {
|
|
513
|
+
width: 12px;
|
|
514
|
+
height: 12px;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
[data-string-devtools-dock]:not([data-collapsed="true"]) [data-string-devtools-main]:hover [data-string-devtools-main-icon] {
|
|
518
|
+
opacity: 0;
|
|
519
|
+
transform: scale(0.82);
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
[data-string-devtools-dock]:not([data-collapsed="true"]) [data-string-devtools-main]:hover [data-string-devtools-main-chevron] {
|
|
523
|
+
opacity: 1;
|
|
524
|
+
transform: scale(1);
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
[data-string-devtools-dock][data-collapsed="true"] [data-string-devtools-main-chevron] {
|
|
528
|
+
transform: rotate(180deg) scale(0.8) translateY(-1px);
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
[data-string-devtools-dock][data-collapsed="true"] [data-string-devtools-main]:hover [data-string-devtools-main-icon] {
|
|
532
|
+
opacity: 0;
|
|
533
|
+
transform: scale(0.82);
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
[data-string-devtools-dock][data-collapsed="true"] [data-string-devtools-main]:hover [data-string-devtools-main-chevron] {
|
|
537
|
+
opacity: 1;
|
|
538
|
+
transform: rotate(180deg) scale(1);
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
[data-string-devtools-items] {
|
|
542
|
+
width: 100%;
|
|
543
|
+
display: flex;
|
|
544
|
+
flex-direction: column;
|
|
545
|
+
align-items: center;
|
|
546
|
+
overflow: hidden;
|
|
547
|
+
max-height: 160px;
|
|
548
|
+
opacity: 1;
|
|
549
|
+
transform: translateY(0);
|
|
550
|
+
transition:
|
|
551
|
+
margin-top 0.22s ease,
|
|
552
|
+
max-height 0.22s ease,
|
|
553
|
+
opacity 0.16s ease,
|
|
554
|
+
transform 0.22s ease;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
[data-string-devtools-dock][data-collapsed="true"] [data-string-devtools-items] {
|
|
558
|
+
margin-top: 0;
|
|
559
|
+
max-height: 0;
|
|
560
|
+
opacity: 0;
|
|
561
|
+
transform: translateY(-6px);
|
|
562
|
+
pointer-events: none;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
[data-string-devtools-item] {
|
|
566
|
+
width: 30px;
|
|
567
|
+
height: 30px;
|
|
568
|
+
padding: 0;
|
|
569
|
+
display: inline-flex;
|
|
570
|
+
align-items: center;
|
|
571
|
+
justify-content: center;
|
|
572
|
+
|
|
573
|
+
background-color: #ffffff;
|
|
574
|
+
border-radius: 8px;
|
|
575
|
+
border: 1px solid transparent;
|
|
576
|
+
|
|
577
|
+
color: rgba(17, 17, 17, 0.25);
|
|
578
|
+
cursor: pointer;
|
|
579
|
+
transition:
|
|
580
|
+
transform 0.15s ease,
|
|
581
|
+
background 0.15s ease,
|
|
582
|
+
color 0.15s ease,
|
|
583
|
+
border-color 0.15s ease,
|
|
584
|
+
box-shadow 0.15s ease;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
[data-string-devtools-item] svg {
|
|
588
|
+
width: 20px;
|
|
589
|
+
height: 20px;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
[data-string-devtools-item]:hover {
|
|
593
|
+
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
[data-string-devtools-item][data-active="true"] {
|
|
597
|
+
border: 1px solid rgba(255, 255, 255, 1);
|
|
598
|
+
background-color: rgba(221, 221, 221, 0.4);
|
|
599
|
+
color: #111111;
|
|
600
|
+
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
[data-string-devtools-item][data-active="true"]:hover {
|
|
604
|
+
background: rgba(17, 17, 17, 0.1);
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
[data-string-devtools-fps] {
|
|
608
|
+
display: inline-flex;
|
|
609
|
+
align-items: center;
|
|
610
|
+
justify-content: center;
|
|
611
|
+
|
|
612
|
+
width: 30px;
|
|
613
|
+
height: 30px;
|
|
614
|
+
|
|
615
|
+
color: #111111;
|
|
616
|
+
font-size: 16px;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
@media (max-width: 768px) {
|
|
620
|
+
[data-string-devtools-dock] {
|
|
621
|
+
--string-devtools-dock-width: 66px;
|
|
622
|
+
--string-devtools-top-padding: 10px;
|
|
623
|
+
--string-devtools-bottom-padding: 12px;
|
|
624
|
+
left: 12px;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
[data-string-devtools-item] {
|
|
628
|
+
width: 44px;
|
|
629
|
+
height: 44px;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
[data-string-devtools-fps] {
|
|
633
|
+
font-size: 20px;
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
`,document.head.appendChild(t)}};var ke=class{constructor(){this.definitions=new Map;this.dock=null}register(e){!e||this.definitions.has(e.id)||(this.definitions.set(e.id,e),this.dock||(this.dock=new De),this.dock.add(e))}setFPS(e){this.dock?.setFPS(e)}destroy(){this.definitions.clear(),this.dock?.destroy(),this.dock=null}};var Ae=class extends M{constructor(e){super(e),this.htmlKey="scroller"}onObjectConnected(e){let t=e.getProperty("scroller-inited");if(t==null||t==""){e.setProperty("scroller-inited","inited");let r=i=>{this.events.emit("wheel",i)};e.setProperty("scroller-wheel-event",r),e.htmlElement.addEventListener("wheel",r)}}onObjectDisconnected(e){e.setProperty("scroller-inited",""),e.htmlElement.removeEventListener("wheel",e.getProperty("scroller-wheel-event"))}};var Ie=class extends M{constructor(t){super(t);this.states=new WeakMap;this.htmlKey="scroll-container",this.attributesToMap.push({key:"lerp",type:"number",fallback:.1})}onObjectConnected(t){super.onObjectConnected(t);let r=t.htmlElement;getComputedStyle(r).overflowY==="visible"&&(r.style.overflowY="auto");let i={current:r.scrollTop,target:r.scrollTop,maxScroll:r.scrollHeight-r.clientHeight,velocity:0,lerp:t.getProperty("lerp")||.1,isDragging:!1,isActive:!1};this.states.set(r,i),r.addEventListener("wheel",n=>this.handleWheel(n,r,i),{passive:!1}),r.addEventListener("scroll",n=>this.onNativeScroll(n,r,i),{passive:!0}),this.measure(r,i)}onObjectDisconnected(t){this.states.delete(t.htmlElement)}onFrame(t){for(let r of this.objectsOnPage){let i=r.htmlElement,n=this.states.get(i);n&&n.isActive&&!n.isDragging&&this.updateScroll(i,n)}}onResize(){for(let t of this.objectsOnPage){let r=t.htmlElement,i=this.states.get(r);i&&this.measure(r,i)}}measure(t,r){r.maxScroll=t.scrollHeight-t.clientHeight}handleWheel(t,r,i){let n=t.deltaY,s=n<0,o=n>0,a=i.target<=.1,l=i.target>=i.maxScroll-.1;s&&a||o&&l||(t.preventDefault(),t.stopPropagation(),i.target+=n,i.target=Math.max(0,Math.min(i.target,i.maxScroll)),i.isActive=!0,i.isDragging=!1)}onWheel(t){}onNativeScroll(t,r,i){i.isActive||(i.current=r.scrollTop,i.target=r.scrollTop)}updateScroll(t,r){let i=r.target-r.current;Math.abs(i)<.1?(r.current=r.target,r.isActive=!1):r.current+=i*r.lerp,t.scrollTop=r.current}};function Pr(u){let e=u.match(/([^[]+)\[([\d.]+)-([\d.]+)\]/);return e?{id:e[1],start:parseFloat(e[2]),end:parseFloat(e[3])}:null}function oi(u,e,t,r,i){return r+(i-r)*(u-e)/(t-e)}var Re=class extends M{constructor(e){super(e),this.htmlKey="progress-part",this.attributesToMap=[...this.attributesToMap,{key:"part-of",type:"string",fallback:""}]}onObjectConnected(e){let t=e.getProperty("part-of"),r=Pr(t);if(r){e.setProperty("part-of-id",r.id),e.setProperty("start",r.start),e.setProperty("end",r.end);let i=n=>{if(r){let s=oi(n,r?.start,r?.end,0,1),o=Math.max(0,Math.min(1,s));e.htmlElement.style.setProperty("--progress-slice",o.toString()),this.events.emit(this.getObjectEventName(e,"object:progress-slice"),o)}};e.setProperty("progress-event",i),this.events.on(`object:progress:${r.id}`,i)}}onObjectDisconnected(e){let t=e.getProperty("part-of-id");t&&this.events.off(`object:progress:${t}`,e.getProperty("progress-event"))}};var ai=(u,e)=>{let t=Math.min(u,e),r=Math.max(u,e);return t+Math.random()*(r-t)},li=(u,e)=>{let t=Math.ceil(Math.min(u,e)),r=Math.floor(Math.max(u,e));return r<t?t:Math.floor(Math.random()*(r-t+1))+t},ci=u=>{if(Array.isArray(u)&&u.length>=2){let e=Number(u[0]),t=Number(u[1]);if(Number.isFinite(e)&&Number.isFinite(t))return[e,t]}return typeof u=="number"&&Number.isFinite(u)?[0,u]:[0,1]},Fe=class extends M{constructor(e){super(e),this.htmlKey="random",this.attributesToMap.push({key:"random-number",type:"json",fallback:"[0,1]"}),this.attributesToMap.push({key:"random-type",type:"string",fallback:"int"})}onObjectConnected(e){let t=e.htmlElement,r=ci(e.getProperty("random-number")),n=String(e.getProperty("random-type")??"float").toLowerCase()==="int"?li(r[0],r[1]):ai(r[0],r[1]);x.run(()=>{x.setVars(t,{"--random":n})})}};var He="http://www.w3.org/2000/svg",Ne=class{clear(e,t){let r=e.querySelector(`[data-grid-id="${t}"]`);r&&r.remove()}getGroup(e,t){let r=e.querySelector(`[data-grid-id="${t}"]`);return r||(r=document.createElementNS(He,"g"),r.setAttribute("data-grid-id",t),e.appendChild(r)),r}createLine(e,t,r,i,n,s,o=1){let a=document.createElementNS(He,"line");return a.setAttribute("data-string-grid-shape","line"),a.setAttribute("x1",String(e)),a.setAttribute("y1",String(t)),a.setAttribute("x2",String(r)),a.setAttribute("y2",String(i)),a.setAttribute("stroke",n),a.setAttribute("stroke-opacity",String(s)),a.setAttribute("stroke-width",String(o)),a}createRect(e,t,r,i,n,s){let o=document.createElementNS(He,"rect");return o.setAttribute("data-string-grid-shape","rect"),o.setAttribute("x",String(e)),o.setAttribute("y",String(t)),o.setAttribute("width",String(r)),o.setAttribute("height",String(i)),o.setAttribute("fill",n),o.setAttribute("fill-opacity",String(s)),o}resolveUnit(e,t,r,i){let n=parseFloat(getComputedStyle(document.documentElement).fontSize)||16,s=i instanceof Element&&parseFloat(getComputedStyle(i).fontSize)||n;switch(t){case"%":return e/100*r;case"vw":return e/100*window.innerWidth;case"vh":return e/100*window.innerHeight;case"em":return e*s;case"rem":return e*n;default:return e}}createPath(e,t,r,i=1,n="none"){let s=document.createElementNS(He,"path");return s.setAttribute("data-string-grid-shape","path"),s.setAttribute("d",e),s.setAttribute("stroke",t),s.setAttribute("stroke-opacity",String(r)),s.setAttribute("stroke-width",String(i)),s.setAttribute("fill",n),s}};var Ve=class Ve{constructor(){this.icons=new Map;this.register("main",Pe),this.register("grid",Sr),this.register("inview",xr),this.register("rulers",Er),this.register("offsets",Mr),this.register("offsets-badge",wr),this.register("progress",Tr),this.register("chevron",Le)}static getInstance(){return this.instance||(this.instance=new Ve),this.instance}register(e,t){this.icons.set(e,t)}get(e){return this.icons.get(e)??null}resolve(e){return this.icons.get(e)??e}};Ve.instance=null;var Ye=Ve;function Lr(u){return Ye.getInstance().resolve(u)}function Or(u){return typeof u=="object"&&u!==null&&"getDevtoolDefinition"in u&&typeof u.getDevtoolDefinition=="function"}function ui(){return"ontouchstart"in window||navigator.maxTouchPoints>0}var Ge=class u{constructor(){this.pendingScroll=!1;this.lastScrollEmitted=NaN;this.observerContainerMutation=null;this.pendingResizeRaf=null;this.pendingResizeForce=!1;this.prevWidth=0;this.prevHeight=0;this.loop=new Se;this.devtoolsFpsLastSampleTime=0;this.devtoolsFpsFrameCount=0;this.observerContainerResize=null;this.canRebuild=!0;this.debouncedResize=br(()=>{this.queueResize(!1)},30);this.root=document.body,this.window=window,this.tools=new Gt,this.data=new ht,this.eventManager=new st,this.moduleManager=new At(this.data),this.objectManager=new Ft(this.data,this.moduleManager,this.eventManager,this.tools),this.centers=new Te,this.hoverManager=new Ce,this.devtools=new ke,this.context={events:this.eventManager,data:this.data,tools:this.tools,settings:{},centers:this.centers,hover:this.hoverManager,objectManager:this.objectManager},this.cursorController=new kt(1,this.context),this.scrollManager=new _t(this.context),this.setupSettings({"global-class":!1,"offset-top":"0%","offset-bottom":"0%",key:"--progress","inview-top":"0%","inview-bottom":"0%","enter-el":"top","enter-vp":"bottom","exit-el":"bottom","exit-vp":"top","parallax-bias":"0.0",parallax:"0.2",lerp:"0.2","cursor-lerp":"0.75",radius:"150",strength:"0.3",glide:"1",anchor:"center center",timeout:900,alignment:"center","target-disable":"false","target-style-disable":"false","target-class":"",active:"false",fixed:"false",repeat:"false","self-disable":"false",abs:"false",easing:"cubic-bezier(0.25, 0.25, 0.25, 0.25)","glide-base-velocity":.00125,"glide-reduce-velocity":625e-7,"glide-negative-velocity":-1e-4,"position-strength":3,"position-tension":.05,"position-friction":.15,"position-max-velocity":10,"position-update-threshold":.1,"rotation-strength":.75,"rotation-tension":.06,"rotation-friction":.18,"rotation-max-angular-velocity":6,"rotation-max-angle":18,"rotation-update-threshold":.15,"max-offset":220,"sleep-epsilon":.01,"continuous-push":!0}),this.onContainerTransitionEndBind=this.onContainerTransitionEnd.bind(this),this.onResizeObserverBind=this.onResizeObserverEvent.bind(this),this.observerContainerResize=new ResizeObserver(this.onResizeObserverBind),this.observerContainerResize.observe(this.context.data.scroll.container),this.onWheelBind=this.onWheelEvent.bind(this),this.onScrollBind=this.onScrollEvent.bind(this),this.onResizeBind=()=>{this.queueResize(!1)},this.onMouseMoveBind=this.onMouseMoveEvent.bind(this),this.onScrollStartBind=this.onScrollStart.bind(this),this.onScrollStopBind=this.onScrollStop.bind(this),this.onDirectionChangeBind=this.onDirectionChange.bind(this),this.onScrollToBind=this.scrollTo.bind(this),this.onDOMChangedBind=this.onDOMChanged.bind(this),this.eventManager.on("wheel",this.onWheelBind),this.eventManager.on("resize",this.onResizeBind),this.eventManager.on("scrollTo",this.onScrollToBind),this.eventManager.on("dom:changed",this.onDOMChangedBind),this.scrollManager.bindEvents({onScrollStart:this.onScrollStartBind,onScrollStop:this.onScrollStopBind,onDirectionChange:this.onDirectionChangeBind}),this.loop.setOnFrame(e=>{this.data.time.delta=e-this.data.time.now,this.data.time.previous=this.data.time.now,this.data.time.now=e,this.data.time.elapsed+=this.data.time.delta,this.onUpdateEvent(),this.updateDevtoolsFPS(e)}),this.on("image:load:all",()=>{this.onResize()}),this.scrollContainer=window}set scrollPosition(e){this.data.scroll.current=e,this.data.scroll.target=e,this.data.scroll.transformedCurrent=this.data.scroll.current*this.data.viewport.transformScale,this.data.scroll.delta=0,this.data.scroll.lerped=0,this.scrollManager.updatePosition(),this.moduleManager.onScroll(),this.objectManager.checkInview()}set scrollContainer(e){this.observerContainerResize?.unobserve(this.context.data.scroll.container),this.data.scroll.elementContainer.removeEventListener("transitionend",this.onContainerTransitionEndBind),e instanceof Window?(this.data.scroll.container=document.body,this.data.scroll.elementContainer=document.documentElement,this.data.scroll.scrollContainer=e):e instanceof HTMLElement?(this.data.scroll.container=e,this.data.scroll.elementContainer=e,this.data.scroll.scrollContainer=e):(this.data.scroll.container=document.body,this.data.scroll.elementContainer=document.documentElement,this.data.scroll.scrollContainer=e),this.data.scroll.elementContainer.addEventListener("transitionend",this.onContainerTransitionEndBind),this.observerContainerResize?.observe(this.context.data.scroll.container),this.observeContainerMutations(),this.queueResize(!0)}get scrollPosition(){return this.data.scroll.current}get scrollHeight(){return this.data.viewport.contentHeight}get containerHeight(){return this.data.viewport.windowHeight}set speed(e){this.data.scroll.speed=e}set speedAccelerate(e){this.data.scroll.speedAccelerate=.1+(.5-.1)*e}set scrollDesktopMode(e){this.scrollManager.setDesktopMode(e)}set scrollMobileMode(e){this.scrollManager.setMobileMode(e)}set FPSTrackerVisible(e){this.data.system.fpsTracker=e,this.eventManager.emit("tracker:fps:visible",e)}set PositionTrackerVisible(e){this.data.system.positionTracker=e,this.eventManager.emit("tracker:position:visible",e)}set domBatcherEnabled(e){this.objectManager.setDOMBatcherEnabled(e)}set intersectionObserverEnabled(e){this.objectManager.setIntersectionObserverEnabled(e)}static getInstance(){return u.i||(u.i=new u),u.i}reuse(e){return this.moduleManager.find(e)}use(e,t=null){let r={...this.context.settings,...t},i=new e({events:this.eventManager,data:this.data,tools:this.tools,settings:r,centers:this.centers,hover:this.hoverManager,objectManager:this.objectManager});this.moduleManager.register(i),Or(i)&&this.devtools.register(i.getDevtoolDefinition())}registerScrollMode(e,t){let r;if(typeof t=="function"&&t.prototype instanceof $){let i=t;r=new i(this.context)}else r=t(this.context);r.name||(r.name=e),this.scrollManager.registerMode(e,r)}on(e,t,r=""){this.eventManager.on(e,t,r)}emit(e,t){this.eventManager.emit(e,t)}off(e,t,r=""){this.eventManager.off(e,t,r)}addScrollMark(e){this.scrollManager.addScrollMark(e)}removeScrollMark(e){this.scrollManager.removeScrollMark(e)}start(e){this.data.scroll.scrollContainer?.addEventListener("scroll",this.onScrollBind),this.data.scroll.container?.addEventListener("wheel",this.onWheelBind,{passive:!1}),window.addEventListener("resize",this.onResizeBind),this.root.addEventListener("mousemove",this.onMouseMoveBind),this.observeContainerMutations(),this.use(ne);let t=window.getComputedStyle(document.documentElement).fontSize,r=parseFloat(t);this.context.data.viewport.baseRem=r,document.documentElement.classList.add("-string"),this.moduleManager.onInit(),this.onResize(),this.initObjects(),this.objectManager.observeDOM(),this.loop.start(e),this.eventManager.emit("start",null)}initObjects(){document.querySelectorAll("[string],[data-string]").forEach(e=>{this.objectManager.add(e)}),document.querySelectorAll("[string-copy-from],[data-string-copy-from]").forEach(e=>{let t=this.tools.domAttribute.process({element:e,key:"copy-from",fallback:""});t&&t.length>0&&this.objectManager.linkMirror(t,e)}),this.moduleManager.onResize(),this.moduleManager.onScroll(),this.moduleManager.onFrame()}setupSettings(e){this.context.settings={...this.context.settings,...e},this.onSettingsChange({isDesktop:this.data.viewport.windowWidth>1024,widthChanged:!0,heightChanged:!0,scrollHeightChanged:!0,isForceRebuild:!1})}onResizeObserverEvent(){this.debouncedResize()}onContainerTransitionEnd(e){e.target===this.context.data.scroll.container&&this.queueResize(!0)}onDOMChanged(){this.queueResize(!1),this.debouncedResize()}observeContainerMutations(){this.observerContainerMutation?.disconnect();let e=this.context.data.scroll.container;e&&(this.observerContainerMutation=new MutationObserver(t=>{for(let r=0;r<t.length;r++){let i=t[r];if(i.type==="attributes"&&(i.attributeName==="style"||i.attributeName==="class")){this.queueResize(!1),this.debouncedResize();break}}}),this.observerContainerMutation.observe(e,{attributes:!0,attributeFilter:["style","class"]}))}queueResize(e=!1){e&&(this.pendingResizeForce=!0),this.pendingResizeRaf==null&&(this.pendingResizeRaf=requestAnimationFrame(()=>{this.pendingResizeRaf=null;let t=this.pendingResizeForce;this.pendingResizeForce=!1,this.onResize(t)}))}onMouseMoveEvent(e){this.cursorController.onMouseMove(e),this.moduleManager.onMouseMove(e),_.measure(()=>{this.moduleManager.onMouseMoveMeasure()})}onWheelEvent(e){e.target.closest("[string-isolation],[data-string-isolation]")==null&&(this.scrollManager.get().onWheel(e),this.moduleManager.onWheel(e))}onScrollStart(){this.moduleManager.onScrollStart(),this.eventManager.emit("scroll:start",null)}onScrollStop(){this.moduleManager.onScrollStop(),this.eventManager.emit("scroll:stop",null)}onDirectionChange(){this.moduleManager.onDirectionChange()}onSettingsChange(e){this.cursorController.onSettingsChange(e),this.objectManager.onSettingsChange(e),this.moduleManager.onSettingsChange(e)}onScrollEvent(e){return e.preventDefault(),this.context.centers.invalidateAll(),this.scrollManager.get().onScroll(e),this.pendingScroll=!0,!1}onUpdateEvent(){this.cursorController.onFrame(),this.scrollManager.get().onFrame(),this.moduleManager.onFrame(),(this.pendingScroll||this.data.scroll.current!==this.lastScrollEmitted)&&(this.pendingScroll=!1,this.moduleManager.onScroll(),this.objectManager.checkInview(),this.eventManager.emit("lerp",this.data.scroll.lerped),this.eventManager.emit("scroll",this.data.scroll.current),_.measure(()=>{this.moduleManager.onScrollMeasure()}),this.lastScrollEmitted=this.data.scroll.current),_.mutate(()=>{x.begin(),this.moduleManager.onMutate(),x.commit()}),this.eventManager.emit("update",null),_.flush()}updateDevtoolsFPS(e){this.devtoolsFpsLastSampleTime===0&&(this.devtoolsFpsLastSampleTime=e),this.devtoolsFpsFrameCount+=1;let t=e-this.devtoolsFpsLastSampleTime;if(t<1e3)return;let r=this.devtoolsFpsFrameCount*1e3/t;this.devtools.setFPS(r),this.devtoolsFpsFrameCount=0,this.devtoolsFpsLastSampleTime=e}onResize(e=!1){if(this.canRebuild==!1)return;let t=this.data.scroll.container,r=this.context.data.scroll,i=0,n=0;var s,o=0;let a=t.getBoundingClientRect();t.tagName=="BODY"?(i=window.innerWidth,n=window.innerHeight):(i=a.width,n=a.height),o=t.tagName==="BODY"?0:a.top,s=r.container.scrollHeight;let l=this.tools.transformScaleParser.process({value:window.getComputedStyle(t).transform});this.context.data.viewport.transformScale=window.getComputedStyle(t).scale=="none"?l:Number(window.getComputedStyle(t).scale),this.context.data.scroll.transformedCurrent=this.context.data.scroll.current*this.context.data.viewport.transformScale;let c=ui(),d=i>1024,p=this.prevWidth!==i,h=this.prevHeight!==n,v=Math.abs(this.prevHeight-n),m=this.context.data.viewport.contentHeight!==s,g=p||!c&&h||c&&v>150||m;this.context.data.scroll.topPosition=Math.floor(o),this.context.data.viewport.contentWidth=i,this.context.data.viewport.contentHeight=s,this.prevWidth=i,this.prevHeight=n,this.context.data.viewport.windowWidth=i,this.context.data.viewport.windowHeight=n;let b=window.getComputedStyle(document.documentElement).fontSize,y=parseFloat(b);if(this.context.data.viewport.baseRem=y*l,r.bottomPosition=this.context.data.viewport.contentHeight-n,(p||typeof e=="boolean"&&e)&&this.moduleManager.onResizeWidth(),g||typeof e=="boolean"&&e){let f=this.context.data.scroll.elementContainer.scrollTop;f>0&&(this.context.data.scroll.current=f,this.context.data.scroll.target=f),this.moduleManager.onResize(),this.scrollManager&&this.scrollManager.updateResponsiveMode(),this.onSettingsChange({isDesktop:d,widthChanged:p,heightChanged:h,scrollHeightChanged:m,isForceRebuild:e===!0}),this.objectManager.invalidateInviewIndex(),this.moduleManager.onScroll(),this.moduleManager.onScrollMeasure(),this.moduleManager.onFrame()}this.objectManager.checkInview()}invalidateCenter(e){this.objectManager.all.get(e)&&this.centers.invalidate(e)}scrollTo(e){let t=this.resolveScrollToValue(e);t!=null&&this.scrollManager.get().scrollTo(t.position,t.immediate)}resolveScrollToValue(e){if(typeof e=="number")return{position:e,immediate:!1};if(typeof e=="string"||e instanceof HTMLElement){let s=this.resolveElementScrollPosition(e);return s==null?null:{position:s,immediate:!1}}let t=e.immediate===!0,r=e.offset??0;if("position"in e)return{position:e.position+r,immediate:t};let i="selector"in e?e.selector:e.element,n=this.resolveElementScrollPosition(i);return n==null?null:{position:n+r,immediate:t}}resolveElementScrollPosition(e){let t=typeof e=="string"?document.querySelector(e):e;if(!(t instanceof HTMLElement))return null;let r=this.data.scroll.container??document.body??document.documentElement,i=this.data.scroll.elementContainer??document.documentElement,n=this.tools.transformNullify.process({element:t});if(r===document.body||r===document.documentElement)return n.top+i.scrollTop;let s=r.getBoundingClientRect();return n.top-s.top+r.scrollTop}destroy(){this.data.scroll.scrollContainer?.removeEventListener("scroll",this.onScrollBind),this.data.scroll.container?.removeEventListener("wheel",this.onWheelBind),window.removeEventListener("resize",this.onResizeBind),this.root.removeEventListener("mousemove",this.onMouseMoveBind),this.eventManager.off("dom:changed",this.onDOMChangedBind),this.observerContainerMutation?.disconnect(),this.observerContainerMutation=null,this.pendingResizeRaf!=null&&(cancelAnimationFrame(this.pendingResizeRaf),this.pendingResizeRaf=null),this.objectManager.destroy(),this.scrollManager.destroy(),this.devtools.destroy()}};0&&(module.exports={CursorReactiveModule,DOMBatcher,GridAdapter,ScrollController,StringAnchor,StringCursor,StringData,StringDelayLerpTracker,StringFPSTracker,StringForm,StringGlide,StringImpulse,StringLazy,StringLerp,StringLerpTracker,StringLoading,StringMagnetic,StringMasonry,StringModule,StringObject,StringParallax,StringPositionTracker,StringProgress,StringProgressPart,StringRandom,StringResponsive,StringScrollContainer,StringScrollbar,StringScroller,StringSequence,StringSplit,StringSpotlight,StringTune,StringVideoAutoplay,buildDevtoolsThemeBlock,ensureStringDevtoolsSharedStyles,frameDOM,resolveDevtoolsIcon,styleTxn});
|
|
28
637
|
//# sourceMappingURL=index.cjs.map
|