@fiddle-digital/string-tune 1.1.53 → 1.1.55
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 +2978 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +757 -30
- package/dist/index.d.ts +757 -30
- package/dist/index.js +2978 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2978 -8
- 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 ni=Object.defineProperty;var Sn=Object.getOwnPropertyDescriptor;var xn=Object.getOwnPropertyNames;var En=Object.prototype.hasOwnProperty;var wn=(p,r)=>{for(var t in r)ni(p,t,{get:r[t],enumerable:!0})},Mn=(p,r,t,e)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of xn(r))!En.call(p,i)&&i!==t&&ni(p,i,{get:()=>r[i],enumerable:!(e=Sn(r,i))||e.enumerable});return p};var Ln=p=>Mn(ni({},"__esModule",{value:!0}),p);var Is={};wn(Is,{CursorReactiveModule:()=>Ht,DOMBatcher:()=>It,GridAdapter:()=>N,ScrollController:()=>rt,StringAnchor:()=>Ye,StringCursor:()=>Ve,StringData:()=>Ut,StringDelayLerpTracker:()=>ir,StringDevIconRegistry:()=>le,StringDevInviewToggle:()=>pe,StringDevLayout:()=>ue,StringDevModule:()=>Q,StringDevOffsets:()=>he,StringDevOverlayRegistry:()=>Nt,StringDevProgress:()=>me,StringDevRulers:()=>ge,StringFPSTracker:()=>nr,StringForm:()=>ur,StringGlide:()=>Xe,StringImpulse:()=>_e,StringLazy:()=>Ge,StringLerp:()=>qe,StringLerpTracker:()=>sr,StringLoading:()=>$e,StringMagnetic:()=>Ne,StringMasonry:()=>Be,StringModule:()=>O,StringObject:()=>Dt,StringParallax:()=>Ke,StringPositionTracker:()=>or,StringProgress:()=>Vt,StringProgressPart:()=>xr,StringRandom:()=>Er,StringResponsive:()=>Ue,StringScrollContainer:()=>Sr,StringScrollbar:()=>Je,StringScroller:()=>yr,StringSequence:()=>dr,StringSplit:()=>rr,StringSpotlight:()=>We,StringTune:()=>Ei,StringVideoAutoplay:()=>lr,buildDevtoolsThemeBlock:()=>Ot,default:()=>Ei,ensureStringDevtoolsSharedStyles:()=>zt,frameDOM:()=>q,resolveDevtoolsIcon:()=>At,styleTxn:()=>E});module.exports=Ln(Is);var be=class{constructor(r=.1,t){this.SETTLE_THRESHOLD=.1;this.lastMouseX=0;this.lastMouseY=0;this.lastMouseTime=0;this.smoothingFactor=r,this.context=t,this.onSettingsChange({isDesktop:t.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 t=performance.now(),e=t-this.lastMouseTime;e>0&&(this.context.data.cursor.velocityX=(r.clientX-this.lastMouseX)/e,this.context.data.cursor.velocityY=(r.clientY-this.lastMouseY)/e),this.lastMouseX=r.clientX,this.lastMouseY=r.clientY,this.lastMouseTime=t}onFrame(){let{targetX:r,targetY:t,smoothedX:e,smoothedY:i}=this.context.data.cursor,n=this.context.tools.lerp.process({from:e,to:r,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(r){let t=Number(this.context.settings["cursor-lerp"]);this.setLerpFactor(t)}setLerpFactor(r){this.smoothingFactor=this.context.tools.adaptiveLerp.process({value:r,inMin:.1,inMax:1,outMin:.05,outMax:.65})}getStepDistance(r,t){return Math.hypot(r,t)}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,t){this.context.data.cursor.smoothedX+=r,this.context.data.cursor.smoothedY+=t,this.context.data.cursor.stepX=r,this.context.data.cursor.stepY=t}};var kt=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,t){this.stateEvents.add(r),t!==void 0&&(this.lastPayloads[r]=t)}on(r,t,e){let i=e?`${r}:${e}`:r;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(r,t,e){let i=e?`${r}:${e}`:r;this.listeners[i]&&this.listeners[i].delete(t)}emit(r,t){this.stateEvents.has(r)&&(this.lastPayloads[r]=t);let e=this.listeners[r];if(e)for(let i of e)i(t)}onProgress(r,t){this.on(`progress:${r}`,t)}emitProgress(r,t){this.emit(`progress:${r}`,t)}onInview(r,t){this.on(`object:inview:${r}`,t)}emitInview(r,t){this.emit(`object:inview:${r}`,t)}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 ye=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 t=0;t<r.cssProperties.length;t++)try{window.CSS.registerProperty(r.cssProperties[t])}catch{}r.onSubscribe(),this.rebuildAllModules()}find(r){for(let t=0;t<this.modules.length;t++){let e=this.modules[t];if(e instanceof r)return e}}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,t){this.callAll("onDOMMutate",r,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(r,t,e){this.modules.length>0&&this.callLifecycleStrict(this.modules,r,t,e),this.uiModules.length>0&&this.callLifecycleStrict(this.uiModules,r,t,e)}callLifecycleStrict(r,t,e,i){let n=r.length;switch(t){case"onFrame":case"onMutate":case"onScrollMeasure":case"onMouseMoveMeasure":case"onScroll":for(let s=0;s<n;s++){let o=r[s];o&&o[t](this.data)}break;case"onDOMMutate":for(let s=0;s<n;s++){let o=r[s];o&&o[t](e,i)}break;case"onMouseMove":case"onWheel":for(let s=0;s<n;s++){let o=r[s];o&&o[t](e)}break;default:for(let s=0;s<n;s++){let o=r[s];o&&o[t]()}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 Se=class{constructor(r,t,e){this.parent=e;this.properties=new Map;this.id=r,this.htmlElement=t}get parentObject(){return this.parent}setProperty(r,t){this.properties.set(r,t)}getProperty(r){return this.properties.get(r)??null}setEasing(r){this.easingFn=r??void 0}getEasing(){return this.easingFn}applyProgress(r,t){let e=this.easingFn??t;return e?e(r):r}};var Dt=class{constructor(r,t){this.id="";this.keys=[];this.tokens=[];this.mirrors=new Map;this.properties=new Map;this.eventNameCache=new Map;this.eventNameSuffixCache=new Map;this.modules=[];this.events=new kt;this.htmlElement=t,this.id=r}getScopedEventName(r,t){if(t==null){let s=this.eventNameCache.get(r);if(s)return s;let o=`${r}:${this.id}`;return this.eventNameCache.set(r,o),o}let e=this.eventNameSuffixCache.get(r);e||(e=new Map,this.eventNameSuffixCache.set(r,e));let i=e.get(t);if(i)return i;let n=`${r}:${this.id}:${t}`;return e.set(t,n),n}setProperty(r,t){this.properties.set(r,t)}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)})}setInviewAutoBlocked(r){this.setProperty("inview-auto-blocked",r)}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(r){return this.modules.includes(r)?!1:(this.modules.push(r),!0)}disconnect(r){let t=this.modules.indexOf(r);return t===-1?!1:(this.modules.splice(t,1),!0)}isConnectedTo(r){return this.modules.includes(r)}setTokens(r){this.tokens=r,this.keys=r.map(t=>t.key)}getToken(r){for(let t=0;t<this.tokens.length;t++)if(this.tokens[t].key===r)return this.tokens[t];return null}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 It=class{constructor(){this.readQueue=[];this.writeQueue=[];this.computeQueue=[];this.isProcessing=!1;this.pendingFrame=null;this.rectCache=new WeakMap;this.dimensionCache=new WeakMap}scheduleRead(r,t=0){this.readQueue.push({priority:t,execute:r}),this.scheduleFlush()}scheduleCompute(r,t=0){this.computeQueue.push({priority:t,execute:r}),this.scheduleFlush()}scheduleWrite(r,t=0){this.writeQueue.push({priority:t,execute:r}),this.scheduleFlush()}batchModuleInitialization(r){r.forEach(({module:t,object:e,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,e,i,n)},1)}),r.forEach(({module:t,object:e,windowSize:i})=>{this.scheduleCompute(()=>{t.calculatePositions(e,i)},2)}),r.forEach(({module:t,object:e})=>{this.scheduleWrite(()=>{t.connectObject(e),t.addObject(e.id,e)},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=(t,e)=>e.priority-t.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 xe=class{constructor(){this.desktop={rebuild:{width:!0,height:!0,scrollHeight:!0}};this.mobile={rebuild:{width:!0,height:!0,scrollHeight:!0}}}};var O=class{constructor(r){this.cssProperties=[];this.objectMapOnPage=new Map;this.allObjectMapOnPage=new Map;this.objectsOnPage=[];this.allObjectsOnPage=[];this.objectMap=new Map;this.allObjectMap=new Map;this.objects=[];this.allObjects=[];this.htmlKey="";this.defaultModeScope="all";this._type=1;this.permissions=new xe;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:(t,e,i)=>{let n=i.top;return Math.floor(n)+this.data.scroll.elementContainer.scrollTop*this.data.viewport.transformScale}},{key:"end",type:"number",fallback:(t,e,i)=>{let n=i.top,s=i.height;return n+s-this.data.scroll.transformedCurrent}},{key:"size",type:"number",fallback:(t,e,i)=>i.height},{key:"half-width",type:"number",fallback:(t,e,i)=>i.width/2},{key:"half-height",type:"number",fallback:(t,e,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}get key(){return this.htmlKey}initializeObject(r,t,e,i){let n=this.tools.boundingClientRect.process({element:e});for(let{key:s,type:o,fallback:a,transform:l}of this.attributesToMap){let d=typeof a=="function"?a(e,t,n):a,c=i[s]??i[`string-${s}`]??i[`data-string-${s}`],u=this.tools.domAttribute.process({element:e,key:s,fallback:c??this.settings[s]??d}),g=this.parseAttribute(u,o,{element:e,boundingRect:n,viewportHeight:this.data.viewport.windowHeight,baseRem:this.data.viewport.baseRem});l&&(g=l(g)),t.setProperty(s,g)}this.cacheLayoutSnapshot(t,e)}cacheLayoutSnapshot(r,t){let e=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,d=n.width,c=n.height;if((!Number.isFinite(d)||d<=0)&&(d=o.width),(!Number.isFinite(c)||c<=0)&&(c=o.height),Number.isFinite(n.left)&&Number.isFinite(n.top)&&n.width>0&&n.height>0)if(e===document.body||e===document.documentElement)a=n.left+i.scrollLeft,l=n.top+i.scrollTop;else{let u=e.getBoundingClientRect();a=n.left-u.left+e.scrollLeft,l=n.top-u.top+e.scrollTop}else{let u=this.getOffsetChainPosition(t);if(e===document.body||e===document.documentElement)a=u.left,l=u.top;else{let g=this.getOffsetChainPosition(e);a=u.left-g.left+e.scrollLeft,l=u.top-g.top+e.scrollTop}}r.setProperty("layout-doc-left",a),r.setProperty("layout-doc-top",l),r.setProperty("layout-width",d),r.setProperty("layout-height",c),r.setProperty("layout-border-radius",s.borderRadius||"0px")}getOffsetSize(r,t){let e=parseFloat(t.width),i=parseFloat(t.height);return{width:r.offsetWidth||r.clientWidth||(Number.isFinite(e)?e:0),height:r.offsetHeight||r.clientHeight||(Number.isFinite(i)?i:0)}}getOffsetChainPosition(r){let t=0,e=0,i=r;for(;i;)t+=i.offsetLeft||0,e+=i.offsetTop||0,i=i.offsetParent;return{left:t,top:e}}calculatePositions(r,t){let e=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"),d=r.getProperty("exit-vp"),c=0,u=0,g=0,v=0;o==="top"&&a==="top"||o==="left"&&a==="left"?(g=-t+1,c=e-n):o==="top"&&a==="bottom"||o==="left"&&a==="right"?c=e-t-n:o==="bottom"&&a==="top"||o==="right"&&a==="left"?(g=-t-i+1,c=e+i-n):(o==="bottom"&&a==="bottom"||o==="right"&&a==="right")&&(g=-i+1,c=e-t+i-n),l==="top"&&d==="top"||l==="left"&&d==="left"?(v=-i+1,u=e+s):l==="top"&&d==="bottom"||l==="left"&&d==="right"?(v=-t-i+1,u=e-t+s):l==="bottom"&&d==="top"||l==="right"&&d==="left"?u=e+i+s:(l==="bottom"&&d==="bottom"||l==="right"&&d==="right")&&(v=-t+1,u=e-t+i+s),r.setProperty("start-bias",g),r.setProperty("end-bias",v),r.setProperty("start-position",c-this.data.scroll.topPosition),r.setProperty("end-position",u-this.data.scroll.topPosition),r.setProperty("difference-position",u-c);let h=r.getProperty("inview-top")??0,m=r.getProperty("inview-bottom")??0;r.setProperty("inview-start-position",r.getProperty("start-position")+h),r.setProperty("inview-end-position",r.getProperty("end-position")+m)}parseAttribute(r,t,e={}){if(r==null)return null;if(typeof t=="object"&&t.type==="enum")return t.values.includes(r)?r:t.values[0];switch(t){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:e.element!=null&&e.viewportHeight!=null&&e.baseRem!=null&&e.boundingRect!=null?this.tools.unitParser.process({value:r,element:e.element,viewportHeight:e.viewportHeight,boundingRect:e.boundingRect,baseRem:e.baseRem}):0;case"breakpoint-dimension":if(e.element!=null&&e.viewportHeight!=null&&e.baseRem!=null&&e.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:e.element,viewportHeight:e.viewportHeight,boundingRect:e.boundingRect,baseRem:e.baseRem})})}else n.push({breakpoint:0,value:this.tools.unitParser.process({value:s,element:e.element,viewportHeight:e.viewportHeight,boundingRect:e.boundingRect,baseRem:e.baseRem})});return n}default:return r}}canConnect(r){return r.keys.includes(this.htmlKey)}isTokenEnabledInCurrentMode(r){let t=this.data.scroll.mode;return r.modeSpec.kind==="all"?!0:r.modeSpec.kind==="include"?r.modeSpec.values.includes(t):this.defaultModeScope==="all"?!0:this.defaultModeScope.includes(t)}isObjectEnabledInCurrentMode(r){let t=r.getToken(this.htmlKey);return t?this.isTokenEnabledInCurrentMode(t):!1}disconnectObject(r){r.disconnect(this)}connectObject(r){r.connect(this)&&this.onObjectConnected(r)}enterObject(r,t){this.allObjectMap.has(r)||(this.allObjectMap.set(r,t),this.allObjects.push(t)),this.isObjectEnabledInCurrentMode(t)&&!this.objectMap.has(r)&&(this.objectMap.set(r,t),this.objects.push(t))}exitObject(r){let t=this.objectMap.get(r);if(t){this.objectMap.delete(r);let n=this.objects.indexOf(t);n!==-1&&this.objects.splice(n,1)}let e=this.allObjectMap.get(r);if(!e)return;this.allObjectMap.delete(r);let i=this.allObjects.indexOf(e);i!==-1&&this.allObjects.splice(i,1)}addObject(r,t){this.allObjectMapOnPage.has(r)||(this.allObjectMapOnPage.set(r,t),this.allObjectsOnPage.push(t)),this.isObjectEnabledInCurrentMode(t)&&!this.objectMapOnPage.has(r)&&(this.objectMapOnPage.set(r,t),this.objectsOnPage.push(t))}removeObject(r){let t=this.objectMapOnPage.get(r);if(t){this.objectMapOnPage.delete(r);let n=this.objectsOnPage.indexOf(t);n!==-1&&this.objectsOnPage.splice(n,1)}let e=this.allObjectMapOnPage.get(r);if(!e)return;this.allObjectMapOnPage.delete(r);let i=this.allObjectsOnPage.indexOf(e);i!==-1&&this.allObjectsOnPage.splice(i,1),this.exitObject(r),this.onObjectDisconnected(e)}onObjectConnected(r){}onObjectDisconnected(r){}applyToElementAndConnects(r,t,e=t){r.getProperty("self-disable")!==!0&&t(r.htmlElement),r.mirrorObjects.forEach(i=>e(i.htmlElement,i))}applyVarToElement(r,t,e){r.getProperty("self-disable")!==!0&&this.tools.styleTxn.setVar(r.htmlElement,t,e)}applyPropToElement(r,t,e){r.getProperty("self-disable")!==!0&&this.tools.styleTxn.setProp(r.htmlElement,t,e)}applyVarToConnects(r,t,e){for(let i of r.mirrorObjects)this.tools.styleTxn.setVar(i.htmlElement,t,e)}applyPropToConnects(r,t,e){for(let i of r.mirrorObjects)this.tools.styleTxn.setProp(i.htmlElement,t,e)}getObjectEventName(r,t,e){return r.getScopedEventName(t,e)}clearManagedStyles(r){let t=i=>{for(let s=0;s<this.cssProperties.length;s++)i.style.removeProperty(this.cssProperties[s].name);let n=r.getProperty("key");typeof n=="string"&&n.length>0&&i.style.removeProperty(n)};t(r.htmlElement);let e=r.mirrorObjects;for(let i=0;i<e.length;i++)t(e[i].htmlElement)}onObjectModeActivated(r){}onObjectModeDeactivated(r){this.clearManagedStyles(r)}rebuildActiveObjectsForCurrentMode(){let r=new Map(this.objectMapOnPage);this.objectMapOnPage=new Map,this.objectsOnPage=[];for(let t=0;t<this.allObjectsOnPage.length;t++){let e=this.allObjectsOnPage[t];this.isObjectEnabledInCurrentMode(e)&&(this.objectMapOnPage.set(e.id,e),this.objectsOnPage.push(e))}this.objectMap=new Map,this.objects=[];for(let t=0;t<this.allObjects.length;t++){let e=this.allObjects[t];this.isObjectEnabledInCurrentMode(e)&&(this.objectMap.set(e.id,e),this.objects.push(e))}r.forEach((t,e)=>{this.objectMapOnPage.has(e)||this.onObjectModeDeactivated(t)}),this.objectMapOnPage.forEach((t,e)=>{r.has(e)||this.onObjectModeActivated(t)})}destroy(){this.objects=[],this.allObjects=[],this.objectMap=new Map,this.allObjectMap=new Map,this.objectsOnPage=[],this.allObjectsOnPage=[],this.objectMapOnPage=new Map,this.allObjectMapOnPage=new Map}onInit(){}onSubscribe(){}onUnsubscribe(){}onFrame(r){}onMutate(r){}onScrollMeasure(r){}onMouseMoveMeasure(r){}onResize(){}onResizeWidth(){}onScroll(r){}onDirectionChange(){}onScrollStart(){}onScrollStop(){}onScrollDirectionChange(){}onAxisChange(){}onDeviceChange(){}onScrollConfigChange(){this.rebuildActiveObjectsForCurrentMode()}onSettingsChange(){}onDOMRebuild(){}onMouseMove(r){}onWheel(r){}onDOMMutate(r,t){}};var Ee=class{constructor(r,t,e,i){this.data=r;this.modules=t;this.events=e;this.tools=i;this.objects=new Map;this.connectQueue=[];this.connectableModulesBuffer=[];this.mirrors=new Map;this.mirrorId=1;this.globalId=1;this.domBatcher=new It;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 t=`string-${this.globalId++}`,e="string-id";r.getAttribute("string-id")&&(t=r.getAttribute("string-id"),e="string-id"),r.getAttribute("data-string-id")&&(t=r.getAttribute("data-string-id"),e="data-string-id");let i=t&&this.objects.has(t)?this.objects.get(t):new Dt(t,r);r.setAttribute(e,i.id);let n=r.getAttribute("string")??r.getAttribute("data-string");n&&i.setTokens(this.parseStringTokens(n)),r.setAttribute("string-inited",""),this.objects.set(i.id,i);let s=this.getAllAttributes(r),o=this.modules.core;for(let d=0;d<o.length;d++){let c=o[d];"setupCoreProperties"in c&&typeof c.setupCoreProperties=="function"&&c.setupCoreProperties(i,r,s)}let a=this.connectableModulesBuffer;a.length=0;let l=this.modules.all;for(let d=0;d<l.length;d++){let c=l[d];c instanceof O&&c.canConnect(i)&&a.push(c)}if(this.domBatcherEnabled&&a.length>0){let d=new Array(a.length);for(let c=0;c<a.length;c++)d[c]={module:a[c],object:i,element:r,attributes:s,globalId:this.globalId,windowSize:this.data.viewport.windowHeight};this.domBatcher.batchModuleInitialization(d),this.domBatcher.scheduleWrite(()=>{this.initObservers(i,r),this.checkInviewForObject(i)})}else{for(let d=0;d<a.length;d++){let c=a[d];c.initializeObject(this.globalId,i,r,s),c.calculatePositions(i,this.data.viewport.windowHeight),c.connectObject(i),c.addObject(i.id,i)}this.initObservers(i,r),this.checkInviewForObject(i)}if(this.connectQueue.length>0){let d=0;for(let c=0;c<this.connectQueue.length;c++){let u=this.connectQueue[c];if(u.id===i.id){this.attachMirrorToObject(i,u.element);continue}this.connectQueue[d++]=u}this.connectQueue.length=d}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 t of this.objects.values())t.getProperty("observer-progress")?.disconnect(),r&&this.initObservers(t,t.htmlElement)}}attachModule(r){this.objects.forEach(t=>{if(!r.canConnect(t))return;let e=t.htmlElement,i=this.getAllAttributes(e);r.initializeObject(this.globalId,t,e,i),r.calculatePositions(t,this.data.viewport.windowHeight),r.connectObject(t),r.addObject(t.id,t),t.getProperty("active")===!0&&r.enterObject(t.id,t)})}refreshModuleConnectionsForCurrentMode(){let r=this.modules.all;for(let t of this.objects.values()){let e=t.htmlElement;if(!e||!e.isConnected)continue;let i=null;for(let n=0;n<r.length;n++){let s=r[n];if(!(s instanceof O)||!t.keys.includes(s.key))continue;let o=s.canConnect(t),a=t.isConnectedTo(s);if(o&&!a){i==null&&(i=this.getAllAttributes(e)),s.initializeObject(this.globalId,t,e,i),s.calculatePositions(t,this.data.viewport.windowHeight),s.connectObject(t),s.addObject(t.id,t),t.getProperty("active")===!0&&s.enterObject(t.id,t);continue}!o&&a&&(s.exitObject(t.id),s.removeObject(t.id),s.disconnectObject(t))}}}invalidateInviewIndex(){this.inviewIndexDirty=!0}refreshLayoutForRoot(r){if(!r)return;let t=new Set,e=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(r instanceof HTMLElement){e(r);let n=r.querySelectorAll("[string-id],[data-string-id]");for(let s=0;s<n.length;s++)e(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 d=a[l];d instanceof O&&d.canConnect(n)&&(d.initializeObject(this.globalId,n,s,o),d.calculatePositions(n,i))}}this.inviewIndexDirty=!0,this.checkInview()}remove(r){let t=this.objects.get(r);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(e=>{let i=this.getMirrorIds(e.htmlElement);this.setMirrorIds(e.htmlElement,i.filter(s=>s!==e.id)),this.mirrors.delete(e.id);let n=e.htmlElement.getAttribute("string-copy-from")??e.htmlElement.getAttribute("data-string-copy-from");n&&this.enqueueConnection(n,e.htmlElement)}),this.objects.delete(r),this.inviewActive.delete(t),this.inviewIndexDirty=!0)}enqueueConnection(r,t){let e=this.splitPipeAndTrim(r);for(let i=0;i<e.length;i++){let n=e[i];this.connectQueue.some(s=>s.id===n&&s.element===t)||this.connectQueue.push({id:n,element:t})}}linkMirror(r,t){let e=this.splitPipeAndTrim(r);for(let i=0;i<e.length;i++){let n=e[i],s=this.objects.get(n);s?this.attachMirrorToObject(s,t):this.enqueueConnection(n,t)}}attachMirrorToObject(r,t){let e=this.getMirrorIds(t);for(let o of e){let a=this.mirrors.get(o);if(a&&a.parentObject===r)return a}let i=`string-mirror-${this.mirrorId++}`,n=new Se(i,t,r);this.setMirrorIds(t,[...e,i]),r.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(r){let t=this.getMirrorIds(r);t.length!==0&&(t.forEach(e=>this.detachMirrorById(e)),this.clearMirrorIds(r))}detachMirrorById(r){let t=this.mirrors.get(r);t&&(t.parentObject.removeMirror(r),this.mirrors.delete(r))}getMirrorIds(r){let t=r.getAttribute("string-mirror-id")??r.getAttribute("data-string-mirror-id");return t?this.splitPipeAndTrim(t):[]}setMirrorIds(r,t){if(t.length===0){this.clearMirrorIds(r);return}r.setAttribute("string-mirror-id",t.join("|"))}clearMirrorIds(r){r.removeAttribute("string-mirror-id"),r.removeAttribute("data-string-mirror-id")}getAllAttributes(r){let t={},e=r.attributes;for(let i=0;i<e.length;i++){let n=e[i];t[n.name]=n.value}return t}initObservers(r,t){if(!this.intersectionObserverEnabled)return;let e=r.getProperty("offset-top")??0,i=r.getProperty("offset-bottom")??0;r.getProperty("observer-progress")?.disconnect();let n=g=>{g.forEach(v=>{this.events.emit(r.getScopedEventName("object:activate"),v.isIntersecting),v.isIntersecting?r.enter():r.leave()})},s=r.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",d=s!=null?s===!0:l,c=this.data.scroll.container===document.body||d?null:this.data.scroll.container,u=new IntersectionObserver(n,{root:c,rootMargin:`${i+this.data.viewport.windowHeight}px 0px ${e+this.data.viewport.windowHeight}px 0px`,threshold:0});u.observe(t),r.setProperty("observer-progress",u)}observeDOM(){this.domObserver?.disconnect();let r=new MutationObserver(t=>{let e=!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 d=l.querySelectorAll("[string],[data-string]");for(let u=0;u<d.length;u++){let g=d[u];this.isFixed(g)||this.handleRemoved(g)}let c=l.querySelectorAll("[string-copy-from],[data-string-copy-from]");for(let u=0;u<c.length;u++)this.detachMirrorByElement(c[u])}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 d=l.querySelectorAll("[string]:not([string-inited]),[data-string]:not([string-inited])");for(let g=0;g<d.length;g++)this.add(d[g]);let c=l.getAttribute("string-copy-from")??l.getAttribute("data-string-copy-from");c&&this.linkMirror(c,l);let u=l.querySelectorAll("[string-copy-from],[data-string-copy-from]");for(let g=0;g<u.length;g++){let v=u[g],h=v.getAttribute("string-copy-from")??v.getAttribute("data-string-copy-from");h&&this.linkMirror(h,v)}}s&&(this.modules.onDOMMutate(n.addedNodes,n.removedNodes),e=!0)}}if(e){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 t=r.getAttribute("string-id")??r.getAttribute("data-string-id");if(!t)return;let e=r.getAttribute("string-copy-from")??r.getAttribute("data-string-copy-from");e&&(this.connectQueue=this.connectQueue.filter(i=>i.id!==e)),this.remove(t)}onSettingsChange(r){for(let t of this.objects.values()){if(!t.htmlElement||!t.htmlElement.isConnected)continue;let e=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(t)&&(e==null&&(e=this.getAllAttributes(t.htmlElement)),s.initializeObject(this.globalId,t,t.htmlElement,e),s.calculatePositions(t,this.data.viewport.windowHeight),s.connectObject(t))}}this.inviewIndexDirty=!0}isFixed(r){return r.hasAttribute("string-fixed")}checkInview(){let r=this.data.scroll.transformedCurrent;this.updateInviewWindow(r);for(let t of this.inviewActive)this.checkInviewForObject(t)}checkInviewForObject(r){let t=this.data.scroll.transformedCurrent;if(!this.intersectionObserverEnabled){let d=r.getProperty("start-position"),c=r.getProperty("end-position");if(d!=null&&c!=null){let u=Math.min(d,c),g=Math.max(d,c),v=r.getProperty("is-active")??!1,h=t>=u&&t<=g;h!==v&&(r.setProperty("is-active",h),this.events.emit(r.getScopedEventName("object:activate"),h),h?r.enter():r.leave())}}let e=r.getProperty("inview-start-position"),i=r.getProperty("inview-end-position"),n=r.getProperty("is-inview")??!1,s=Math.min(e,i),o=Math.max(e,i),a=t>=s&&t<=o,l=null;if(!n&&a){let d=Math.abs(t-s),c=Math.abs(o-t);l=d<=c?"enter-top":"enter-bottom"}else n&&!a&&(l=t<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 t=this.data.viewport.windowHeight,e=r-t,i=r+this.data.viewport.windowHeight+t;for((this.inviewIndexDirty||r<this.lastInviewScrollPos)&&this.rebuildInviewIndex(e,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<e;)this.inviewActive.delete(this.inviewEnds[this.inviewEndIdx].object),this.inviewEndIdx++;this.lastInviewScrollPos=r}rebuildInviewIndex(r,t){this.inviewStarts=[],this.inviewEnds=[];for(let e of this.objects.values()){let i=e.getProperty("inview-start-position"),n=e.getProperty("inview-end-position");i==null||n==null||(this.inviewStarts.push({pos:Math.min(i,n),object:e}),this.inviewEnds.push({pos:Math.max(i,n),object:e}))}this.inviewStarts.sort((e,i)=>e.pos-i.pos),this.inviewEnds.sort((e,i)=>e.pos-i.pos),this.inviewActive.clear(),this.inviewStartIdx=this.upperBound(this.inviewStarts,t),this.inviewEndIdx=this.upperBound(this.inviewEnds,r-1);for(let e=0;e<this.inviewStartIdx;e++)this.inviewActive.add(this.inviewStarts[e].object);for(let e=0;e<this.inviewEndIdx;e++)this.inviewActive.delete(this.inviewEnds[e].object);this.inviewIndexDirty=!1}upperBound(r,t){let e=0,i=r.length;for(;e<i;){let n=e+i>>>1;r[n].pos<=t?e=n+1:i=n}return e}splitPipeAndTrim(r){let t=r.split("|"),e=[];for(let i=0;i<t.length;i++){let n=t[i].trim();n.length>0&&e.push(n)}return e}parseStringTokens(r){let t=this.splitTopLevelPipe(r),e=[];for(let i=0;i<t.length;i++){let n=t[i].trim();if(n.length===0)continue;let s=n.match(/^([^\[\]]+?)(?:\[([^\]]*)\])?$/);if(!s){e.push({raw:n,key:n,modeSpec:{kind:"default",values:[]}});continue}let o=s[1].trim(),a=s[2];if(!o)continue;if(a==null){e.push({raw:n,key:o,modeSpec:{kind:"default",values:[]}});continue}let l=a.trim();if(l.length===0){e.push({raw:n,key:o,modeSpec:{kind:"all",values:[]}});continue}let d=this.splitTopLevelPipe(l).map(c=>c.trim()).filter(c=>c.length>0);e.push({raw:n,key:o,modeSpec:d.length>0?{kind:"include",values:d}:{kind:"all",values:[]}})}return e}splitTopLevelPipe(r){let t=[],e="",i=0;for(let n=0;n<r.length;n++){let s=r[n];if(s==="["){i++,e+=s;continue}if(s==="]"){i=Math.max(0,i-1),e+=s;continue}if(s==="|"&&i===0){t.push(e),e="";continue}e+=s}return e.length>0&&t.push(e),t}destroy(){this.domObserver?.disconnect(),this.domObserver=null,this.domBatcher.clear()}};var Ct={SCROLL_FORWARD:"-scroll-forward",SCROLL_BACKWARD:"-scroll-backward",SCROLLING_FORWARD:"-scrolling-forward",SCROLLING_BACKWARD:"-scrolling-backward"};var rt=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(Ct.SCROLLING_FORWARD,r),document.documentElement.classList.toggle(Ct.SCROLLING_BACKWARD,!r),document.documentElement.classList.toggle(Ct.SCROLL_FORWARD,r),document.documentElement.classList.toggle(Ct.SCROLL_BACKWARD,!r),this.lastAppliedDirection=r)}clearScrollingClasses(){document.documentElement.classList.remove(Ct.SCROLLING_BACKWARD,Ct.SCROLLING_FORWARD)}triggerScrollRules(){this.scrollTriggerRules.forEach(r=>{let t=(r.direction==="any"||this.isLastBottomScrollDirection&&r.direction==="forward"||!this.isLastBottomScrollDirection&&r.direction==="backward")&&this.context.data.scroll.current>=r.offset;t&&!r.isActive?(r.onEnter?.(),r.toggleClass&&r.toggleClass.target.classList.add(r.toggleClass.className),r.isActive=!0):!t&&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(t=>t.id!==r)}scrollTo(r,t){}};var we=class extends rt{constructor(t){super(t);this.name="default";this.previousScrollTop=0;this.previousScrollTime=0;this.isScrolling=!1;this.lastScrollEventTime=0;this.nativeVelocity=0;this.nativeVelocityTarget=0;this.scrollStopDelay=120;this.nativeVelocityFollow=.2;this.nativeVelocityDecay=.84;this.nativeVelocityBoost=2;this.nativeVelocityDeadzone=.25}onFrame(){let t=0;if(this.context.data.scroll.delta!==0){let i=this.context.data.scroll.delta*this.context.data.scroll.speedAccelerate;this.context.data.scroll.delta-=i,t=i,Math.abs(t)<.1&&(this.context.data.scroll.delta=0,t=0)}let e=performance.now();this.nativeVelocityTarget*=this.nativeVelocityDecay,Math.abs(this.nativeVelocityTarget)<this.nativeVelocityDeadzone&&(this.nativeVelocityTarget=0),this.nativeVelocity+=(this.nativeVelocityTarget-this.nativeVelocity)*this.nativeVelocityFollow,Math.abs(this.nativeVelocity)<this.nativeVelocityDeadzone&&(this.nativeVelocity=0),Math.abs(this.nativeVelocity)>Math.abs(t)&&(t=this.nativeVelocity),this.context.data.scroll.lerped=t,this.isScrolling&&!(this.context.data.scroll.delta!==0||this.nativeVelocityTarget!==0||this.nativeVelocity!==0)&&e-this.lastScrollEventTime>this.scrollStopDelay&&(this.isScrolling=!1,this.onScrollStop(),this.clearScrollingClasses())}onScroll(t){let e=performance.now(),i=this.context.data.scroll.elementContainer.scrollTop,n=i-this.previousScrollTop;if(this.context.data.scroll.current=i,this.context.data.scroll.target=i,this.context.data.scroll.transformedCurrent=i,n!==0){this.updateScrollDirection(n>0);let s=this.previousScrollTime===0?16.6667:e-this.previousScrollTime,o=n*(16.6667/Math.max(8,s))*this.nativeVelocityBoost;this.nativeVelocityTarget=o,this.previousScrollTop=i,this.previousScrollTime=e}this.triggerScrollRules(),this.lastScrollEventTime=e,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 e=t.deltaY;this.context.data.scroll.target===0&&(this.context.data.scroll.delta+=Math.max(0,t.deltaY)),this.context.data.scroll.delta+=e,this.lastScrollEventTime=performance.now()}}deactivate(){super.deactivate(),this.isScrolling=!1,this.lastScrollEventTime=0,this.previousScrollTop=this.context.data.scroll.current,this.previousScrollTime=0,this.nativeVelocity=0,this.nativeVelocityTarget=0}scrollTo(t,e){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.nativeVelocity=0,this.nativeVelocityTarget=0,this.previousScrollTop=t,this.previousScrollTime=0,this.triggerScrollRules(),this._scrollDirection==="vertical"?this.context.data.scroll.scrollContainer?.scrollTo({top:t,left:0,behavior:e?"auto":"smooth"}):this.context.data.scroll.scrollContainer?.scrollTo({left:t,top:0,behavior:e?"auto":"smooth"})}};var Me=class extends rt{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 Le=class extends rt{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 e=Math.sign(this.wheelImpulse),i=this.context.data.scroll.target===0&&e<0,n=this.context.data.scroll.target===this.context.data.scroll.bottomPosition&&e>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,e){if(e){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,e,i,n,s,o,a){let l=i*s,d=Math.min(Math.max(0,e+l),o),c=i-l,u=(d-t)*n,g=u>0?Math.ceil(t+u):Math.floor(t+u);a.current=g,a.target=d,a.delta=c,a.lerped=u,a.scrollForce=l,a.absVelocity=Math.abs(u)}};var Ce=class{constructor(r){this.context=r;this.modes=new Map;this.boundEvents=null;this.scrollMarks=[];this.registerMode("smooth",new Le(r)),this.registerMode("default",new we(r)),this.registerMode("disable",new Me(r)),this.updateResponsiveMode()}registerMode(r,t){let e=this.context.data.scroll.mode===r,i=this.modes.get(r);i&&(e&&i.deactivate(),i.destroy()),t.name||(t.name=String(r)),this.modes.set(r,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)),e&&t.activate()}setMobileMode(r){this.context.data.scroll.modeMobile=r,this.updateResponsiveMode()}setDesktopMode(r){this.context.data.scroll.modeDesktop=r,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(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(),this.boundEvents?.onModeChange()}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(t=>{t.onScrollStart=r.onScrollStart,t.onScrollStop=r.onScrollStop,t.onChangeDirection=r.onDirectionChange})}addScrollMark(r){this.scrollMarks.push(r),this.modes.forEach(t=>{t.addScrollMark(r)})}removeScrollMark(r){this.scrollMarks=this.scrollMarks.filter(t=>t.id!==r),this.modes.forEach(t=>{t.removeScrollMark(r)})}destroy(){this.modes.forEach(r=>{r.deactivate(),r.destroy()})}};var Te=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 Pe=class{constructor(){this.threeInstance=null}};var Oe=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="default";this.modeDesktop="smooth";this.speed=.1;this.speedAccelerate=.25}};var Ae=class{constructor(){this.fpsTracker=!1;this.positionTracker=!1;this.suppressMasonryResize=!1}};var ke=class{constructor(){this.now=0;this.previous=0;this.delta=0;this.elapsed=0}};var De=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 Ut=class{constructor(){this.scroll=new Oe;this.viewport=new De;this.cursor=new Te;this.render=new Pe;this.time=new ke;this.system=new Ae}};var Yt=class{process({element:r}){return r.getBoundingClientRect()}};var Xt=class{process({element:r,key:t,fallback:e=null}){return r.getAttribute(`string-${t}`)??r.getAttribute(`data-string-${t}`)??e}};var qt=class{process({record:r,name:t,fallback:e=null}){return r[t]??r[`data-${t}`]??e}};var Tt=class{process({element:r}){let t=r.getBoundingClientRect(),i=getComputedStyle(r).transform.match(/-?[\d.]+/g)?.map(parseFloat)??[];if(i.length===6){let[n,s,o,a,l,d]=i,c=n*a-s*o;return{width:t.width/(n||1),height:t.height/(a||1),left:(t.left*a-t.top*o+o*d-l*a)/c,top:(-t.left*s+t.top*n+l*s-n*d)/c}}return t}};var Kt=class{constructor(r=new Tt){this.transformTool=r}process({element:r,container:t=document.body}){let e;try{e=t.getBoundingClientRect()}catch{e=document.body.getBoundingClientRect()}let i=this.transformTool.process({element:r});return{top:i.top-e.top,left:i.left-e.left}}};var Zt=class{process({from:r,to:t,progress:e}){return(t-r)*e}};var Qt=class{process({value:r,element:t,viewportHeight:e,baseRem:i,boundingRect:n}){let s=r.split("|").map(a=>a.trim()).filter(Boolean),o=0;for(let a of s){let l=a,d=!1;l.startsWith("-")&&(d=!0,l=l.slice(1));let c=0;l==="selfHeight"?c=t.offsetHeight:l.endsWith("px")?c=parseFloat(l):l.endsWith("%")?c=parseFloat(l)/100*e:l.endsWith("rem")?c=parseFloat(l)*i:l.endsWith("sh")?c=parseFloat(l)*n.height/100:c=parseFloat(l),o+=d?-c:c}return o}};var Jt=class{process({value:r,inMin:t=.1,inMax:e=1,outMin:i=.05,outMax:n=.65}){if(r<t)return n;if(r>1&&(r=1),r<=e){let s=(r-t)/(e-t);return n-s*(n-i)}return i}};var dt={left:0,center:.5,right:1},ct={top:0,center:.5,bottom:1},te=class{process({value:r}){if(!r)return"center";let t=r.trim();if(t.startsWith("random(")&&t.endsWith(")")){let e=t.slice(7,-1).split(",").map(n=>n.trim()).filter(Boolean),i=Math.floor(Math.random()*e.length);return e[i]}return t}toNormalized({value:r}){let e=this.process({value:r}).toLowerCase().split(/\s+/).filter(Boolean);if(e.length===0)return{x:.5,y:.5};if(e.length===1){let a=e[0],l=this.parseValue(a);return a in dt&&!(a in ct)?{x:l,y:.5}:a in ct&&!(a in dt)?{x:.5,y:l}:{x:l,y:l}}let[i,n]=e,s=i in ct&&!(i in dt),o=n in dt&&!(n in ct);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,t){if(t==="horizontal"&&r in dt)return dt[r];if(t==="vertical"&&r in ct)return ct[r];if(r in dt)return dt[r];if(r in ct)return ct[r];if(r.endsWith("%")){let i=parseFloat(r);if(!isNaN(i))return i/100}let e=parseFloat(r);return isNaN(e)?.5:e>1?e/100:e}};var ee=class{process({value:r}){let t=r.trim().toLowerCase();if(t.startsWith("#")){let n=t.slice(1);n.length===3&&(n=n.split("").map(d=>d+d).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 e=t.match(/rgba?\(([^)]+)\)/);if(e){let[n,s,o,a=1]=e[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(u=>u.trim()),[l,d,c]=this.hslToRgb(parseFloat(n),parseFloat(s),parseFloat(o));return{r:l,g:d,b:c,a:parseFloat(a)}}return{r:0,g:0,b:0,a:0}}hslToRgb(r,t,e){r=r/360,t=parseFloat(t.toString())/100,e=parseFloat(e.toString())/100;let i=(d,c,u)=>(u<0&&(u+=1),u>1&&(u-=1),u<1/6?d+(c-d)*6*u:u<1/2?c:u<2/3?d+(c-d)*(2/3-u)*6:d),n=e<.5?e*(1+t):e+t-e*t,s=2*e-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 re=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 t=r.trim();if(this.namedCurves[t])return this.cubicBezier(...this.namedCurves[t]);let e=t.match(/^cubic-bezier\s*\(\s*([-+]?\d*\.?\d+)\s*,\s*([-+]?\d*\.?\d+)\s*,\s*([-+]?\d*\.?\d+)\s*,\s*([-+]?\d*\.?\d+)\s*\)$/);if(e){let[i,n,s,o]=e.slice(1).map(Number);return this.cubicBezier(i,n,s,o)}return i=>i}cubicBezier(r,t,e,i){let n=3*r,s=3*(e-r)-n,o=1-n-s,a=3*t,l=3*(i-t)-a,d=1-a-l;function c(h){return((o*h+s)*h+n)*h}function u(h){return((d*h+l)*h+a)*h}function g(h){return(3*o*h+2*s)*h+n}function v(h,m=1e-5){let b,y,f=h,S,x,w;for(w=0;w<8;w++){if(S=c(f)-h,Math.abs(S)<m)return f;if(x=g(f),Math.abs(x)<1e-6)break;f=f-S/x}for(b=0,y=1,f=h;b<y;){if(S=c(f)-h,Math.abs(S)<m)return f;S>0?y=f:b=f,f=(y+b)/2}return f}return function(h){return u(v(h))}}};var ie=class{process({distance:r,radius:t,strength:e}){if(r>=t)return 0;let i=(t-r)/t;return e*i}};var ne=class{process({from:r,to:t,progress:e}){return{r:r.r+(t.r-r.r)*e,g:r.g+(t.g-r.g)*e,b:r.b+(t.b-r.b)*e,a:r.a+(t.a-r.a)*e}}};var se=class{process({from:r,to:t,progress:e}){return{x:(t.x-r.x)*e,y:(t.y-r.y)*e}}};var oe=class{process({value:r}){let e=r?.trim();if(!e||e==="none")return 1;try{if(e.startsWith("matrix(")){let i=e.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(e.startsWith("scale(")){let i=e.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(e.startsWith("scaleX(")){let i=e.match(/scaleX\(([^)]+)\)/);if(i&&i[1]){let n=parseFloat(i[1].trim());if(!isNaN(n))return n}}if(e.startsWith("scale3d(")){let i=e.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(e.startsWith("matrix3d(")){let i=e.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 "${e}":`,i),1}return 1}};var Ie=class{process({attributeValue:r}){let t={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),c=(s[4]||"").split(";").map(g=>g.trim()).filter(g=>g.length>0),u=this.parseParamsArray(c);switch(l){case"line":t.line.push(u);break;case"word":t.word.push(u);break;case"char":t.char.push(u);break;case"charLine":t.charLine.push(u);break;case"charWord":t.charWord.push(u);break;case"wordLine":t.wordLine.push(u);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(r){return r.replace(/-([a-z])/g,(t,e)=>e.toUpperCase())}parseParamsArray(r){let t={align:"start"};return r.forEach(e=>{if(e==="abs")t.abs=!0;else if(e.startsWith("random")){t.align="random";let i=e.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(e)&&(t.align=e)}),t}};var ae=class{process({value:r}){let t=[],e="",i=0;for(let n=0;n<r.length;n++){let s=r[n];s==="("&&i++,s===")"&&i--,s==="|"&&i===0?(e.trim()&&t.push(e.trim()),e=""):e+=s}return e.trim()&&t.push(e.trim()),t.map(n=>{let s=n.match(/^(\w+)(?:\((.*)\))?$/);if(s){let[,a,l]=s;return l?{key:a,params:l.split(",").map(d=>d.trim())}:{key:a}}let o=n.indexOf(":");if(o!==-1){let a=n.slice(0,o).trim(),l=n.slice(o+1).trim(),d=l?l.split(",").map(c=>c.trim()):void 0;return{key:a,params:d}}return{key:n}})}};var Re=class{constructor(){this.inputValidators={required:r=>r!=null&&String(r).trim()!=="",min:(r,t)=>typeof r=="string"&&r.length>=Number(t?.[0]??0),max:(r,t)=>typeof r=="string"&&r.length<=Number(t?.[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 t=r.trim().toLowerCase();return t==="false"||t==="0"?!1:t.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 t=r.trim();if(t===""||!/^[0-9()\s+-.]+$/.test(t))return!1;let e=t.replace(/\D/g,"").length;return e>=7&&e<=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,t)=>this.testByRegex(r,t?.[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,t,e)=>{let i=t?.[0],n=this.getContextValue(e,i);return i&&n===void 0?!1:this.areValuesEqual(r,n)},different:(r,t,e)=>{let i=t?.[0],n=this.getContextValue(e,i);return i&&n===void 0?!1:!this.areValuesEqual(r,n)},range:(r,t)=>{if(r==null||r==="")return!0;let e=Number(r),i=Number(t?.[0]),n=Number(t?.[1]);return Number.isNaN(e)||Number.isNaN(i)||Number.isNaN(n)?!1:e>=i&&e<=n},digits:(r,t)=>{if(typeof r!="string")return!1;let e=Number(t?.[0]??0);return e<=0?!1:new RegExp(`^\\d{${e}}$`).test(r)},ip:r=>typeof r=="string"&&(this.isIPv4(r)||this.isIPv6(r)),mimes:(r,t)=>this.validateMimes(r,t),max_size:(r,t)=>{let e=Number(t?.[0]);return!e||e<=0?!0:this.validateMaxSize(r,e)},after:(r,t,e)=>this.compareDates(r,t,e,"after"),before:(r,t,e)=>this.compareDates(r,t,e,"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,t)=>{let e=Number(t?.[0]??0);return e<=0?/^\d*$/.test(r):new RegExp(`^\\d{0,${e}}$`).test(r)},url:r=>/^[a-zA-Z0-9\-._~:\/?#\[\]@!$&'()*+,;=%]*$/.test(r),pattern:(r,t)=>{try{return new RegExp(t?.[0]||"").test(r)}catch{return!0}}}}process({rules:r,value:t,type:e="input",context:i}){let n=[];for(let d of r){var s=null,o=null,a=!0,l=!0;e=="input"&&(o=this.inputValidators[d.key],!o)||e=="beforeinput"&&(s=this.beforeInputValidators[d.key],!s)||(o&&(a=o(t,d.params,i)),s&&(l=s(t,d.params,i)),l||n.push(this.getErrorMessage(d.key,d.params)),a||n.push(this.getErrorMessage(d.key,d.params)))}return{valid:n.length===0,errors:n}}getErrorMessage(r,t){switch(r){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(r,t){if(!t||t.length===0)return!0;let e=this.extractFiles(r);if(e.length===0)return!0;let i=t.map(n=>n.trim().toLowerCase());return e.every(n=>this.isMimeAllowed(n,i))}validateMaxSize(r,t){let e=this.extractFiles(r);if(e.length===0)return!0;let i=t*1024;return e.every(n=>typeof n.size!="number"?!0:n.size<=i)}extractFiles(r){if(!r)return[];let t=[];return typeof File<"u"&&r instanceof File?(t.push(r),t):typeof FileList<"u"&&r instanceof FileList?Array.from(r):Array.isArray(r)?(r.forEach(e=>{t.push(...this.extractFiles(e))}),t):typeof r=="object"&&("name"in r||"size"in r||"type"in r)?(t.push(r),t):(typeof r=="string"&&r!==""&&t.push({name:r}),t)}isMimeAllowed(r,t){let e=(r.type||"").toLowerCase(),i=this.getFileExtension(r.name);return t.some(n=>{let s=n.replace(/^\./,"").toLowerCase();return s?s.includes("/")?e===s:i===s:!1})}getFileExtension(r){if(!r)return"";let t=r.split(".");return t.length<=1?"":(t.pop()||"").toLowerCase()}compareDates(r,t,e,i){if(r==null||r==="")return!0;let n=t?.[0];if(!n)return!0;let s=this.toDate(r),o=this.resolveDateReference(n,e);return!s||!o?!1:i==="after"?s.getTime()>o.getTime():s.getTime()<o.getTime()}resolveDateReference(r,t){let e=this.getContextValue(t,r);if(e!==void 0)return this.toDate(e);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 t=new Date(r);return Number.isNaN(t.getTime())?null:t}if(typeof r=="string"){let t=Date.parse(r);if(!Number.isNaN(t))return new Date(t)}return null}testByRegex(r,t,e=!1){if(t==null||t==="")return!0;let i=typeof r=="string"?r:r==null?"":String(r);if(e&&i==="")return!0;try{let{source:n,flags:s}=this.normalizeRegex(t);return new RegExp(n,s).test(i)}catch{return!0}}normalizeRegex(r){let t=r.trim();if(t.startsWith("/")&&t.lastIndexOf("/")>0){let e=t.lastIndexOf("/"),i=t.slice(1,e),n=t.slice(e+1);return{source:i,flags:n}}return{source:t,flags:""}}getContextValue(r,t){if(!(!r||!t)){if(r.values&&Object.prototype.hasOwnProperty.call(r.values,t))return r.values[t];if(r.getValue)return r.getValue(t)}}areValuesEqual(r,t){return Array.isArray(r)||Array.isArray(t)?JSON.stringify(r)===JSON.stringify(t):r===t}isIPv4(r){let t=r.split(".");return t.length!==4?!1:t.every(e=>{if(!/^\d+$/.test(e))return!1;let i=Number(e);return i>=0&&i<=255})}isIPv6(r){if(!r)return!1;if(r==="::")return!0;let t=r.split("::");if(t.length>2)return!1;let e=/^[0-9a-fA-F]{1,4}$/,i=r.split(":");return t.length===2?i.every(n=>n===""||e.test(n))&&i.length<=8:i.length===8&&i.every(n=>e.test(n))}};var si=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,t,e){let i=r.style;if(this.canUseTypedOM(r)&&typeof e=="number"&&Number.isFinite(e))try{r.attributeStyleMap.set(t,CSS.number(e));return}catch{}i.setProperty(t,String(e))}begin(){this.isOpen||(this.isOpen=!0)}setVars(r,t){if(!this.isOpen){console.warn("StyleTxn: call begin() first to set custom properties.");return}let e=this.pendingVars.get(r)??{};for(let[i,n]of Object.entries(t))e[i]!==n&&(e[i]=n);this.pendingVars.set(r,e)}setVar(r,t,e){if(!this.isOpen){console.warn("StyleTxn: call begin() first to set custom properties.");return}let i=this.pendingVars.get(r)??{};i[t]!==e&&(i[t]=e,this.pendingVars.set(r,i))}setVarDirect(r,t,e){this.writeVar(r,t,e)}setProps(r,t){if(!this.isOpen){console.warn("StyleTxn: call begin() first to set standard properties.");return}let e=this.pendingProps.get(r)??{};for(let[i,n]of Object.entries(t))e[i]!==n&&(e[i]=n);this.pendingProps.set(r,e)}setProp(r,t,e){if(!this.isOpen){console.warn("StyleTxn: call begin() first to set standard properties.");return}let i=this.pendingProps.get(r)??{};i[t]!==e&&(i[t]=e,this.pendingProps.set(r,i))}run(r){let t=this.isOpen;t||this.begin();try{r(),t||this.commit()}catch(e){throw t||this.cancel(),e}}commit(){if(this.isOpen){this.isOpen=!1;for(let[r,t]of this.pendingVars)for(let[e,i]of Object.entries(t))this.writeVar(r,e,i);this.pendingVars.clear();for(let[r,t]of this.pendingProps){let e=r.style;for(let[i,n]of Object.entries(t))e[i]=String(n)}this.pendingProps.clear()}}cancel(){this.pendingVars.clear(),this.pendingProps.clear(),this.isOpen=!1}},E=new si;var He=class{constructor(){this.domAttribute=new Xt;this.recordAttribute=new qt;this.transformNullify=new Tt;this.boundingClientRect=new Yt;this.relativePosition=new Kt(this.transformNullify);this.unitParser=new Qt;this.lerp=new Zt;this.adaptiveLerp=new Jt;this.originParser=new te;this.colorParser=new ee;this.validation=new Re;this.easingFunction=new re;this.magneticPull=new ie;this.lerpColor=new ne;this.lerpVector=new se;this.transformScaleParser=new oe;this.optionsParser=new Ie;this.ruleParser=new ae;this.styleTxn=E}};function Fe(){let p=typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)").matches:!1,r=typeof navigator<"u"?(navigator.maxTouchPoints||0)>0:!1,t=typeof window<"u"?window.innerWidth<=768:!1;return p||r||t}var Mi=new WeakMap,X=5e-4,Rt="default",oi="[string-cursor],[data-string-cursor]",Li="[string-cursor-content],[data-string-cursor-content]",ai=1/240,J=(p,r)=>{let t=Math.pow(10,r);return Math.round(p*t)/t};function Cn(p){let r=Mi.get(p);return r||(r={prevX:Number.NaN,prevY:Number.NaN},Mi.set(p,r)),r}var Ve=class extends O{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"]??Rt},{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:e=>this.tools.adaptiveLerp.process({value:e,inMin:.1,inMax:1,outMin:.05,outMax:.65})},{key:"cursor-float",type:"number",fallback:2},{key:"cursor-vars",type:"string",fallback:""}],Fe()&&(this.enabled=!1),this.collectCursorPortals(),this.enabled&&this.bindGlobalLifecycleListeners()}initializeObject(t,e,i,n){super.initializeObject(t,e,i,n),e.setProperty("mouse-x",0),e.setProperty("mouse-y",0),e.setProperty("mouse-pixel-x",0),e.setProperty("mouse-pixel-y",0),e.setProperty("is-mouse-over",!1),e.setProperty("is-mouse-move",!1),e.setProperty("__cursor-vars",this.parseCursorVars(e.getProperty("cursor-vars")));let s=i.getBoundingClientRect();e.setProperty("cached-width",s.width||i.offsetWidth||1),e.setProperty("cached-height",s.height||i.offsetHeight||1)}onResize(){super.onResize(),this.objects.forEach(t=>{let e=t.htmlElement.getBoundingClientRect();t.setProperty("cached-width",e.width||t.htmlElement.offsetWidth||1),t.setProperty("cached-height",e.height||t.htmlElement.offsetHeight||1)})}onMutate(t){if(!this.enabled)return;let e=performance.now(),i=this.lastFrameTime?(e-this.lastFrameTime)/1e3:.016;this.lastFrameTime=e,i>.1&&(i=.1),i<ai&&(i=ai);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"),d=o.getProperty("lerp")??.15,c=this.getFrameAdjustedLerp(d,i),u=this.getObjectDimensions(o),{halfWidth:g,halfHeight:v,width:h,height:m}=u;if(a&&!l){let{cx:b,cy:y}=this.centers.getCenter(o),f=n-(b-g),S=s-(y-v),x=o.getProperty("mouse-pixel-x")??0,w=o.getProperty("mouse-pixel-y")??0,M=x-f,k=w-S;if(M*M+k*k>1e-4){let R=o.getProperty("is-mouse-move")??!1,P=o.getProperty("cursor-enter")??"snap",A=o.getProperty("alignment")??"center";if(!R){if(o.setProperty("is-mouse-move",!0),P==="snap")o.setProperty("mouse-pixel-x",f),o.setProperty("mouse-pixel-y",S),o.setProperty("mouse-x",f),o.setProperty("mouse-y",S),x=f,w=S;else{let Z=o.getProperty("mouse-x")??0,U=o.getProperty("mouse-y")??0;x=this.reverseOffset(A,Z,h),w=this.reverseOffset(A,U,m),o.setProperty("mouse-pixel-x",x),o.setProperty("mouse-pixel-y",w)}this.events.emit(this.getObjectEventName(o,"cursor:start"),null)}let _=this.tools.lerp.process({from:x,to:f,progress:c}),T=this.tools.lerp.process({from:w,to:S,progress:c}),D=x+_,F=w+T,H=Math.abs(D-x)>X||Math.abs(F-w)>X;o.setProperty("mouse-pixel-x",D),o.setProperty("mouse-pixel-y",F);let z=this.calculateOffset(A,D,h),G=this.calculateOffset(A,F,m);o.setProperty("mouse-x",z),o.setProperty("mouse-y",G),this.setMouseCoordinates(o,z,G,D,F)&&this.events.emit(this.getObjectEventName(o,"cursor:move"),{x:z,y:G}),H&&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 R=o.getProperty("alignment")??"center",P=this.calculateOffset(R,f,h),A=this.calculateOffset(R,S,m);this.setMouseCoordinates(o,P,A,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 x=this.calculateOffset("center",g,h),w=this.calculateOffset("center",v,m),M=f+this.tools.lerp.process({from:f,to:x,progress:c}),k=S+this.tools.lerp.process({from:S,to:w,progress:c});o.setProperty("mouse-x",M),o.setProperty("mouse-y",k),Math.abs(M)<.001&&Math.abs(k)<.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,M,k)}}}),this.cursorPortals.size>0){let{stepX:o,stepY:a,smoothedX:l,smoothedY:d}=this.data.cursor,c=this.cursorPrev;(!Number.isFinite(c.x)||Math.abs(l-c.x)>X||Math.abs(d-c.y)>X||Math.abs(o-c.stepX)>X||Math.abs(a-c.stepY)>X)&&(this.events.emit("cursor",{stepX:o,stepY:a,x:l,y:d}),this.cursorPrev={x:l,y:d,stepX:o,stepY:a});let g=this.data.cursor.targetX,v=this.data.cursor.targetY;this.cursorPortals.forEach(h=>{h.forEach(m=>{this.updatePortalPosition(m,g,v,i)})})}}onObjectConnected(t){let e=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 e=t.getProperty("cursor-class");return e!=null&&e.length>0?e:null}onMouseEnter(t){if(!document.contains(t.htmlElement))return;t.setProperty("is-mouse-over",!0),this.hoveredObjects.add(t);let e=this.getCursorClass(t);this.withPortalsForObject(t,i=>{e&&i.element.classList.add(e),this.incrementPortalHover(i)}),t.htmlElement.addEventListener("mouseleave",t.getProperty("mouseleave"))}onMouseLeave(t){t.setProperty("is-mouse-over",!1),this.hoveredObjects.delete(t);let e=this.getCursorClass(t);this.withPortalsForObject(t,i=>{e&&i.element.classList.remove(e),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,e){this.enabled&&((this.shouldRefreshPortals(t)||this.shouldRefreshPortals(e))&&this.collectCursorPortals(),e.length>0&&this.handleRemovedNodes(e))}collectCursorPortals(){this.cursorPortals.clear(),document.querySelectorAll(oi).forEach(e=>{if(!(e instanceof HTMLElement))return;let i=this.resolvePortalId(e),n=this.resolvePortalLerp(e),s=e.matches(Li)?e:e.querySelector(Li),o=this.data.cursor.targetX,a=this.data.cursor.targetY,l={id:i,element:e,content:s,prev:{x:o,y:a,stepX:0,stepY:0},hoverCount:0,showTimer:null,lerp:n},d=this.cursorPortals.get(i);d?d.push(l):this.cursorPortals.set(i,[l])})}resolvePortalId(t){let e=[t.getAttribute("data-string-cursor"),t.getAttribute("string-cursor"),t.getAttribute("data-string-cursor-id"),t.getAttribute("string-cursor-id")];for(let i of e)if(i&&i.trim().length>0)return i.trim();return Rt}resolvePortalLerp(t){let e=t.getAttribute("data-string-cursor-lerp")??t.getAttribute("string-cursor-lerp")??this.settings["cursor-lerp"];if(!e)return null;let i=parseFloat(e);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 e of Array.from(t))if(e instanceof Element&&(e.matches(oi)||e.querySelector(oi)))return!0;return!1}withPortalsForObject(t,e){this.getPortalsForObject(t).forEach(n=>e(n))}getPortalsForObject(t){if(this.cursorPortals.size===0)return[];let e=this.extractPortalIds(t),i=[];if(e.forEach(n=>{if(n==="*"){this.cursorPortals.forEach(a=>{a.forEach(l=>i.push(l))});return}let s=n.length>0?n:Rt,o=this.cursorPortals.get(s);o&&o.forEach(a=>i.push(a))}),i.length===0){let n=this.cursorPortals.get(Rt)??this.cursorPortals.values().next().value;n&&n.length>0&&n.forEach(s=>i.push(s))}return i}extractPortalIds(t){if(!t)return[Rt];let e=t.getProperty("cursor-target");return typeof e!="string"||e.trim().length===0?[Rt]:e.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,e,i,n){if(!t.element.isConnected)return;let s=t.prev,o=Number.isFinite(s.x)?s.x:e,a=Number.isFinite(s.y)?s.y:i,l=t.lerp??.1,d=this.getFrameAdjustedLerp(l,n),c=(e-o)*d,u=(i-a)*d,g=n>1e-4?n:1/60,v=c/(g*60),h=u/(g*60);if(Math.abs(c)<X&&Math.abs(u)<X)return;let m=o+c,b=a+u;this.writePortalVars(t.element,{"--x":J(m,2),"--y":J(b,2),"--x-lerp":J(v,3),"--y-lerp":J(h,3)}),s.x=m,s.y=b,s.stepX=c,s.stepY=u}handleRemovedNodes(t){this.hoveredObjects.size!==0&&Array.from(this.hoveredObjects).forEach(e=>{e.htmlElement.isConnected||this.onElementRemovedFromDOM(e)})}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,e,i,n,s){if(t.getProperty("cursor-target-style-disable"))return!1;let o=Cn(t),a=t.getProperty("cursor-float")??2,l=Math.pow(10,a),d=Math.abs(e)<X&&Number.isFinite(o.prevX)&&Math.abs(o.prevX)<X?o.prevX:Math.round(e*l)/l,c=Math.abs(i)<X&&Number.isFinite(o.prevY)&&Math.abs(o.prevY)<X?o.prevY:Math.round(i*l)/l;if(Number.isFinite(o.prevX)&&Math.abs(d-o.prevX)<=X&&Number.isFinite(o.prevY)&&Math.abs(c-o.prevY)<=X)return!1;o.prevX=d,o.prevY=c;let u=t.getProperty("__cursor-vars"),g={"--x":J(d,a),"--y":J(c,a)};if(u&&u.size>0){let h=Number.isFinite(n)?n:t.getProperty("mouse-pixel-x"),m=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)?h-b:0,S=Number.isFinite(y)?m-y:0;t.setProperty("__prev-x-px",h),t.setProperty("__prev-y-px",m);let x=f===0&&S===0?0:Math.atan2(S,f),w=x*180/Math.PI;u.has("xpx")&&(g["--x-px"]=J(h,2)),u.has("ypx")&&(g["--y-px"]=J(m,2)),u.has("dx")&&(g["--dx"]=J(f,3)),u.has("dy")&&(g["--dy"]=J(S,3)),u.has("angle")&&(g["--angle"]=J(x,4)),u.has("angle-deg")&&(g["--angle-deg"]=J(w,2))}let v=()=>{this.applyToElementAndConnects(t,h=>{E.setVars(h,g)})};return E.isOpen?v():E.run(v),!0}writePortalVars(t,e){if(E.isOpen){E.setVars(t,e);return}E.run(()=>{E.setVars(t,e)})}parseCursorVars(t){return t?new Set(t.split(/[|,]/).map(e=>e.trim().toLowerCase()).filter(e=>e.length>0)):new Set}getFrameAdjustedLerp(t,e){let i=Math.min(.99,Math.max(.001,t));if(!Number.isFinite(e)||e<=0)return i;let s=Math.max(e,ai)*60,o=1-Math.pow(1-i,s);return Math.min(.999,Math.max(1e-4,o))}getObjectDimensions(t){let e=t.getProperty("cached-width"),i=t.getProperty("cached-height");if(typeof e=="number"&&typeof i=="number"&&e>0&&i>0){let v=e/2,h=i/2;return{width:e,height:i,halfWidth:v,halfHeight:h}}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"),d=typeof a=="number"&&Number.isFinite(a)?a:s/2,c=typeof l=="number"&&Number.isFinite(l)?l:o/2,u=d>0?d*2:s,g=c>0?c*2:o;return t.setProperty("cached-width",u),t.setProperty("cached-height",g),{width:u,height:g,halfWidth:d,halfHeight:c}}calculateOffset(t,e,i){switch(t){case"start":return e/i;case"end":return(e-i)/i;case"center":default:return(e-i/2)/(i/2)}}reverseOffset(t,e,i){switch(t){case"start":return e*i;case"end":return e*i+i;case"center":default:return e*(i/2)+i/2}}removeObject(t){if(!this.enabled)return super.removeObject(t);let e=this.objectMapOnPage.get(t);e&&this.centers.detach(e),super.removeObject(t)}destroy(){this.unbindGlobalLifecycleListeners(),this.hoveredObjects.clear(),super.destroy()}};var _e=class extends O{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 e=this.originObservers.get(t);e&&(e.disconnect(),this.originObservers.delete(t))}onMouseMove(t){if(!t)return;let e=this.data.cursor.velocityX,i=this.data.cursor.velocityY;if(e===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 u=a.width||1,g=Math.max(0,Math.min(1,(this.data.cursor.targetX-a.left)/u));this.events.emit(this.getObjectEventName(o,"object:impulse","side"),{value:g})}let d=o.getProperty("position-strength")||0;if(d!==0){let u=o.getProperty("continuous-push")??!0,g=o.getProperty("__push-latch")===!0;if(u||!g){let v=o.getProperty("velocity-x")||0,h=o.getProperty("velocity-y")||0;v+=e*d,h+=i*d,o.setProperty("velocity-x",v),o.setProperty("velocity-y",h),u||o.setProperty("__push-latch",!0)}}let c=o.getProperty("rotation-strength")??.75;if(c!==0){let u=o.getProperty("continuous-push")??!0,g=o.getProperty("__rotate-latch")===!0;if(u||!g){let{centerX:v,centerY:h}=this.getRotationOriginFromRect(o,a),m=n-v,b=s-h,y=m*i-b*e,f=o.getProperty("ang-vel-deg")||0;f+=y*c*.02,o.setProperty("ang-vel-deg",f),u||o.setProperty("__rotate-latch",!0)}}}}}cacheRotationOrigin(t){let e=t.getProperty("rotation-origin")??"center center",{x:i,y:n}=this.tools.originParser.toNormalized({value:e});t.setProperty("__rotation-origin-x",i),t.setProperty("__rotation-origin-y",n)}observeRotationOrigin(t){let e="string-rotation-origin",i="data-string-rotation-origin",n=new MutationObserver(s=>{for(let o of s)if(o.type==="attributes"&&(o.attributeName===e||o.attributeName===i)){let a=t.htmlElement.getAttribute(e)??t.htmlElement.getAttribute(i);a!==null&&t.setProperty("rotation-origin",a),this.cacheRotationOrigin(t);break}});n.observe(t.htmlElement,{attributes:!0,attributeFilter:[e,i]}),this.originObservers.set(t,n)}getRotationOriginFromRect(t,e){let i=t.getProperty("__rotation-origin-x")??.5,n=t.getProperty("__rotation-origin-y")??.5;return{centerX:e.left+e.width*i,centerY:e.top+e.height*n}}onFrame(t){let e=this.data.cursor.targetX,i=this.data.cursor.targetY;for(let n of this.objects){let s=n.htmlElement.getBoundingClientRect(),o=e>=s.left&&e<=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,d=s.getProperty("velocity-y")||0,c=s.getProperty("position-tension")??.05,u=s.getProperty("position-friction")??.15,g=s.getProperty("position-max-velocity")??120,v=s.getProperty("max-offset")??220;l-=c*o,d-=c*a;let h=1-u;l*=h,d*=h,l>g?l=g:l<-g&&(l=-g),d>g?d=g:d<-g&&(d=-g),o+=l,a+=d,o>v?o=v:o<-v&&(o=-v),a>v?a=v:a<-v&&(a=-v);let m=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,x=s.getProperty("rotation-max-angle")??18;b-=y*m,b*=1-f,b>S?b=S:b<-S&&(b=-S),m+=b,m>x?(m=x,b*=.35):m<-x&&(m=-x,b*=.35);let w=s.getProperty("sleep-epsilon")??.01,M=l*l+d*d<w*w&&o*o+a*a<w*w,k=Math.abs(b)<w&&Math.abs(m)<w;M?(l||d||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=d=0):(s.setProperty("offset-x",o),s.setProperty("offset-y",a),s.setProperty("velocity-x",l),s.setProperty("velocity-y",d)),k?(m||b)&&(s.setProperty("angle-deg",0),s.setProperty("ang-vel-deg",0),m=b=0):(s.setProperty("angle-deg",m),s.setProperty("ang-vel-deg",b));let C=s.getProperty("position-update-threshold")??.1,R=s.getProperty("rotation-update-threshold")??.15,P=s.getProperty("__prev-css-x")||0,A=s.getProperty("__prev-css-y")||0,_=s.getProperty("__prev-css-rot")||0,T=Math.round(o*10)/10,D=Math.round(a*10)/10,F=Math.round(m*10)/10,H=Math.abs(T-P)>C||Math.abs(D-A)>C,z=Math.abs(F-_)>R;(H||z)&&(s.setProperty("__next-css-x",T),s.setProperty("__next-css-y",D),s.setProperty("__next-css-rot",F)),s.setProperty("__needs-position-update",H),s.setProperty("__needs-rotation-update",z)}}onMutate(){for(let t=0;t<this.objects.length;t++){let e=this.objects[t],i=e.getProperty("__needs-position-update")===!0,n=e.getProperty("__needs-rotation-update")===!0;if(!i&&!n)continue;let s=e.getProperty("__next-css-x")||0,o=e.getProperty("__next-css-y")||0,a=e.getProperty("__next-css-rot")||0;this.applyToElementAndConnects(e,l=>{i&&(E.setVar(l,"--push-x",s),E.setVar(l,"--push-y",o)),n&&E.setVar(l,"--push-rotation",a)}),i&&(e.setProperty("__prev-css-x",s),e.setProperty("__prev-css-y",o),this.events.emit(this.getObjectEventName(e,"object:impulse","move"),{x:s,y:o})),n&&(e.setProperty("__prev-css-rot",a),this.events.emit(this.getObjectEventName(e,"object:impulse","rotate"),{rotation:a})),e.setProperty("__needs-position-update",!1),e.setProperty("__needs-rotation-update",!1)}}};var li=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 e=0;e<r.length;e++)try{r[e]()}catch(i){console.error("Error in frameDOM measure task:",i)}let t=this.mutateQueue;this.mutateQueue=[];for(let e=0;e<t.length;e++)try{t[e]()}catch(i){console.error("Error in frameDOM mutate task:",i)}this.scheduled=!1}},q=new li;var Tn=20,it={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 Ci(p){if(!p)return it.DEFAULT_DURATION;let r=parseFloat(p);return isNaN(r)?it.DEFAULT_DURATION:r}function ze(p,r){let t=[...p].sort((i,n)=>n.breakpoint-i.breakpoint),e=t.find(i=>r>=i.breakpoint);return e?e.value:t[t.length-1]?.value}var Be=class extends O{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||it.DEFAULT_EASING})}onObjectConnected(t){super.onObjectConnected(t);let e=t.htmlElement;E.begin(),E.setProps(e,{position:"relative",boxSizing:"border-box"}),E.commit();let i=this.createState(t,e);this.states.set(t,i),this.attachImgLoaders(t,i,e),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(it.MANUAL_COLS_KEY,Number(s.cols)),s.gap!==void 0&&t.setProperty(it.MANUAL_GAP_KEY,Number(s.gap)),this.scheduleLayout(t,!0,"external-event")})}onFrame(t){let e=t.time.now;this.objectsOnPage.forEach(i=>{let n=this.states.get(i);if(!n||!n.isAnimating)return;let s=0;E.run(()=>{if(n.isAnimatingHeight){let o=e-n.heightStartTime,a=Math.min(1,o/n.heightDuration),l=n.heightEase(a),d=n.startHeight+(n.targetHeight-n.startHeight)*l;E.setProps(i.htmlElement,{height:`${d}px`}),a<1?s++:n.isAnimatingHeight=!1}n.items.forEach((o,a)=>{if(!o.isMoving)return;let l=e-o.startTime,d=l*o.invPosDur,c=d>1?1:d,u=o.posEase(c);o.cx=o.sx+o.dx*u,o.cy=o.sy+o.dy*u;let g=l*o.invSizeDur,v=g>1?1:g,h=o.sizeEase(v);o.cw=o.sw+o.dw*h,E.setProps(a,{transform:`translate3d(${o.cx}px, ${o.cy}px, 0)`,...Math.abs(o.dw)>.05?{width:`${o.cw}px`}:{},willChange:"transform, width"}),c<1||v<1?s++:(o.isMoving=!1,E.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,e)})}onResize(){this.data.system.suppressMasonryResize||this.objectsOnPage.forEach(t=>{this.states.has(t)&&this.scheduleLayout(t,!0,"window-resize")})}cleanupObject(t){let e=this.states.get(t);e&&(e.ro.disconnect(),e.mo.disconnect(),e.resizeDebounceId&&clearTimeout(e.resizeDebounceId),this.states.delete(t))}createState(t,e){let i=e.getBoundingClientRect(),n=a=>{if(!a.length)return;let l=a[0].contentRect,d=this.states.get(t);if(!d||Math.abs(l.width-d.lastObservedWidth)<=.5&&Math.abs(l.height-d.lastObservedHeight)<=.5)return;d.lastObservedWidth=l.width,d.lastObservedHeight=l.height;let c=getComputedStyle(e),u=parseFloat(c.paddingLeft)||0,g=parseFloat(c.paddingRight)||0,v=l.width-u-g;if(v<=0)return;let{columns:h,gap:m}=this.getGridSettings(t),b=(v-m*(h-1))/h;h===d.lastLayoutColumns&&m===d.lastLayoutGap&&Math.abs(b-d.lastLayoutColumnWidth)<=.5||(d.resizeDebounceId&&window.clearTimeout(d.resizeDebounceId),d.resizeDebounceId=window.setTimeout(()=>{d.isResizing=!0,this.scheduleLayout(t,!0,"resize-observer"),d.isResizing=!1},Tn))},s=a=>{let l=this.states.get(t);if(!l)return;let d=!1;for(let c of a)c.removedNodes.length&&c.removedNodes.forEach(u=>{if(u.nodeType===1){let g=u;this.cleanupImgListeners(l,g),l.items.delete(g),d=!0}}),c.addedNodes.length&&c.addedNodes.forEach(u=>{u.nodeType===1&&(this.attachImgLoaders(t,l,u),d=!0)});d&&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:e.offsetHeight,targetHeight:e.offsetHeight,heightStartTime:0,heightDuration:it.DEFAULT_DURATION,heightEase:this.parseEasing(null),isAnimatingHeight:!1,isAnimating:!1,pendingHeight:void 0,pendingHeightAnimate:!1,expectedEndTime:0};return o.ro.observe(e),o.mo.observe(e,{childList:!0}),o}handleAnimationEnd(t,e,i){if(e.pendingHeight!==void 0){let n=e.pendingHeight,s=e.pendingHeightAnimate;if(e.pendingHeight=void 0,e.pendingHeightAnimate=!1,s){e.startHeight=t.htmlElement.offsetHeight,e.targetHeight=n,e.heightStartTime=i,e.heightDuration=it.DEFAULT_DURATION,e.heightEase=this.parseEasing(null),e.isAnimatingHeight=!0,e.isAnimating=!0;return}E.run(()=>{E.setProps(t.htmlElement,{height:`${n}px`})})}e.isAnimating&&this.events.emit("masonry:shuffle:end",{object:t}),e.isAnimating=!1,this.objectManager.refreshLayoutForRoot(t.htmlElement),e.endTimerId&&(window.clearTimeout(e.endTimerId),e.endTimerId=void 0),requestAnimationFrame(()=>{this.events.emit("resize",!0)})}scheduleLayout(t,e,i){let n=this.states.get(t);!n||n.layoutScheduled||(n.layoutScheduled=!0,q.measure(()=>{n.layoutScheduled=!1,this.performSyncLayout(t,n,e,i)}))}performSyncLayout(t,e,i,n){let s=t.htmlElement,o=Array.from(s.children);if(o.length===0)return;let a=s.getBoundingClientRect(),l=getComputedStyle(s),d=parseFloat(l.paddingLeft)||0,c=parseFloat(l.paddingRight)||0,u=parseFloat(l.paddingTop)||0,g=a.width-d-c;if(g<=0)return;let{columns:v,gap:h}=this.getGridSettings(t),m=(g-h*(v-1))/v,y=(t.getProperty("masonry-mode")||"auto")==="auto"&&i&&!e.isResizing&&n!=="window-resize"&&n!=="resize-observer",f=v===e.lastLayoutColumns&&h===e.lastLayoutGap&&Math.abs(m-e.lastLayoutColumnWidth)<=.5,S=0;o.forEach(T=>{let D=e.childIds.get(T);D||(D=e.nextChildId++,e.childIds.set(T,D)),S=S*31+D>>>0}),e.lastLayoutColumns=v,e.lastLayoutGap=h,e.lastLayoutColumnWidth=m,e.lastChildrenHash=S;let x=new Map;i&&o.forEach(T=>{let D=e.items.get(T);D&&x.set(T,D.cw)}),E.begin(),o.forEach(T=>{E.setProps(T,{position:"absolute",top:"0",left:"0",width:`${m}px`})}),E.commit();let w=o.map(T=>T.offsetHeight),M=0;w.forEach(T=>M=M*31+Math.round(T*2)>>>0),e.lastHeightsHash=M,i&&x.size>0&&E.run(()=>{x.forEach((T,D)=>{E.setProps(D,{width:`${T}px`})})});let k=new Array(v).fill(0),C=performance.now(),R=!1,P=0;o.forEach((T,D)=>{let F=w[D],H=0,z=k[0];for(let Y=1;Y<v;Y++)k[Y]<z&&(z=k[Y],H=Y);let G=H*(m+h)+d,j=z+u,Z=m;k[H]=z+F+h;let U=Ci(T.getAttribute("string-masonry-position-time")),st=Ci(T.getAttribute("string-masonry-size-time")),Et=U>0?1/U:1e3,ot=st>0?1/st:1e3,jt=this.parseEasing(T.getAttribute("string-masonry-position-easing")),wt=this.parseEasing(T.getAttribute("string-masonry-size-easing")),I=e.items.get(T);if(I)Math.abs(I.tx-G)+Math.abs(I.ty-j)+Math.abs(I.tw-Z)>.5&&(I.sx=I.cx,I.sy=I.cy,I.sw=I.cw,I.tx=G,I.ty=j,I.tw=Z,I.dx=I.tx-I.sx,I.dy=I.ty-I.sy,I.dw=I.tw-I.sw,I.posEase=jt,I.invPosDur=Et,I.sizeEase=wt,I.invSizeDur=ot,I.startTime=C,I.isMoving=!0,R=!0,P=Math.max(P,U,st));else{let Y=G,L=i?j+30:j;I={sx:Y,sy:L,sw:Z,tx:G,ty:j,tw:Z,dx:0,dy:0,dw:0,cx:Y,cy:L,cw:Z,startTime:C,posEase:jt,invPosDur:Et,sizeEase:wt,invSizeDur:ot,isMoving:i},e.items.set(T,I),i?(I.dx=I.tx-I.sx,I.dy=I.ty-I.sy,I.dw=I.tw-I.sw,R=!0,P=Math.max(P,U,st)):E.run(()=>{E.setProps(T,{transform:`translate3d(${G}px, ${j}px, 0)`,width:`${Z}px`,willChange:"auto"})})}});let A=Math.max(...k);if(Math.abs(e.targetHeight-A)>1)if(i){let T=s.getBoundingClientRect(),D=this.data.viewport.windowHeight;var _=!1;if(T.bottom>=-100&&T.bottom<=D+100){let F=T.top+A-D;if(Math.abs(F)>1&&A<s.offsetHeight){let H=T.top+this.data.scroll.current+A-D;this.events.emit("scrollTo",H),_=!0}}A>=e.targetHeight?(y?(e.startHeight=s.offsetHeight,e.heightStartTime=C,e.heightDuration=it.DEFAULT_DURATION,e.heightEase=this.parseEasing(null),e.isAnimatingHeight=!0):E.run(()=>{E.setProps(t.htmlElement,{height:`${A}px`}),requestAnimationFrame(()=>{this.events.emit("resize",!0)})}),e.targetHeight=A,e.pendingHeight=void 0):(e.pendingHeight=A,e.pendingHeightAnimate=y,e.targetHeight=A,_||E.run(()=>{E.setProps(t.htmlElement,{height:`${A}px`}),requestAnimationFrame(()=>{this.events.emit("resize",!0)})})),R=!0}else e.targetHeight=A,e.pendingHeight=void 0,E.run(()=>{E.setProps(t.htmlElement,{height:`${A}px`})});R&&(e.isAnimating||this.events.emit("masonry:shuffle:start",{object:t}),e.isAnimating=!0,P>0&&(e.expectedEndTime=C+P+32,e.endTimerId&&window.clearTimeout(e.endTimerId),e.endTimerId=window.setTimeout(()=>{e.isAnimating&&(e.pendingHeight!==void 0||e.isAnimatingHeight||(this.events.emit("masonry:shuffle:end",{object:t}),e.isAnimating=!1,e.endTimerId=void 0))},P+50)))}getGridSettings(t){let e=this.data.viewport.windowWidth;if((t.getProperty("masonry-mode")||"auto")==="manual"){let o=t.getProperty(it.MANUAL_COLS_KEY),a=t.getProperty(it.MANUAL_GAP_KEY),l=t.getProperty("masonry-cols")||[],d=t.getProperty("masonry-gap")||[];return{columns:Math.max(1,Math.round(o??ze(l,e)??2)),gap:Math.max(0,a??ze(d,e)??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(ze(n,e)??2)),gap:Math.max(0,ze(s,e)??16)}}attachImgLoaders(t,e,i){(i.tagName==="IMG"?[i]:Array.from(i.querySelectorAll("img"))).forEach(s=>{let o=s;if(o.complete||e.imgUnsubs.has(o))return;let a=()=>{this.scheduleLayout(t,!0,"img-load"),this.cleanupImgListeners(e,o)};o.addEventListener("load",a),o.addEventListener("error",a),e.imgUnsubs.set(o,()=>{o.removeEventListener("load",a),o.removeEventListener("error",a)})})}cleanupImgListeners(t,e){let i=n=>{let s=t.imgUnsubs.get(n);s&&(s(),t.imgUnsubs.delete(n))};e.tagName==="IMG"?i(e):e.querySelectorAll("img").forEach(n=>i(n))}};var Ne=class extends O{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,t,e,i){super.initializeObject(r,t,e,i),t.setProperty("magnetic-active",!1),t.setProperty("magnetic-target-x",0),t.setProperty("magnetic-target-y",0),t.setProperty("magnetic-x",0),t.setProperty("magnetic-y",0),t.setProperty("magnetic-lerp",.1),t.setProperty("event-magnetic-name",this.getObjectEventName(t,"magnetic:move")),t.setProperty("__next-magnetic-x",0),t.setProperty("__next-magnetic-y",0),t.setProperty("__needs-magnetic-update",!1)}onMouseMove(r){for(let t=0;t<this.objects.length;t++){let e=this.objects[t],n=e.htmlElement.getBoundingClientRect(),s=n.left+n.width/2,o=n.top+n.height/2,a=r.clientX-s,l=r.clientY-o,d=Math.sqrt(a**2+l**2),c=e.getProperty("radius")??0,u=e.getProperty("strength")??0,g=this.tools.magneticPull.process({distance:d,radius:c,strength:u});e.setProperty("magnetic-target-x",a*g),e.setProperty("magnetic-target-y",l*g),g>0&&e.setProperty("magnetic-active",!0)}}onFrame(r){for(let t=0;t<this.objects.length;t++){let e=this.objects[t];if(e.getProperty("magnetic-active")===!0){let i=e.getProperty("magnetic-x")??0,n=e.getProperty("magnetic-y")??0,s=e.getProperty("magnetic-lerp")??.1,o=e.getProperty("magnetic-target-x")??0,a=e.getProperty("magnetic-target-y")??0,l=this.tools.lerp.process({from:i,to:o,progress:s}),d=this.tools.lerp.process({from:n,to:a,progress:s});l>-.01&&l<.01&&(l=0,e.setProperty("magnetic-x",o)),d>-.01&&d<.01&&(d=0,e.setProperty("magnetic-y",a)),i+=l,n+=d,e.setProperty("magnetic-x",i),e.setProperty("magnetic-y",n);let c=e.getProperty("event-magnetic-name");c&&this.events.emit(c,{x:i,y:n}),e.setProperty("__next-magnetic-x",i),e.setProperty("__next-magnetic-y",n),e.setProperty("__needs-magnetic-update",!0),o===i&&a===n&&e.setProperty("magnetic-active",!1)}}}onMutate(){for(let r=0;r<this.objects.length;r++){let t=this.objects[r];if(!(t.getProperty("__needs-magnetic-update")===!0))continue;let i=t.getProperty("__next-magnetic-x")??t.getProperty("magnetic-x")??0,n=t.getProperty("__next-magnetic-y")??t.getProperty("magnetic-y")??0;this.applyToElementAndConnects(t,s=>{E.setVar(s,"--magnetic-x",i),E.setVar(s,"--magnetic-y",n)}),t.setProperty("__needs-magnetic-update",!1)}}};var Ht=class extends O{constructor(t){super(t);this.nearOnly=!0;this.useAllObjects=!1;this.maxDistanceMultiplier=1;this.updateThreshold=.1;this.enabled=!0;this.scrollUpdateScheduled=!1;Fe()&&(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 e=this.objectMapOnPage.get(t);e&&(this.centers.detach(e),this.hover.untrack(e)),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 e=this.hover.activeObjects();return this.nearOnly&&e.length?e:this.useAllObjects?this.objectsOnPage:this.objects.length>0?this.objects:t?this.objectsOnPage:this.objects}refreshPointerState(t,e=!1){if(!this.enabled)return;let i=this.data.cursor.targetX,n=this.data.cursor.targetY,s=t?[t]:this.getCursorTargets(e),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:d}=this.centers.getCenter(a),c=i-l,u=n-d,g=c*c+u*u;if(this.nearOnly){if(g>this.data.viewport.windowWidth*this.data.viewport.windowWidth&&!this.hover.isActive(a))continue}else if(o!==null&&g>o)continue;a.setProperty("dx",c),a.setProperty("dy",u),a.setProperty("dist",Math.sqrt(g))}}scheduleCursorUpdate(){!this.enabled||this.scrollUpdateScheduled||(this.scrollUpdateScheduled=!0,q.measure(()=>{this.refreshPointerState(),q.mutate(()=>{this.scrollUpdateScheduled=!1,E.run(()=>{this.onCursorScrollUpdate()})})}))}onCursorScrollUpdate(){}};var di=Math.PI*2,Pn=180/Math.PI,Pi=p=>p<0?0:p>1?1:p,On=(p,r)=>{let t=(r-p)%di;return t>Math.PI&&(t-=di),t<-Math.PI&&(t+=di),p+t},An={computeStep(p,r,t,e,i,n,s,o,a,l,d,c,u,g,v,h,m){let b=a;(h===1||t>e)&&(b=Math.atan2(r,p));let y=i>0?Math.min(t,i):t,f=s,S=o;if(g===1)f=b,S=y;else{let k=On(s,b),C=Pi(n);f+=(k-f)*C,S+=(y-S)*C}let x=f*Pn-90,w=v===1||Number.isNaN(l)||Math.abs(x-l)>c,M=v===1||Number.isNaN(d)||Math.abs(S-d)>u;m.angle=f,m.dist=S,m.tAngle=b,m.tDist=y,m.degRaw=x,m.cssDeg=Math.round(x*10)/10,m.cssDist=Math.round(S*10)/10,m.angleChanged=w?1:0,m.distChanged=M?1:0}},kn={bypassDeadzone:!0},Dn={forceImmediate:!0,forceEmit:!0,bypassDeadzone:!0},Ti=new WeakMap,In=p=>{let r=Ti.get(p);return r||(r={angle:0,dist:0,tAngle:0,tDist:0,prevDeg:NaN,prevDist:NaN},Ti.set(p,r)),r},We=class extends Ht{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:e=>Pi(this.tools.adaptiveLerp.process({value:e,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,e,i,n){super.initializeObject(t,e,i,n),e.setProperty("spotlight-angle-rad",0),e.setProperty("spotlight-distance",0),e.setProperty("spotlight-angle-rad-target",0),e.setProperty("spotlight-distance-target",0),q.measure(()=>{this.refreshPointerState(e,!0),q.mutate(()=>{E.run(()=>{this.updateSpotlightState(e,Dn)})})})}onMutate(t){if(this.enabled){super.onMutate(t);let e=this.getCursorTargets(!1),i=e.length>0?e:this.getCursorTargets(!0);for(let n=0;n<i.length;n++){let s=i[n];this.updateSpotlightState(s)}}}onCursorScrollUpdate(){let t=this.getCursorTargets(!1),e=t.length>0?t:this.getCursorTargets(!0);for(let i=0;i<e.length;i++){let n=e[i];this.updateSpotlightState(n,kn)}}updateSpotlightState(t,e={}){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=In(t);An.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,e.forceImmediate===!0?1:0,e.forceEmit===!0?1:0,e.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,e,i){let n=()=>{this.applyToElementAndConnects(t,s=>{E.setVar(s,"--spotlight-angle",e),E.setVar(s,"--spotlight-distance",i)})};if(E.isOpen){n();return}E.run(n)}};var Oi="-aspect-ready";function Rn(p){if(!p)return!1;let r=p.toLowerCase();return!!(r.endsWith(".svg")||r.startsWith("data:image/svg"))}function Ai(p){let r=new DataView(p);return p.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 ki(p){let r=new DataView(p);if(r.getUint16(0)!==65496)return{width:0,height:0};let t=2;for(;t+9<p.byteLength;){let e=r.getUint16(t);if(t+=2,e===65498||e===65497)break;let i=r.getUint16(t);if(i<2||t+i>p.byteLength)break;if(e>=65472&&e<=65475||e>=65477&&e<=65479||e>=65481&&e<=65483||e>=65485&&e<=65487)return{height:r.getUint16(t+3),width:r.getUint16(t+5)};t+=i}return{width:0,height:0}}function Di(p){let r=new DataView(p);if(p.byteLength<16)return{width:0,height:0};if(r.getUint32(0,!0)!==1179011410||r.getUint32(8,!0)!==1346520407)return{width:0,height:0};let t=12;for(;t+8<=p.byteLength;){let e=r.getUint32(t,!1),i=r.getUint32(t+4,!0),n=t+8;if(e===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(e===1448097824&&n+10<=p.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(e===1448097868&&n+5<=p.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),d=1+((o&63)<<8|s),c=1+((l&15)<<10|a<<2|(o&192)>>6);return{width:d,height:c}}t=n+i+(i&1)}return{width:0,height:0}}function Ii(p,r){let t=(r||"").toLowerCase();if(t.includes("png"))return Ai(p);if(t.includes("jpeg")||t.includes("jpg"))return ki(p);if(t.includes("webp"))return Di(p);let e=Ai(p);return e.width||(e=ki(p),e.width)||(e=Di(p),e.width)?e:{width:0,height:0}}async function Hn(p,r,t){let e=await fetch(p,{mode:"cors",credentials:r?.credentials??"omit",referrerPolicy:r?.referrerPolicy,signal:r?.signal,cache:"default"});if(!e.ok||!e.body)throw new Error(`HTTP ${e.status}`);let i=e.headers.get("content-type"),n=e.body.getReader(),s=1048576,o=4096,a=new Uint8Array(s),l=0,d=0,c=[],u=null,g=!1;for(;;){let{done:m,value:b}=await n.read();if(m)break;if(!b)continue;let y=b.buffer.slice(b.byteOffset,b.byteOffset+b.byteLength);if(c.push(y),!u&&l<s){let f=Math.min(b.byteLength,s-l);if(f>0&&(a.set(b.subarray(0,f),l),l+=f),l-d>=o){let S=l===a.byteLength?a:a.slice(0,l),x=Ii(S.buffer,i);x.width&&x.height&&(u=x,!g&&t&&(t(u),g=!0)),d=l}}}if(!u){let m=await new Response(new Blob(c)).arrayBuffer(),b=Ii(m,i);b.width&&b.height&&(u=b,!g&&t&&(t(u),g=!0))}let v=new Blob(c,{type:i||"application/octet-stream"}),h=URL.createObjectURL(v);return{dims:u,blobUrl:h,contentType:i}}var Ge=class extends O{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(e=>this.ensureState(e)),this.isStartLoaded=!0}onObjectConnected(t){let e=t.htmlElement;if(!(e instanceof HTMLImageElement))return;e.getAttribute("src")||e.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(e);!i.aspectReady&&!i.aspectLoading&&this.prepareAspectRatio(e);let n=o=>{this.handleInView(e,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(e,i,!0)}onObjectDisconnected(t){let e=t.htmlElement;if(!(e instanceof HTMLImageElement))return;let i=this.imageStates.get(e);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 e=this.imageStates.get(t);if(!e){let i=this.readSource(t);return e={src:i,aspectReady:!1,contentReady:!1,aspectLoading:!1,contentLoading:!1,pendingActivation:!1,rangeAttempted:!1,fetching:!1},this.imageStates.set(t,e),t.classList.contains("lazyLoad")||t.classList.add("lazyLoad"),t.dataset&&!t.dataset.stringLazySrc&&i&&(t.dataset.stringLazySrc=i),e}return e.src||(e.src=this.readSource(t)),e}readSource(t){let e=this.tools.domAttribute.process({element:t,key:this.htmlKey,fallback:""});return typeof e=="string"?e:e==null?"":String(e)}handleInView(t,e,i){e.pendingActivation=i,i&&(e.aspectReady?this.maybeActivateImage(t,e):e.aspectLoading||this.prepareAspectRatio(t))}async prepareAspectRatio(t){let e=this.ensureState(t);if(!e.src||e.aspectLoading||e.aspectReady)return;if(Rn(e.src)){e.aspectReady=!0,e.allowSrcFallback=!0,this.maybeActivateImage(t,e);return}e.aspectLoading=!0,e.fetching=!0;let i=t.getAttribute("crossorigin"),n=t.getAttribute("referrerpolicy"),s=new AbortController;e.controller=s;try{let{blobUrl:o}=await Hn(e.src,{credentials:i==="use-credentials"?"include":"omit",referrerPolicy:n||void 0,signal:s.signal},a=>{a.width>0&&a.height>0&&!e.aspectReady&&(t.style.aspectRatio=`${a.width} / ${a.height}`,t.classList.add(Oi),e.width=a.width,e.height=a.height,e.aspectReady=!0)});e.blobUrl=o,!e.aspectReady&&e.width&&e.height&&(t.style.aspectRatio=`${e.width} / ${e.height}`,t.classList.add(Oi),e.aspectReady=!0)}catch{e.allowSrcFallback=!0,e.aspectReady=!0}finally{e.fetching=!1,e.aspectLoading=!1,this.maybeActivateImage(t,e)}}maybeActivateImage(t,e){!e.pendingActivation||e.contentReady||e.contentLoading||!e.aspectReady||!e.src||e.fetching&&!e.blobUrl||(e.blobUrl||e.allowSrcFallback)&&this.activateImage(t,e)}activateImage(t,e){e.contentLoading=!0,this.loadingCount++;let i=o=>{e.contentLoading&&(e.contentLoading=!1,e.pendingActivation=!1,this.loadingCount=Math.max(0,this.loadingCount-1),o&&(e.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",e.blobUrl?(t.removeAttribute("srcset"),t.removeAttribute("sizes"),t.src=e.blobUrl):t.src=e.src,t.complete&&t.naturalWidth>0&&t.naturalHeight>0&&(t.removeEventListener("load",n),t.removeEventListener("error",s),i(!0))}};var $e=class extends O{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 je=class extends O{constructor(r){super(r),this.htmlKey=""}canConnect(r){return r.keys[0]==null}};var Ft=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,t){this.min=r??void 0,this.max=t??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}},Ue=class extends O{constructor(t){super(t);this.queries={0:new Ft({max:359}),1:new Ft({min:360,max:1023}),2:new Ft({min:1024,max:1365}),3:new Ft({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,e=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!=e&&this.events.emit("screen:tablet",e),this.isLaptopMedia!=i&&this.events.emit("screen:laptop",i),this.isDesktopMedia!=n&&this.events.emit("screen:desktop",n),this.isMobileMedia=t,this.isTabletMedia=e,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")&&e&&(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 Ye=class extends O{constructor(r){super(r),this.htmlKey="anchor",this.attributesToMap=[...this.attributesToMap,{key:"anchor",type:"tuple",fallback:this.settings.anchor,transform:t=>{let[e,i]=t,n=this.tools.originParser.process({value:e}),s=this.tools.originParser.process({value:i});return{x:n,y:s}}}]}onObjectConnected(r){super.onObjectConnected(r);let t=r.getProperty("anchor");t&&this.applyToElementAndConnects(r,e=>{e.style.transformOrigin=`${t.x} ${t.y}`})}};var Fn=.05,Vn=.01,Ri=1,_n=-1,zn=1,Xe=class extends O{constructor(t){super(t);this.defaultModeScope=["smooth"];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 e=t.getProperty("glide-value")??0,i=-this.data.scroll.displacement*this.maxDisplacementValue*e,n=t.getProperty("event-glide-name");n&&this.events.emit(n,i);let s=`translate3d(0, ${i}px, 0)`;t.setProperty("__next-glide-transform",s),t.setProperty("__needs-glide-transform-update",!0)};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,e,i,n){super.initializeObject(t,e,i,n),e.setProperty("glide-value",e.getProperty("glide")??0),e.setProperty("event-glide-name",this.getObjectEventName(e,"object:glide")),e.setProperty("__next-glide",0),e.setProperty("__next-glide-transform","translate3d(0, 0px, 0)"),e.setProperty("__needs-glide-var-update",!1),e.setProperty("__needs-glide-transform-update",!1)}updateTransforms(){for(let t=0;t<this.objects.length;t++)this.setupItem(this.objects[t])}resetObjectStyles(t){for(let e=0;e<t.length;e++){let i=t[e];i.setProperty("__next-glide-transform","translate3d(0, 0px, 0)"),i.setProperty("__needs-glide-transform-update",!0),i.setProperty("__next-glide",0),i.setProperty("__needs-glide-var-update",!0)}}calcExpanderFactor(t){let e=t?this.data.scroll.lerped<this.previousLerp:this.data.scroll.lerped>this.previousLerp;this.velocityMultiplier=e?this.isInitialScroll?this.baseVelocityMultiplier:this.reducedVelocityMultiplier:this.negativeVelocityMultiplier,e||(this.isInitialScroll=!1)}onStart(){this.maxDisplacementValue=this.data.viewport.windowHeight*.1}onResize(){this.maxDisplacementValue=this.data.viewport.windowHeight*.1}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,this.resetObjectStyles(this.objects),this.flushPendingGlideStyles()}onFrame(t){this.calcExpanderFactor(this.data.scroll.isScrollingDown===!1),this.acceleration=Math.min(Ri,this.acceleration+Fn),this.displacement=Math.max(Vn,Math.min(Ri,this.displacement+this.velocityMultiplier)),this.data.scroll.displacement=Math.min(zn,Math.max(_n,this.data.scroll.lerped*this.displacement*this.acceleration));let e=this.data.scroll.displacement;for(let i=0;i<this.objects.length;i++){let n=this.objects[i];n.setProperty("__next-glide",e),n.setProperty("__needs-glide-var-update",!0)}this.previousLerp=this.data.scroll.lerped,this.updateTransforms()}onObjectModeDeactivated(t){super.onObjectModeDeactivated(t),this.resetObjectStyles([t]),E.run(()=>{this.applyPendingGlideStylesForObject(t)})}onMutate(){this.applyPendingGlideStyles()}applyPendingGlideStylesForObject(t){let e=t.getProperty("__next-glide")??0,i=t.getProperty("__next-glide-transform")??"translate3d(0, 0px, 0)";this.applyVarToElement(t,"--glide",e),this.applyVarToConnects(t,"--glide",e),this.applyPropToElement(t,"transform",i),t.setProperty("__needs-glide-var-update",!1),t.setProperty("__needs-glide-transform-update",!1)}applyPendingGlideStyles(){for(let t=0;t<this.objects.length;t++){let e=this.objects[t],i=e.getProperty("__needs-glide-var-update")===!0,n=e.getProperty("__needs-glide-transform-update")===!0;if(!(!i&&!n)){if(i){let s=e.getProperty("__next-glide")??this.data.scroll.displacement;this.applyVarToElement(e,"--glide",s),this.applyVarToConnects(e,"--glide",s),e.setProperty("__needs-glide-var-update",!1)}if(n){let s=e.getProperty("__next-glide-transform")??"translate3d(0, 0px, 0)";this.applyPropToElement(e,"transform",s),e.setProperty("__needs-glide-transform-update",!1)}}}}flushPendingGlideStyles(){if(E.isOpen){this.applyPendingGlideStyles();return}E.run(()=>{this.applyPendingGlideStyles()})}};var qe=class extends O{constructor(t){super(t);this.hasInitializedCSS=!1;this.defaultModeScope=["smooth"];this.htmlKey="lerp",this.cssProperties=[{name:"--lerp",syntax:"<number>",initialValue:"0",inherits:!0}],this.attributesToMap=[]}onObjectConnected(t){super.onObjectConnected(t),t.setProperty("lerp-value",0),t.setProperty("lerp-applied",0),t.setProperty("event-lerp-name",this.getObjectEventName(t,"object:lerp"))}onResize(){super.onResize(),!this.hasInitializedCSS&&this.objectsOnPage.length>0&&(this.hasInitializedCSS=!0,E.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 e=t.scroll.lerped;for(let i=0;i<this.objects.length;i++)this.recomputeLerp(this.objects[i],e)}recomputeLerp(t,e){(t.getProperty("lerp-value")??0)!==e&&(t.setProperty("lerp-value",e),this.updateObjectLerp(t))}onMutate(){E.run(()=>{let t=this.objects.length;for(let e=0;e<t;e++)this.updateObjectLerp(this.objects[e])})}updateObjectLerp(t,e=!1){let i=t.getProperty("lerp-value")??0,n=t.getProperty("lerp-applied");if(!e&&n===i)return;t.setProperty("lerp-applied",i);let s=i?.toString()??"0",o=t.getProperty("event-lerp-name");o&&this.events.emit(o,i),E.run(()=>{this.applyVarToElement(t,"--lerp",s),this.applyVarToConnects(t,"--lerp",s)})}onObjectDisconnected(t){super.onObjectDisconnected(t);let e=n=>{n.style.removeProperty("--lerp")};e(t.htmlElement);let i=t.mirrorObjects;for(let n=0;n<i.length;n++)e(i[n].htmlElement)}};var ut="__string-dev-progress-override",Hi={computeRawProgress(p,r,t){if(t===0)return 0;let e=(p-r)/t;return e<=0?0:e>=1?1:e},computeRawProgressBatch(p,r,t,e,i){for(let n=0;n<i;n++){let s=t[n];if(s===0){e[n]=0;continue}let o=(p-r[n])/s;o<=0?e[n]=0:o>=1?e[n]=1:e[n]=o}}},Vt=class extends O{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,e,i,n){super.initializeObject(t,e,i,n)}sanitizeRawProgress(t){if(!Number.isFinite(t)||t<=0)return 0;if(t>=1)return 1;let e=1e-4;return t>1-e?t=1:t<e&&(t=0),t}resolveRawProgress(t,e,i,n){let s=t.getProperty(ut);return s!=null?this.sanitizeRawProgress(s):Hi.computeRawProgress(e,i,n)}applyRawProgress(t,e){let i=this.sanitizeRawProgress(e);if((t.getProperty("progress-raw")??0)===i)return;t.setProperty("progress-raw",i);let s=t.getProperty("easing"),o=typeof s=="function"?s(i):i;t.setProperty("progress-value",o)}recomputeProgress(t){let e=t.getProperty("start-position")??t.getProperty("progress-start-position")??0,i=t.getProperty("difference-position")??t.getProperty("progress-difference-position")??0;t.setProperty("progress-start-position",e),t.setProperty("progress-difference-position",i);let n=this.resolveRawProgress(t,this.data.scroll.transformedCurrent,e,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,e){super.calculatePositions(t,e),t.setProperty("progress-start-position",t.getProperty("start-position")??t.getProperty("progress-start-position")??0),t.setProperty("progress-difference-position",t.getProperty("difference-position")??t.getProperty("progress-difference-position")??0),this.recomputeProgress(t)}onScroll(t){super.onScroll(t)}onObjectConnected(t){super.onObjectConnected(t)}onScrollMeasure(t){let e=this.objects.length;if(e!==0){this.ensureBatchCapacity(e);for(let i=0;i<e;i++){let n=this.objects[i],s=n.getProperty("start-position")??n.getProperty("progress-start-position")??0,o=n.getProperty("difference-position")??n.getProperty("progress-difference-position")??0;n.setProperty("progress-start-position",s),n.setProperty("progress-difference-position",o),this.batchStarts[i]=s,this.batchDiffs[i]=o}Hi.computeRawProgressBatch(this.data.scroll.transformedCurrent,this.batchStarts,this.batchDiffs,this.batchOut,e);for(let i=0;i<e;i++){let n=this.objects[i],s=n.getProperty(ut),o=s!=null?this.sanitizeRawProgress(s):this.batchOut[i];this.applyRawProgress(n,o)}}}onMutate(){E.run(()=>{let t=this.objects.length;for(let e=0;e<t;e++)this.updateObjectProgress(this.objects[e])})}updateObjectProgress(t){let e=t.getProperty("progress-value")??0;if(t.getProperty("progress-applied")===e)return;let n=t.getProperty("key");t.setProperty("progress-applied",e);let s=t.getProperty("progress-raw")??e,o=t.getProperty("easing"),a=t.getProperty("event-progress-name")??t.getScopedEventName("object:progress");t.setProperty("event-progress-name",a),a&&this.events.emit(a,e),n&&this.applyVarToElement(t,n,e);for(let l=0;l<t.mirrorObjects.length;l++){let d=t.mirrorObjects[l],c=d.applyProgress(s,typeof o=="function"?o:void 0);d.setProperty("progress",c),n&&this.tools.styleTxn.setVar(d.htmlElement,n,c)}}onObjectDisconnected(t){super.onObjectDisconnected(t);let e=t.getProperty("key");if(!e)return;let i=s=>{s.style.removeProperty(e)};i(t.htmlElement);let n=t.mirrorObjects;for(let s=0;s<n.length;s++)i(n[s].htmlElement)}};var Ke=class extends Vt{constructor(t){super(t);this.defaultModeScope=["smooth"];this.updateScheduledTransform=!1;this.calculateParallax=t=>{let e=t.getProperty("progress-value")??0,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+e*a*s);return this.events.emit(this.getObjectEventName(t,"object:parallax"),l),{transform:`translate3d(0, ${l}px, 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.calculateParallax}initializeObject(t,e,i,n){super.initializeObject(t,e,i,n);let s=e.getProperty("parallax-bias")??0,o=Math.abs(e.getProperty("parallax")??.2);e.setProperty("parallax-sign",Math.sign(e.getProperty("parallax"))),e.setProperty("parallax",o),e.setProperty("parallax-position-start",-.5+.5*s),e.setProperty("parallax-position-end",.5+.5*(1-s));let a=this.data.viewport.windowHeight;e.setProperty("offset-top",o*a),e.setProperty("offset-bottom",o*a)}calculatePositions(t,e){super.calculatePositions(t,e),t.setProperty("parallax-transform-value",this.calculateParallaxForObject(t))}onScroll(t){super.onScroll(t)}onScrollMeasure(t){super.onScrollMeasure(t);for(let e=0;e<this.objects.length;e++){let i=this.objects[e];i.setProperty("parallax-transform-value",this.calculateParallaxForObject(i))}}onMutate(){E.run(()=>{for(let t=0;t<this.objects.length;t++){let e=this.objects[t],i=e.getProperty("parallax-transform-value");i&&(this.applyPropToElement(e,"transform",i.transform),this.applyPropToConnects(e,"transform",i.transform))}})}};var Ze=class{constructor(r,t,e,i){this.isDragging=!1;this.startY=0;this.startScrollPosition=0;this.data=r,this.scrollbar=t,this.thumb=e,this.onScrollTo=i}onResize(){let r=this.data.viewport.contentWidth,t=this.data.viewport.windowWidth,e=t/r*t;this.thumb.style.setProperty("--size",e+"px"),r<=t?this.scrollbar.classList.add("-hide"):this.scrollbar.classList.remove("-hide")}updateThumb(){let r=this.data.viewport.contentWidth,t=this.data.viewport.windowWidth;this.thumb.style.setProperty("--position",`${this.data.scroll.current/r*t+"px"}`)}mouseDownEvent(r){this.startY=r.clientY,this.startScrollPosition=this.data.scroll.current}mouseMoveEvent(r){let t=r.clientY-this.startY,e=this.startScrollPosition+t/this.data.viewport.windowWidth*this.data.viewport.contentWidth;this.data.scroll.current=e,this.data.scroll.target=e,this.onScrollTo(e),this.updateThumb()}};var Qe=class{constructor(r,t,e,i){this.isDragging=!1;this.startCoordinate=0;this.startScrollPosition=0;this.data=r,this.scrollbar=t,this.thumb=e,this.onScrollTo=i}onResize(){let r=this.data.viewport.contentHeight,t=this.data.viewport.windowHeight,e=t/r*t;this.thumb.style.setProperty("--height",e+"px"),r<=t?this.scrollbar.classList.add("-hide"):this.scrollbar.classList.remove("-hide")}updateThumb(){let r=this.data.viewport.contentHeight,t=this.data.viewport.windowHeight;this.thumb.style.setProperty("--position",`${this.data.scroll.current/r*t+"px"}`)}mouseDownEvent(r){this.startCoordinate=r.clientY,this.startScrollPosition=this.data.scroll.current}mouseMoveEvent(r){let t=r.clientY-this.startCoordinate,e=this.startScrollPosition+t/this.data.viewport.windowHeight*this.data.viewport.contentHeight,i=this.data.scroll.bottomPosition,n=Math.max(0,Math.min(e,i));this.data.scroll.current=n,this.data.scroll.target=n,this.onScrollTo(n),this.updateThumb()}};var Je=class extends O{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=e=>{this.events.emit("scrollTo",{position:e,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,2983 @@
|
|
|
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}onInit(){let r=()=>{this.objectsOnPage.forEach(e=>{this.onObjectConnected(e)})};document.fonts.ready.then(r),document.fonts.addEventListener("loadingdone",r)}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=`
|
|
20
|
-
[${
|
|
21
|
-
content: 'FPS: ' attr(${
|
|
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 Ze(this.data,this.scrollbar,this.thumb,this.requestScrollTo),this.scrollbarStateVertical=new Qe(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 Pt={BEFORE_ELEMENT:"-before-element",AFTER_ELEMENT:"-after-element"};function Bn(p){if(!p||!Array.isArray(p.chars)||p.chars.length===0)return[];let r=p.chars[0].splitClass??[];if(r.length===0)return[];for(let t of p.chars){let e=t.splitClass??[];if(e.length!==r.length)return[];for(let i=0;i<e.length;i++)if(e[i]!==r[i])return[]}return r}function Nn(p){return p.chars[0]?.token?.meta?.wrappers??[]}function Fi(p,r,t){let e=document.createDocumentFragment(),i=0,n=tt(r,"line")||tt(r,"charLine")||tt(r,"wordLine"),s=tt(r,"char")||tt(r,"charLine")||tt(r,"charWord"),o=0;p.forEach(u=>o+=u.words.length),o--;let a=0;p.forEach(u=>u.words.forEach(g=>a+=g.chars.length));let l=p.length,d=o+1,c=new Map;return p.forEach((u,g)=>{let v=g===p.length-1,h=e,m=[];n&&(h=document.createElement("span"),h.setAttribute("aria-hidden","true"),h.classList.add("-s-line"),u.isBeforeElement&&h.classList.add(Pt.BEFORE_ELEMENT),u.isAfterElement&&h.classList.add(Pt.AFTER_ELEMENT),h.style.setProperty("--line-index",String(u.lineIndex)),h.style.setProperty("--word-total",String(u.words.length)),u.fitFontSize!==void 0&&h.style.setProperty("--fit-font-size",String(u.fitFontSize)),ci(h,u.calculatedValues,r));let b=[],y=h;if(u.words.forEach((f,S)=>{n&&(o=u.words.length-1);let x=S===o,w=Nn(f),M=0;for(;M<b.length&&M<w.length&&b[M].info.id===w[M].id;)M++;for(;b.length>M;)b.pop();y=b.length>0?b[b.length-1].element:h;for(let T=M;T<w.length;T++){let D=w[T],F=document.createElement(D.tag);for(let[H,z]of D.attributes)F.setAttribute(H,z);y.appendChild(F),b.push({info:D,element:F}),y=F}if(f.chars.length===1&&f.chars[0].token.type==="element"){let T=f.chars[0].token.node.cloneNode(!0);y.appendChild(T);return}let C=f.chars.map(T=>T.char).join("");C&&m.push(C);let R=tt(r,"word")||tt(r,"charWord")||tt(r,"wordLine"),P=R?document.createElement("span"):y,A=Bn(f);if(R&&(P.setAttribute("aria-hidden","true"),P.classList.add("-s-word"),f.isBeforeElement&&P.classList.add(Pt.BEFORE_ELEMENT),f.isAfterElement&&P.classList.add(Pt.AFTER_ELEMENT),P.style.setProperty("--word-index",String(f.wordIndexGlobal)),P.style.setProperty("--char-total",String(f.chars.length)),P.setAttribute("data-split-content",C),ci(P,f.calculatedValues,r),A.length&&P.classList.add(...A)),s)f.chars.forEach((T,D)=>{if(T.char===" "||T.char===" ")return;let F=document.createElement("span");F.setAttribute("aria-hidden","true");let H=F;H.classList.add("-s-char"),T.isBeforeElement&&H.classList.add(Pt.BEFORE_ELEMENT),T.isAfterElement&&H.classList.add(Pt.AFTER_ELEMENT),H.textContent=T.char,H.setAttribute("data-split-content",T.char),H.style.setProperty("--char-index",String(i++));let z=f.chars[D+1];if(z){let j=t.getKerning(T.char,z.char);Math.abs(j)>.01&&(H.style.setProperty("--kerning",`${j.toFixed(2)}px`),H.style.marginRight="var(--kerning)")}ci(H,T.calculatedValues,r);let G=T.splitClass??[];G.length&&!A.length&&H.classList.add(...G),P.appendChild(F)});else{let T=document.createTextNode(C);P.appendChild(T)}R&&y.appendChild(P);let _=u.words[S+1]?.noSpaceBefore;n?x?v||h.appendChild(document.createElement("br")):_||P.appendChild(document.createTextNode("\xA0")):!x&&!_&&P.appendChild(document.createTextNode("\xA0"))}),n){let f=m.join(" ");h.setAttribute("data-split-content",f),e.appendChild(h)}}),s&&c.set("--char-global-total",String(a)),(tt(r,"word")||tt(r,"charWord")||tt(r,"wordLine"))&&c.set("--word-global-total",String(d)),n&&c.set("--line-global-total",String(l)),{fragment:e,extraProps:c}}function ci(p,r,t){if(r)for(let e of r){if(!Wn(e.type,e.align,t))continue;let i=Gn(e.type,e.align);p.style.setProperty(i,String(e.value))}}function Wn(p,r,t){let e=t[p]??[];return Array.isArray(e)&&e.some(i=>r.startsWith("random")?i.align.startsWith("random"):i.align===r)}function Gn(p,r){let t=r.startsWith("random")?"random":r;return`--${p}-${t}`}function tt(p,r){return Array.isArray(p[r])&&p[r].length>0}var $n=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 jn(p){let r=[];for(let t=0;t<p.attributes.length;t++){let e=p.attributes[t];r.push([e.name,e.value])}return r}var _t=0;function Vi(p){_t=0;let r=[],t=(i,n)=>{n&&Object.keys(n).length&&(i.meta={...i.meta||{},...n}),r.push(i)},e=(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(d=>e(d,l));return}if(o==="br"){t({type:"br",id:`br_${_t++}`,node:s,tagName:"br"},n);return}if(!$n.has(o)&&s.childNodes.length>0){let a={id:`wrapper_${_t++}`,tag:o,attributes:jn(s)},l=n?.wrappers??[],d={...n||{},wrappers:[...l,a]};s.childNodes.forEach(c=>e(c,d));return}t({type:"element",id:`el_${_t++}`,node:s,tagName:o},n);return}if(i.nodeType===Node.TEXT_NODE){let s=i.nodeValue??"",o=`text_${_t++}`;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_${_t++}`,node:i},n)};return p.forEach(i=>e(i)),r}var tr=class{constructor(r){this.font="";this.cache={kerning:new Map,charWidth:new Map};let t=document.createElement("canvas");this.ctx=t.getContext("2d"),this.setFontFromElement(r)}setFontFromElement(r){let t=window.getComputedStyle(r),e=`${t.fontStyle} ${t.fontVariant} ${t.fontWeight} ${t.fontSize}/${t.lineHeight} ${t.fontFamily}`;e!==this.font&&(this.font=e,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 t=this.ctx.measureText(r).width;return this.cache.charWidth.set(r,t),t}getKerning(r,t){let e=`${r}${t}`,i=`${this.font}|${e}`;if(this.cache.kerning.has(i))return this.cache.kerning.get(i);let n=this.ctx.measureText(e).width,s=this.getCharWidth(r)+this.getCharWidth(t),o=n-s;return this.cache.kerning.set(i,o),o}measureWord(r){let t=0;for(let e=0;e<r.length;e++){let i=r[e];if(t+=this.getCharWidth(i),e>0){let n=r[e-1];t+=this.getKerning(n,i)}}return t}};function Un(p,r){return!p?.length&&!r?.length?!0:!p||!r||p.length!==r.length?!1:p.every((t,e)=>t.id===r[e].id)}function Yn(p){let r=[],t=[];for(let e of p)e.type==="br"?(t.length&&r.push(t),r.push([e]),t=[]):t.push(e);return t.length&&r.push(t),r}function _i(p,r,t){let e=document.createElement("div"),i=window.getComputedStyle(r);e.style.position="absolute",e.style.visibility="hidden",e.style.pointerEvents="none",e.style.width=r.clientWidth+"px",e.style.padding=i.padding,e.style.font=i.font,e.style.letterSpacing=i.letterSpacing,e.style.lineHeight=i.lineHeight,e.style.fontVariant=i.fontVariant,e.style.fontStretch=i.fontStretch,e.style.wordBreak=i.wordBreak,e.style.wordWrap=i.wordWrap,e.style.whiteSpace=i.whiteSpace,e.style.textTransform=i.textTransform;let n=document.createElement("span");n.textContent="\xA0",e.appendChild(n);let s=n.getBoundingClientRect().width;e.removeChild(n),e.style.width=r.clientWidth+s+"px",e.style.boxSizing="border-box",r.appendChild(e);let o=[],a=Yn(p),l=!1,d=!1,c=!1,u;for(let g of a){if(g.length===1&&g[0].type==="br"){o.push({token:g[0],rect:new DOMRect(0,0,0,0)});continue}if(g.length===0)continue;e.innerHTML="";let v=[],h=[];g.forEach(m=>{switch(m.type){case"text":{let b=m.content,y=/^\s/.test(b),f=/\s$/.test(b),S=m.meta?.wrappers??[],x=b.trim().split(/\s+/).filter(w=>w.length>0);x.forEach((w,M)=>{let k=document.createElement("span");if(k.style.display="inline-block",S.length>0){let P=k;for(let A of S){let _=document.createElement(A.tag);for(let[T,D]of A.attributes)_.setAttribute(T,D);P.appendChild(_),P=_}P.textContent=w}else k.textContent=w;e.appendChild(k),(M<x.length-1||f)&&e.appendChild(document.createTextNode(" "));let C=M===0&&!y&&!d&&c,R=M>0||Un(u,S);v.push(k),h.push({token:{type:"text",id:"",node:m.node,content:w,meta:{...m.meta||{},joinPrev:C&&R,noSpaceBefore:C&&!R}},wordIndex:v.length-1,hadLeadingSpace:y,hadTrailingSpace:f})}),d=f,c=!0,u=S;break}case"element":{let b=m.node.cloneNode(!0),y=document.createElement("span");y.style.display="inline-block",y.appendChild(b),e.appendChild(y),v.push(y),h.push({token:m,wordIndex:v.length-1}),l=!0,c=!1,d=!1;break}case"space":d=!0;break;case"other":c=!1,d=!1;break}}),e.offsetHeight,h.forEach((m,b)=>{if(m.wordIndex!==void 0){let f=v[m.wordIndex].getBoundingClientRect(),S;if(m.token.type==="text"){let w=t.measureWord(m.token.content);S=new DOMRect(f.x,f.y,w,f.height)}else S=f;let x={token:m.token,rect:S,browserWidth:f.width};if(l&&m.token.type==="text"&&(l=!1,x.token.meta={...x.token.meta||{},isAfterElement:!0}),o.push(x),m.token.type==="element"){let w=o[o.length-2];w?.token.type==="text"&&(w.token.meta={...w.token.meta||{},isBeforeElement:!0})}}})}return r.removeChild(e),o}var zi=5;function Bi(p,r,t){let e=[],i=null,n=0,s=0,o=0,a=0;return p.forEach(l=>{let d=l.token,c=d.meta?.isBeforeElement??!1,u=d.meta?.isAfterElement??!1;if(d.type==="br"){i=null;return}if(d.type==="text"){let g=d.content,v=d.meta?.splitClass??[],h=!!d.meta?.joinPrev,m=[],b=0;for(let C=0;C<g.length;C++){let R=g[C],P=C>0?g[C-1]:null,A=t.getCharWidth(R),_=P?t.getKerning(P,R):0;b+=_;let T=new DOMRect(l.rect.left+b,l.rect.top,A,l.rect.height),D={char:R,rect:T,token:d,charIndexInWord:C,charIndexInLine:0,charIndexGlobal:s++};v.length&&(D.splitClass=v),m.push(D),b+=A}if(m.length>0){let C=m[m.length-1];c&&(C.isBeforeElement=!0),u&&(C.isAfterElement=!0)}let y=Math.round(l.rect.top),f=Math.round(n);if((!i||Math.abs(y-f)>zi)&&(n=y,i={words:[],rect:l.rect,lineIndex:e.length},a=0,e.push(i)),!i)return;let x=l.rect.left+(l.browserWidth??l.rect.width);if(h&&i.words.length>0){let C=i.words[i.words.length-1],R=i.words.reduce((A,_)=>A+_.chars.length,0),P=C.chars.length;m.forEach((A,_)=>{A.charIndexInLine=R+_,A.charIndexInWord=P+_}),C.chars.push(...m),C.rect=er([C.rect,l.rect]),i.rect=er(i.words.map(A=>A.rect)),a=Math.max(a,x),i.fitWidth=a-i.rect.left,i.browserWordWidthSum=(i.browserWordWidthSum??0)+(l.browserWidth??l.rect.width),c&&(C.isBeforeElement=!0),u&&(C.isAfterElement=!0);return}let w=i.words.length,M=i.words.reduce((C,R)=>C+R.chars.length,0);m.forEach((C,R)=>C.charIndexInLine=M+R);let k={chars:m,rect:l.rect,wordIndexGlobal:o++,wordIndexInLine:w,isBeforeElement:c,isAfterElement:u,noSpaceBefore:!!d.meta?.noSpaceBefore};i.words.push(k),i.rect=er(i.words.map(C=>C.rect)),a=Math.max(a,x),i.fitWidth=a-i.rect.left,i.browserWordWidthSum=(i.browserWordWidthSum??0)+(l.browserWidth??l.rect.width),c&&(i.isBeforeElement=!0),u&&(i.isAfterElement=!0);return}if(d.type==="element"){let g=l.rect,v=Math.round(g.top),h=Math.round(n);if((!i||Math.abs(v-h)>zi)&&(n=v,i={words:[],rect:g,lineIndex:e.length},a=0,e.push(i)),!i)return;let b=i.words.length,y=i.words.reduce((x,w)=>x+w.chars.length,0),S={chars:[{char:"[E]",rect:g,token:d,charIndexInWord:0,charIndexInLine:y,charIndexGlobal:s++}],rect:g,wordIndexGlobal:o++,wordIndexInLine:b,isBeforeElement:!1,isAfterElement:!1};i.words.push(S),i.rect=er(i.words.map(x=>x.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)}}),e}function er(p){if(p.length===0)return new DOMRect(0,0,0,0);let r=Math.min(...p.map(n=>n.left)),t=Math.min(...p.map(n=>n.top)),e=Math.max(...p.map(n=>n.right)),i=Math.max(...p.map(n=>n.bottom));return new DOMRect(r,t,e-r,i-t)}var rr=class extends O{constructor(r){super(r),this.htmlKey="split",this.permissions.mobile.rebuild.height=!1,this.permissions.mobile.rebuild.width=!1}onInit(){let r=()=>{this.objectsOnPage.forEach(t=>{this.onObjectConnected(t)})};document.fonts.ready.then(r),document.fonts.addEventListener("loadingdone",r)}onResizeWidth(){this.objectsOnPage.forEach(r=>{this.onObjectConnected(r)})}onObjectConnected(r){let t=r.htmlElement;if(!t)return;let e=t.classList.contains("-splitted"),i=t.getAttribute("string-split-original");(!e||i===null)&&(i=this.escapeAttribute(t.innerHTML),t.setAttribute("string-split-original",i),t.classList.add("-splitted")),r.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);r.setProperty("nodes",o.childNodes),t.setAttribute("aria-label",i),t.innerHTML="",t.appendChild(a),l.forEach((c,u)=>{t.style.setProperty(u,c)});let d=t.getAttribute("string-split-restore-after");d&&!isNaN(Number(d))&&setTimeout(()=>{t.innerHTML=i,t.classList.add("-restored")},Number(d))}split(r,t){let e=new tr(r),i=document.createDocumentFragment();r.childNodes.forEach(c=>i.appendChild(c.cloneNode(!0)));let n=Vi(i.childNodes),s=_i(n,r,e),o=Bi(s,r,e),a=t.fit?this.getFitContext(o,r):null,l=a?this.applyFit(o,t,a):new Map;this.applyCalculatedValues(o,t);let d=Fi(o,t,e);return l.forEach((c,u)=>d.extraProps.set(u,c)),a&&this.refineFitFontSize(r,d.fragment,d.extraProps,o,t,a),{fragment:i,result:d.fragment,extraProps:d.extraProps}}getFitContext(r,t){let e=window.getComputedStyle(t),i=parseFloat(e.fontSize);if(!i)return null;let n=t.clientWidth-(parseFloat(e.paddingLeft)||0)-(parseFloat(e.paddingRight)||0);if(n<=0)return null;let s=0;for(let l of r){let d=l.fitWidth??l.rect.width;d>s&&(s=d)}if(s<=0)return null;let o=n;if(Math.abs(n-s)<2&&t.parentElement){let l=window.getComputedStyle(t.parentElement),d=t.parentElement.clientWidth-(parseFloat(l.paddingLeft)||0)-(parseFloat(l.paddingRight)||0);d>n&&(o=d)}let a=parseFloat(e.lineHeight)||0;return{currentFontSize:i,contentWidth:o,lineHeightPx:a}}applyFit(r,t,e){let i=new Map,{currentFontSize:n,contentWidth:s}=e,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 r){let d=l.fitWidth??l.rect.width;d>0&&(l.fitFontSize=this.computeFitFontSize(n,s,d,a?l.browserWordWidthSum:void 0))}else{let l=r.reduce((u,g)=>(g.fitWidth??g.rect.width)>(u.fitWidth??u.rect.width)?g:u,r[0]),d=l.fitWidth??l.rect.width,c=this.computeFitFontSize(n,s,d,a?l.browserWordWidthSum:void 0);i.set("--fit-font-size",String(Math.floor(c)))}return i}refineFitFontSize(r,t,e,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(t.cloneNode(!0)),o){let d=Array.from(r.querySelectorAll(".-s-line")),c=Array.from(t.querySelectorAll(".-s-line"));d.forEach((u,g)=>{let v=c[g];if(!v)return;let h=parseFloat(v.style.getPropertyValue("--fit-font-size"));if(!h)return;let m=this.solveRenderedFitFontSize(u,s.currentFontSize,h,s.contentWidth,a);m&&(i[g].fitFontSize=m,v.style.setProperty("--fit-font-size",String(Math.floor(m))))})}else{let d=parseFloat(e.get("--fit-font-size")??"");if(!d)return;let c=this.solveRenderedFitFontSize(r,s.currentFontSize,d,s.contentWidth,a);if(!c)return;let u=Math.floor(c);e.set("--fit-font-size",String(u));let{lineHeightPx:g,currentFontSize:v,contentWidth:h}=s;if(g>0&&v>0){let m=g*(u/v);m>0&&(e.set("--fit-scale-y",String(window.innerHeight/m)),e.set("--fit-aspect-ratio",String(h/m)))}}}finally{r.innerHTML=l}}solveRenderedFitFontSize(r,t,e,i,n){if(!Number.isFinite(t)||!Number.isFinite(e)||t<=0||e<=0)return null;let s=this.measureScopeAtFontSize(r,n,t);if(s<=0)return null;if(Math.abs(i-s)<.01)return t;let o=Math.abs(e-t)<.01?s:this.measureScopeAtFontSize(r,n,e);if(o<=0)return t*(i/s);let a=(o-s)/(e-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(r,t,e){if(t){let s=Array.from(r.querySelectorAll(".-s-char")),o=s.map(l=>l.style.fontSize);s.forEach(l=>{l.style.fontSize=`${e}px`}),r.offsetWidth;let a=this.measureCharScopeWidth(r);return s.forEach((l,d)=>{l.style.fontSize=o[d]}),a}let i=r.style.fontSize;r.style.fontSize=`${e}px`,r.offsetWidth;let n=this.measureContentWidth(r);return r.style.fontSize=i,n}measureCharScopeWidth(r){let t=0;Array.from(r.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(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 d=document.createRange();d.selectNodeContents(n),t+=d.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=>{t+=o.getBoundingClientRect().width}),t}measureContentWidth(r){if(!r.childNodes.length)return r.getBoundingClientRect().width;let t=document.createRange();return t.selectNodeContents(r),t.getBoundingClientRect().width}computeFitFontSize(r,t,e,i){let n=i!==void 0?e-i:0,s=e-n;return s<=0?r*(t/e):r*(t-n)/s}computeValue(r,t,e){if(r.align.startsWith("random")){let i=r.random?.min??0,n=r.random?.max??e-1;return Math.floor(Math.random()*(n-i+1))+i}switch(r.align){case"start":return t;case"end":return e-t-1;case"center":{let i=Math.floor((e-1)/2);return Math.abs(t-i)}default:return t}}applyCalculatedValues(r,t){let e=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)=>{t.line&&(s.calculatedValues=t.line.map(a=>({type:"line",align:a.align,value:this.computeValue(a,o,r.length)}))),s.words.forEach(a=>{t.word&&(a.calculatedValues=t.word.map(d=>({type:"word",align:d.align,value:this.computeValue(d,a.wordIndexGlobal,i)}))),t.wordLine&&(a.calculatedValues??(a.calculatedValues=[]),a.calculatedValues.push(...t.wordLine.map(d=>({type:"wordLine",align:d.align,value:this.computeValue(d,a.wordIndexInLine,s.words.length)}))));let l=e(s);a.chars.forEach(d=>{let c=[];t.char&&c.push(...t.char.map(u=>({type:"char",align:u.align,value:this.computeValue(u,d.charIndexGlobal,n)}))),t.charWord&&c.push(...t.charWord.map(u=>({type:"charWord",align:u.align,value:this.computeValue(u,d.charIndexInWord,a.chars.length)}))),t.charLine&&c.push(...t.charLine.map(u=>({type:"charLine",align:u.align,value:this.computeValue(u,d.charIndexInLine,l)}))),d.calculatedValues=c})})})}escapeAttribute(r){return r.replace(/src="(https?:\/\/[^"\s]+)"/g,"src=$1")}};var ir=class extends O{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 e=Math.abs(t.scroll.displacement);this.value=e,this.history.push(e),this.history.length>this.maxPoints&&this.history.shift(),this.draw()}draw(){let t=this.context,e=this.canvas.width,i=this.canvas.height;t.clearRect(0,0,e,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"),e=window.innerWidth*.5;this.height=window.innerHeight/15-20,t.width=e,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 pt="data-fps",nr=class extends O{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 e=String(t);for(let i of this.fpsElements)i.isConnected&&i.setAttribute(pt,e);this.displayElement&&this.displayElement.setAttribute(pt,e),this.events.emit("fps",t)}scanElements(){this.fpsElements.clear(),document.querySelectorAll(`[${pt}]`).forEach(t=>{t!==this.displayElement&&this.fpsElements.add(t)})}observeDOM(){this.observer=new MutationObserver(t=>{let e=!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(pt)&&(e=!0),s.querySelector(`[${pt}]`)&&(e=!0)}for(let n of Array.from(i.removedNodes))n.nodeType===Node.ELEMENT_NODE&&this.fpsElements.delete(n)}e&&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(pt,"0"),document.body.appendChild(t);let e="string-fps-tracker-style";if(!document.getElementById(e)){let i=document.createElement("style");i.id=e,i.innerHTML=`
|
|
20
|
+
[${pt}]::before {
|
|
21
|
+
content: 'FPS: ' attr(${pt});
|
|
22
22
|
}
|
|
23
|
-
`,document.head.appendChild(i)}this.displayElement=
|
|
24
|
-
[${
|
|
25
|
-
content: attr(${
|
|
23
|
+
`,document.head.appendChild(i)}this.displayElement=t}};var sr=class extends O{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 e=Math.abs(t.scroll.displacement);this.currentValue=e,this.history.push(e),this.history.length>this.maxPoints&&this.history.shift(),this.draw()}draw(){let t=this.context,e=this.canvas.width,i=this.canvas.height;t.clearRect(0,0,e,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 gt="data-val",ht="data-val-pct",mt="data-dir",or=class extends O{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 e=t.scroll.current,i=t.scroll.target,n=t.viewport.contentHeight,s=t.viewport.windowHeight,o=Math.round(e),a=Math.max(1,n-s),l=Math.round(e/a*100),d;if(e!==i?d=e<i?"\u2193":"\u2191":e!==this.previousCurrent?d=e>this.previousCurrent?"\u2193":"\u2191":d=this.lastDir||"\u2022",this.previousCurrent=e,this.idleTimeout&&clearTimeout(this.idleTimeout),d!=="\u2022"&&(this.idleTimeout=setTimeout(()=>{this.setDirection("\u2022")},150)),o!==this.lastVal){this.lastVal=o;let c=String(o);for(let u of this.valElements)u.isConnected&&u.setAttribute(gt,c);this.displayElement&&this.displayElement.setAttribute(gt,c)}if(l!==this.lastValPct){this.lastValPct=l;let c=String(l);for(let u of this.valPctElements)u.isConnected&&u.setAttribute(ht,c);this.displayElement&&this.displayElement.setAttribute(ht,c)}this.setDirection(d),this.events.emit("scroll-position",{val:o,valPct:l,direction:d})}setDirection(t){if(t!==this.lastDir){this.lastDir=t;for(let e of this.dirElements)e.isConnected&&e.setAttribute(mt,t);this.displayElement&&this.displayElement.setAttribute(mt,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(`[${gt}]`).forEach(t=>{t!==this.displayElement&&this.valElements.add(t)}),document.querySelectorAll(`[${ht}]`).forEach(t=>{t!==this.displayElement&&this.valPctElements.add(t)}),document.querySelectorAll(`[${mt}]`).forEach(t=>{t!==this.displayElement&&this.dirElements.add(t)})}observeDOM(){this.observer=new MutationObserver(t=>{let e=!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)&&(e=!0),s.querySelector(`[${gt}],[${ht}],[${mt}]`)&&(e=!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)}}e&&this.scanElements()}),this.observer.observe(document.body,{childList:!0,subtree:!0})}hasTrackingAttr(t){return t.hasAttribute(gt)||t.hasAttribute(ht)||t.hasAttribute(mt)}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(mt,"\u2022"),t.setAttribute(gt,"0"),t.setAttribute(ht,"0"),document.body.appendChild(t);let e="string-position-tracker-style";if(!document.getElementById(e)){let i=document.createElement("style");i.id=e,i.innerHTML=`
|
|
24
|
+
[${mt}][${gt}][${ht}]::before {
|
|
25
|
+
content: attr(${mt}) ' | ' attr(${gt}) 'px (' attr(${ht}) '%)';
|
|
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 Ni(p,r){let t=null;return function(...e){let i=this;t&&clearTimeout(t),t=setTimeout(()=>{p.apply(i,e),t=null},r)}}var ar=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 t=performance.now();this.requestAnimationId=requestAnimationFrame(this.animate),this.onFrameCallback(t)}:this.animate=()=>{let t=performance.now(),e=t-this.then;e>this.fpsInterval&&(this.then=t-e%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(r){this.onFrameCallback=r}destructor(){this.stop()}};var lr=class extends O{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 t=r.htmlElement,e=this.tools.domAttribute.process({element:t,key:"string-started",fallback:null})!==null;t.tagName.toLowerCase()==="video"&&!e&&(t.setAttribute("string-started",""),t.muted=!0,t.setAttribute("muted","muted"),t.setAttribute("playsinline",""),t.setAttribute("loop",""),t.setAttribute("autoplay",""),t.src=r.getProperty("src"),t.load(),t.addEventListener("canplay",()=>{}))}onEnterObject(r){let t=r.htmlElement;this.tryPlay(t)}onLeaveObject(r){r.htmlElement.pause()}tryPlay(r){r.play().catch(t=>console.warn("[StringVideoAutoplay] Autoplay failed:",t))}};var ui=(i=>(i.ACTIVE="-active",i.ENTERING="-entering",i.LEAVING="-leaving",i.DISABLED="-disabled",i))(ui||{}),Wi={PROGRESS:"--sequence-progress",DIRECTION:"--sequence-direction"};var cr=class cr extends O{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 e=this.triggerElements.get(t.currentTarget);if(!e)return;let i=this.activeStep.get(e.slider)??0,n=this.getMaxStep(e.slider),s,o;if(e.step==="next"){if(s=i+1,o=1,!this.elementIndex.has(`${e.slider}[${s}]`))if(e.loop&&n>=0)s=0;else return}else if(e.step==="prev"){if(s=i-1,o=-1,s<0)if(e.loop&&n>=0)s=n;else return;if(!this.elementIndex.has(`${e.slider}[${s}]`))return}else{if(s=e.step,i===s)return;o=s>i?1:-1}this.startTransition(e.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 e of Array.from(t)){let i=e.getAttribute("string-sequence-trigger"),n=i?this.parseTriggerKey(i):null;n&&(this.triggerElements.set(e,n),e.addEventListener("click",this.onTriggerClick))}}parseGlobalSettingsFromObject(t){let e=n=>t.getProperty(n),i=e("sequence-duration");this.tryParseGlobalSetting(i,"enteringDuration"),this.tryParseGlobalSetting(i,"leavingDuration"),this.tryParseGlobalSetting(e("entering-duration"),"enteringDuration"),this.tryParseGlobalSetting(e("leaving-duration"),"leavingDuration"),this.tryParseGlobalSetting(e("entering-easing"),"enteringEasing"),this.tryParseGlobalSetting(e("leaving-easing"),"leavingEasing"),this.tryParseGlobalSetting(e("active-step"),"activeStep")}tryParseGlobalSetting(t,e){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[e]=e==="enteringEasing"||e==="leavingEasing"?s:parseFloat(s),this.applyGlobalSettingsToExistingObjects(n)}applyGlobalSettingsToExistingObjects(t){let e=this.globalSettings.get(t);if(e){for(let[i,n]of this.elementIndex)if(this.parseSequenceKey(i)?.slider===t){e.enteringDuration!==void 0&&(n.enteringDuration=e.enteringDuration),e.leavingDuration!==void 0&&(n.leavingDuration=e.leavingDuration);for(let o of n.objects)this.resolveEasings(o,i)}}}initializeSliders(){let t=new Set;for(let e of this.elementIndex.keys()){let i=this.parseSequenceKey(e);i&&t.add(i.slider)}for(let e of t){if(this.activeStep.has(e))continue;let n=this.globalSettings.get(e)?.activeStep??0;this.elementIndex.has(`${e}[${n}]`)||(n=0),this.switchInstant(e,n,1)}}tryApplyPendingActiveStep(t){if(this.activeStep.has(t))return;let e=this.globalSettings.get(t)?.activeStep;e!==void 0&&this.elementIndex.has(`${t}[${e}]`)&&this.switchInstant(t,e,1)}canConnect(t){return t.keys.includes("sequence")||t.keys.includes("sequence-trigger")}onObjectConnected(t){super.onObjectConnected(t),this.parseGlobalSettingsFromObject(t);let e=t.getProperty("sequence"),i=t.getProperty("sequence-trigger");if(!e&&i){let n=this.parseTriggerKey(i);n&&typeof n.step=="number"&&(e=`${n.slider}[${n.step}]`,t.setProperty("sequence",e))}if(e){let n=this.parseSequenceKey(e);if(n){this.ensureStateEventRegistered(n.slider);let s=this.elementIndex.get(e);if(!s){let{enteringDuration:a,leavingDuration:l}=this.resolveDurations(t,e);s={objects:[],enteringDuration:a,leavingDuration:l},this.elementIndex.set(e,s)}s.objects.push(t),this.resolveEasings(t,e);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 e=t.match(/^(.+)\[(next|prev|\d+)(\|loop)?\]$/);if(!e)return null;let i=e[2]==="next"||e[2]==="prev"?e[2]:parseInt(e[2],10);return{slider:e[1],step:i,loop:e[3]==="|loop"}}getMaxStep(t){let e=-1;for(let i of this.elementIndex.keys()){let n=this.parseSequenceKey(i);n?.slider===t&&n.step>e&&(e=n.step)}return e}resolveDuration(t,e,i,n){let s=t.getProperty(n),o=t.getProperty("sequence-duration"),a=this.globalSettings.get(e)?.[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,e){let i=this.parseSequenceKey(e)?.slider??"";return{enteringDuration:this.resolveDuration(t,i,"enteringDuration","entering-duration"),leavingDuration:this.resolveDuration(t,i,"leavingDuration","leaving-duration")}}resolveEasing(t,e,i,n){let s=t.getProperty(n);(!s||typeof s=="string"&&s.includes("["))&&(s=this.globalSettings.get(e)?.[i]??this.settings.easing??"ease-out"),typeof s=="string"&&t.setProperty(n,this.tools.easingFunction.process({easing:s}))}resolveEasings(t,e){let i=this.parseSequenceKey(e)?.slider;i&&(this.resolveEasing(t,i,"enteringEasing","entering-easing"),this.resolveEasing(t,i,"leavingEasing","leaving-easing"))}onObjectDisconnected(t){super.onObjectDisconnected(t);let e=t.getProperty("sequence");if(e){let i=this.elementIndex.get(e);if(i){let n=i.objects.indexOf(t);n!==-1&&i.objects.splice(n,1),i.objects.length||this.elementIndex.delete(e)}}this.triggerElements.has(t.htmlElement)&&(t.htmlElement.removeEventListener("click",this.onTriggerClick),this.triggerElements.delete(t.htmlElement))}parseSequenceKey(t){let e=t.match(/^(.+)\[(\d+)\]$/);return e?{slider:e[1],step:parseInt(e[2],10)}:null}onSequenceEvent(t){let{slider:e,step:i,transitionProgress:n,direction:s=1,duration:o,instant:a}=t;this.activeStep.get(e)===i&&n===void 0||(n!==void 0?this.handleScrub(e,i,n,s):a?this.switchInstant(e,i,s):this.startTransition(e,i,s,o))}startTransition(t,e,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}[${e}]`),l=s!==void 0?this.elementIndex.get(`${t}[${s}]`):null;s!==void 0&&this.leavingStep.set(t,s),this.activeStep.set(t,e),this.emitActiveState(t,e);let d={fromStep:s??e,toStep:e,direction:i,startTime:this.data.time.now,enteringDuration:n??a?.enteringDuration??this.defaultDuration,leavingDuration:n??l?.leavingDuration??this.defaultDuration};this.transitions.set(t,d),this.emitTransitionStart(t,d)}handleScrub(t,e,i,n){this.transitions.delete(t);let s=this.activeStep.get(t);if(s!==e){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,e),this.emitActiveState(t,e)}let o=this.leavingStep.get(t)??s??e;this.applyProgress(t,o,e,i,i,n)}switchInstant(t,e,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!==e&&this.setStepState(t,n,"-disabled",0,i),this.activeStep.set(t,e),this.leavingStep.delete(t),this.setStepState(t,e,"-active",1,i),this.emitActiveState(t,e),s!==void 0&&s!==e?this.emitStepLeave(t,s,i,!0):n!==void 0&&n!==e&&this.emitStepLeave(t,n,i,!0),this.emitStepEnter(t,e,i,!0);let o={fromStep:n??e,toStep:e,direction:i,startTime:this.data.time.now,enteringDuration:0,leavingDuration:0};this.emitTransitionStart(t,o),this.emitTransitionEnd(t,e,n??e,i,!0)}applyProgress(t,e,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,e,i,n,s,o),n>=1&&this.emitStepEnter(t,a,o,!1)}setStepState(t,e,i,n,s){let o=this.elementIndex.get(`${t}[${e}]`);if(o)for(let a of o.objects)this.setState(a,i,n,s)}setState(t,e,i,n){let s=t.htmlElement,o=t.getProperty("_state"),a=t.getProperty("_direction"),l=t.getProperty(e==="-leaving"?"leaving-easing":"entering-easing"),d=typeof l=="function"?l(i):i;o!==e&&(s.classList.remove(...cr.ALL_STATES),s.classList.add(e),t.setProperty("_state",e)),a!==n&&(t.setProperty("_direction",n),E.run(()=>E.setVars(s,{[Wi.DIRECTION]:n.toString()})))}onFrame(t){super.onFrame(t),this.initialized||(this.initialized=!0,this.initializeSliders());for(let[e,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(e,i.fromStep,i.toStep,s,o,i.direction),s>=1&&o>=1&&(this.emitTransitionEnd(e,i.toStep,i.fromStep,i.direction,!1),this.transitions.delete(e))}}emitTransitionStart(t,e){let i={slider:t,from:e.fromStep,to:e.toStep,direction:e.direction,enteringDuration:e.enteringDuration,leavingDuration:e.leavingDuration,startedAt:e.startTime};this.events.emit("sequence:transition:start",i),this.events.emit(`sequence:transition:start:${t}`,i)}emitTransitionProgress(t,e,i,n,s,o){let a={slider:t,from:e,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,e,i,n,s){let o={slider:t,from:i,to:e,direction:n,instant:s};this.events.emit("sequence:transition:end",o),this.events.emit(`sequence:transition:end:${t}`,o)}emitStepEnter(t,e,i,n){if(!n&&this.lastEnteredStep.get(t)===e)return;this.lastEnteredStep.set(t,e);let s={slider:t,step:e,direction:i,instant:n};this.events.emit("sequence:step:enter",s),this.events.emit(`sequence:step:enter:${t}`,s)}emitStepLeave(t,e,i,n){if(e==null)return;let s={slider:t,step:e,direction:i,instant:n};this.events.emit("sequence:step:leave",s),this.events.emit(`sequence:step:leave:${t}`,s)}emitActiveState(t,e){let i={slider:t,step:e};this.events.emit("sequence:active",i),this.events.emit(`sequence:active:${t}`,i)}};cr.ALL_STATES=Object.values(ui);var dr=cr;var vt=class vt extends O{constructor(r){super(r),this.htmlKey="form"}initializeObject(r,t,e,i){super.initializeObject(r,t,e,i);let n=t.getProperty("form-events")??[];n.forEach(d=>{d.eventElement.removeEventListener(d.eventType,d.eventCallback)}),n.length=0,t.setProperty("form-events",n),super.onObjectConnected(t);let s=t.htmlElement,o=[],a={};this.getInteractiveFields(s).forEach((d,c)=>this.registerField(d,s,o,a,n,c));let l=d=>{d.preventDefault();let c=!0,u={},g=new Set;for(let v of o){let h=v.field;if(!h.isConnected||!this.shouldValidateField(h))continue;if(this.isRadioField(h)){if(g.has(v.key))continue;g.add(v.key)}let{key:m,rules:b,needsContext:y}=v,f=this.getFieldValue(h);u[m]=f,a[m]=f;let{valid:S,errors:x}=this.tools.validation.process({rules:b,value:f,context:this.buildContext(y,m,a)});this.applyValidationState(s,h,m,S,x,"submit"),S||(c=!1)}if(c)this.events.emit(`form:submit:${t.id}`,u);else{let v=new Set,h=o.find(m=>{let b=m.field;if(!b.isConnected||!this.shouldValidateField(b))return!1;if(this.isRadioField(b)){if(v.has(m.key))return!1;v.add(m.key)}let{key:y,rules:f,needsContext:S}=m,x=this.getFieldValue(b);a[y]=x;let{valid:w}=this.tools.validation.process({rules:f,value:x,context:this.buildContext(S,y,a)});return!w});h?.field&&typeof h.field.focus=="function"&&h.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(r){}onDOMMutate(r,t){this.objects.length!==0&&(r.length>0&&this.handleMutationAdditions(r),t.length>0&&this.handleMutationRemovals(t))}applyValidationState(r,t,e,i,n,s){let o=r.querySelector(`[string-input="error[${e}]"]`),a=r.querySelector(`[string-input="group[${e}]"]`);o&&(o.innerHTML="",n.forEach(d=>{let c=document.createElement("span");c.textContent=d,o.appendChild(c)})),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}:${e}`,{key:e,field:t,errors:n,phase:s,valid:i})}getInteractiveFields(r){return Array.from(r.querySelectorAll("[string-input]")).filter(t=>!this.isServiceFieldAttribute(t.getAttribute("string-input")||"")).filter(t=>this.isFormFieldElement(t)).map(t=>t)}getFieldRules(r){let t=this.tools.domAttribute.process({element:r,key:"input"})??"";return this.tools.ruleParser.process({value:t})}registerField(r,t,e,i,n,s){if(!this.isFormFieldElement(r)||r.closest("form")!==t||e.some(h=>h.field===r))return;let o=this.registerFieldIndex(r,s??e.length),a=this.getInputKey(r,o),l=this.getFieldRules(r),d=this.supportsBeforeInputValidation(l),c=this.requiresContext(l),u=this.getInputEventType(r),g={field:r,key:a,rules:l,supportsRealtime:d,needsContext:c,inputEventType:u,inputHandler:()=>{}},v=h=>{let m=h.currentTarget||h.target;if(!m||!m.isConnected||!this.shouldValidateField(m))return;let b=this.getFieldValue(m);i[g.key]=b;let y=this.buildContext(g.needsContext,g.key,i),{valid:f,errors:S}=this.tools.validation.process({rules:g.rules,value:b,context:y});this.applyValidationState(t,m,g.key,f,S,"live")};if(g.inputHandler=v,r.addEventListener(u,v),n.push({eventElement:r,eventType:u,eventCallback:v}),d&&(r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement)){let h=m=>{let b=m;if(b.isComposing||b.inputType?.startsWith("insertComposition"))return;let y=m.currentTarget||m.target;if(!y||!(y instanceof HTMLInputElement||y instanceof HTMLTextAreaElement)||!y.isConnected)return;let f=y.selectionStart??0,S=y.selectionEnd??0,x=y.value;switch(b.inputType){case"deleteContentBackward":x=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":x=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":x=y.value.slice(0,f)+(b.data||"")+y.value.slice(S);break;default:typeof b.data=="string"&&(x=y.value.slice(0,f)+b.data+y.value.slice(S))}let{errors:w}=this.tools.validation.process({rules:g.rules,value:x,type:"beforeinput",context:this.buildContext(g.needsContext,g.key,i,{applied:!0,value:x})});w.length>0&&m.cancelable&&m.preventDefault()};g.beforeInputHandler=h,r.addEventListener("beforeinput",h),n.push({eventElement:r,eventType:"beforeinput",eventCallback:h})}r.classList.add("-inited"),e.push(g),i[a]=this.getFieldValue(r)}unregisterField(r,t,e,i){let n=t.findIndex(o=>o.field===r);if(n===-1)return;let s=t[n];s.inputHandler&&r.removeEventListener(s.inputEventType,s.inputHandler),s.beforeInputHandler&&r.removeEventListener("beforeinput",s.beforeInputHandler),delete e[s.key],t.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 t=[];return r instanceof Element?(r.hasAttribute("string-input")&&t.push(r),t.push(...Array.from(r.querySelectorAll("[string-input]")))):r instanceof DocumentFragment&&t.push(...Array.from(r.querySelectorAll("[string-input]"))),t.filter(e=>!this.isServiceFieldAttribute(e.getAttribute("string-input")||"")).filter(e=>this.isFormFieldElement(e))}isRadioField(r){return r instanceof HTMLInputElement&&r.type==="radio"}handleMutationAdditions(r){r.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(r){r.forEach(t=>{this.collectInteractiveFieldsFromNode(t).forEach(i=>{let n=this.getFormStateByReference(i);n&&this.unregisterField(i,n.entries,n.values,n.events)})})}getFormStateByContainment(r){let t=this.objects.find(e=>e.htmlElement instanceof HTMLFormElement&&e.htmlElement.contains(r));return t?this.buildFormState(t):null}getFormStateByReference(r){for(let t of this.objects){let e=t.getProperty("form-field-entries");if(e&&e.some(i=>i.field===r))return this.buildFormState(t,e)}return null}buildFormState(r,t){let e=r.htmlElement;if(!(e instanceof HTMLFormElement))return null;let i=t??r.getProperty("form-field-entries"),n=r.getProperty("form-field-values"),s=r.getProperty("form-events");return!i||!n||!s?null:{object:r,form:e,entries:i,values:n,events:s}}registerFieldIndex(r,t){let e=r.getAttribute("data-string-form-index");return e!==null?Number(e):(r.setAttribute("data-string-form-index",String(t)),t)}getFieldIndex(r,t){let e=r.getAttribute("data-string-form-index");if(e!==null){let i=Number(e);return Number.isNaN(i)?t:i}return this.registerFieldIndex(r,t)}shouldValidateField(r){return!(r.disabled||r instanceof HTMLInputElement&&r.type==="hidden")}supportsBeforeInputValidation(r){return r.some(t=>vt.beforeInputRuleKeys.has(t.key))}requiresContext(r){return r.some(t=>vt.crossFieldRuleKeys.has(t.key))}buildContext(r,t,e,i){if(!r)return{fieldKey:t};let n=!!i?.applied,s=n?{...e,[t]:i.value}:e;return{fieldKey:t,values:s,getValue:o=>n&&o===t?i.value:s[o]}}getInputKey(r,t){return this.tools.domAttribute.process({element:r,key:"id"})||r.getAttribute("name")||r.getAttribute("id")||`input-${t}`}getFieldValue(r){if(r instanceof HTMLInputElement){if(r.type==="checkbox"){if(r.name){let t=r.form||r.closest("form"),e=t?Array.from(t.querySelectorAll(`input[type="checkbox"][name="${r.name}"]:checked`)):[r];return e.length>1?e.map(i=>i.value):e.length===1?e[0].value:""}return r.checked}if(r.type==="radio"){if(r.name){let e=(r.form||r.closest("form"))?.querySelector(`input[type="radio"][name="${r.name}"]:checked`);return e?e.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(t=>t.value):r.value:r instanceof HTMLTextAreaElement?r.value:""}isServiceFieldAttribute(r){return vt.serviceAttributePrefixes.some(t=>r.startsWith(`${t}[`))}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"}};vt.beforeInputRuleKeys=new Set(["number","integer","email","phone","letters","lettersSpaces","lettersNumbers","alpha","alpha_num","alpha_dash","digits","url","pattern"]),vt.crossFieldRuleKeys=new Set(["same","different","after","before"]),vt.serviceAttributePrefixes=["error","group"];var ur=vt;var pr=class{constructor(){this.map=new WeakMap;this.all=new Set}attach(r){if(this.map.has(r))return;let t=r.htmlElement,e={cx:0,cy:0,valid:!1,el:t};e.ro=new ResizeObserver(()=>{e.valid=!1}),e.ro.observe(t),this.map.set(r,e),this.all.add(r)}detach(r){let t=this.map.get(r);t&&(t.ro?.disconnect(),this.map.delete(r),this.all.delete(r))}invalidate(r){this.all.forEach(t=>{if(t.id===r){let e=this.map.get(t);e&&(e.valid=!1)}})}invalidateAll(){this.all.forEach(r=>{let t=this.map.get(r);t&&(t.valid=!1)})}getCenter(r){let t=this.map.get(r);if(!t||!t.el)return{cx:0,cy:0};if(!t.valid){let e=t.el.getBoundingClientRect();t.cx=e.left+e.width/2,t.cy=e.top+e.height/2,t.valid=!0}return{cx:t.cx,cy:t.cy}}};var gr=class{constructor(){this.active=new Set;this.subs=new WeakMap}track(r){if(this.subs.has(r))return;let t=r.htmlElement,e=()=>this.active.add(r),i=()=>this.active.delete(r);t.addEventListener("pointerenter",e),t.addEventListener("pointerleave",i),this.subs.set(r,{enter:e,leave:i})}untrack(r){let t=this.subs.get(r);if(!t)return;let e=r.htmlElement;t.enter&&e.removeEventListener("pointerenter",t.enter),t.leave&&e.removeEventListener("pointerleave",t.leave),this.active.delete(r),this.subs.delete(r)}isActive(r){return this.active.has(r)}activeObjects(){return Array.from(this.active)}};var hr=`
|
|
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>`,Gi=`
|
|
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>`,$i=`
|
|
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>`,ji=`
|
|
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>`,Ui=`
|
|
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>`,mr=`
|
|
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>`,Yi=`
|
|
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>`,vr=`
|
|
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 Xn={"--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 qn(p,r){return p.trim().split(`
|
|
162
|
+
`).map(t=>`${r}${t}`).join(`
|
|
163
|
+
`)}function Ot(p,r={}){let t=Array.isArray(p)?p.join(`,
|
|
164
|
+
`):p,e={...Xn,...r},i=Object.entries(e).map(([n,s])=>`${n}: ${s};`).join(`
|
|
165
|
+
`);return`${t} {
|
|
166
|
+
${qn(i," ")}
|
|
167
|
+
}`}function zt(){if(typeof document>"u")return null;let p="string-devtools-shared-styles",r=document.getElementById(p);if(r instanceof HTMLStyleElement)return r;let t=document.createElement("style");return t.id=p,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 Xi="string-devtools:dock",fr=class{constructor(){this.entries=new Map;this.collapsed=!1;zt(),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(r){if(this.entries.has(r.id))return;this.applyStoredActiveState(r);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",r.id),t.setAttribute("aria-label",r.label),t.innerHTML=r.icon,t.title=r.label,t.addEventListener("click",()=>{let n=!r.getState().active;if(r.setActive(n),!r.subscribe){let s=r.getState();this.renderButton(t,r.label,s),this.persistActiveState(r.id,s.active)}});let e=r.subscribe?r.subscribe(n=>{this.renderButton(t,r.label,n),this.persistActiveState(r.id,n.active)}):null;this.entries.set(r.id,{definition:r,button:t,unsubscribe:e}),this.itemsWrap.appendChild(t),this.sortButtons();let i=r.getState();this.renderButton(t,r.label,i),this.persistActiveState(r.id,i.active)}remove(r){let t=this.entries.get(r);t&&(t.unsubscribe?.(),t.button.remove(),this.entries.delete(r))}destroy(){for(let r of this.entries.values())r.unsubscribe?.(),r.button.remove();this.entries.clear(),this.root.remove()}setFPS(r){this.fpsElement.textContent=String(Math.max(0,Math.round(r)))}sortButtons(){let r=Array.from(this.entries.values()).sort((t,e)=>{let i=t.definition.order??0,n=e.definition.order??0;return i!==n?i-n:t.definition.label.localeCompare(e.definition.label)});for(let t of r)this.itemsWrap.appendChild(t.button);this.itemsWrap.appendChild(this.fpsElement)}createMainButton(){let r=document.createElement("button");return r.type="button",r.setAttribute("data-string-devtools-main",""),r.setAttribute("data-string-devtools-icon-button",""),r.setAttribute("aria-label","Collapse developer tools"),r.innerHTML=`
|
|
436
|
+
<span data-string-devtools-main-icon="">${hr}</span>
|
|
437
|
+
<span data-string-devtools-main-chevron="">${vr}</span>
|
|
438
|
+
`,r.addEventListener("click",()=>{this.setCollapsed(!this.collapsed)}),r}setCollapsed(r,t=!0){this.collapsed=r,this.root.setAttribute("data-collapsed",r?"true":"false"),this.mainButton.setAttribute("aria-label",r?"Expand developer tools":"Collapse developer tools"),t&&(this.preferences.collapsed=r,this.savePreferences())}renderButton(r,t,e){r.setAttribute("data-active",e.active?"true":"false"),r.title=`${t}: ${e.active?"On":"Off"}`}applyStoredActiveState(r){let t=this.preferences.active[r.id];typeof t!="boolean"||t===r.getState().active||r.setActive(t)}persistActiveState(r,t){this.preferences.active[r]=t,this.savePreferences()}loadPreferences(){try{let r=localStorage.getItem(Xi);if(!r)return{collapsed:!1,active:{}};let t=JSON.parse(r);return{collapsed:t.collapsed===!0,active:t.active&&typeof t.active=="object"?t.active:{}}}catch{return{collapsed:!1,active:{}}}}savePreferences(){try{localStorage.setItem(Xi,JSON.stringify(this.preferences))}catch{}}injectStyles(){let r="string-devtools-dock-styles";if(document.getElementById(r))return;let t=document.createElement("style");t.id=r,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 br=class{constructor(){this.definitions=new Map;this.dock=null}register(r){!r||this.definitions.has(r.id)||(this.definitions.set(r.id,r),this.dock||(this.dock=new fr),this.dock.add(r))}setFPS(r){this.dock?.setFPS(r)}destroy(){this.definitions.clear(),this.dock?.destroy(),this.dock=null}};var yr=class extends O{constructor(r){super(r),this.htmlKey="scroller"}onObjectConnected(r){let t=r.getProperty("scroller-inited");if(t==null||t==""){r.setProperty("scroller-inited","inited");let e=i=>{this.events.emit("wheel",i)};r.setProperty("scroller-wheel-event",e),r.htmlElement.addEventListener("wheel",e)}}onObjectDisconnected(r){r.setProperty("scroller-inited",""),r.htmlElement.removeEventListener("wheel",r.getProperty("scroller-wheel-event"))}};var Sr=class extends O{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 e=t.htmlElement;getComputedStyle(e).overflowY==="visible"&&(e.style.overflowY="auto");let i={current:e.scrollTop,target:e.scrollTop,maxScroll:e.scrollHeight-e.clientHeight,velocity:0,lerp:t.getProperty("lerp")||.1,isDragging:!1,isActive:!1};this.states.set(e,i),e.addEventListener("wheel",n=>this.handleWheel(n,e,i),{passive:!1}),e.addEventListener("scroll",n=>this.onNativeScroll(n,e,i),{passive:!0}),this.measure(e,i)}onObjectDisconnected(t){this.states.delete(t.htmlElement)}onFrame(t){for(let e of this.objectsOnPage){let i=e.htmlElement,n=this.states.get(i);n&&n.isActive&&!n.isDragging&&this.updateScroll(i,n)}}onResize(){for(let t of this.objectsOnPage){let e=t.htmlElement,i=this.states.get(e);i&&this.measure(e,i)}}measure(t,e){e.maxScroll=t.scrollHeight-t.clientHeight}handleWheel(t,e,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,e,i){i.isActive||(i.current=e.scrollTop,i.target=e.scrollTop)}updateScroll(t,e){let i=e.target-e.current;Math.abs(i)<.1?(e.current=e.target,e.isActive=!1):e.current+=i*e.lerp,t.scrollTop=e.current}};function qi(p){let r=p.match(/([^[]+)\[([\d.]+)-([\d.]+)\]/);return r?{id:r[1],start:parseFloat(r[2]),end:parseFloat(r[3])}:null}function Kn(p,r,t,e,i){return e+(i-e)*(p-r)/(t-r)}var xr=class extends O{constructor(r){super(r),this.htmlKey="progress-part",this.attributesToMap=[...this.attributesToMap,{key:"part-of",type:"string",fallback:""}]}onObjectConnected(r){let t=r.getProperty("part-of"),e=qi(t);if(e){r.setProperty("part-of-id",e.id),r.setProperty("start",e.start),r.setProperty("end",e.end);let i=n=>{if(e){let s=Kn(n,e?.start,e?.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:${e.id}`,i)}}onObjectDisconnected(r){let t=r.getProperty("part-of-id");t&&this.events.off(`object:progress:${t}`,r.getProperty("progress-event"))}};var Zn=(p,r)=>{let t=Math.min(p,r),e=Math.max(p,r);return t+Math.random()*(e-t)},Qn=(p,r)=>{let t=Math.ceil(Math.min(p,r)),e=Math.floor(Math.max(p,r));return e<t?t:Math.floor(Math.random()*(e-t+1))+t},Jn=p=>{if(Array.isArray(p)&&p.length>=2){let r=Number(p[0]),t=Number(p[1]);if(Number.isFinite(r)&&Number.isFinite(t))return[r,t]}return typeof p=="number"&&Number.isFinite(p)?[0,p]:[0,1]},Er=class extends O{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 t=r.htmlElement,e=Jn(r.getProperty("random-number")),n=String(r.getProperty("random-type")??"float").toLowerCase()==="int"?Qn(e[0],e[1]):Zn(e[0],e[1]);E.run(()=>{E.setVars(t,{"--random":n})})}};var wr=class wr{constructor(){this.icons=new Map;this.register("main",hr),this.register("grid",Gi),this.register("inview",$i),this.register("rulers",ji),this.register("offsets",Ui),this.register("offsets-badge",mr),this.register("progress",Yi),this.register("chevron",vr)}static getInstance(){return this.instance||(this.instance=new wr),this.instance}register(r,t){this.icons.set(r,t)}get(r){return this.icons.get(r)??null}resolve(r){return this.icons.get(r)??r}};wr.instance=null;var le=wr;function At(p){return le.getInstance().resolve(p)}var Bt=class{constructor(r,t){this.id=r;this.zIndex=t;this.screenRoot=null;this.world=null;this.screen=null;this.worldHost=null;this.hostPositionWasPatched=!1;this.hostPositionInlineValue=null}ensure(r){if(this.screenRoot?.isConnected)return r&&this.attachWorldToHost(r),this.screenRoot;let t=document.querySelector(`[data-string-dev-viewport-layer="${this.id}"]`);if(t)return this.screenRoot=t,this.screen=t.querySelector(`[data-string-dev-viewport-screen="${this.id}"]`),r&&this.attachWorldToHost(r),t;let e=document.createElement("div");e.setAttribute("data-string-dev-viewport-layer",this.id),e.setAttribute("data-string-devtools-theme",""),e.style.position="fixed",e.style.inset="0",e.style.zIndex=String(this.zIndex),e.style.pointerEvents="none",e.style.overflow="hidden";let i=document.createElement("div");return i.setAttribute("data-string-dev-viewport-screen",this.id),i.style.position="absolute",i.style.inset="0",i.style.pointerEvents="none",i.style.overflow="hidden",e.appendChild(i),(document.body??document.documentElement).appendChild(e),this.screenRoot=e,this.screen=i,this.attachWorldToHost(r??document.body??document.documentElement),e}getElement(){return this.screenRoot?.isConnected?this.screenRoot:null}getWorldElement(r){return this.ensure(r),this.world}getScreenElement(){return this.ensure(),this.screen}destroy(){this.restoreHostPosition(),this.screenRoot?.remove(),this.screenRoot=null,this.world?.remove(),this.world=null,this.screen=null,this.worldHost=null}attachWorldToHost(r){if(this.worldHost===r&&this.world?.isConnected)return;if(this.restoreHostPosition(),this.worldHost=r,!this.world){let e=document.createElement("div");e.setAttribute("data-string-dev-viewport-world",this.id),e.setAttribute("data-string-devtools-theme",""),e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="1px",e.style.height="1px",e.style.pointerEvents="none",e.style.overflow="visible",e.style.zIndex=String(this.zIndex),this.world=e}r!==document.body&&r!==document.documentElement&&window.getComputedStyle(r).position==="static"&&(this.hostPositionWasPatched=!0,this.hostPositionInlineValue=r.style.position||null,r.style.position="relative"),r.appendChild(this.world)}restoreHostPosition(){this.world&&this.world.remove(),this.worldHost&&this.hostPositionWasPatched&&(this.hostPositionInlineValue==null||this.hostPositionInlineValue===""?this.worldHost.style.removeProperty("position"):this.worldHost.style.position=this.hostPositionInlineValue),this.hostPositionWasPatched=!1,this.hostPositionInlineValue=null}};var Mr=class Mr{constructor(){this.layers=new Map}static getInstance(){return this.instance||(this.instance=new Mr),this.instance}acquire(r,t){let e=this.layers.get(r);if(e){if(e.zIndex!==t)throw new Error(`Shared devtools layer "${r}" already exists with z-index ${e.zIndex}, requested ${t}.`);return e.refs+=1,e.layer}let i=new Bt(r,t);return this.layers.set(r,{layer:i,refs:1,zIndex:t}),i}release(r){let t=this.layers.get(r);t&&(t.refs-=1,!(t.refs>0)&&(t.layer.destroy(),this.layers.delete(r)))}};Mr.instance=null;var Nt=Mr;var Q=class extends O{constructor(t){super(t);this.overlayRegistry=Nt.getInstance();this.acquiredViewportLayers=new Map;this.devtoolListeners=new Set;this.devtoolConfig=null;this._type=2,zt();let e=this.constructor.devtool;e&&this.configureDevtool(e);let i=e?.styles,n=(typeof i=="function"?i():i)??this.getStyles();n&&this.ensureStyle(`${this.getStyleScopeId(n)}-styles`,n)}getStyleScopeId(t){if(this.htmlKey)return this.htmlKey;let e=0;for(let i=0;i<t.length;i+=1)e=e*31+t.charCodeAt(i)>>>0;return`string-dev-${e.toString(16)}`}getStyles(){return null}getDevtoolDefinition(){if(!this.devtoolConfig)return null;let t=this.devtoolConfig;return{id:t.id,label:t.label,icon:At(t.icon),order:t.order,getState:()=>({active:this.getDevtoolActiveState()}),setActive:e=>{this.setDevtoolActiveState(e)},subscribe:e=>(this.devtoolListeners.add(e),e({active:this.getDevtoolActiveState()}),()=>{this.devtoolListeners.delete(e)})}}configureDevtool(t){this.devtoolConfig=t}emitDevtoolState(t=this.getDevtoolActiveState()){let e={active:t};for(let i of this.devtoolListeners)i(e)}acquireViewportLayer(t,e){let i=this.acquiredViewportLayers.get(t);if(i)return i;let n=this.overlayRegistry.acquire(t,e);return this.acquiredViewportLayers.set(t,n),n}releaseViewportLayer(t){this.acquiredViewportLayers.has(t)&&(this.overlayRegistry.release(t),this.acquiredViewportLayers.delete(t))}ensureStyle(t,e){let i=document.getElementById(t);if(i instanceof HTMLStyleElement)return i;let n=document.createElement("style");return n.id=t,n.textContent=e,document.head.appendChild(n),n}getWorldHost(){return this.data.scroll.container??document.body??document.documentElement}getDevtoolActiveState(){return!1}setDevtoolActiveState(t){}destroy(){this.devtoolListeners.clear();for(let t of this.acquiredViewportLayers.keys())this.overlayRegistry.release(t);this.acquiredViewportLayers.clear(),super.destroy()}};Q.devtool=null;var $=[{name:"L",minWidth:1024},{name:"M",minWidth:768},{name:"S",minWidth:0}],Ki=0;function Lr(){return`grid-${Date.now()}-${Ki++}`}function ts(){return`layout-${Date.now()}-${Ki++}`}function de(){return $.map(p=>({id:ts(),name:p.name,minWidth:p.minWidth,instances:[]}))}function ft(p){return Number.isFinite(p)?Math.max(0,Math.round(p)):0}function Zi(p){return p<=0?"L":p===1?"M":"S"}function Qi(p){return p>=1024?"desktop":p>=768?"tablet":"phone"}var Ji="string-grid:",Cr=class{constructor(){this.adapterRegistry=new Map;this.elementStates=new Map}registerAdapter(r){this.adapterRegistry.set(r.type,r)}getAdapter(r){return this.adapterRegistry.get(r)}getAdapterRegistry(){return this.adapterRegistry}getLayouts(r){return this.getOrInitState(r).layouts}getSelectedLayoutId(r){return this.getOrInitState(r).selectedLayoutId}getSelectedLayoutName(r){let t=this.getOrInitState(r);return this.findSelectedLayout(t)?.name??"Layout 1"}getResolvedLayoutId(r,t){let e=this.getOrInitState(r);return this.findResolvedLayout(e,t)?.id??e.layouts[0].id}getResolvedLayoutName(r,t){let e=this.getOrInitState(r);return this.findResolvedLayout(e,t)?.name??e.layouts[0].name}getSelectedInstances(r){let t=this.getOrInitState(r);return this.findSelectedLayout(t)?.instances??[]}getResolvedInstances(r,t){let e=this.getOrInitState(r);return this.findResolvedLayout(e,t)?.instances??[]}addLayout(r){let t=this.getOrInitState(r),e=this.findSelectedLayout(t)??t.layouts[0];return this.save(r),e}renameLayout(r,t,e){let i=this.getOrInitState(r).layouts.find(n=>n.id===t);i&&(i.name=e.trim()||i.name,this.save(r))}selectLayout(r,t,e=!0){let i=this.getOrInitState(r);i.layouts.some(n=>n.id===t)&&(i.selectedLayoutId=t,e&&this.save(r))}updateLayoutMinWidth(r,t,e,i=!0){let n=this.getOrInitState(r),s=n.layouts.find(o=>o.id===t);s&&(s.minWidth=ft(e),this.normalizeFixedLayouts(n,t),i&&this.save(r))}stepLayoutMinWidth(r,t,e,i=!0){let n=this.getOrInitState(r).layouts.find(s=>s.id===t);n&&this.updateLayoutMinWidth(r,t,n.minWidth+e,i)}replaceLayouts(r,t,e){let i={elementId:r,layouts:this.normalizeLayouts(t),selectedLayoutId:e};this.ensureValidSelection(i),this.elementStates.set(r,i),this.save(r)}getInstances(r){return this.getSelectedInstances(r)}addInstance(r,t){let e=this.adapterRegistry.get(t);if(!e)return null;let i=this.findSelectedLayout(this.getOrInitState(r));if(!i)return null;let n={id:Lr(),type:t,visible:!0,settings:{...e.getDefaults()}};return i.instances.push(n),this.save(r),n}removeInstance(r,t){let e=this.findSelectedLayout(this.getOrInitState(r));e&&(e.instances=e.instances.filter(i=>i.id!==t),this.save(r))}reorderInstance(r,t,e,i){let n=this.findSelectedLayout(this.getOrInitState(r));if(!n||t===e)return;let s=n.instances.findIndex(c=>c.id===t),o=n.instances.findIndex(c=>c.id===e);if(s===-1||o===-1)return;let[a]=n.instances.splice(s,1),l=n.instances.findIndex(c=>c.id===e),d=i==="before"?l:l+1;n.instances.splice(d,0,a),this.save(r)}moveInstanceToEnd(r,t){let e=this.findSelectedLayout(this.getOrInitState(r));if(!e)return;let i=e.instances.findIndex(s=>s.id===t);if(i===-1||i===e.instances.length-1)return;let[n]=e.instances.splice(i,1);e.instances.push(n),this.save(r)}toggleVisibility(r,t){let e=this.findInstance(r,t);e&&(e.visible=!e.visible,this.save(r))}renameInstance(r,t,e){let i=this.findInstance(r,t);if(!i)return;let n=e.trim();i.name=n||void 0,this.save(r)}updateSetting(r,t,e,i){let n=this.findInstance(r,t);n&&(n.settings[e]=i,this.save(r))}findInstance(r,t){return this.getSelectedInstances(r).find(e=>e.id===t)}save(r){let t=this.elementStates.get(r);if(t)try{localStorage.setItem(Ji+r,JSON.stringify({layouts:t.layouts,selectedLayoutId:t.selectedLayoutId}))}catch{}}load(r){try{let t=localStorage.getItem(Ji+r);if(!t)return;let e=JSON.parse(t);if(Array.isArray(e)){let a=e.filter(d=>this.adapterRegistry.has(d.type));for(let d of a){let c=this.adapterRegistry.get(d.type);c&&(d.settings={...c.getDefaults(),...d.settings})}let l=de();l[0].instances=a,this.elementStates.set(r,{elementId:r,layouts:l,selectedLayoutId:l[0].id});return}let i=Array.isArray(e?.layouts)?e.layouts:null;if(!i)return;let n=this.normalizeLayouts(i);if(n.length===0)return;let s=typeof e?.selectedLayoutId=="string"?e.selectedLayoutId:typeof e?.activeLayoutId=="string"?e.activeLayoutId:n[0].id,o={elementId:r,layouts:n,selectedLayoutId:s};this.ensureValidSelection(o),this.elementStates.set(r,o)}catch{}}clear(){this.elementStates.clear()}getOrInitState(r){let t=this.elementStates.get(r);if(!t){let e=de();t={elementId:r,layouts:e,selectedLayoutId:e[0].id},this.elementStates.set(r,t)}return this.sortLayouts(t),this.ensureValidSelection(t),t}normalizeLayouts(r){let t=r.filter(e=>e&&typeof e=="object"&&typeof e.id=="string"&&typeof e.name=="string").map((e,i)=>{let n=Array.isArray(e.instances)?e.instances:Array.isArray(e.grids)?e.grids:[];return{id:e.id,name:e.name,minWidth:this.resolveLoadedMinWidth(e.minWidth,i),instances:n.filter(s=>this.adapterRegistry.has(s.type)).map(s=>{let o=this.adapterRegistry.get(s.type);return o?{...s,visible:s.visible!==!1,settings:{...o.getDefaults(),...s.settings}}:s})}});return this.createFixedLayouts(t)}resolveLoadedMinWidth(r,t){if(typeof r=="number"&&Number.isFinite(r))return ft(r);let e=$[t];if(e)return e.minWidth;let i=$[$.length-1].minWidth;return Math.max(0,i-(t-($.length-1))*DEFAULT_LAYOUT_STEP)}sortLayouts(r){r.layouts.sort((t,e)=>e.minWidth-t.minWidth)}ensureValidSelection(r){r.layouts.length===0&&(r.layouts=de()),r.layouts.length!==$.length&&(r.layouts=this.createFixedLayouts(r.layouts)),r.layouts.some(t=>t.id===r.selectedLayoutId)||(r.selectedLayoutId=r.layouts[0].id)}findSelectedLayout(r){return r.layouts.find(t=>t.id===r.selectedLayoutId)}findResolvedLayout(r,t){let e=[...r.layouts].sort((i,n)=>n.minWidth-i.minWidth);for(let i of e)if(t>=i.minWidth)return i;return e[e.length-1]}createFixedLayouts(r){let t=[...r].sort((s,o)=>o.minWidth-s.minWidth),e=de(),i=$.map((s,o)=>{let a=t[o];return{id:a?.id??e[o].id,name:s.name,minWidth:o===$.length-1?0:a?ft(a.minWidth):s.minWidth,instances:a?[...a.instances]:[]}}),n={elementId:"",layouts:i,selectedLayoutId:i[0].id};return this.normalizeFixedLayouts(n),n.layouts}normalizeFixedLayouts(r,t){this.sortLayouts(r);let[e,i,n]=r.layouts;!e||!i||!n||(e.name=$[0].name,i.name=$[1].name,n.name=$[2].name,e.minWidth=Math.max(i.minWidth+1,ft(e.minWidth)),i.minWidth=Math.max(1,ft(i.minWidth)),i.minWidth>=e.minWidth&&(i.minWidth=Math.max(1,e.minWidth-1)),n.minWidth=0,t&&r.layouts.some(s=>s.id===t)&&(r.selectedLayoutId=t))}};var es="http://www.w3.org/2000/svg",Tr=class{constructor(r,t){this.enabled=!0;this.target=r,this.svg=document.createElementNS(es,"svg"),this.svg.setAttribute("data-string-grid-overlay",""),this.svg.style.position="absolute",this.svg.style.pointerEvents="none",this.svg.style.transformOrigin="top left",t.appendChild(this.svg),this.syncViewBox(),this.resizeObserver=new ResizeObserver(()=>this.syncViewBox()),this.resizeObserver.observe(this.target)}getElement(){return this.svg}setPosition(r,t,e,i){this.svg.style.width=`${e}px`,this.svg.style.height=`${i}px`,this.svg.style.transform=`translate3d(${Math.round(r*100)/100}px, ${Math.round(t*100)/100}px, 0)`}render(r,t){if(this.clearAll(),!this.enabled)return;let{width:e,height:i}=this.getDimensions();for(let n of[...r].reverse()){let s=t.get(n.type);if(s&&n.visible){s.render(this.svg,e,i,{...n.settings,__instanceId:n.id});let o=this.svg.querySelector(`[data-grid-id="${n.id}"]`);o&&(o.setAttribute("data-grid-type",n.type),o.setAttribute("data-grid-visible","true"))}}}setEnabled(r){this.enabled=r,this.svg.style.display=r?"":"none",r||this.clearAll()}clearAll(){let r=this.svg.querySelectorAll("[data-grid-id]");for(let t=r.length-1;t>=0;t--)r[t].remove()}clearInstance(r,t){t.clear(this.svg,r)}syncViewBox(){let{width:r,height:t}=this.getDimensions();this.svg.setAttribute("viewBox",`0 0 ${r} ${t}`)}getDimensions(){return{width:this.target.offsetWidth,height:this.target.offsetHeight}}destroy(){this.resizeObserver.disconnect(),this.svg.remove()}ensurePositioned(){getComputedStyle(this.target).position==="static"&&(this.target.style.position="relative")}};function rs(){return`
|
|
637
|
+
[data-string-dev-settings-container] {
|
|
638
|
+
display: flex;
|
|
639
|
+
flex-direction: column;
|
|
640
|
+
gap: 2px;
|
|
641
|
+
padding: 0;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
[data-string-dev-field-row] {
|
|
645
|
+
display: grid;
|
|
646
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
647
|
+
align-items: center;
|
|
648
|
+
gap: 0;
|
|
649
|
+
min-height: 32px;
|
|
650
|
+
padding: 0 0px 0 8px;
|
|
651
|
+
min-width: 0;
|
|
652
|
+
border: 1px solid var(--string-dev-field-border);
|
|
653
|
+
border-radius: 8px;
|
|
654
|
+
background: var(--string-dev-field-bg);
|
|
655
|
+
overflow: hidden;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
[data-string-dev-field-label] {
|
|
659
|
+
font-size: 12px;
|
|
660
|
+
color: #111111;
|
|
661
|
+
font-family: var(--string-dev-panel-font-family);
|
|
662
|
+
user-select: none;
|
|
663
|
+
white-space: nowrap;
|
|
664
|
+
min-width: 0;
|
|
665
|
+
display: flex;
|
|
666
|
+
align-items: center;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
[data-string-dev-field-input],
|
|
670
|
+
[data-string-dev-field-select] {
|
|
671
|
+
min-height: var(--string-dev-input-height);
|
|
672
|
+
font-size: var(--string-dev-panel-font-size);
|
|
673
|
+
font-family: var(--string-dev-panel-font-family);
|
|
674
|
+
background: var(--string-dev-field-bg);
|
|
675
|
+
border: 1px solid var(--string-dev-field-border);
|
|
676
|
+
border-radius: var(--string-dev-field-radius);
|
|
677
|
+
color: var(--string-dev-panel-text);
|
|
678
|
+
outline: none;
|
|
679
|
+
box-sizing: border-box;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
[data-string-dev-field-input] {
|
|
683
|
+
width: 100%;
|
|
684
|
+
font-size: 12px;
|
|
685
|
+
font-family: var(--string-dev-panel-font-family);
|
|
686
|
+
font-weight: 500;
|
|
687
|
+
color: #111111;
|
|
688
|
+
text-align: center;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
[data-string-dev-field-select] {
|
|
692
|
+
cursor: pointer;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
[data-string-dev-field-input]:focus,
|
|
696
|
+
[data-string-dev-field-select]:focus,
|
|
697
|
+
[data-string-dev-field-unit]:focus {
|
|
698
|
+
border-color: var(--string-dev-focus-color);
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
[data-string-dev-field-select] option,
|
|
702
|
+
[data-string-dev-field-unit] option {
|
|
703
|
+
background: #ffffff;
|
|
704
|
+
color: var(--string-dev-panel-text);
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
[data-string-dev-field-range-right] {
|
|
708
|
+
display: flex;
|
|
709
|
+
align-items: center;
|
|
710
|
+
gap: 0;
|
|
711
|
+
min-width: 0;
|
|
712
|
+
justify-content: flex-end;
|
|
713
|
+
min-height: 100%;
|
|
714
|
+
border-left: 1px solid rgba(17, 17, 17, 0.15);
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
[data-string-dev-number-input],
|
|
718
|
+
[data-string-dev-range-input] {
|
|
719
|
+
display: grid;
|
|
720
|
+
align-items: center;
|
|
721
|
+
width: auto;
|
|
722
|
+
max-width: 100%;
|
|
723
|
+
min-width: 0;
|
|
724
|
+
min-height: 100%;
|
|
725
|
+
border: 0;
|
|
726
|
+
border-radius: 0;
|
|
727
|
+
background: transparent;
|
|
728
|
+
box-shadow: none;
|
|
729
|
+
overflow: hidden;
|
|
730
|
+
box-sizing: border-box;
|
|
731
|
+
justify-self: end;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
[data-string-dev-number-input] {
|
|
735
|
+
grid-template-columns: minmax(0, 75px) 28px;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
[data-string-dev-range-input] {
|
|
739
|
+
grid-template-columns: minmax(0, 40px) auto 28px;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
[data-string-dev-range-input][data-has-unit="false"] {
|
|
743
|
+
grid-template-columns: minmax(0, 75px) 28px;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
[data-string-dev-field-row] > [data-string-dev-number-input],
|
|
747
|
+
[data-string-dev-field-row] > [data-string-dev-range-input],
|
|
748
|
+
[data-string-dev-field-row] > [data-string-dev-select-shell],
|
|
749
|
+
[data-string-dev-field-row] > [data-string-dev-color-shell] {
|
|
750
|
+
min-height: 100%;
|
|
751
|
+
border-left: 1px solid rgba(17, 17, 17, 0.15);
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
[data-string-dev-input-value-wrap],
|
|
755
|
+
[data-string-dev-input-unit-wrap] {
|
|
756
|
+
min-width: 0;
|
|
757
|
+
min-height: 100%;
|
|
758
|
+
display: flex;
|
|
759
|
+
align-items: center;
|
|
760
|
+
justify-content: center;
|
|
761
|
+
background: transparent;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
[data-string-dev-input-value-wrap] {
|
|
765
|
+
padding: 0 0px;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
[data-string-dev-input-unit-wrap] {
|
|
769
|
+
border-left: 1px solid rgba(17, 17, 17, 0.15);
|
|
770
|
+
min-width: 32px;
|
|
771
|
+
padding: 0 6px;
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
[data-string-dev-stepper-stack] {
|
|
775
|
+
display: grid;
|
|
776
|
+
grid-template-rows: 1fr 1fr;
|
|
777
|
+
min-height: 100%;
|
|
778
|
+
border-left: 1px solid rgba(17, 17, 17, 0.15);
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
[data-string-dev-number-input] [data-string-dev-field-input],
|
|
782
|
+
[data-string-dev-range-input] [data-string-dev-field-value],
|
|
783
|
+
[data-string-dev-range-input] [data-string-dev-field-unit] {
|
|
784
|
+
background: transparent;
|
|
785
|
+
border: 0;
|
|
786
|
+
border-radius: 0;
|
|
787
|
+
box-shadow: none;
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
[data-string-dev-field-value] {
|
|
791
|
+
width: 100%;
|
|
792
|
+
min-height: calc(var(--string-dev-input-height) - 4px);
|
|
793
|
+
padding: 0;
|
|
794
|
+
font-size: 12px;
|
|
795
|
+
font-family: var(--string-dev-panel-font-family);
|
|
796
|
+
font-weight: 500;
|
|
797
|
+
color: #111111;
|
|
798
|
+
background: transparent;
|
|
799
|
+
border: 0;
|
|
800
|
+
border-radius: 0;
|
|
801
|
+
text-align: center;
|
|
802
|
+
outline: none;
|
|
803
|
+
transition: border-color 0.15s ease, color 0.15s ease;
|
|
804
|
+
box-sizing: border-box;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
[data-string-dev-stepper-btn] {
|
|
808
|
+
width: 100%;
|
|
809
|
+
min-width: 0;
|
|
810
|
+
min-height: 0;
|
|
811
|
+
padding: 0;
|
|
812
|
+
border: 0;
|
|
813
|
+
border-radius: 0;
|
|
814
|
+
background: transparent;
|
|
815
|
+
color: var(--string-dev-panel-text);
|
|
816
|
+
font-size: 12px;
|
|
817
|
+
line-height: 1;
|
|
818
|
+
cursor: pointer;
|
|
819
|
+
display: flex;
|
|
820
|
+
align-items: center;
|
|
821
|
+
justify-content: center;
|
|
822
|
+
transition: background 0.15s ease, color 0.15s ease;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
[data-string-dev-stepper-btn][data-direction="up"] {
|
|
826
|
+
border-bottom: 1px solid rgba(17, 17, 17, 0.15);
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
[data-string-dev-stepper-btn]:hover,
|
|
830
|
+
[data-string-dev-stepper-btn]:focus-visible {
|
|
831
|
+
background: rgba(255, 255, 255, 0.3);
|
|
832
|
+
color: var(--string-dev-panel-text);
|
|
833
|
+
outline: none;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
[data-string-dev-stepper-icon] {
|
|
837
|
+
display: flex;
|
|
838
|
+
align-items: center;
|
|
839
|
+
justify-content: center;
|
|
840
|
+
width: 14px;
|
|
841
|
+
height: 14px;
|
|
842
|
+
color: rgba(17, 17, 17, 0.72);
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
[data-string-dev-stepper-icon] svg {
|
|
846
|
+
width: 100%;
|
|
847
|
+
height: 100%;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
[data-string-dev-field-value]:focus {
|
|
851
|
+
color: #111111;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
[data-string-dev-field-unit] {
|
|
855
|
+
width: 100%;
|
|
856
|
+
min-height: calc(var(--string-dev-input-height) - 4px);
|
|
857
|
+
padding: 0;
|
|
858
|
+
font-size: 12px;
|
|
859
|
+
font-family: var(--string-dev-panel-font-family);
|
|
860
|
+
font-weight: 500;
|
|
861
|
+
color: var(--string-dev-panel-text);
|
|
862
|
+
background: transparent;
|
|
863
|
+
border: 0;
|
|
864
|
+
border-radius: 0;
|
|
865
|
+
outline: none;
|
|
866
|
+
cursor: pointer;
|
|
867
|
+
appearance: none;
|
|
868
|
+
-webkit-appearance: none;
|
|
869
|
+
text-align: center;
|
|
870
|
+
text-align-last: center;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
[data-string-dev-select-shell],
|
|
874
|
+
[data-string-dev-color-shell] {
|
|
875
|
+
display: grid;
|
|
876
|
+
align-items: center;
|
|
877
|
+
width: 104px;
|
|
878
|
+
max-width: 100%;
|
|
879
|
+
min-height: 100%;
|
|
880
|
+
border: 0;
|
|
881
|
+
border-radius: 0;
|
|
882
|
+
background: transparent;
|
|
883
|
+
box-shadow: none;
|
|
884
|
+
overflow: hidden;
|
|
885
|
+
box-sizing: border-box;
|
|
886
|
+
justify-self: end;
|
|
887
|
+
position: relative;
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
[data-string-dev-select-shell] {
|
|
891
|
+
grid-template-columns: minmax(0, 1fr) 32px;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
[data-string-dev-color-shell] {
|
|
895
|
+
grid-template-columns: 38px minmax(0, auto);
|
|
896
|
+
column-gap: 0;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
[data-string-dev-select-value-wrap] {
|
|
900
|
+
min-width: 0;
|
|
901
|
+
padding: 0 8px;
|
|
902
|
+
pointer-events: none;
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
[data-string-dev-select-display] {
|
|
906
|
+
display: block;
|
|
907
|
+
width: 100%;
|
|
908
|
+
font-size: 12px;
|
|
909
|
+
font-family: var(--string-dev-panel-font-family);
|
|
910
|
+
color: #111111;
|
|
911
|
+
line-height: calc(var(--string-dev-input-height) - 4px);
|
|
912
|
+
white-space: nowrap;
|
|
913
|
+
overflow: hidden;
|
|
914
|
+
text-overflow: ellipsis;
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
[data-string-dev-select-shell] [data-string-dev-field-select] {
|
|
918
|
+
position: absolute;
|
|
919
|
+
inset: 0;
|
|
920
|
+
width: 100%;
|
|
921
|
+
height: 100%;
|
|
922
|
+
padding: 0;
|
|
923
|
+
opacity: 0;
|
|
924
|
+
border: 0;
|
|
925
|
+
outline: none;
|
|
926
|
+
appearance: none;
|
|
927
|
+
-webkit-appearance: none;
|
|
928
|
+
cursor: pointer;
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
[data-string-dev-select-indicator] {
|
|
932
|
+
display: flex;
|
|
933
|
+
align-items: center;
|
|
934
|
+
justify-content: center;
|
|
935
|
+
width: 28px;
|
|
936
|
+
min-height: 100%;
|
|
937
|
+
border-left: 1px solid rgba(17, 17, 17, 0.15);
|
|
938
|
+
color: rgba(17, 17, 17, 0.72);
|
|
939
|
+
pointer-events: none;
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
[data-string-dev-select-indicator] svg {
|
|
943
|
+
width: 14px;
|
|
944
|
+
height: 14px;
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
[data-string-dev-color-swatch-wrap] {
|
|
948
|
+
display: flex;
|
|
949
|
+
align-items: center;
|
|
950
|
+
justify-content: center;
|
|
951
|
+
width: 32px;
|
|
952
|
+
min-height: 100%;
|
|
953
|
+
border-right: 1px solid rgba(17, 17, 17, 0.15);
|
|
954
|
+
pointer-events: none;
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
[data-string-dev-color-input] {
|
|
958
|
+
position: absolute;
|
|
959
|
+
inset: 0;
|
|
960
|
+
width: 100%;
|
|
961
|
+
height: 100%;
|
|
962
|
+
opacity: 0;
|
|
963
|
+
padding: 0;
|
|
964
|
+
cursor: pointer;
|
|
965
|
+
border: 0;
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
[data-string-dev-color-swatch] {
|
|
969
|
+
width: 16px;
|
|
970
|
+
height: 16px;
|
|
971
|
+
border-radius: 999px;
|
|
972
|
+
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.96);
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
[data-string-dev-color-value] {
|
|
976
|
+
min-width: 65px;
|
|
977
|
+
padding: 0 0 0 8px;
|
|
978
|
+
font-size: 12px;
|
|
979
|
+
font-family: var(--string-dev-panel-font-family);
|
|
980
|
+
font-weight: 500;
|
|
981
|
+
color: var(--string-dev-panel-text);
|
|
982
|
+
text-align: left;
|
|
983
|
+
pointer-events: none;
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
[data-string-dev-toggle-input] {
|
|
987
|
+
display: none;
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
[data-string-dev-toggle] {
|
|
991
|
+
width: 22px;
|
|
992
|
+
height: 14px;
|
|
993
|
+
border-radius: 999px;
|
|
994
|
+
background: rgba(17, 17, 17, 0.18);
|
|
995
|
+
display: inline-flex;
|
|
996
|
+
align-items: center;
|
|
997
|
+
position: relative;
|
|
998
|
+
cursor: pointer;
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
[data-string-dev-toggle][data-checked="true"] {
|
|
1002
|
+
background: var(--string-dev-accent);
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
[data-string-dev-toggle-knob] {
|
|
1006
|
+
width: 10px;
|
|
1007
|
+
height: 10px;
|
|
1008
|
+
border-radius: 50%;
|
|
1009
|
+
background: #ffffff;
|
|
1010
|
+
position: absolute;
|
|
1011
|
+
top: 2px;
|
|
1012
|
+
left: 2px;
|
|
1013
|
+
transition: left 0.2s ease;
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
[data-string-dev-toggle][data-checked="true"] [data-string-dev-toggle-knob] {
|
|
1017
|
+
left: 10px;
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
[data-string-dev-divider] {
|
|
1021
|
+
height: 4px;
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
[data-string-dev-divider-label] {
|
|
1025
|
+
display: none;
|
|
1026
|
+
font-family: var(--string-dev-panel-font-family);
|
|
1027
|
+
color: var(--string-dev-panel-subtle);
|
|
1028
|
+
text-transform: uppercase;
|
|
1029
|
+
letter-spacing: 0.5px;
|
|
1030
|
+
}
|
|
1031
|
+
`}var tn=!1;function en(){if(tn)return;tn=!0;let p=document.createElement("style");p.id="string-dev-ui-fields-styles",p.textContent=rs(),document.head.appendChild(p)}var K=class{constructor(r,t,e,i){this.root=null;this.key=r,this.label=t,this.value=e,this.onChange=i}getValue(){return this.value}destroy(){this.root?.remove(),this.root=null}emit(r){this.value=r,this.onChange(this.key,r)}createLabel(){let r=document.createElement("label");return r.textContent=this.label,r.setAttribute("data-string-dev-field-label",""),r}createRow(){let r=document.createElement("div");return r.setAttribute("data-string-dev-field-row",""),r}};var is=320,ns=60,rn=6,Pr=class extends K{constructor(t,e,i,n,s=0,o=100,a=1){super(t,e,i,n);this.input=null;this.min=s,this.max=o,this.step=a}build(){let t=this.createRow();return t.appendChild(this.createLabel()),t.appendChild(this.createControls()),this.root=t,t}setValue(t){this.value=t,this.input&&(this.input.value=this.formatValue(t))}createControls(){let t=document.createElement("div");t.setAttribute("data-string-dev-number-input","");let e=document.createElement("div");e.setAttribute("data-string-dev-input-value-wrap",""),e.appendChild(this.createInput());let i=document.createElement("div");return i.setAttribute("data-string-dev-stepper-stack",""),i.appendChild(this.createStepperButton("up",1)),i.appendChild(this.createStepperButton("down",-1)),t.appendChild(e),t.appendChild(i),t}createInput(){let t=document.createElement("input");return t.type="text",t.inputMode="decimal",t.value=this.formatValue(this.value),t.setAttribute("data-string-dev-field-input",""),t.addEventListener("focus",()=>{t.select()}),t.addEventListener("blur",()=>{this.commitValue(t.value)}),t.addEventListener("keydown",e=>{if(e.key==="Enter"){t.blur();return}if(e.key==="Escape"){t.value=this.formatValue(this.value),t.blur();return}e.key!=="ArrowUp"&&e.key!=="ArrowDown"||(e.preventDefault(),this.applyDelta(e.key==="ArrowUp"?1:-1,e))}),t.addEventListener("wheel",e=>{document.activeElement===t&&(e.preventDefault(),this.applyDelta(e.deltaY<0?1:-1,e))}),t.addEventListener("mousedown",e=>{e.button===1&&this.startMiddleDrag(e,t)}),t.addEventListener("auxclick",e=>{e.button===1&&e.preventDefault()}),this.input=t,t}createStepperButton(t,e){let i=document.createElement("button");i.type="button",i.setAttribute("data-string-dev-stepper-btn",""),i.setAttribute("data-direction",t);let n=document.createElement("span");n.setAttribute("data-string-dev-stepper-icon",""),n.innerHTML=t==="up"?'<svg viewBox="0 0 12 12" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M3 7L6 5L9 7" fill="currentColor"/><path d="M3 7L6 5L9 7" fill="none" stroke="currentColor"/></svg>':'<svg viewBox="0 0 12 12" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M3 5L6 7L9 5" fill="currentColor"/><path d="M3 5L6 7L9 5" fill="none" stroke="currentColor"/></svg>',i.appendChild(n);let s=0,o=0,a=!1,l=()=>{window.clearTimeout(s),window.clearInterval(o),document.removeEventListener("pointerup",l),document.removeEventListener("pointercancel",l)};return i.addEventListener("pointerdown",d=>{d.button===0&&(s=window.setTimeout(()=>{a=!0,this.applyDelta(e),o=window.setInterval(()=>{this.applyDelta(e)},ns)},is),document.addEventListener("pointerup",l),document.addEventListener("pointercancel",l))}),i.addEventListener("click",d=>{if(a){a=!1,d.preventDefault();return}this.applyDelta(e),this.input?.focus(),this.input?.select()}),i}startMiddleDrag(t,e){t.preventDefault();let i=t.clientX,n=0,s=document.body.style.cursor,o=document.body.style.userSelect;document.body.style.cursor="ew-resize",document.body.style.userSelect="none";let a=()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",a),document.body.style.cursor=s,document.body.style.userSelect=o},l=d=>{let c=d.clientX-i;for(i=d.clientX,n+=c;Math.abs(n)>=rn;){let u=n>0?1:-1;this.applyDelta(u,d),n-=rn*u}};e.focus(),e.select(),document.addEventListener("mousemove",l),document.addEventListener("mouseup",a)}commitValue(t){let e=parseFloat(t.replace(",","."));if(isNaN(e)){this.input&&(this.input.value=this.formatValue(this.value));return}let i=this.normalizeValue(e);this.input&&(this.input.value=this.formatValue(i)),this.emit(i)}applyDelta(t,e){let i=e?.shiftKey?10:e?.altKey?.1:1,n=this.normalizeValue(this.value+t*this.step*i);this.input&&(this.input.value=this.formatValue(n)),this.emit(n)}normalizeValue(t){let e=Math.round(t/this.step)*this.step,i=this.getPrecision(this.step);return Number(e.toFixed(i))}getPrecision(t){return String(t).split(".")[1]?.length??0}formatValue(t){let e=this.getPrecision(this.step);return e>0?t.toFixed(e):String(t)}};var ss=320,os=60,nn=6,Or=class extends K{constructor(t,e,i,n,s=0,o=100,a=1,l,d){super(t,e,i,n);this.valueInput=null;this.unitSelect=null;this.min=s,this.max=o,this.step=a,this.units=l,this.currentUnit=d}build(){let t=this.createRow();t.appendChild(this.createLabel());let e=document.createElement("div");return e.setAttribute("data-string-dev-field-range-right",""),e.appendChild(this.createControls()),t.appendChild(e),this.root=t,t}setValue(t){this.value=t,this.valueInput&&(this.valueInput.value=this.formatValue(t))}createControls(){let t=document.createElement("div");t.setAttribute("data-string-dev-range-input",""),t.setAttribute("data-has-unit",String(!!this.units?.length));let e=document.createElement("div");if(e.setAttribute("data-string-dev-input-value-wrap",""),e.appendChild(this.createInput()),t.appendChild(e),this.units&&this.units.length>0){let n=document.createElement("div");n.setAttribute("data-string-dev-input-unit-wrap","");let s=document.createElement("select");s.setAttribute("data-string-dev-field-unit","");for(let o of this.units){let a=document.createElement("option");a.value=o.value,a.textContent=o.label,s.appendChild(a)}s.value=this.currentUnit||this.units[0].value,s.addEventListener("change",()=>{this.currentUnit=s.value,this.onChange(this.key+"Unit",s.value)}),this.unitSelect=s,n.appendChild(s),t.appendChild(n)}let i=document.createElement("div");return i.setAttribute("data-string-dev-stepper-stack",""),i.appendChild(this.createStepperButton("up",1)),i.appendChild(this.createStepperButton("down",-1)),t.appendChild(i),t}createInput(){let t=document.createElement("input");return t.type="text",t.inputMode="decimal",t.value=this.formatValue(this.value),t.setAttribute("data-string-dev-field-value",""),t.addEventListener("focus",()=>{t.select()}),t.addEventListener("blur",()=>{this.commitInputValue(t)}),t.addEventListener("keydown",e=>{e.key==="Enter"?t.blur():e.key==="Escape"?(t.value=this.formatValue(this.value),t.blur()):(e.key==="ArrowUp"||e.key==="ArrowDown")&&(e.preventDefault(),this.applyDelta(e.key==="ArrowUp"?1:-1,e,t))}),t.addEventListener("wheel",e=>{document.activeElement===t&&(e.preventDefault(),this.applyDelta(e.deltaY<0?1:-1,e,t))}),t.addEventListener("mousedown",e=>{e.button===1&&this.startMiddleDrag(e,t)}),t.addEventListener("auxclick",e=>{e.button===1&&e.preventDefault()}),this.valueInput=t,t}createStepperButton(t,e){let i=document.createElement("button");i.type="button",i.setAttribute("data-string-dev-stepper-btn",""),i.setAttribute("data-direction",t);let n=document.createElement("span");n.setAttribute("data-string-dev-stepper-icon",""),n.innerHTML=t==="up"?'<svg viewBox="0 0 12 12" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M3 7L6 5L9 7" fill="currentColor"/><path d="M3 7L6 5L9 7" fill="none" stroke="currentColor"/></svg>':'<svg viewBox="0 0 12 12" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M3 5L6 7L9 5" fill="currentColor"/><path d="M3 5L6 7L9 5" fill="none" stroke="currentColor"/></svg>',i.appendChild(n);let s=0,o=0,a=!1,l=()=>{window.clearTimeout(s),window.clearInterval(o),document.removeEventListener("pointerup",l),document.removeEventListener("pointercancel",l)};return i.addEventListener("pointerdown",d=>{d.button===0&&(s=window.setTimeout(()=>{a=!0,this.valueInput&&(this.applyDelta(e,void 0,this.valueInput),o=window.setInterval(()=>{this.valueInput&&this.applyDelta(e,void 0,this.valueInput)},os))},ss),document.addEventListener("pointerup",l),document.addEventListener("pointercancel",l))}),i.addEventListener("click",d=>{if(a){a=!1,d.preventDefault();return}this.valueInput&&(this.applyDelta(e,void 0,this.valueInput),this.valueInput.focus(),this.valueInput.select())}),i}startMiddleDrag(t,e){t.preventDefault();let i=t.clientX,n=0,s=document.body.style.cursor,o=document.body.style.userSelect;document.body.style.cursor="ew-resize",document.body.style.userSelect="none";let a=()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",a),document.body.style.cursor=s,document.body.style.userSelect=o},l=d=>{let c=d.clientX-i;for(i=d.clientX,n+=c;Math.abs(n)>=nn;){let u=n>0?1:-1;this.applyDelta(u,d,e),n-=nn*u}};e.focus(),e.select(),document.addEventListener("mousemove",l),document.addEventListener("mouseup",a)}commitInputValue(t){let e=parseFloat(t.value.replace(",","."));if(isNaN(e)){t.value=this.formatValue(this.value);return}let i=this.normalizeValue(e);t.value=this.formatValue(i),this.emit(i)}applyDelta(t,e,i){let n=e?.shiftKey?10:e?.altKey?.1:1,s=this.normalizeValue(this.value+t*this.step*n);i.value=this.formatValue(s),this.emit(s)}normalizeValue(t){let e=Math.round(t/this.step)*this.step,i=this.getPrecision(this.step);return Number(e.toFixed(i))}getPrecision(t){return String(t).split(".")[1]?.length??0}formatValue(t){let e=this.step<1?Math.max(2,this.getPrecision(this.step)):0;return e>0?t.toFixed(e):String(t)}};var Ar=class extends K{constructor(){super(...arguments);this.colorInput=null;this.hexLabel=null}build(){let t=this.createRow();return t.appendChild(this.createLabel()),t.appendChild(this.createControl()),this.root=t,t}setValue(t){this.value=t,this.colorInput&&(this.colorInput.value=t),this.hexLabel&&(this.hexLabel.textContent=t)}createControl(){let t=document.createElement("div");t.setAttribute("data-string-dev-color-shell","");let e=document.createElement("label");e.setAttribute("data-string-dev-color-swatch-wrap","");let i=document.createElement("span");i.setAttribute("data-string-dev-color-swatch",""),i.style.background=this.value;let n=document.createElement("input");n.type="color",n.value=this.value,n.setAttribute("data-string-dev-color-input","");let s=document.createElement("span");return s.setAttribute("data-string-dev-color-value",""),s.textContent=this.value,n.addEventListener("input",()=>{i.style.background=n.value,s.textContent=n.value,this.emit(n.value)}),this.colorInput=n,this.hexLabel=s,e.appendChild(i),t.appendChild(e),t.appendChild(s),t.appendChild(n),t}};var kr=class extends K{constructor(t,e,i,n,s){super(t,e,i,n);this.select=null;this.display=null;this.options=s}build(){let t=this.createRow();return t.appendChild(this.createLabel()),t.appendChild(this.createControl()),this.root=t,t}setValue(t){this.value=t,this.select&&(this.select.value=t),this.display&&(this.display.textContent=this.getOptionLabel(t))}createControl(){let t=document.createElement("div");t.setAttribute("data-string-dev-select-shell","");let e=document.createElement("div");e.setAttribute("data-string-dev-select-value-wrap","");let i=document.createElement("span");i.setAttribute("data-string-dev-select-display",""),i.textContent=this.getOptionLabel(this.value);let n=document.createElement("select");n.setAttribute("data-string-dev-field-select","");for(let o of this.options){let a=document.createElement("option");a.value=o.value,a.textContent=o.label,o.value===this.value&&(a.selected=!0),n.appendChild(a)}n.addEventListener("change",()=>{i.textContent=this.getOptionLabel(n.value),this.emit(n.value)});let s=document.createElement("div");return s.setAttribute("data-string-dev-select-indicator",""),s.innerHTML='<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3 5.5 8 10.5l5-5" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg>',this.select=n,this.display=i,e.appendChild(i),t.appendChild(e),t.appendChild(s),t.appendChild(n),t}getOptionLabel(t){return this.options.find(e=>e.value===t)?.label??t}};var Dr=class extends K{constructor(){super(...arguments);this.checkbox=null;this.toggle=null}build(){let t=this.createRow();t.appendChild(this.createLabel());let e=document.createElement("div");e.setAttribute("data-string-dev-toggle",""),e.setAttribute("data-checked",String(this.value));let i=document.createElement("div");i.setAttribute("data-string-dev-toggle-knob",""),e.appendChild(i);let n=document.createElement("input");return n.type="checkbox",n.checked=this.value,n.setAttribute("data-string-dev-toggle-input",""),this.checkbox=n,this.toggle=e,e.addEventListener("click",()=>{let s=!this.value;this.value=s,n.checked=s,e.setAttribute("data-checked",String(s)),this.emit(s)}),t.appendChild(n),t.appendChild(e),this.root=t,t}setValue(t){this.value=t,this.checkbox&&(this.checkbox.checked=t),this.toggle?.setAttribute("data-checked",String(t))}};var Ir=class extends K{constructor(r){super("",r??"",void 0,()=>{})}build(){let r=document.createElement("div");if(r.setAttribute("data-string-dev-divider",""),this.label){let t=document.createElement("span");t.textContent=this.label,t.setAttribute("data-string-dev-divider-label",""),r.appendChild(t)}return this.root=r,r}setValue(){}};var Rr=class{constructor(){this.fields=[];this.container=null}build(r,t,e){en(),this.destroy();let i=document.createElement("div");i.setAttribute("data-string-dev-settings-container","");for(let n of r){let s=this.createField(n,t,e);s&&(this.fields.push(s),i.appendChild(s.build()))}return this.container=i,i}updateValues(r){for(let t of this.fields){let e=t.key;e&&e in r&&t.setValue(r[e])}}destroy(){for(let r of this.fields)r.destroy();this.fields=[],this.container?.remove(),this.container=null}createField(r,t,e){switch(r.type){case"number":return new Pr(r.key,r.label,t[r.key]??r.default,e,r.min,r.max,r.step);case"range":return new Or(r.key,r.label,t[r.key]??r.default,e,r.min,r.max,r.step,r.units,t[r.key+"Unit"]??r.defaultUnit);case"color":return new Ar(r.key,r.label,t[r.key]??r.default,e);case"select":return new kr(r.key,r.label,t[r.key]??r.default,e,r.options);case"toggle":return new Dr(r.key,r.label,t[r.key]??r.default,e);case"divider":return new Ir(r.label);default:return null}}};function as(p){return p==="desktop"?"Desktop":p==="tablet"?"Tablet":"Phone"}function sn(p){let r=p.name.trim(),t=/^Layout \d+$/i.test(r)||$.some(i=>i.name===r);return`${r.length>0&&!t||r.length>0?r:as(Qi(p.minWidth))} - ${p.minWidth}px`}var Hr=class{constructor(r,t,e,i){this.detailTitle=null;this.detailIcon=null;this.detailBuilder=null;this.instances=[];this.layouts=[];this.selectedLayoutId="";this.resolvedLayoutId="";this.selectedInstanceId=null;this.isOpen=!1;this.isAddPanelOpen=!1;this.isLayoutSettingsOpen=!1;this.enabled=!0;this.target=r,this.adapterRegistry=t,this.onAdd=e.onAdd,this.onRemove=e.onRemove,this.onToggle=e.onToggle,this.onSettingChange=e.onSettingChange,this.onReorder=e.onReorder,this.onMoveToEnd=e.onMoveToEnd,this.onSelectLayout=e.onSelectLayout,this.onUpdateLayoutMinWidth=e.onUpdateLayoutMinWidth,this.onPreviewResponsiveLayout=e.onPreviewResponsiveLayout,this.onCommitResponsiveLayout=e.onCommitResponsiveLayout,this.onExport=e.onExport,this.onImport=e.onImport,this.onRenameInstance=e.onRenameInstance,this.onHUDOpen=e.onHUDOpen,this.onHUDClose=e.onHUDClose,this.onLayoutPanelOpen=e.onLayoutPanelOpen,this.onLayoutPanelClose=e.onLayoutPanelClose,this.onDocumentPointerDownBind=this.onDocumentPointerDown.bind(this),this.chromeRoot=this.createChromeRoot(),this.trigger=this.createTrigger(),this.panel=this.createMainPanel(),this.addPanel=this.createAddPanel(),this.layoutPanel=this.createLayoutPanel(),this.detailPanel=this.createDetailPanel(),i?.attachTrigger!==!1&&this.chromeRoot.appendChild(this.trigger),this.chromeRoot.appendChild(this.panel),this.chromeRoot.appendChild(this.addPanel),this.chromeRoot.appendChild(this.layoutPanel),this.chromeRoot.appendChild(this.detailPanel),document.addEventListener("pointerdown",this.onDocumentPointerDownBind)}refresh(r,t,e,i){this.instances=[...r],this.layouts=[...t],this.selectedLayoutId=e,this.resolvedLayoutId=i,this.selectedInstanceId&&!r.some(s=>s.id===this.selectedInstanceId)&&this.clearSelection();let n=this.layouts.find(s=>s.id===i)??this.layouts[0];this.layoutTitle.textContent=n?sn(n):"Layout",this.renderLayoutChips(),this.renderLayoutSettings(),this.renderList(),this.renderDetailPanel()}destroy(){this.detailBuilder?.destroy(),document.removeEventListener("pointerdown",this.onDocumentPointerDownBind),this.chromeRoot.remove()}getTriggerElement(){return this.trigger}getChromeElement(){return this.chromeRoot}setTargetId(r){this.chromeRoot.setAttribute("data-target-id",r),this.trigger.setAttribute("data-target-id",r),this.panel.setAttribute("data-target-id",r),this.addPanel.setAttribute("data-target-id",r),this.layoutPanel.setAttribute("data-target-id",r),this.detailPanel.setAttribute("data-target-id",r)}setAnchorPosition(r,t){this.chromeRoot.removeAttribute("hidden"),this.chromeRoot.style.transform=`translate3d(${Math.round(r*100)/100}px, ${Math.round(t*100)/100}px, 0)`}setAnchorVisible(r){if(r){this.chromeRoot.removeAttribute("hidden");return}this.chromeRoot.setAttribute("hidden","")}isHUDOpen(){return this.isOpen}isLayoutSettingsPanelOpen(){return this.isLayoutSettingsOpen}setEnabled(r){this.enabled=r,r||this.hide(),this.chromeRoot.style.display=r?"":"none"}isEnabled(){return this.enabled}createChromeRoot(){let r=document.createElement("div");return r.setAttribute("data-string-grid-chrome",""),r.setAttribute("data-string-devtools-theme",""),r.setAttribute("hidden",""),r.setAttribute("string-isolation",""),r.setAttribute("data-string-isolation",""),r}createTrigger(){let r=document.createElement("button");return r.type="button",r.setAttribute("data-string-grid-trigger",""),r.setAttribute("data-open","false"),r.setAttribute("data-state","visible"),r.setAttribute("aria-label","Open layout guides"),r.setAttribute("aria-expanded","false"),r.innerHTML=this.icon("settings"),r.addEventListener("click",t=>{t.stopPropagation(),this.toggle()}),r}createMainPanel(){let r=document.createElement("div");r.setAttribute("data-string-grid-hud",""),r.setAttribute("data-string-devtools-panel",""),r.setAttribute("string-isolation",""),r.setAttribute("data-string-isolation","");let t=document.createElement("div");t.setAttribute("data-string-grid-panel-header",""),t.setAttribute("data-string-devtools-panel-header",""),this.layoutTitle=document.createElement("span"),this.layoutTitle.setAttribute("data-string-grid-layout-summary",""),this.layoutTitle.setAttribute("data-string-devtools-panel-title",""),this.layoutTitle.textContent="Layout";let e=document.createElement("button");return e.type="button",e.setAttribute("data-string-grid-header-close",""),e.setAttribute("data-string-devtools-icon-button",""),e.setAttribute("aria-label","Close layout guides"),e.innerHTML=this.icon("close"),e.addEventListener("click",i=>{i.stopPropagation(),this.hide()}),t.appendChild(this.layoutTitle),t.appendChild(e),this.layoutChips=document.createElement("div"),this.layoutChips.setAttribute("data-string-grid-layout-chip-row",""),this.layoutSettingsToggle=document.createElement("button"),this.layoutSettingsToggle.type="button",this.layoutSettingsToggle.setAttribute("data-string-grid-layout-chip",""),this.layoutSettingsToggle.setAttribute("data-string-devtools-chip",""),this.layoutSettingsToggle.setAttribute("data-string-grid-layout-chip-action","settings"),this.layoutSettingsToggle.setAttribute("aria-label","Toggle responsive layout settings"),this.layoutSettingsToggle.innerHTML=this.icon("more"),this.layoutSettingsToggle.addEventListener("click",i=>{i.stopPropagation(),this.isLayoutSettingsOpen?this.closeLayoutPanel():this.openLayoutPanel()}),this.listContainer=document.createElement("div"),this.listContainer.setAttribute("data-string-grid-list",""),this.addGuideButton=document.createElement("button"),this.addGuideButton.type="button",this.addGuideButton.setAttribute("data-string-grid-empty-add",""),this.addGuideButton.setAttribute("data-string-devtools-button",""),this.addGuideButton.setAttribute("data-full-width","true"),this.addGuideButton.innerHTML=`<span data-string-grid-empty-add-icon>${this.icon("plus")}</span><span data-string-grid-empty-add-label>Add Layout Guide</span>`,this.addGuideButton.addEventListener("click",i=>{i.stopPropagation(),this.openAddPanel()}),r.appendChild(t),r.appendChild(this.layoutChips),r.appendChild(this.listContainer),r.appendChild(this.addGuideButton),r.addEventListener("pointerdown",i=>i.stopPropagation()),r}createAddPanel(){let r=document.createElement("div");r.setAttribute("data-string-grid-side-panel",""),r.setAttribute("data-string-devtools-panel",""),r.setAttribute("data-panel","add"),r.setAttribute("data-open","false"),r.setAttribute("string-isolation",""),r.setAttribute("data-string-isolation","");let t=document.createElement("div");t.setAttribute("data-string-grid-panel-header",""),t.setAttribute("data-string-devtools-panel-header","");let e=document.createElement("span");e.setAttribute("data-string-grid-header-title",""),e.setAttribute("data-string-devtools-panel-title",""),e.textContent="Add Layout Guide";let i=document.createElement("button");i.type="button",i.setAttribute("data-string-grid-header-close",""),i.setAttribute("data-string-devtools-icon-button",""),i.innerHTML=this.icon("close"),i.addEventListener("click",n=>{n.stopPropagation(),this.closeAddPanel()}),t.appendChild(e),t.appendChild(i),this.addGridList=document.createElement("div"),this.addGridList.setAttribute("data-string-grid-add-grid-list","");for(let[,n]of this.adapterRegistry){let s=document.createElement("button");s.type="button",s.setAttribute("data-string-grid-add-grid-item",""),s.setAttribute("data-string-devtools-button",""),s.setAttribute("data-full-width","true"),s.innerHTML=`<span data-string-grid-add-grid-icon>${n.icon}</span><span data-string-grid-add-grid-label>${n.label}</span>`,s.addEventListener("click",o=>{o.stopPropagation(),this.onAdd(n.type),this.closeAddPanel()}),this.addGridList.appendChild(s)}return r.appendChild(t),r.appendChild(this.addGridList),r.addEventListener("pointerdown",n=>n.stopPropagation()),r}createLayoutPanel(){let r=document.createElement("div");r.setAttribute("data-string-grid-side-panel",""),r.setAttribute("data-string-devtools-panel",""),r.setAttribute("data-panel","layout"),r.setAttribute("data-open","false"),r.setAttribute("string-isolation",""),r.setAttribute("data-string-isolation","");let t=document.createElement("div");t.setAttribute("data-string-grid-panel-header",""),t.setAttribute("data-string-devtools-panel-header","");let e=document.createElement("span");e.setAttribute("data-string-grid-header-title",""),e.setAttribute("data-string-devtools-panel-title",""),e.textContent="Layout Settings";let i=document.createElement("button");i.type="button",i.setAttribute("data-string-grid-header-close",""),i.setAttribute("data-string-devtools-icon-button",""),i.setAttribute("aria-label","Close layout settings"),i.innerHTML=this.icon("close"),i.addEventListener("click",o=>{o.stopPropagation(),this.closeLayoutPanel()}),t.appendChild(e),t.appendChild(i),this.layoutSettings=document.createElement("div"),this.layoutSettings.setAttribute("data-string-grid-layout-settings",""),this.layoutSettingsList=document.createElement("div"),this.layoutSettingsList.setAttribute("data-string-grid-layout-settings-list",""),this.layoutIOActions=document.createElement("div"),this.layoutIOActions.setAttribute("data-string-grid-layout-io-row","");let n=document.createElement("button");n.type="button",n.setAttribute("data-string-grid-io-btn",""),n.setAttribute("data-string-devtools-button",""),n.setAttribute("data-io","export"),n.setAttribute("aria-label","Export layouts"),n.innerHTML=`<span data-string-grid-layout-add-icon>${this.icon("export")}</span><span>Export</span>`,n.addEventListener("click",o=>{o.stopPropagation(),this.onExport()});let s=document.createElement("button");return s.type="button",s.setAttribute("data-string-grid-io-btn",""),s.setAttribute("data-string-devtools-button",""),s.setAttribute("data-io","import"),s.setAttribute("aria-label","Import layouts"),s.innerHTML=`<span data-string-grid-layout-add-icon>${this.icon("import")}</span><span>Import</span>`,s.addEventListener("click",o=>{o.stopPropagation(),this.onImport()}),this.layoutIOActions.appendChild(n),this.layoutIOActions.appendChild(s),this.layoutSettings.appendChild(this.layoutSettingsList),this.layoutSettings.appendChild(this.layoutIOActions),r.appendChild(t),r.appendChild(this.layoutSettings),r.addEventListener("pointerdown",o=>o.stopPropagation()),r}createDetailPanel(){let r=document.createElement("div");r.setAttribute("data-string-grid-side-panel",""),r.setAttribute("data-string-devtools-panel",""),r.setAttribute("data-panel","detail"),r.setAttribute("data-open","false"),r.setAttribute("string-isolation",""),r.setAttribute("data-string-isolation","");let t=document.createElement("div");t.setAttribute("data-string-grid-panel-header",""),t.setAttribute("data-string-devtools-panel-header",""),this.detailIcon=document.createElement("span"),this.detailIcon.setAttribute("data-string-grid-header-icon",""),this.detailIcon.setAttribute("data-string-devtools-panel-icon",""),this.detailTitle=document.createElement("span"),this.detailTitle.setAttribute("data-string-grid-detail-title",""),this.detailTitle.setAttribute("data-string-devtools-panel-title",""),this.detailTitle.addEventListener("click",i=>{i.stopPropagation(),this.startDetailRename()});let e=document.createElement("button");return e.type="button",e.setAttribute("data-string-grid-header-close",""),e.setAttribute("data-string-devtools-icon-button",""),e.innerHTML=this.icon("close"),e.addEventListener("click",i=>{i.stopPropagation(),this.closeDetailPanel()}),t.appendChild(this.detailIcon),t.appendChild(this.detailTitle),t.appendChild(e),this.detailContent=document.createElement("div"),this.detailContent.setAttribute("data-string-grid-detail-content",""),r.appendChild(t),r.appendChild(this.detailContent),r.addEventListener("pointerdown",i=>i.stopPropagation()),r}renderLayoutChips(){this.layoutChips.innerHTML="";let r=t=>{this.selectedLayoutId=t,this.renderLayoutChips(),this.renderLayoutSettings()};this.layouts.forEach((t,e)=>{let i=Zi(e),n=document.createElement("button");n.type="button",n.setAttribute("data-string-grid-layout-chip",""),n.setAttribute("data-string-devtools-chip",""),n.setAttribute("data-selected",String(t.id===this.selectedLayoutId)),n.setAttribute("data-resolved",String(t.id===this.resolvedLayoutId)),n.setAttribute("data-mode",i),n.setAttribute("aria-label",`Select ${i} layout`),n.textContent=i,n.addEventListener("click",s=>{s.stopPropagation(),r(t.id),this.onSelectLayout(t.id)}),this.layoutChips.appendChild(n)}),this.layoutSettingsToggle.setAttribute("data-open",String(this.isLayoutSettingsOpen)),this.layoutChips.appendChild(this.layoutSettingsToggle)}renderLayoutSettings(){this.layoutSettingsList.innerHTML="";let[r,t,e]=this.layouts;!r||!t||!e||this.layoutSettingsList.appendChild(this.createCombinedBreakpointControl(e,t,r))}createCombinedBreakpointControl(r,t,e){let i=document.createElement("div");i.setAttribute("data-string-grid-layout-range",""),i.setAttribute("data-state","default"),i.setAttribute("data-active-handle","none");let n=320,s=1920,o=24,a=document.createElement("div");a.setAttribute("data-string-grid-layout-range-labels","");let l=document.createElement("button");l.type="button",l.setAttribute("data-string-grid-layout-range-value",""),l.setAttribute("data-handle","m"),l.textContent=`${t.minWidth}`;let d=document.createElement("button");d.type="button",d.setAttribute("data-string-grid-layout-range-value",""),d.setAttribute("data-handle","l"),d.textContent=`${e.minWidth}`;let c=document.createElement("div");c.setAttribute("data-string-grid-layout-range-track","");let u=document.createElement("button");u.type="button",u.setAttribute("data-string-grid-layout-range-segment",""),u.setAttribute("data-mode","S"),u.textContent="S";let g=document.createElement("button");g.type="button",g.setAttribute("data-string-grid-layout-range-segment",""),g.setAttribute("data-mode","M"),g.textContent="M";let v=document.createElement("button");v.type="button",v.setAttribute("data-string-grid-layout-range-segment",""),v.setAttribute("data-mode","L"),v.textContent="L";let h=document.createElement("button");h.type="button",h.setAttribute("data-string-grid-layout-range-divider",""),h.setAttribute("data-handle","m"),h.setAttribute("data-handle-state","default"),h.setAttribute("aria-label","Adjust S/M breakpoint");let m=document.createElement("button");m.type="button",m.setAttribute("data-string-grid-layout-range-divider",""),m.setAttribute("data-handle","l"),m.setAttribute("data-handle-state","default"),m.setAttribute("aria-label","Adjust M/L breakpoint");let b=document.createElement("span");b.setAttribute("data-string-grid-layout-range-knob",""),b.setAttribute("data-handle","m"),b.setAttribute("data-handle-state","default");let y=document.createElement("span");y.setAttribute("data-string-grid-layout-range-knob",""),y.setAttribute("data-handle","l"),y.setAttribute("data-handle-state","default");let f=document.createElement("div");f.setAttribute("data-string-grid-layout-range-editor",""),f.setAttribute("data-state","default"),f.setAttribute("data-active-handle","none");let S=document.createElement("span");S.setAttribute("data-string-grid-layout-range-editor-prefix",""),S.innerHTML=this.getRangeHandleIcon("m");let x=document.createElement("input");x.type="number",x.inputMode="numeric",x.step="1",x.setAttribute("data-string-grid-layout-range-editor-input","");let w=document.createElement("span");w.setAttribute("data-string-grid-layout-range-editor-suffix",""),w.textContent="px",a.appendChild(l),a.appendChild(d),c.appendChild(u),c.appendChild(g),c.appendChild(v),c.appendChild(h),c.appendChild(m),c.appendChild(b),c.appendChild(y),i.appendChild(a),i.appendChild(c),f.appendChild(S),f.appendChild(x),f.appendChild(w),i.appendChild(f);let M=(L,V=c.getBoundingClientRect().width)=>{let B=Math.max(V,1),W=Math.max(0,Math.min(1,L/B));return Math.round(n+W*(s-n))},k=L=>{let V=(L-n)/(s-n);return Math.max(0,Math.min(1,V))*100},C=(L,V)=>{let B=Math.min(L,V),W=Math.max(L,V);return{low:B,high:W}},R=(L,V)=>{let B=window.innerWidth;return B>=V?e.id:B>=L?t.id:r.id},P=()=>{u.setAttribute("data-selected",String(r.id===this.selectedLayoutId)),u.setAttribute("data-resolved",String(r.id===this.resolvedLayoutId)),g.setAttribute("data-selected",String(t.id===this.selectedLayoutId)),g.setAttribute("data-resolved",String(t.id===this.resolvedLayoutId)),v.setAttribute("data-selected",String(e.id===this.selectedLayoutId)),v.setAttribute("data-resolved",String(e.id===this.resolvedLayoutId))},A=(L,V,B,W)=>{let at=k(L),Mt=k(V),Lt=k(B),ve=k(W);i.style.setProperty("--string-grid-layout-range-first",`${at}%`),i.style.setProperty("--string-grid-layout-range-second",`${Mt}%`),i.style.setProperty("--string-grid-layout-range-medium",`${Lt}%`),i.style.setProperty("--string-grid-layout-range-large",`${ve}%`),l.textContent=`${L}`,d.textContent=`${V}`,P()},_=L=>Math.max(n,Math.min(s,L)),T=t.minWidth,D=e.minWidth,F=T,H=D,z=null,G=null,j="m",Z=(L,V)=>{[h,b,m,y].forEach(B=>{B.getAttribute("data-handle")===L&&B.setAttribute("data-handle-state",V)})},U=()=>{let L=G?"dragging":z?"active":"default",V=G??z??j;i.setAttribute("data-state",L),i.setAttribute("data-active-handle",V),c.setAttribute("data-state",L),c.setAttribute("data-active-handle",V),f.setAttribute("data-state",L),f.setAttribute("data-active-handle",V),f.setAttribute("data-handle",V),S.innerHTML=this.getRangeHandleIcon(V),x.value=String(V==="m"?F:H),Z("m",V==="m"?L:"default"),Z("l",V==="l"?L:"default")},st=()=>{this.layoutChips.querySelectorAll("[data-string-grid-layout-chip][data-mode]").forEach((V,B)=>{let W=this.layouts[B];W&&(V.setAttribute("data-selected",String(W.id===this.selectedLayoutId)),V.setAttribute("data-resolved",String(W.id===this.resolvedLayoutId)))})},Et=L=>{this.selectedLayoutId=L,st(),P()},ot=(L,V,B)=>{F=_(L),H=_(V);let W=C(F,H);t.minWidth=W.low,e.minWidth=W.high;let at=R(W.low,W.high);B?.syncSelectionToActive!==!1&&(this.selectedLayoutId=at),this.resolvedLayoutId=at;let Mt=this.layouts.find(Lt=>Lt.id===at);this.layoutTitle.textContent=Mt?sn(Mt):"Layout",A(F,H,W.low,W.high),st(),B?.syncEditor!==!1&&z&&(x.value=String(z==="m"?F:H)),B?.syncRuntime!==!1&&this.onPreviewResponsiveLayout(W.low,W.high,at)},jt=()=>{z=null,U()},wt=L=>{j=L,z=L,f.setAttribute("data-handle",L),x.value=String(L==="m"?F:H),S.innerHTML=this.getRangeHandleIcon(L),U(),x.focus(),x.select()},I=()=>{let L=C(F,H),V=R(L.low,L.high);T=F,D=H,this.onCommitResponsiveLayout(L.low,L.high,V),jt()},Y=(L,V,B)=>{B.preventDefault(),B.stopPropagation(),j=L,V.setPointerCapture(B.pointerId);let W=B.pointerId,at=B.clientX,Mt=c.getBoundingClientRect(),Lt=!1;G=L,U();let ve=lt=>{if(lt.pointerId!==W)return;lt.preventDefault(),lt.stopPropagation();let yn=lt.clientX-at;Math.abs(yn)>2&&(Lt=!0);let wi=M(lt.clientX-Mt.left,Mt.width);L==="m"?F=_(wi):H=_(wi),Lt&&z!==L&&wt(L),ot(F,H)},fe=lt=>{if(lt.pointerId===W){if(lt.stopPropagation(),V.releasePointerCapture(W),window.removeEventListener("pointermove",ve),window.removeEventListener("pointerup",fe),window.removeEventListener("pointercancel",fe),G=null,!Lt){wt(L);return}U(),I()}};window.addEventListener("pointermove",ve),window.addEventListener("pointerup",fe),window.addEventListener("pointercancel",fe)};return l.addEventListener("click",L=>{L.stopPropagation(),wt("m")}),d.addEventListener("click",L=>{L.stopPropagation(),wt("l")}),u.addEventListener("click",L=>{L.stopPropagation(),Et(r.id),this.onSelectLayout(r.id)}),g.addEventListener("click",L=>{L.stopPropagation(),Et(t.id),this.onSelectLayout(t.id)}),v.addEventListener("click",L=>{L.stopPropagation(),Et(e.id),this.onSelectLayout(e.id)}),h.addEventListener("pointerdown",L=>Y("m",h,L)),m.addEventListener("pointerdown",L=>Y("l",m,L)),b.addEventListener("pointerdown",L=>Y("m",b,L)),y.addEventListener("pointerdown",L=>Y("l",y,L)),x.addEventListener("input",L=>{L.stopPropagation();let V=z??j,B=Number.parseInt(x.value,10);if(Number.isFinite(B)){if(V==="m"){ot(B,H);return}ot(F,B)}}),x.addEventListener("keydown",L=>{if(L.stopPropagation(),L.key==="Enter"){I();return}L.key==="Escape"&&(ot(T,D),jt())}),x.addEventListener("blur",()=>{z&&I()}),ot(t.minWidth,e.minWidth,{syncRuntime:!1,syncSelectionToActive:!1}),U(),i.style.setProperty("--string-grid-layout-range-handle-gap",`${o}px`),i}renderList(){this.listContainer.innerHTML="";for(let r of this.instances){let t=this.adapterRegistry.get(r.type);if(!t)continue;let e=document.createElement("div");e.setAttribute("data-string-grid-list-item",""),e.setAttribute("data-state",r.id===this.selectedInstanceId?"selected":r.visible?"default":"disabled"),e.innerHTML=`<span data-string-grid-list-icon>${t.icon}</span><span data-string-grid-list-label>${r.name?.trim()||t.label}</span>`;let i=this.createToggle(r.visible,()=>this.onToggle(r.id)),n=document.createElement("button");n.type="button",n.setAttribute("data-string-grid-list-delete",""),n.innerHTML=this.icon("delete"),n.addEventListener("click",s=>{s.stopPropagation(),this.selectedInstanceId===r.id&&this.closeDetailPanel(),this.onRemove(r.id)}),e.appendChild(i),e.appendChild(n),e.addEventListener("click",()=>{this.selectedInstanceId===r.id?this.closeDetailPanel():this.selectInstance(r.id)}),this.listContainer.appendChild(e)}this.listContainer.style.display=this.instances.length===0?"none":"",this.addGuideButton.setAttribute("data-empty",String(this.instances.length===0))}renderDetailPanel(){if(!this.selectedInstanceId){this.hideDetailPanelUI();return}let r=this.instances.find(i=>i.id===this.selectedInstanceId);if(!r){this.clearSelection();return}let t=this.adapterRegistry.get(r.type);if(!t){this.clearSelection();return}this.detailIcon&&(this.detailIcon.innerHTML=t.icon),this.detailTitle&&(this.detailTitle.textContent=r.name?.trim()||t.label),this.detailBuilder?.destroy(),this.detailBuilder=new Rr;let e=this.detailBuilder.build(t.getUISchema(),r.settings,(i,n)=>this.onSettingChange(r.id,i,n));this.detailContent.innerHTML="",this.detailContent.appendChild(e),this.detailPanel.setAttribute("data-open","true"),this.alignDetailPanel()}createToggle(r,t){let e=document.createElement("label");e.setAttribute("data-string-grid-list-toggle",""),e.setAttribute("data-checked",String(r));let i=document.createElement("input");i.type="checkbox",i.checked=r,i.setAttribute("data-string-grid-toggle-input",""),i.addEventListener("change",s=>{s.stopPropagation(),t()});let n=document.createElement("span");return n.setAttribute("data-string-grid-list-toggle-knob",""),e.addEventListener("click",s=>s.stopPropagation()),e.appendChild(i),e.appendChild(n),e}startDetailRename(){if(!this.selectedInstanceId||!this.detailTitle)return;let r=this.instances.find(o=>o.id===this.selectedInstanceId);if(!r)return;let t=this.adapterRegistry.get(r.type);if(!t)return;let e=r.name?.trim()||t.label,i=this.detailTitle.parentElement;if(!i)return;let n=document.createElement("input");n.setAttribute("data-string-grid-detail-title-input",""),n.setAttribute("data-string-devtools-text-input",""),n.type="text",n.value=e;let s=()=>{let o=n.value.trim();o!==e&&this.onRenameInstance(r.id,o),i.contains(n)&&i.replaceChild(this.detailTitle,n)};n.addEventListener("blur",s),n.addEventListener("keydown",o=>{o.key==="Enter"&&n.blur(),o.key==="Escape"&&(n.value=e,n.blur())}),n.addEventListener("click",o=>o.stopPropagation()),n.addEventListener("pointerdown",o=>o.stopPropagation()),i.replaceChild(n,this.detailTitle),n.focus(),n.select()}openAddPanel(){this.isAddPanelOpen=!0,this.closeLayoutPanel(),this.clearSelection(),this.addPanel.setAttribute("data-open","true")}closeAddPanel(){this.isAddPanelOpen=!1,this.addPanel.setAttribute("data-open","false")}openLayoutPanel(){this.isLayoutSettingsOpen=!0,this.closeAddPanel(),this.clearSelection(),this.layoutPanel.setAttribute("data-open","true"),this.renderLayoutChips(),this.alignLayoutPanel(),this.onLayoutPanelOpen()}closeLayoutPanel(){this.isLayoutSettingsOpen=!1,this.layoutPanel.setAttribute("data-open","false"),this.renderLayoutChips(),this.onLayoutPanelClose()}alignLayoutPanel(){let r=this.layoutSettingsToggle.getBoundingClientRect(),t=this.panel.getBoundingClientRect();this.layoutPanel.style.top=`${r.top-t.top}px`}selectInstance(r){this.selectedInstanceId=r,this.closeLayoutPanel(),this.closeAddPanel(),this.renderList(),this.renderDetailPanel()}closeDetailPanel(){this.clearSelection(),this.renderList()}clearSelection(){this.selectedInstanceId=null,this.hideDetailPanelUI()}hideDetailPanelUI(){let r=this.detailBuilder;this.detailBuilder=null,this.detailPanel.setAttribute("data-open","false"),window.setTimeout(()=>{this.detailPanel.getAttribute("data-open")==="false"&&(r?.destroy(),this.detailContent.innerHTML="",this.detailPanel.style.top="")},220)}alignDetailPanel(){let r=this.listContainer.querySelector('[data-string-grid-list-item][data-state="selected"]');if(!r)return;let t=r.getBoundingClientRect(),e=this.panel.getBoundingClientRect();this.detailPanel.style.top=`${t.top-e.top}px`}show(){this.isOpen=!0,this.trigger.setAttribute("data-open","true"),this.trigger.setAttribute("data-state","open"),this.trigger.setAttribute("aria-expanded","true"),this.onHUDOpen()}hide(){this.isOpen=!1,this.closeAddPanel(),this.closeDetailPanel(),this.closeLayoutPanel(),this.trigger.setAttribute("data-open","false"),this.trigger.setAttribute("data-state","visible"),this.trigger.setAttribute("aria-expanded","false"),this.onHUDClose()}toggle(){this.enabled&&(this.isOpen?this.hide():this.show())}onDocumentPointerDown(r){if(!this.isOpen)return;let t=r.target;t instanceof Node&&(this.panel.contains(t)||this.trigger.contains(t)||this.addPanel.contains(t)||this.layoutPanel.contains(t)||this.detailPanel.contains(t)||this.hide())}deviceIcon(r){return r==="desktop"?'<svg viewBox="0 0 16 16" aria-hidden="true"><rect x="2.5" y="3" width="11" height="8" rx="1.5" fill="currentColor"/><path d="M6 13h4" stroke="currentColor" stroke-linecap="round"/><path d="M4.5 14h7" stroke="currentColor" stroke-linecap="round"/></svg>':r==="tablet"?'<svg viewBox="0 0 16 16" aria-hidden="true"><rect x="4.25" y="2.25" width="7.5" height="11.5" rx="1.8" fill="currentColor"/><circle cx="8" cy="11.6" r="0.55" fill="#ffffff"/></svg>':'<svg viewBox="0 0 16 16" aria-hidden="true"><rect x="5" y="1.75" width="6" height="12.5" rx="2.4" fill="currentColor"/><circle cx="8" cy="11.8" r="0.55" fill="#ffffff"/></svg>'}getRangeHandleIcon(r){return r==="m"?this.deviceIcon("tablet"):this.deviceIcon("desktop")}icon(r){switch(r){case"plus":return'<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M1 8H15" fill="none" stroke="currentColor"/><path d="M8 15V1" fill="none" stroke="currentColor"/></svg>';case"close":return'<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M2 2L14 14" fill="none" stroke="currentColor"/><path d="M2 14L14 2" fill="none" stroke="currentColor"/></svg>';case"delete":return'<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4 8h8" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/></svg>';case"settings":return'<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M7.79199 1.17639C7.92907 1.14726 8.07093 1.14726 8.20801 1.17639C8.36286 1.20932 8.50859 1.29342 8.7998 1.46155L13.2617 4.03772C13.5531 4.20597 13.6997 4.29016 13.8057 4.40784C13.8994 4.51198 13.9704 4.63491 14.0137 4.76819C14.0626 4.91878 14.0625 5.08713 14.0625 5.42346V10.5758C14.0625 10.9123 14.0626 11.0814 14.0137 11.2321C13.9704 11.3651 13.8992 11.4874 13.8057 11.5914C13.6997 11.7091 13.5532 11.7933 13.2617 11.9615L8.7998 14.5377C8.50837 14.706 8.36293 14.7909 8.20801 14.8239C8.07093 14.853 7.92907 14.853 7.79199 14.8239C7.63707 14.7909 7.49163 14.706 7.2002 14.5377L2.73828 11.9615C2.44684 11.7933 2.30032 11.7091 2.19434 11.5914C2.10078 11.4874 2.02959 11.3651 1.98633 11.2321C1.93738 11.0814 1.9375 10.9123 1.9375 10.5758V5.42346C1.9375 5.08713 1.9374 4.91878 1.98633 4.76819C2.02963 4.63491 2.10057 4.51198 2.19434 4.40784C2.30031 4.29016 2.44687 4.20597 2.73828 4.03772L7.2002 1.46155C7.49141 1.29342 7.63714 1.20932 7.79199 1.17639ZM8 4.99964C6.34327 4.99964 5.0002 6.34295 5 7.99964C5 9.65649 6.34315 10.9996 8 10.9996C9.65685 10.9996 11 9.65649 11 7.99964C10.9998 6.34295 9.65673 4.99964 8 4.99964Z" fill="currentColor"/></svg>';case"more":return'<svg viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="3" r="1.2" fill="currentColor"/><circle cx="8" cy="8" r="1.2" fill="currentColor"/><circle cx="8" cy="13" r="1.2" fill="currentColor"/></svg>';case"chevron-up":return'<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3 10l5-5 5 5" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>';case"chevron-down":return'<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3 6l5 5 5-5" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>';case"export":return'<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 2v8" stroke="currentColor" stroke-linecap="round" fill="none"/><path d="M5 7l3 3 3-3" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" fill="none"/><path d="M2 13h12" stroke="currentColor" stroke-linecap="round" fill="none"/></svg>';case"import":return'<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 10V2" stroke="currentColor" stroke-linecap="round" fill="none"/><path d="M5 5l3-3 3 3" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" fill="none"/><path d="M2 13h12" stroke="currentColor" stroke-linecap="round" fill="none"/></svg>'}}};var bt=class{static serialize(r,t){return{v:this.VERSION,source:"StringDevLayout",selectedLayout:t,layouts:r.map(e=>({id:e.id,name:e.name,minWidth:e.minWidth,grids:e.instances.map(i=>({id:i.id,type:i.type,visible:i.visible,...i.name!==void 0?{name:i.name}:{},settings:{...i.settings}}))}))}}static deserialize(r,t){if(!r||typeof r!="object")return null;let e=r,i=e.v,n=e.source;if(n!=="StringDevLayout"&&n!=="StringGrid"||i!==1&&i!==2||!Array.isArray(e.layouts))return null;let s=e.layouts.filter(l=>!!l&&typeof l=="object"&&typeof l.id=="string"&&typeof l.name=="string").map((l,d)=>({id:l.id,name:l.name,minWidth:this.resolveImportedMinWidth(l.minWidth,d),instances:(Array.isArray(l.grids)?l.grids:[]).filter(c=>!!c&&typeof c=="object"&&typeof c.type=="string"&&t.has(c.type)).map(c=>{let u=c.type,g=t.get(u);return{id:typeof c.id=="string"?c.id:Lr(),type:u,visible:c.visible!==!1,...typeof c.name=="string"&&c.name?{name:c.name}:{},settings:{...g.getDefaults(),...c.settings&&typeof c.settings=="object"&&!Array.isArray(c.settings)?c.settings:{}}}})}));if(s.length===0)return null;s.sort((l,d)=>d.minWidth-l.minWidth);let o=typeof e.selectedLayout=="string"?e.selectedLayout:typeof e.activeLayout=="string"?e.activeLayout:s[0].id,a=s.some(l=>l.id===o)?o:s[0].id;return{layouts:s,selectedLayoutId:a}}static toFile(r,t){let e=JSON.stringify(t,null,2),i=new Blob([e],{type:"application/json"}),n=URL.createObjectURL(i),s=document.createElement("a");s.href=n,s.download=r,s.click(),URL.revokeObjectURL(n)}static fromFile(){return new Promise((r,t)=>{let e=document.createElement("input");e.type="file",e.accept=".json,application/json";let i=()=>e.remove();e.addEventListener("change",()=>{let n=e.files?.[0];if(!n){i(),t(new Error("No file selected"));return}let s=new FileReader;s.onload=()=>{i();try{r(JSON.parse(s.result))}catch{t(new Error("Invalid JSON"))}},s.onerror=()=>{i(),t(new Error("File read error"))},s.readAsText(n)}),e.addEventListener("cancel",()=>{i(),t(new Error("Cancelled"))}),document.body.appendChild(e),e.click()})}static resolveImportedMinWidth(r,t){if(typeof r=="number"&&Number.isFinite(r))return ft(r);let e=$[t];if(e)return e.minWidth;let i=$[$.length-1];return Math.max(0,i.minWidth-(t-($.length-1))*160)}};bt.VERSION=2;var Fr="http://www.w3.org/2000/svg",N=class{clear(r,t){let e=r.querySelector(`[data-grid-id="${t}"]`);e&&e.remove()}getGroup(r,t){let e=r.querySelector(`[data-grid-id="${t}"]`);return e||(e=document.createElementNS(Fr,"g"),e.setAttribute("data-grid-id",t),r.appendChild(e)),e}createLine(r,t,e,i,n,s,o=1){let a=document.createElementNS(Fr,"line");return a.setAttribute("data-string-grid-shape","line"),a.setAttribute("x1",String(r)),a.setAttribute("y1",String(t)),a.setAttribute("x2",String(e)),a.setAttribute("y2",String(i)),a.setAttribute("stroke",n),a.setAttribute("stroke-opacity",String(s)),a.setAttribute("stroke-width",String(o)),a}createRect(r,t,e,i,n,s){let o=document.createElementNS(Fr,"rect");return o.setAttribute("data-string-grid-shape","rect"),o.setAttribute("x",String(r)),o.setAttribute("y",String(t)),o.setAttribute("width",String(e)),o.setAttribute("height",String(i)),o.setAttribute("fill",n),o.setAttribute("fill-opacity",String(s)),o}resolveUnit(r,t,e,i){let n=parseFloat(getComputedStyle(document.documentElement).fontSize)||16,s=i instanceof Element&&parseFloat(getComputedStyle(i).fontSize)||n;switch(t){case"%":return r/100*e;case"vw":return r/100*window.innerWidth;case"vh":return r/100*window.innerHeight;case"em":return r*s;case"rem":return r*n;default:return r}}createPath(r,t,e,i=1,n="none"){let s=document.createElementNS(Fr,"path");return s.setAttribute("data-string-grid-shape","path"),s.setAttribute("d",r),s.setAttribute("stroke",t),s.setAttribute("stroke-opacity",String(e)),s.setAttribute("stroke-width",String(i)),s.setAttribute("fill",n),s}};var ce=class ce extends N{constructor(){super(...arguments);this.type="columns";this.label="Columns";this.icon='<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="7" y="3" width="2" height="10" fill="currentColor"/><rect x="3" y="3" width="2" height="10" fill="currentColor"/><rect x="11" y="3" width="2" height="10" fill="currentColor"/></svg>'}getDefaults(){return{count:12,gap:20,gapUnit:"px",margin:0,marginUnit:"px",color:"#4a90e2",opacity:.15,showLines:!1}}getUISchema(){return[{type:"number",key:"count",label:"Columns",default:12,min:1,max:48,step:1},{type:"range",key:"gap",label:"Gap",default:20,min:0,max:100,step:1,units:ce.UNIT_OPTIONS,defaultUnit:"px"},{type:"range",key:"margin",label:"Margin",default:0,min:0,max:100,step:1,units:ce.UNIT_OPTIONS,defaultUnit:"px"},{type:"divider"},{type:"color",key:"color",label:"Color",default:"#4a90e2"},{type:"range",key:"opacity",label:"Opacity",default:.15,min:0,max:1,step:.01},{type:"toggle",key:"showLines",label:"Lines only",default:!1}]}render(t,e,i,n){let s=this.getGroup(t,n.__instanceId),{count:o,gap:a,gapUnit:l,margin:d,marginUnit:c,color:u,opacity:g,showLines:v}=n,h=t.parentElement,m=this.resolveUnit(a,l||"px",e,h),b=this.resolveUnit(d,c||"px",e,h),y=e-b*2,f=(o-1)*m,S=(y-f)/o;if(!(S<=0))for(let x=0;x<o;x++){let w=b+x*(S+m);v?(s.appendChild(this.createLine(w,0,w,i,u,g)),s.appendChild(this.createLine(w+S,0,w+S,i,u,g))):s.appendChild(this.createRect(w,0,S,i,u,g))}}};ce.UNIT_OPTIONS=[{value:"px",label:"px"},{value:"%",label:"%"},{value:"vw",label:"vw"},{value:"vh",label:"vh"},{value:"em",label:"em"},{value:"rem",label:"rem"}];var Vr=ce;var Wt=class Wt extends N{constructor(){super(...arguments);this.type="rows";this.label="Rows";this.icon='<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="3" y="3" width="10" height="2" fill="currentColor"/><rect x="3" y="7" width="10" height="2" fill="currentColor"/><rect x="3" y="11" width="10" height="2" fill="currentColor"/></svg>'}getDefaults(){return{mode:"count",count:8,size:24,sizeUnit:"px",gap:0,gapUnit:"px",margin:0,marginUnit:"px",color:"#e2784a",opacity:.2,style:"line"}}getUISchema(){return[{type:"select",key:"mode",label:"Mode",default:"count",options:[{value:"count",label:"By count"},{value:"size",label:"By size"}]},{type:"number",key:"count",label:"Rows",default:8,min:1,max:48,step:1},{type:"range",key:"size",label:"Size",default:24,min:1,max:200,step:1,units:Wt.UNIT_OPTIONS,defaultUnit:"px"},{type:"range",key:"gap",label:"Gap",default:0,min:0,max:100,step:1,units:Wt.UNIT_OPTIONS,defaultUnit:"px"},{type:"range",key:"margin",label:"Margin",default:0,min:0,max:100,step:1,units:Wt.UNIT_OPTIONS,defaultUnit:"px"},{type:"divider"},{type:"color",key:"color",label:"Color",default:"#e2784a"},{type:"range",key:"opacity",label:"Opacity",default:.2,min:0,max:1,step:.01},{type:"select",key:"style",label:"Style",default:"line",options:[{value:"line",label:"Lines"},{value:"fill",label:"Fill"}]}]}render(t,e,i,n){let s=this.getGroup(t,n.__instanceId),{mode:o,count:a,size:l,sizeUnit:d,gap:c,gapUnit:u,margin:g,marginUnit:v,color:h,opacity:m,style:b}=n,y=t.parentElement,f=this.resolveUnit(c,u||"px",i,y),S=this.resolveUnit(g,v||"px",i,y),x=i-S*2;if(!(x<=0))if(o==="count")this.renderByCount(s,e,x,S,a,f,h,m,b);else{let w=this.resolveUnit(l,d||"px",i,y);if(w<=0)return;this.renderBySize(s,e,x,S,w,f,h,m,b)}}renderByCount(t,e,i,n,s,o,a,l,d){if(d==="fill"){let c=(i-(s-1)*o)/s;if(c<=0)return;for(let u=0;u<s;u++){let g=n+u*(c+o);t.appendChild(this.createRect(0,g,e,c,a,l))}}else{if(s===1){let u=n+i/2;t.appendChild(this.createLine(0,u,e,u,a,l));return}let c=i/(s-1);for(let u=0;u<s;u++){let g=n+u*c;t.appendChild(this.createLine(0,g,e,g,a,l))}}}renderBySize(t,e,i,n,s,o,a,l,d){if(d==="fill"){let c=s+o;for(let u=0;u<i;u+=c){let g=Math.min(s,i-u);t.appendChild(this.createRect(0,n+u,e,g,a,l))}}else for(let c=0;c<=i;c+=s)t.appendChild(this.createLine(0,n+c,e,n+c,a,l))}};Wt.UNIT_OPTIONS=[{value:"px",label:"px"},{value:"%",label:"%"},{value:"vh",label:"vh"},{value:"vw",label:"vw"},{value:"em",label:"em"},{value:"rem",label:"rem"}];var _r=Wt;var zr=class extends N{constructor(){super(...arguments);this.type="center";this.label="Center";this.icon='<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="3" y="3" width="10" height="10" rx="3" fill="currentColor"/><path d="M8 2V14" stroke="white"/><path d="M2 8H14" stroke="white"/></svg>'}getDefaults(){return{showVertical:!0,showHorizontal:!0,color:"#50e24a",opacity:.5,dashed:!0}}getUISchema(){return[{type:"toggle",key:"showVertical",label:"Vertical",default:!0},{type:"toggle",key:"showHorizontal",label:"Horizontal",default:!0},{type:"divider"},{type:"color",key:"color",label:"Color",default:"#50e24a"},{type:"range",key:"opacity",label:"Opacity",default:.5,min:0,max:1,step:.01},{type:"toggle",key:"dashed",label:"Dashed",default:!0}]}render(t,e,i,n){let s=this.getGroup(t,n.__instanceId),{showVertical:o,showHorizontal:a,color:l,opacity:d,dashed:c}=n,u=c?"6 3":"none";if(o){let g=this.createLine(e/2,0,e/2,i,l,d);c&&g.setAttribute("stroke-dasharray",u),s.appendChild(g)}if(a){let g=this.createLine(0,i/2,e,i/2,l,d);c&&g.setAttribute("stroke-dasharray",u),s.appendChild(g)}}};var Br=class extends N{constructor(){super(...arguments);this.type="rule-of-thirds";this.label="3\xD73";this.icon='<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="6" y="6" width="4" height="4" fill="currentColor"/><path d="M6 3.6C6 3.03995 6 2.75992 6.10899 2.54601C6.20487 2.35785 6.35785 2.20487 6.54601 2.10899C6.75992 2 7.03995 2 7.6 2H8.4C8.96005 2 9.24008 2 9.45399 2.10899C9.64215 2.20487 9.79513 2.35785 9.89101 2.54601C10 2.75992 10 3.03995 10 3.6V5H6V3.6Z" fill="currentColor"/><path d="M6 11H10V12.4C10 12.9601 10 13.2401 9.89101 13.454C9.79513 13.6422 9.64215 13.7951 9.45399 13.891C9.24008 14 8.96005 14 8.4 14H7.6C7.03995 14 6.75992 14 6.54601 13.891C6.35785 13.7951 6.20487 13.6422 6.10899 13.454C6 13.2401 6 12.9601 6 12.4V11Z" fill="currentColor"/><path d="M2 7.6C2 7.03995 2 6.75992 2.10899 6.54601C2.20487 6.35785 2.35785 6.20487 2.54601 6.10899C2.75992 6 3.03995 6 3.6 6H5V10H3.6C3.03995 10 2.75992 10 2.54601 9.89101C2.35785 9.79513 2.20487 9.64215 2.10899 9.45399C2 9.24008 2 8.96005 2 8.4V7.6Z" fill="currentColor"/><path d="M11 6H12.4C12.9601 6 13.2401 6 13.454 6.10899C13.6422 6.20487 13.7951 6.35785 13.891 6.54601C14 6.75992 14 7.03995 14 7.6V8.4C14 8.96005 14 9.24008 13.891 9.45399C13.7951 9.64215 13.6422 9.79513 13.454 9.89101C13.2401 10 12.9601 10 12.4 10H11V6Z" fill="currentColor"/></svg>'}getDefaults(){return{color:"#e2e24a",opacity:.4,showIntersections:!0}}getUISchema(){return[{type:"color",key:"color",label:"Color",default:"#e2e24a"},{type:"range",key:"opacity",label:"Opacity",default:.4,min:0,max:1,step:.01},{type:"toggle",key:"showIntersections",label:"Show points",default:!0}]}render(t,e,i,n){let s=this.getGroup(t,n.__instanceId),{color:o,opacity:a,showIntersections:l}=n,d=e/3,c=i/3;if(s.appendChild(this.createLine(d,0,d,i,o,a)),s.appendChild(this.createLine(d*2,0,d*2,i,o,a)),s.appendChild(this.createLine(0,c,e,c,o,a)),s.appendChild(this.createLine(0,c*2,e,c*2,o,a)),l){let u=[[d,c],[d*2,c],[d,c*2],[d*2,c*2]];for(let[g,v]of u){let h=document.createElementNS("http://www.w3.org/2000/svg","circle");h.setAttribute("cx",String(g)),h.setAttribute("cy",String(v)),h.setAttribute("r","3"),h.setAttribute("fill",o),h.setAttribute("fill-opacity",String(a*1.5)),s.appendChild(h)}}}};var ls=1.6180339887,Nr=class extends N{constructor(){super(...arguments);this.type="phi";this.label="Phi";this.icon='<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><line x1="6.1" y1="1" x2="6.1" y2="15" stroke="currentColor" stroke-opacity="0.5"/><line x1="9.9" y1="1" x2="9.9" y2="15" stroke="currentColor" stroke-opacity="0.5"/><line x1="1" y1="6.1" x2="15" y2="6.1" stroke="currentColor" stroke-opacity="0.5"/><line x1="1" y1="9.9" x2="15" y2="9.9" stroke="currentColor" stroke-opacity="0.5"/><text x="8" y="8.5" text-anchor="middle" font-size="4" fill="currentColor" opacity="0.3">\u03C6</text></svg>'}getDefaults(){return{color:"#c24ae2",opacity:.4,showIntersections:!0}}getUISchema(){return[{type:"color",key:"color",label:"Color",default:"#c24ae2"},{type:"range",key:"opacity",label:"Opacity",default:.4,min:0,max:1,step:.01},{type:"toggle",key:"showIntersections",label:"Show points",default:!0}]}render(t,e,i,n){let s=this.getGroup(t,n.__instanceId),{color:o,opacity:a,showIntersections:l}=n,d=1/ls,c=1-d,u=e*c,g=e*d,v=i*c,h=i*d;if(s.appendChild(this.createLine(u,0,u,i,o,a)),s.appendChild(this.createLine(g,0,g,i,o,a)),s.appendChild(this.createLine(0,v,e,v,o,a)),s.appendChild(this.createLine(0,h,e,h,o,a)),l){let m=[[u,v],[u,h],[g,v],[g,h]];for(let[b,y]of m){let f=document.createElementNS("http://www.w3.org/2000/svg","circle");f.setAttribute("cx",String(b)),f.setAttribute("cy",String(y)),f.setAttribute("r","3"),f.setAttribute("fill",o),f.setAttribute("fill-opacity",String(a*1.5)),s.appendChild(f)}}}};var pi=1.6180339887,Wr=class extends N{constructor(){super(...arguments);this.type="golden-rectangle";this.label="Golden";this.icon='<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="3" y="3" width="10" height="10" rx="3" fill="currentColor"/><path d="M9 13V3" stroke="white"/><path d="M13 9H9" stroke="white"/></svg>'}getDefaults(){return{depth:8,showSpiral:!0,color:"#e2a44a",opacity:.4}}getUISchema(){return[{type:"number",key:"depth",label:"Depth",default:8,min:2,max:14,step:1},{type:"toggle",key:"showSpiral",label:"Show spiral",default:!0},{type:"divider"},{type:"color",key:"color",label:"Color",default:"#e2a44a"},{type:"range",key:"opacity",label:"Opacity",default:.4,min:0,max:1,step:.01}]}render(t,e,i,n){let s=this.getGroup(t,n.__instanceId),{depth:o,showSpiral:a,color:l,opacity:d}=n,c,u;e/i>=pi?(u=i,c=u*pi):(c=e,u=c/pi);let g=(e-c)/2,v=(i-u)/2;if(c<e-1||u<i-1){let x=this.createPath(`M ${g} ${v} L ${g+c} ${v} L ${g+c} ${v+u} L ${g} ${v+u} Z`,l,d*.3,1);x.setAttribute("stroke-dasharray","6 4"),s.appendChild(x)}let h=g,m=v,b=c,y=u,f="",S=!0;for(let x=0;x<o&&!(b<1||y<1);x++){let w=x%4,M=Math.min(b,y),k,C;switch(w){case 0:{k=h+b-M,C=m,b-M>.5&&s.appendChild(this.createLine(k,m,k,m+y,l,d)),a&&(S&&(f=`M ${k+M} ${C}`,S=!1),f+=` A ${M} ${M} 0 0 1 ${k} ${C+M}`),b-=M;break}case 1:{k=h,C=m+y-M,y-M>.5&&s.appendChild(this.createLine(h,C,h+b,C,l,d)),a&&(S&&(f=`M ${k+M} ${C+M}`,S=!1),f+=` A ${M} ${M} 0 0 1 ${k} ${C}`),y-=M;break}case 2:{k=h,C=m,b-M>.5&&s.appendChild(this.createLine(h+M,m,h+M,m+y,l,d)),a&&(S&&(f=`M ${k} ${C+M}`,S=!1),f+=` A ${M} ${M} 0 0 1 ${k+M} ${C}`),h+=M,b-=M;break}case 3:{k=h,C=m,y-M>.5&&s.appendChild(this.createLine(h,m+M,h+b,m+M,l,d)),a&&(S&&(f=`M ${k} ${C}`,S=!1),f+=` A ${M} ${M} 0 0 1 ${k+M} ${C+M}`),m+=M,y-=M;break}}}a&&f&&s.appendChild(this.createPath(f,l,d*.8,1.5))}};var Gr=class extends N{constructor(){super(...arguments);this.type="harmonic-armature";this.label="Harmonic";this.icon='<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><line x1="1" y1="1" x2="15" y2="15" stroke="currentColor" stroke-opacity="0.4"/><line x1="15" y1="1" x2="1" y2="15" stroke="currentColor" stroke-opacity="0.4"/><line x1="1" y1="8" x2="8" y2="1" stroke="currentColor" stroke-opacity="0.3"/><line x1="8" y1="1" x2="15" y2="8" stroke="currentColor" stroke-opacity="0.3"/></svg>'}getDefaults(){return{level:"basic",color:"#4ae2c4",opacity:.3}}getUISchema(){return[{type:"select",key:"level",label:"Detail",default:"basic",options:[{value:"basic",label:"Basic (diagonals)"},{value:"mid",label:"Mid (+ midpoints)"},{value:"full",label:"Full armature"}]},{type:"divider"},{type:"color",key:"color",label:"Color",default:"#4ae2c4"},{type:"range",key:"opacity",label:"Opacity",default:.3,min:0,max:1,step:.01}]}render(t,e,i,n){let s=this.getGroup(t,n.__instanceId),{level:o,color:a,opacity:l}=n,d=e,c=i,u=d/2,g=c/2;if(s.appendChild(this.createLine(0,0,d,c,a,l)),s.appendChild(this.createLine(d,0,0,c,a,l)),(o==="mid"||o==="full")&&(s.appendChild(this.createLine(u,0,0,c,a,l*.7)),s.appendChild(this.createLine(u,0,d,c,a,l*.7)),s.appendChild(this.createLine(u,c,0,0,a,l*.7)),s.appendChild(this.createLine(u,c,d,0,a,l*.7)),s.appendChild(this.createLine(0,g,d,0,a,l*.7)),s.appendChild(this.createLine(0,g,d,c,a,l*.7)),s.appendChild(this.createLine(d,g,0,0,a,l*.7)),s.appendChild(this.createLine(d,g,0,c,a,l*.7))),o==="full"){let v=d/4,h=c/4;s.appendChild(this.createLine(v,0,v,c,a,l*.4)),s.appendChild(this.createLine(d-v,0,d-v,c,a,l*.4)),s.appendChild(this.createLine(0,h,d,h,a,l*.4)),s.appendChild(this.createLine(0,c-h,d,c-h,a,l*.4)),s.appendChild(this.createLine(u,0,u,c,a,l*.3)),s.appendChild(this.createLine(0,g,d,g,a,l*.3))}}};var gi="http://www.w3.org/2000/svg",yt=class yt extends N{constructor(){super(...arguments);this.type="dot-grid";this.label="Dots";this.icon='<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="11" y="3" width="2" height="2" fill="currentColor"/><rect x="11" y="7" width="2" height="2" fill="currentColor"/><rect x="11" y="11" width="2" height="2" fill="currentColor"/><rect x="7" y="3" width="2" height="2" fill="currentColor"/><rect x="7" y="7" width="2" height="2" fill="currentColor"/><rect x="7" y="11" width="2" height="2" fill="currentColor"/><rect x="3" y="3" width="2" height="2" fill="currentColor"/><rect x="3" y="7" width="2" height="2" fill="currentColor"/><rect x="3" y="11" width="2" height="2" fill="currentColor"/></svg>'}getDefaults(){return{step:16,stepUnit:"px",dotSize:1.5,shape:"dot",color:"#a0a0a0",opacity:.4}}getUISchema(){return[{type:"range",key:"step",label:"Step",default:16,min:4,max:100,step:1,units:yt.UNIT_OPTIONS,defaultUnit:"px"},{type:"range",key:"dotSize",label:"Size",default:1.5,min:.5,max:6,step:.5},{type:"select",key:"shape",label:"Shape",default:"dot",options:[{value:"dot",label:"Dot \u25CF"},{value:"cross",label:"Cross +"}]},{type:"divider"},{type:"color",key:"color",label:"Color",default:"#a0a0a0"},{type:"range",key:"opacity",label:"Opacity",default:.4,min:0,max:1,step:.01}]}render(t,e,i,n){let s=this.getGroup(t,n.__instanceId),{step:o,stepUnit:a,dotSize:l,shape:d,color:c,opacity:u}=n,g=this.resolveUnit(o,a||"px",Math.min(e,i),t.parentElement),v=this.getSafeStep(e,i,g,d);if(v<2)return;let h=this.getPatternId(n.__instanceId),m=this.getDefs(t),b=document.createElementNS(gi,"pattern");b.setAttribute("id",h),b.setAttribute("data-string-grid-pattern-for",n.__instanceId),b.setAttribute("patternUnits","userSpaceOnUse"),b.setAttribute("width",String(v)),b.setAttribute("height",String(v)),b.setAttribute("x",String(v/2)),b.setAttribute("y",String(v/2));let y=v/2;if(d==="cross")b.appendChild(this.createLine(y-l*2,y,y+l*2,y,c,u,.8)),b.appendChild(this.createLine(y,y-l*2,y,y+l*2,c,u,.8));else{let S=document.createElementNS(gi,"circle");S.setAttribute("cx",String(y)),S.setAttribute("cy",String(y)),S.setAttribute("r",String(l)),S.setAttribute("fill",c),S.setAttribute("fill-opacity",String(u)),b.appendChild(S)}m.appendChild(b);let f=this.createRect(0,0,e,i,`url(#${h})`,1);f.setAttribute("fill-opacity","1"),s.appendChild(f)}clear(t,e){super.clear(t,e),t.querySelector(`[data-string-grid-pattern-for="${e}"]`)?.remove()}getDefs(t){let e=t.querySelector("defs");return e||(e=document.createElementNS(gi,"defs"),t.insertBefore(e,t.firstChild)),e}getPatternId(t){return`string-grid-dot-pattern-${t.replace(/[^a-zA-Z0-9_-]/g,"-")}`}getSafeStep(t,e,i,n){let o=Math.max(i,2),a=n==="cross"?yt.MAX_CROSS_CELLS:yt.MAX_DOT_CELLS;return Math.floor(t/o)*Math.floor(e/o)<=a?o:Math.max(o,Math.sqrt(t*e/a))}};yt.MAX_DOT_CELLS=12e4,yt.MAX_CROSS_CELLS=8e4,yt.UNIT_OPTIONS=[{value:"px",label:"px"},{value:"%",label:"%"},{value:"vw",label:"vw"},{value:"vh",label:"vh"},{value:"em",label:"em"},{value:"rem",label:"rem"}];var $r=yt;var jr=class extends N{constructor(){super(...arguments);this.type="pentagram";this.label="Pentagram";this.icon='<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><polygon points="8,1 9.8,6.2 15,6.2 10.8,9.5 12.4,15 8,11.5 3.6,15 5.2,9.5 1,6.2 6.2,6.2" stroke="currentColor" stroke-opacity="0.5" fill="none" stroke-width="0.8"/></svg>'}getDefaults(){return{sizing:"stretch",rotation:0,showPentagon:!0,showStar:!0,color:"#b07ee8",opacity:.45}}getUISchema(){return[{type:"select",key:"sizing",label:"Sizing",default:"stretch",options:[{value:"stretch",label:"Stretch"},{value:"fit",label:"Fit"},{value:"fill",label:"Fill"}]},{type:"range",key:"rotation",label:"Rotation",default:0,min:0,max:360,step:1},{type:"toggle",key:"showPentagon",label:"Pentagon",default:!0},{type:"toggle",key:"showStar",label:"Star",default:!0},{type:"divider"},{type:"color",key:"color",label:"Color",default:"#b07ee8"},{type:"range",key:"opacity",label:"Opacity",default:.45,min:0,max:1,step:.01}]}render(t,e,i,n){let s=this.getGroup(t,n.__instanceId),{sizing:o,rotation:a,showPentagon:l,showStar:d,color:c,opacity:u}=n,g=1,v=(a-90)*Math.PI/180,h=[];for(let P=0;P<5;P++){let A=v+P*(2*Math.PI/5);h.push([Math.cos(A),Math.sin(A)])}let m=h[0][0],b=h[0][0],y=h[0][1],f=h[0][1];for(let[P,A]of h)P<m&&(m=P),P>b&&(b=P),A<y&&(y=A),A>f&&(f=A);let S=b-m,x=f-y,w=(m+b)/2,M=(y+f)/2,k,C;switch(o){case"fit":{let P=Math.min(e/S,i/x)*g;k=P,C=P;break}case"fill":{let P=Math.max(e/S,i/x)*g;k=P,C=P;break}default:k=e/S*g,C=i/x*g;break}let R=h.map(([P,A])=>[e/2+(P-w)*k,i/2+(A-M)*C]);if(l){let P=R.map((A,_)=>`${_===0?"M":"L"} ${A[0]} ${A[1]}`).join(" ")+" Z";s.appendChild(this.createPath(P,c,u*.5,1))}if(d){let A=[0,2,4,1,3].map((_,T)=>{let D=R[_];return`${T===0?"M":"L"} ${D[0]} ${D[1]}`}).join(" ")+" Z";s.appendChild(this.createPath(A,c,u,1))}}};var Ur=class extends N{constructor(){super(...arguments);this.type="rabatment";this.label="Rabatment";this.icon='<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="1" width="14" height="14" rx="0.5" stroke="currentColor" stroke-opacity="0.2"/><rect x="1" y="1" width="10" height="14" rx="0.3" stroke="currentColor" stroke-opacity="0.5"/><line x1="11" y1="1" x2="11" y2="15" stroke="currentColor" stroke-opacity="0.5" stroke-dasharray="2 1"/></svg>'}getDefaults(){return{side:"both",showDiagonals:!1,color:"#56b886",opacity:.4}}getUISchema(){return[{type:"select",key:"side",label:"Side",default:"both",options:[{value:"both",label:"Both"},{value:"start",label:"Start"},{value:"end",label:"End"}]},{type:"toggle",key:"showDiagonals",label:"Diagonals",default:!1},{type:"divider"},{type:"color",key:"color",label:"Color",default:"#56b886"},{type:"range",key:"opacity",label:"Opacity",default:.4,min:0,max:1,step:.01}]}render(t,e,i,n){let s=this.getGroup(t,n.__instanceId),{side:o,showDiagonals:a,color:l,opacity:d}=n,c=e>=i,u=Math.min(e,i);c?this.renderLandscape(s,e,i,u,o,a,l,d):this.renderPortrait(s,e,i,u,o,a,l,d)}renderLandscape(t,e,i,n,s,o,a,l){if((s==="both"||s==="start")&&(t.appendChild(this.createRect(0,0,n,i,a,l*.15)),t.appendChild(this.createLine(n,0,n,i,a,l,1)),o&&(t.appendChild(this.createLine(0,0,n,i,a,l*.5,.8)),t.appendChild(this.createLine(n,0,0,i,a,l*.5,.8)))),s==="both"||s==="end"){let d=e-n;t.appendChild(this.createRect(d,0,n,i,a,l*.15)),t.appendChild(this.createLine(d,0,d,i,a,l,1)),o&&(t.appendChild(this.createLine(d,0,e,i,a,l*.5,.8)),t.appendChild(this.createLine(e,0,d,i,a,l*.5,.8)))}}renderPortrait(t,e,i,n,s,o,a,l){if((s==="both"||s==="start")&&(t.appendChild(this.createRect(0,0,e,n,a,l*.15)),t.appendChild(this.createLine(0,n,e,n,a,l,1)),o&&(t.appendChild(this.createLine(0,0,e,n,a,l*.5,.8)),t.appendChild(this.createLine(e,0,0,n,a,l*.5,.8)))),s==="both"||s==="end"){let d=i-n;t.appendChild(this.createRect(0,d,e,n,a,l*.15)),t.appendChild(this.createLine(0,d,e,d,a,l,1)),o&&(t.appendChild(this.createLine(0,d,e,i,a,l*.5,.8)),t.appendChild(this.createLine(e,d,0,i,a,l*.5,.8)))}}};var Yr="string-devtools-overlay-layout:change",hi=new Map;function on(p,r){hi.set(p,r)}function mi(p){hi.delete(p)}function ds(){let p=[];for(let[r,t]of hi)p.push({id:r,order:t});return p.sort((r,t)=>r.order!==t.order?r.order-t.order:r.id.localeCompare(t.id)),p}function cs(){return!!document.querySelector('[data-string-dev-viewport-layer="rulers"]')&&!document.body.hasAttribute("data-string-rulers-hidden")}function vi(p,r,t){let i=ds().findIndex(o=>o.id===p),n=i>=0?i:0,s=cs()?24:12;return{docX:r+s+n*36,docY:t+12}}function Xr(){window.dispatchEvent(new CustomEvent(Yr))}function qr(p,r,t,e){let i=0,n=p.parentElement;for(;n;){let s=n.getAttribute("string-id")??n.getAttribute("data-string-id");if(s){let o=e(s);o&&Math.abs(o.docX-r)<28&&Math.abs(o.docY-(t+i))<28&&(i+=36)}n=n.parentElement}return i}function an(){return`
|
|
1032
|
+
${Ot(["[data-string-grid-root]","[data-string-grid-chrome]"])}
|
|
1033
|
+
|
|
1034
|
+
[data-string-grid-root],
|
|
1035
|
+
[data-string-grid-chrome] {
|
|
1036
|
+
--string-grid-overlay-z-index: 10010;
|
|
1037
|
+
--string-grid-trigger-z-index: 10011;
|
|
1038
|
+
--string-grid-panel-z-index: 10012;
|
|
1039
|
+
--string-grid-trigger-size: 28px;
|
|
1040
|
+
--string-grid-trigger-gap: 8px;
|
|
1041
|
+
--string-grid-trigger-opacity-idle: 0;
|
|
1042
|
+
--string-grid-trigger-opacity-visible: 1;
|
|
1043
|
+
--string-grid-trigger-opacity-open: 1;
|
|
1044
|
+
--string-grid-stack-offset: 0px;
|
|
1045
|
+
--string-grid-panel-offset-top: 0px;
|
|
1046
|
+
--string-grid-panel-width: 200px;
|
|
1047
|
+
--string-grid-panel-height: auto;
|
|
1048
|
+
--string-grid-panel-max-height: 60vh;
|
|
1049
|
+
--string-grid-panel-padding: var(--string-dev-panel-padding);
|
|
1050
|
+
--string-grid-panel-bg: var(--string-dev-panel-bg);
|
|
1051
|
+
--string-grid-panel-bg-strong: #f0f0f0;
|
|
1052
|
+
--string-grid-panel-border: var(--string-dev-panel-border);
|
|
1053
|
+
--string-grid-panel-radius: var(--string-dev-panel-radius);
|
|
1054
|
+
--string-grid-panel-shadow: var(--string-dev-panel-shadow);
|
|
1055
|
+
--string-grid-panel-dropdown-shadow: 0 16px 24px rgba(0, 0, 0, 0.1);
|
|
1056
|
+
--string-grid-panel-backdrop: var(--string-dev-panel-backdrop);
|
|
1057
|
+
--string-grid-panel-font-family: var(--string-dev-panel-font-family);
|
|
1058
|
+
--string-grid-panel-font-size: var(--string-dev-panel-font-size);
|
|
1059
|
+
--string-grid-panel-text: var(--string-dev-panel-text);
|
|
1060
|
+
--string-grid-panel-muted: var(--string-dev-panel-muted);
|
|
1061
|
+
--string-grid-panel-subtle: var(--string-dev-panel-subtle);
|
|
1062
|
+
--string-grid-panel-faint: rgba(17, 17, 17, 0.38);
|
|
1063
|
+
--string-grid-panel-divider: var(--string-dev-panel-divider);
|
|
1064
|
+
--string-grid-panel-divider-strong: rgba(17, 17, 17, 0.1);
|
|
1065
|
+
--string-grid-header-font-size: var(--string-dev-header-font-size);
|
|
1066
|
+
--string-grid-header-font-weight: var(--string-dev-header-font-weight);
|
|
1067
|
+
--string-grid-header-letter-spacing: var(--string-dev-header-letter-spacing);
|
|
1068
|
+
--string-grid-header-padding: var(--string-dev-header-padding);
|
|
1069
|
+
--string-grid-header-margin-bottom: var(--string-dev-header-margin-bottom);
|
|
1070
|
+
--string-grid-row-gap: 8px;
|
|
1071
|
+
--string-grid-row-padding: 6px 8px;
|
|
1072
|
+
--string-grid-row-radius: 8px;
|
|
1073
|
+
--string-grid-row-hover-bg: rgba(221, 221, 221, 0.24);
|
|
1074
|
+
--string-grid-row-border: rgba(255, 255, 255, 0.9);
|
|
1075
|
+
--string-grid-settings-indent: 0px;
|
|
1076
|
+
--string-grid-accent: var(--string-dev-accent);
|
|
1077
|
+
--string-grid-accent-soft: var(--string-dev-accent-soft);
|
|
1078
|
+
--string-grid-accent-soft-hover: var(--string-dev-accent-soft-hover);
|
|
1079
|
+
--string-grid-accent-border: rgba(255, 79, 54, 0.32);
|
|
1080
|
+
--string-grid-accent-border-hover: rgba(255, 79, 54, 0.54);
|
|
1081
|
+
--string-grid-accent-focus: var(--string-dev-focus-color);
|
|
1082
|
+
--string-grid-accent-focus-soft: rgba(255, 79, 54, 0.18);
|
|
1083
|
+
--string-grid-accent-strong: var(--string-dev-accent);
|
|
1084
|
+
--string-grid-danger: #111111;
|
|
1085
|
+
--string-grid-font-mono: "JetBrains Mono", monospace;
|
|
1086
|
+
--string-grid-field-label-color: #111111;
|
|
1087
|
+
--string-grid-field-value-color: rgba(17, 17, 17, 0.72);
|
|
1088
|
+
--string-grid-field-value-color-active: #111111;
|
|
1089
|
+
--string-grid-field-bg: var(--string-dev-field-bg);
|
|
1090
|
+
--string-grid-field-bg-soft: rgba(221, 221, 221, 0.22);
|
|
1091
|
+
--string-grid-field-border: var(--string-dev-field-border);
|
|
1092
|
+
--string-grid-field-border-soft: var(--string-dev-field-border);
|
|
1093
|
+
--string-grid-field-radius: var(--string-dev-field-radius);
|
|
1094
|
+
--string-grid-field-radius-sm: 6px;
|
|
1095
|
+
--string-grid-toggle-off: rgba(17, 17, 17, 0.18);
|
|
1096
|
+
--string-grid-toggle-on: var(--string-grid-accent);
|
|
1097
|
+
--string-grid-toggle-knob: #ffffff;
|
|
1098
|
+
--string-grid-option-bg: #ffffff;
|
|
1099
|
+
--string-grid-option-text: var(--string-grid-panel-text);
|
|
1100
|
+
--string-grid-scrollbar-size: 4px;
|
|
1101
|
+
--string-grid-scrollbar-thumb: rgba(17, 17, 17, 0.16);
|
|
1102
|
+
--string-grid-scrollbar-thumb-hover: rgba(17, 17, 17, 0.24);
|
|
1103
|
+
--string-grid-number-columns: minmax(0, 75px) 28px;
|
|
1104
|
+
--string-grid-range-columns: minmax(0, 40px) auto 28px;
|
|
1105
|
+
--string-grid-range-no-unit-columns: minmax(0, 75px) 28px;
|
|
1106
|
+
--string-grid-unit-width: 32px;
|
|
1107
|
+
--string-grid-input-height: var(--string-dev-input-height);
|
|
1108
|
+
--string-grid-field-font-size: var(--string-dev-panel-font-size);
|
|
1109
|
+
--string-grid-field-font-size-sm: var(--string-dev-panel-font-size);
|
|
1110
|
+
--string-grid-universal-radius: var(--string-dev-field-radius);
|
|
1111
|
+
--string-grid-universal-border: transparent;
|
|
1112
|
+
--string-grid-universal-bg: transparent;
|
|
1113
|
+
--string-grid-universal-bg-hover: transparent;
|
|
1114
|
+
--string-grid-universal-divider: rgba(17, 17, 17, 0.15);
|
|
1115
|
+
--string-grid-universal-shadow: none;
|
|
1116
|
+
--string-grid-side-panel-gap: 8px;
|
|
1117
|
+
--string-grid-hud-inset: 12px;
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
[data-string-grid-overlay] {
|
|
1121
|
+
position: absolute;
|
|
1122
|
+
inset: 0;
|
|
1123
|
+
width: 100%;
|
|
1124
|
+
height: 100%;
|
|
1125
|
+
pointer-events: none;
|
|
1126
|
+
z-index: var(--string-grid-overlay-z-index);
|
|
1127
|
+
overflow: hidden;
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
[data-string-grid-trigger] {
|
|
1131
|
+
position: absolute;
|
|
1132
|
+
top: 0;
|
|
1133
|
+
left: 0;
|
|
1134
|
+
width: var(--string-grid-trigger-size, 28px);
|
|
1135
|
+
height: var(--string-grid-trigger-size, 28px);
|
|
1136
|
+
z-index: var(--string-grid-trigger-z-index, 10011);
|
|
1137
|
+
cursor: pointer;
|
|
1138
|
+
display: flex;
|
|
1139
|
+
align-items: center;
|
|
1140
|
+
justify-content: center;
|
|
1141
|
+
pointer-events: auto;
|
|
1142
|
+
transition: opacity 0.2s ease, background 0.2s ease;
|
|
1143
|
+
border: 1px solid rgba(255, 255, 255, 0.92);
|
|
1144
|
+
border-radius: 8px;
|
|
1145
|
+
background: rgba(224, 224, 224, 0.92);
|
|
1146
|
+
box-shadow: 0 12px 16px rgba(0, 0, 0, 0.05);
|
|
1147
|
+
padding: 5px;
|
|
1148
|
+
box-sizing: border-box;
|
|
1149
|
+
color: #111;
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
[data-string-grid-trigger][data-state="idle"] {
|
|
1153
|
+
opacity: var(--string-grid-trigger-opacity-idle, 0);
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
[data-string-grid-trigger][data-state="visible"] {
|
|
1157
|
+
opacity: var(--string-grid-trigger-opacity-visible, 1);
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
[data-string-grid-trigger][data-state="open"] {
|
|
1161
|
+
opacity: var(--string-grid-trigger-opacity-open, 1);
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
[data-string-grid-trigger] svg {
|
|
1165
|
+
width: 16px;
|
|
1166
|
+
height: 16px;
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
[data-string-grid-trigger]:hover {
|
|
1170
|
+
background: rgba(255, 255, 255, 0.98);
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
[data-string-grid-chrome] {
|
|
1174
|
+
position: absolute;
|
|
1175
|
+
top: 0;
|
|
1176
|
+
left: 0;
|
|
1177
|
+
width: var(--string-grid-trigger-size, 28px);
|
|
1178
|
+
height: var(--string-grid-trigger-size, 28px);
|
|
1179
|
+
pointer-events: auto;
|
|
1180
|
+
overflow: visible;
|
|
1181
|
+
z-index: var(--string-grid-panel-z-index);
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
[data-string-grid-hud],
|
|
1185
|
+
[data-string-grid-side-panel] {
|
|
1186
|
+
position: absolute;
|
|
1187
|
+
top: 0;
|
|
1188
|
+
width: var(--string-grid-panel-width);
|
|
1189
|
+
max-height: var(--string-grid-panel-max-height);
|
|
1190
|
+
overflow-y: auto;
|
|
1191
|
+
z-index: var(--string-grid-panel-z-index);
|
|
1192
|
+
opacity: 0;
|
|
1193
|
+
transform: translateY(4px);
|
|
1194
|
+
transition: opacity 0.2s ease, transform 0.2s ease;
|
|
1195
|
+
pointer-events: none;
|
|
1196
|
+
box-sizing: border-box;
|
|
1197
|
+
overflow-x: hidden;
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
[data-string-grid-hud] {
|
|
1201
|
+
right: calc(var(--string-grid-trigger-size) + var(--string-grid-trigger-gap));
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
[data-string-grid-side-panel] {
|
|
1205
|
+
right: calc(
|
|
1206
|
+
var(--string-grid-trigger-size) +
|
|
1207
|
+
var(--string-grid-trigger-gap) +
|
|
1208
|
+
var(--string-grid-panel-width) +
|
|
1209
|
+
var(--string-grid-side-panel-gap)
|
|
1210
|
+
);
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
[data-string-grid-trigger][data-open="true"] ~ [data-string-grid-hud] {
|
|
1214
|
+
opacity: 1;
|
|
1215
|
+
transform: translateY(0);
|
|
1216
|
+
pointer-events: auto;
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
[data-string-grid-side-panel][data-open="true"] {
|
|
1220
|
+
opacity: 1;
|
|
1221
|
+
transform: translateY(0);
|
|
1222
|
+
pointer-events: auto;
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
[data-string-grid-header-action] {
|
|
1226
|
+
width: 16px;
|
|
1227
|
+
height: 16px;
|
|
1228
|
+
display: inline-flex;
|
|
1229
|
+
align-items: center;
|
|
1230
|
+
justify-content: center;
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
[data-string-grid-header-action] {
|
|
1234
|
+
padding: 0;
|
|
1235
|
+
border: 0;
|
|
1236
|
+
background: transparent;
|
|
1237
|
+
color: var(--string-grid-panel-text);
|
|
1238
|
+
cursor: pointer;
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
[data-string-grid-header-action][data-passive="true"] {
|
|
1242
|
+
cursor: default;
|
|
1243
|
+
opacity: 0.9;
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
[data-string-grid-header-action] svg {
|
|
1247
|
+
width: 16px;
|
|
1248
|
+
height: 16px;
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
[data-string-grid-list] {
|
|
1252
|
+
display: flex;
|
|
1253
|
+
flex-direction: column;
|
|
1254
|
+
gap: 0;
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
[data-string-grid-empty-add] {
|
|
1258
|
+
justify-content: flex-start;
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
[data-string-grid-empty-add-icon] {
|
|
1262
|
+
width: 16px;
|
|
1263
|
+
height: 16px;
|
|
1264
|
+
display: inline-flex;
|
|
1265
|
+
align-items: center;
|
|
1266
|
+
justify-content: center;
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
[data-string-grid-empty-add-label] {
|
|
1270
|
+
font-size: 12px;
|
|
1271
|
+
font-weight: 500;
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
[data-string-grid-list-item] {
|
|
1275
|
+
min-height: 32px;
|
|
1276
|
+
display: grid;
|
|
1277
|
+
grid-template-columns: 16px 16px minmax(0, 1fr) auto 20px;
|
|
1278
|
+
align-items: center;
|
|
1279
|
+
column-gap: 8px;
|
|
1280
|
+
padding: 6px 8px;
|
|
1281
|
+
border: 1px solid var(--string-grid-field-border);
|
|
1282
|
+
border-radius: 8px;
|
|
1283
|
+
background: var(--string-grid-field-bg);
|
|
1284
|
+
cursor: pointer;
|
|
1285
|
+
transition: opacity 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
[data-string-grid-list-item] + [data-string-grid-list-item] {
|
|
1289
|
+
margin-top: 2px;
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
[data-string-grid-list-item][data-state="selected"] {
|
|
1293
|
+
background: rgba(221, 221, 221, 0.2);
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
[data-string-grid-list-item][data-state="disabled"] {
|
|
1297
|
+
color: rgba(17, 17, 17, 0.45);
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
[data-string-grid-list-item][data-dragging="true"] {
|
|
1301
|
+
opacity: 0.48;
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
[data-string-grid-list-item][data-drop="before"] {
|
|
1305
|
+
box-shadow: inset 0 2px 0 var(--string-grid-accent);
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
[data-string-grid-list-item][data-drop="after"] {
|
|
1309
|
+
box-shadow: inset 0 -2px 0 var(--string-grid-accent);
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
[data-string-grid-list-label] {
|
|
1313
|
+
font-size: 12px;
|
|
1314
|
+
font-weight: 500;
|
|
1315
|
+
color: inherit;
|
|
1316
|
+
min-width: 0;
|
|
1317
|
+
white-space: nowrap;
|
|
1318
|
+
overflow: hidden;
|
|
1319
|
+
text-overflow: ellipsis;
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
[data-string-grid-list-icon],
|
|
1323
|
+
[data-string-grid-add-grid-icon] {
|
|
1324
|
+
width: 16px;
|
|
1325
|
+
height: 16px;
|
|
1326
|
+
align-items: center;
|
|
1327
|
+
justify-content: center;
|
|
1328
|
+
display: inline-flex;
|
|
1329
|
+
color: currentColor;
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
[data-string-grid-list-delete] {
|
|
1333
|
+
width: 20px;
|
|
1334
|
+
height: 20px;
|
|
1335
|
+
padding: 0;
|
|
1336
|
+
border: 0;
|
|
1337
|
+
border-radius: 999px;
|
|
1338
|
+
background: #ffffff;
|
|
1339
|
+
color: var(--string-grid-panel-text);
|
|
1340
|
+
display: inline-flex;
|
|
1341
|
+
align-items: center;
|
|
1342
|
+
justify-content: center;
|
|
1343
|
+
cursor: pointer;
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
[data-string-grid-list-delete] svg {
|
|
1347
|
+
width: 16px;
|
|
1348
|
+
height: 16px;
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
[data-string-grid-list-toggle] {
|
|
1352
|
+
width: 22px;
|
|
1353
|
+
height: 14px;
|
|
1354
|
+
border-radius: 999px;
|
|
1355
|
+
background: var(--string-grid-toggle-off);
|
|
1356
|
+
display: inline-flex;
|
|
1357
|
+
align-items: center;
|
|
1358
|
+
position: relative;
|
|
1359
|
+
cursor: pointer;
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
[data-string-grid-toggle-input] {
|
|
1363
|
+
display: none;
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
[data-string-grid-toggle] {
|
|
1367
|
+
width: 22px;
|
|
1368
|
+
height: 14px;
|
|
1369
|
+
border-radius: 999px;
|
|
1370
|
+
background: var(--string-grid-toggle-off);
|
|
1371
|
+
display: inline-flex;
|
|
1372
|
+
align-items: center;
|
|
1373
|
+
position: relative;
|
|
1374
|
+
cursor: pointer;
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
[data-string-grid-toggle][data-checked="true"] {
|
|
1378
|
+
background: var(--string-grid-toggle-on);
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
[data-string-grid-toggle-knob] {
|
|
1382
|
+
width: 10px;
|
|
1383
|
+
height: 10px;
|
|
1384
|
+
border-radius: 50%;
|
|
1385
|
+
background: var(--string-grid-toggle-knob);
|
|
1386
|
+
position: absolute;
|
|
1387
|
+
top: 2px;
|
|
1388
|
+
left: 2px;
|
|
1389
|
+
transition: left 0.2s ease;
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
[data-string-grid-toggle][data-checked="true"] [data-string-grid-toggle-knob] {
|
|
1393
|
+
left: 10px;
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1396
|
+
[data-string-grid-list-toggle][data-checked="true"] {
|
|
1397
|
+
background: var(--string-grid-toggle-on);
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
[data-string-grid-list-toggle-knob] {
|
|
1401
|
+
width: 10px;
|
|
1402
|
+
height: 10px;
|
|
1403
|
+
border-radius: 50%;
|
|
1404
|
+
background: var(--string-grid-toggle-knob);
|
|
1405
|
+
position: absolute;
|
|
1406
|
+
top: 2px;
|
|
1407
|
+
left: 2px;
|
|
1408
|
+
transition: left 0.2s ease;
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
[data-string-grid-list-toggle][data-checked="true"] [data-string-grid-list-toggle-knob] {
|
|
1412
|
+
left: 10px;
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
[data-string-grid-drag-handle],
|
|
1416
|
+
[data-string-grid-header-action] {
|
|
1417
|
+
width: 16px;
|
|
1418
|
+
height: 16px;
|
|
1419
|
+
padding: 0;
|
|
1420
|
+
border: 0;
|
|
1421
|
+
background: transparent;
|
|
1422
|
+
color: var(--string-grid-panel-subtle);
|
|
1423
|
+
cursor: pointer;
|
|
1424
|
+
display: inline-flex;
|
|
1425
|
+
align-items: center;
|
|
1426
|
+
justify-content: center;
|
|
1427
|
+
transition: opacity 0.15s ease;
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
[data-string-grid-drag-handle] {
|
|
1431
|
+
color: rgba(17, 17, 17, 0.16);
|
|
1432
|
+
cursor: grab;
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1435
|
+
[data-string-grid-drag-handle]:active {
|
|
1436
|
+
cursor: grabbing;
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
[data-string-grid-drag-handle] svg,
|
|
1440
|
+
[data-string-grid-list-delete] svg,
|
|
1441
|
+
[data-string-grid-header-action] svg {
|
|
1442
|
+
width: 16px;
|
|
1443
|
+
height: 16px;
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
[data-string-grid-add-grid-list] {
|
|
1447
|
+
display: grid;
|
|
1448
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
1449
|
+
gap: 0;
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
[data-string-grid-add-grid-item] {
|
|
1453
|
+
justify-content: flex-start;
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
[data-string-grid-add-grid-item]:nth-child(n + 3) {
|
|
1457
|
+
margin-top: 2px;
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
[data-string-grid-add-grid-label] {
|
|
1461
|
+
font-size: 12px;
|
|
1462
|
+
font-weight: 500;
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
[data-string-grid-detail-content] {
|
|
1466
|
+
display: block;
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
[data-string-grid-settings-container] {
|
|
1470
|
+
display: flex;
|
|
1471
|
+
flex-direction: column;
|
|
1472
|
+
gap: 2px;
|
|
1473
|
+
padding: 0;
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
[data-string-grid-field-row] {
|
|
1477
|
+
display: grid;
|
|
1478
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
1479
|
+
align-items: center;
|
|
1480
|
+
gap: 0;
|
|
1481
|
+
min-height: 32px;
|
|
1482
|
+
padding: 0 0px 0 8px;
|
|
1483
|
+
min-width: 0;
|
|
1484
|
+
border: 1px solid var(--string-grid-field-border);
|
|
1485
|
+
border-radius: 8px;
|
|
1486
|
+
background: var(--string-grid-field-bg);
|
|
1487
|
+
overflow: hidden;
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
[data-string-grid-field-label] {
|
|
1491
|
+
font-size: 12px;
|
|
1492
|
+
color: var(--string-grid-field-label-color);
|
|
1493
|
+
font-family: var(--string-grid-panel-font-family);
|
|
1494
|
+
user-select: none;
|
|
1495
|
+
white-space: nowrap;
|
|
1496
|
+
min-width: 0;
|
|
1497
|
+
display: flex;
|
|
1498
|
+
align-items: center;
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
[data-string-grid-field-input],
|
|
1502
|
+
[data-string-grid-field-select] {
|
|
1503
|
+
min-height: var(--string-grid-input-height);
|
|
1504
|
+
font-size: var(--string-grid-field-font-size);
|
|
1505
|
+
font-family: var(--string-grid-panel-font-family);
|
|
1506
|
+
background: var(--string-grid-field-bg);
|
|
1507
|
+
border: 1px solid var(--string-grid-field-border);
|
|
1508
|
+
border-radius: var(--string-grid-field-radius);
|
|
1509
|
+
color: var(--string-grid-panel-text);
|
|
1510
|
+
outline: none;
|
|
1511
|
+
box-sizing: border-box;
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1514
|
+
[data-string-grid-field-input] {
|
|
1515
|
+
width: 100%;
|
|
1516
|
+
font-size: 12px;
|
|
1517
|
+
font-family: var(--string-grid-panel-font-family);
|
|
1518
|
+
font-weight: 500;
|
|
1519
|
+
color: var(--string-grid-field-value-color-active);
|
|
1520
|
+
text-align: center;
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
[data-string-grid-field-select] {
|
|
1524
|
+
cursor: pointer;
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
[data-string-grid-field-input]:focus,
|
|
1528
|
+
[data-string-grid-field-select]:focus,
|
|
1529
|
+
[data-string-grid-field-unit]:focus {
|
|
1530
|
+
border-color: var(--string-grid-accent-focus);
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
[data-string-grid-field-select] option,
|
|
1534
|
+
[data-string-grid-field-unit] option {
|
|
1535
|
+
background: var(--string-grid-option-bg);
|
|
1536
|
+
color: var(--string-grid-option-text);
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
[data-string-grid-field-range-right] {
|
|
1540
|
+
display: flex;
|
|
1541
|
+
align-items: center;
|
|
1542
|
+
gap: 0;
|
|
1543
|
+
min-width: 0;
|
|
1544
|
+
justify-content: flex-end;
|
|
1545
|
+
min-height: 100%;
|
|
1546
|
+
border-left: 1px solid var(--string-grid-universal-divider);
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
[data-string-grid-number-input],
|
|
1550
|
+
[data-string-grid-range-input] {
|
|
1551
|
+
display: grid;
|
|
1552
|
+
align-items: center;
|
|
1553
|
+
width: auto;
|
|
1554
|
+
max-width: 100%;
|
|
1555
|
+
min-width: 0;
|
|
1556
|
+
min-height: 100%;
|
|
1557
|
+
border: 0;
|
|
1558
|
+
border-radius: 0;
|
|
1559
|
+
background: var(--string-grid-universal-bg);
|
|
1560
|
+
box-shadow: var(--string-grid-universal-shadow);
|
|
1561
|
+
overflow: hidden;
|
|
1562
|
+
box-sizing: border-box;
|
|
1563
|
+
justify-self: end;
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
[data-string-grid-number-input] {
|
|
1567
|
+
grid-template-columns: var(--string-grid-number-columns);
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
[data-string-grid-range-input] {
|
|
1571
|
+
grid-template-columns: var(--string-grid-range-columns);
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
[data-string-grid-range-input][data-has-unit="false"] {
|
|
1575
|
+
grid-template-columns: var(--string-grid-range-no-unit-columns);
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
[data-string-grid-field-row] > [data-string-grid-number-input],
|
|
1579
|
+
[data-string-grid-field-row] > [data-string-grid-range-input],
|
|
1580
|
+
[data-string-grid-field-row] > [data-string-grid-select-shell],
|
|
1581
|
+
[data-string-grid-field-row] > [data-string-grid-color-shell] {
|
|
1582
|
+
min-height: 100%;
|
|
1583
|
+
border-left: 1px solid var(--string-grid-universal-divider);
|
|
1584
|
+
}
|
|
1585
|
+
|
|
1586
|
+
[data-string-grid-input-value-wrap],
|
|
1587
|
+
[data-string-grid-input-unit-wrap] {
|
|
1588
|
+
min-width: 0;
|
|
1589
|
+
min-height: 100%;
|
|
1590
|
+
display: flex;
|
|
1591
|
+
align-items: center;
|
|
1592
|
+
justify-content: center;
|
|
1593
|
+
background: transparent;
|
|
1594
|
+
}
|
|
1595
|
+
|
|
1596
|
+
[data-string-grid-input-value-wrap] {
|
|
1597
|
+
padding: 0 0px;
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1600
|
+
[data-string-grid-input-unit-wrap] {
|
|
1601
|
+
border-left: 1px solid var(--string-grid-universal-divider);
|
|
1602
|
+
min-width: var(--string-grid-unit-width);
|
|
1603
|
+
padding: 0 6px;
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
[data-string-grid-stepper-stack] {
|
|
1607
|
+
display: grid;
|
|
1608
|
+
grid-template-rows: 1fr 1fr;
|
|
1609
|
+
min-height: 100%;
|
|
1610
|
+
border-left: 1px solid var(--string-grid-universal-divider);
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
[data-string-grid-number-input] [data-string-grid-field-input],
|
|
1614
|
+
[data-string-grid-range-input] [data-string-grid-field-value],
|
|
1615
|
+
[data-string-grid-range-input] [data-string-grid-field-unit] {
|
|
1616
|
+
background: transparent;
|
|
1617
|
+
border: 0;
|
|
1618
|
+
border-radius: 0;
|
|
1619
|
+
box-shadow: none;
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
[data-string-grid-field-value] {
|
|
1623
|
+
width: 100%;
|
|
1624
|
+
min-height: calc(var(--string-grid-input-height) - 4px);
|
|
1625
|
+
padding: 0;
|
|
1626
|
+
font-size: 12px;
|
|
1627
|
+
font-family: var(--string-grid-panel-font-family);
|
|
1628
|
+
font-weight: 500;
|
|
1629
|
+
color: var(--string-grid-field-value-color-active);
|
|
1630
|
+
background: transparent;
|
|
1631
|
+
border: 0;
|
|
1632
|
+
border-radius: 0;
|
|
1633
|
+
text-align: left;
|
|
1634
|
+
outline: none;
|
|
1635
|
+
transition: border-color 0.15s ease, color 0.15s ease;
|
|
1636
|
+
box-sizing: border-box;
|
|
1637
|
+
text-align: center;
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
[data-string-grid-stepper-btn] {
|
|
1641
|
+
width: 100%;
|
|
1642
|
+
min-width: 0;
|
|
1643
|
+
min-height: 0;
|
|
1644
|
+
padding: 0;
|
|
1645
|
+
border: 0;
|
|
1646
|
+
border-radius: 0;
|
|
1647
|
+
background: transparent;
|
|
1648
|
+
color: var(--string-grid-panel-text);
|
|
1649
|
+
font-size: 12px;
|
|
1650
|
+
line-height: 1;
|
|
1651
|
+
cursor: pointer;
|
|
1652
|
+
transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
|
|
1653
|
+
display: flex;
|
|
1654
|
+
align-items: center;
|
|
1655
|
+
justify-content: center;
|
|
1656
|
+
transition: background 0.15s ease, color 0.15s ease;
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1659
|
+
[data-string-grid-stepper-btn][data-direction="up"] {
|
|
1660
|
+
border-bottom: 1px solid var(--string-grid-universal-divider);
|
|
1661
|
+
}
|
|
1662
|
+
|
|
1663
|
+
[data-string-grid-stepper-btn]:hover,
|
|
1664
|
+
[data-string-grid-stepper-btn]:focus-visible {
|
|
1665
|
+
background: rgba(255, 255, 255, 0.3);
|
|
1666
|
+
color: var(--string-grid-panel-text);
|
|
1667
|
+
outline: none;
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1670
|
+
[data-string-grid-stepper-icon] {
|
|
1671
|
+
display: flex;
|
|
1672
|
+
align-items: center;
|
|
1673
|
+
justify-content: center;
|
|
1674
|
+
width: 14px;
|
|
1675
|
+
height: 14px;
|
|
1676
|
+
color: rgba(17, 17, 17, 0.72);
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1679
|
+
[data-string-grid-stepper-icon] svg {
|
|
1680
|
+
width: 100%;
|
|
1681
|
+
height: 100%;
|
|
1682
|
+
}
|
|
1683
|
+
|
|
1684
|
+
[data-string-grid-field-value]:focus {
|
|
1685
|
+
color: var(--string-grid-field-value-color-active);
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1688
|
+
[data-string-grid-field-unit] {
|
|
1689
|
+
width: 100%;
|
|
1690
|
+
min-height: calc(var(--string-grid-input-height) - 4px);
|
|
1691
|
+
padding: 0;
|
|
1692
|
+
font-size: 12px;
|
|
1693
|
+
font-family: var(--string-grid-panel-font-family);
|
|
1694
|
+
font-weight: 500;
|
|
1695
|
+
color: var(--string-grid-panel-text);
|
|
1696
|
+
background: transparent;
|
|
1697
|
+
border: 0;
|
|
1698
|
+
border-radius: 0;
|
|
1699
|
+
outline: none;
|
|
1700
|
+
cursor: pointer;
|
|
1701
|
+
appearance: none;
|
|
1702
|
+
-webkit-appearance: none;
|
|
1703
|
+
text-align: center;
|
|
1704
|
+
text-align-last: center;
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
[data-string-grid-select-shell],
|
|
1708
|
+
[data-string-grid-color-shell] {
|
|
1709
|
+
display: grid;
|
|
1710
|
+
align-items: center;
|
|
1711
|
+
width: 104px;
|
|
1712
|
+
max-width: 100%;
|
|
1713
|
+
min-height: 100%;
|
|
1714
|
+
border: 0;
|
|
1715
|
+
border-radius: 0;
|
|
1716
|
+
background: var(--string-grid-universal-bg);
|
|
1717
|
+
box-shadow: var(--string-grid-universal-shadow);
|
|
1718
|
+
overflow: hidden;
|
|
1719
|
+
box-sizing: border-box;
|
|
1720
|
+
justify-self: end;
|
|
1721
|
+
position: relative;
|
|
1722
|
+
}
|
|
1723
|
+
|
|
1724
|
+
[data-string-grid-select-shell] {
|
|
1725
|
+
grid-template-columns: minmax(0, 1fr) 32px;
|
|
1726
|
+
}
|
|
1727
|
+
|
|
1728
|
+
[data-string-grid-color-shell] {
|
|
1729
|
+
grid-template-columns: 38px minmax(0, auto);
|
|
1730
|
+
}
|
|
1731
|
+
|
|
1732
|
+
[data-string-grid-select-value-wrap] {
|
|
1733
|
+
min-width: 0;
|
|
1734
|
+
padding: 0 8px;
|
|
1735
|
+
pointer-events: none;
|
|
1736
|
+
}
|
|
1737
|
+
|
|
1738
|
+
[data-string-grid-select-display] {
|
|
1739
|
+
display: block;
|
|
1740
|
+
width: 100%;
|
|
1741
|
+
font-size: 12px;
|
|
1742
|
+
font-family: var(--string-grid-panel-font-family);
|
|
1743
|
+
color: var(--string-grid-field-value-color-active);
|
|
1744
|
+
line-height: calc(var(--string-grid-input-height) - 4px);
|
|
1745
|
+
white-space: nowrap;
|
|
1746
|
+
overflow: hidden;
|
|
1747
|
+
text-overflow: ellipsis;
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1750
|
+
[data-string-grid-select-shell] [data-string-grid-field-select] {
|
|
1751
|
+
position: absolute;
|
|
1752
|
+
inset: 0;
|
|
1753
|
+
width: 100%;
|
|
1754
|
+
height: 100%;
|
|
1755
|
+
padding: 0;
|
|
1756
|
+
opacity: 0;
|
|
1757
|
+
border: 0;
|
|
1758
|
+
outline: none;
|
|
1759
|
+
appearance: none;
|
|
1760
|
+
-webkit-appearance: none;
|
|
1761
|
+
cursor: pointer;
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1764
|
+
[data-string-grid-select-indicator] {
|
|
1765
|
+
display: flex;
|
|
1766
|
+
align-items: center;
|
|
1767
|
+
justify-content: center;
|
|
1768
|
+
width: 28px;
|
|
1769
|
+
min-height: 100%;
|
|
1770
|
+
border-left: 1px solid var(--string-grid-universal-divider);
|
|
1771
|
+
color: rgba(17, 17, 17, 0.72);
|
|
1772
|
+
pointer-events: none;
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
[data-string-grid-select-indicator] svg {
|
|
1776
|
+
width: 14px;
|
|
1777
|
+
height: 14px;
|
|
1778
|
+
}
|
|
1779
|
+
|
|
1780
|
+
[data-string-grid-color-shell] {
|
|
1781
|
+
column-gap: 0;
|
|
1782
|
+
}
|
|
1783
|
+
|
|
1784
|
+
[data-string-grid-color-swatch-wrap] {
|
|
1785
|
+
display: flex;
|
|
1786
|
+
align-items: center;
|
|
1787
|
+
justify-content: center;
|
|
1788
|
+
width: 32px;
|
|
1789
|
+
min-height: 100%;
|
|
1790
|
+
border-right: 1px solid var(--string-grid-universal-divider);
|
|
1791
|
+
pointer-events: none;
|
|
1792
|
+
}
|
|
1793
|
+
|
|
1794
|
+
[data-string-grid-color-input] {
|
|
1795
|
+
position: absolute;
|
|
1796
|
+
inset: 0;
|
|
1797
|
+
width: 100%;
|
|
1798
|
+
height: 100%;
|
|
1799
|
+
opacity: 0;
|
|
1800
|
+
padding: 0;
|
|
1801
|
+
cursor: pointer;
|
|
1802
|
+
border: 0;
|
|
1803
|
+
}
|
|
1804
|
+
|
|
1805
|
+
[data-string-grid-color-swatch] {
|
|
1806
|
+
width: 16px;
|
|
1807
|
+
height: 16px;
|
|
1808
|
+
border-radius: 999px;
|
|
1809
|
+
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.96);
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1812
|
+
[data-string-grid-color-value] {
|
|
1813
|
+
min-width: 65px;
|
|
1814
|
+
padding: 0 0 0 8px;
|
|
1815
|
+
font-size: 12px;
|
|
1816
|
+
font-family: var(--string-grid-panel-font-family);
|
|
1817
|
+
font-weight: 500;
|
|
1818
|
+
color: var(--string-grid-panel-text);
|
|
1819
|
+
text-align: left;
|
|
1820
|
+
pointer-events: none;
|
|
1821
|
+
}
|
|
1822
|
+
|
|
1823
|
+
[data-string-grid-divider] {
|
|
1824
|
+
height: 4px;
|
|
1825
|
+
}
|
|
1826
|
+
|
|
1827
|
+
[data-string-grid-divider-label] {
|
|
1828
|
+
display: none;
|
|
1829
|
+
font-family: var(--string-grid-panel-font-family);
|
|
1830
|
+
color: var(--string-grid-panel-subtle);
|
|
1831
|
+
text-transform: uppercase;
|
|
1832
|
+
letter-spacing: 0.5px;
|
|
1833
|
+
}
|
|
1834
|
+
|
|
1835
|
+
[data-string-grid-hud]::-webkit-scrollbar {
|
|
1836
|
+
width: var(--string-grid-scrollbar-size);
|
|
1837
|
+
}
|
|
1838
|
+
[data-string-grid-hud]::-webkit-scrollbar-track {
|
|
1839
|
+
background: transparent;
|
|
1840
|
+
}
|
|
1841
|
+
[data-string-grid-hud]::-webkit-scrollbar-thumb {
|
|
1842
|
+
background: var(--string-grid-scrollbar-thumb);
|
|
1843
|
+
border-radius: 2px;
|
|
1844
|
+
}
|
|
1845
|
+
[data-string-grid-hud]::-webkit-scrollbar-thumb:hover {
|
|
1846
|
+
background: var(--string-grid-scrollbar-thumb-hover);
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
[data-string-grid-layout-selector] {
|
|
1850
|
+
display: flex;
|
|
1851
|
+
align-items: center;
|
|
1852
|
+
justify-content: center;
|
|
1853
|
+
gap: 3px;
|
|
1854
|
+
min-width: 0;
|
|
1855
|
+
}
|
|
1856
|
+
|
|
1857
|
+
[data-string-grid-layout-name] {
|
|
1858
|
+
font-size: var(--string-grid-header-font-size);
|
|
1859
|
+
font-weight: var(--string-grid-header-font-weight);
|
|
1860
|
+
color: var(--string-grid-panel-text);
|
|
1861
|
+
letter-spacing: var(--string-grid-header-letter-spacing);
|
|
1862
|
+
line-height: 1.2;
|
|
1863
|
+
max-width: 110px;
|
|
1864
|
+
overflow: hidden;
|
|
1865
|
+
text-overflow: ellipsis;
|
|
1866
|
+
white-space: nowrap;
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1869
|
+
[data-string-grid-layout-arrow] {
|
|
1870
|
+
width: 12px;
|
|
1871
|
+
height: 12px;
|
|
1872
|
+
padding: 0;
|
|
1873
|
+
border: 0;
|
|
1874
|
+
background: transparent;
|
|
1875
|
+
color: var(--string-grid-panel-muted);
|
|
1876
|
+
cursor: pointer;
|
|
1877
|
+
display: inline-flex;
|
|
1878
|
+
align-items: center;
|
|
1879
|
+
justify-content: center;
|
|
1880
|
+
flex-shrink: 0;
|
|
1881
|
+
transition: color 0.15s ease;
|
|
1882
|
+
}
|
|
1883
|
+
|
|
1884
|
+
[data-string-grid-layout-arrow] svg {
|
|
1885
|
+
width: 12px;
|
|
1886
|
+
height: 12px;
|
|
1887
|
+
transition: transform 0.2s ease;
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1890
|
+
[data-string-grid-layout-arrow][data-open="true"] svg {
|
|
1891
|
+
transform: rotate(180deg);
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1894
|
+
[data-string-grid-layout-dropdown] {
|
|
1895
|
+
display: none;
|
|
1896
|
+
flex-direction: column;
|
|
1897
|
+
gap: 2px;
|
|
1898
|
+
padding: 0 4px 6px;
|
|
1899
|
+
border-bottom: 1px solid var(--string-grid-panel-divider);
|
|
1900
|
+
margin-bottom: 4px;
|
|
1901
|
+
}
|
|
1902
|
+
|
|
1903
|
+
[data-string-grid-layout-dropdown][data-open="true"] {
|
|
1904
|
+
display: flex;
|
|
1905
|
+
}
|
|
1906
|
+
|
|
1907
|
+
[data-string-grid-layout-list] {
|
|
1908
|
+
display: flex;
|
|
1909
|
+
flex-direction: column;
|
|
1910
|
+
gap: 1px;
|
|
1911
|
+
margin-bottom: 4px;
|
|
1912
|
+
}
|
|
1913
|
+
|
|
1914
|
+
[data-string-grid-layout-item] {
|
|
1915
|
+
min-height: 28px;
|
|
1916
|
+
display: grid;
|
|
1917
|
+
grid-template-columns: 1fr 20px;
|
|
1918
|
+
align-items: center;
|
|
1919
|
+
gap: 4px;
|
|
1920
|
+
padding: 0 4px;
|
|
1921
|
+
border-radius: 6px;
|
|
1922
|
+
background: transparent;
|
|
1923
|
+
cursor: default;
|
|
1924
|
+
}
|
|
1925
|
+
|
|
1926
|
+
[data-string-grid-layout-item][data-active="false"] {
|
|
1927
|
+
cursor: pointer;
|
|
1928
|
+
}
|
|
1929
|
+
|
|
1930
|
+
[data-string-grid-layout-item]:hover {
|
|
1931
|
+
background: var(--string-grid-row-hover-bg);
|
|
1932
|
+
}
|
|
1933
|
+
|
|
1934
|
+
[data-string-grid-layout-item][data-active="true"] {
|
|
1935
|
+
background: var(--string-grid-accent-soft);
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1938
|
+
[data-string-grid-layout-item-name] {
|
|
1939
|
+
font-size: 12px;
|
|
1940
|
+
font-weight: 500;
|
|
1941
|
+
color: var(--string-grid-panel-text);
|
|
1942
|
+
white-space: nowrap;
|
|
1943
|
+
overflow: hidden;
|
|
1944
|
+
text-overflow: ellipsis;
|
|
1945
|
+
}
|
|
1946
|
+
|
|
1947
|
+
[data-string-grid-layout-item-name-input] {
|
|
1948
|
+
width: 100%;
|
|
1949
|
+
font-size: 12px;
|
|
1950
|
+
font-weight: 500;
|
|
1951
|
+
font-family: var(--string-grid-panel-font-family);
|
|
1952
|
+
color: var(--string-grid-panel-text);
|
|
1953
|
+
background: transparent;
|
|
1954
|
+
border: 0;
|
|
1955
|
+
border-bottom: 1px solid var(--string-grid-accent);
|
|
1956
|
+
outline: none;
|
|
1957
|
+
padding: 0;
|
|
1958
|
+
}
|
|
1959
|
+
|
|
1960
|
+
[data-string-grid-layout-item-rename] {
|
|
1961
|
+
width: 20px;
|
|
1962
|
+
height: 20px;
|
|
1963
|
+
padding: 0;
|
|
1964
|
+
border: 0;
|
|
1965
|
+
background: transparent;
|
|
1966
|
+
color: var(--string-grid-panel-muted);
|
|
1967
|
+
cursor: pointer;
|
|
1968
|
+
display: inline-flex;
|
|
1969
|
+
align-items: center;
|
|
1970
|
+
justify-content: center;
|
|
1971
|
+
opacity: 0;
|
|
1972
|
+
flex-shrink: 0;
|
|
1973
|
+
transition: opacity 0.15s ease;
|
|
1974
|
+
}
|
|
1975
|
+
|
|
1976
|
+
[data-string-grid-layout-item]:hover [data-string-grid-layout-item-rename] {
|
|
1977
|
+
opacity: 1;
|
|
1978
|
+
}
|
|
1979
|
+
|
|
1980
|
+
[data-string-grid-layout-item-rename] svg {
|
|
1981
|
+
width: 10px;
|
|
1982
|
+
height: 10px;
|
|
1983
|
+
}
|
|
1984
|
+
|
|
1985
|
+
[data-string-grid-layout-add] {
|
|
1986
|
+
justify-content: flex-start;
|
|
1987
|
+
margin-top: 1px;
|
|
1988
|
+
}
|
|
1989
|
+
|
|
1990
|
+
[data-string-grid-layout-add-icon] {
|
|
1991
|
+
width: 10px;
|
|
1992
|
+
height: 10px;
|
|
1993
|
+
display: inline-flex;
|
|
1994
|
+
align-items: center;
|
|
1995
|
+
justify-content: center;
|
|
1996
|
+
flex-shrink: 0;
|
|
1997
|
+
}
|
|
1998
|
+
|
|
1999
|
+
[data-string-grid-layout-add-icon] svg {
|
|
2000
|
+
width: 16px;
|
|
2001
|
+
height: 16px;
|
|
2002
|
+
}
|
|
2003
|
+
|
|
2004
|
+
[data-string-grid-layout-name-input] {
|
|
2005
|
+
width: 100%;
|
|
2006
|
+
max-width: 110px;
|
|
2007
|
+
background: transparent;
|
|
2008
|
+
border-top: 0;
|
|
2009
|
+
border-left: 0;
|
|
2010
|
+
border-right: 0;
|
|
2011
|
+
border-bottom: 1px solid var(--string-grid-accent);
|
|
2012
|
+
padding: 0;
|
|
2013
|
+
min-height: auto;
|
|
2014
|
+
border-radius: 0;
|
|
2015
|
+
box-shadow: none;
|
|
2016
|
+
text-align: center;
|
|
2017
|
+
line-height: 1.2;
|
|
2018
|
+
}
|
|
2019
|
+
|
|
2020
|
+
[data-string-grid-detail-title-input] {
|
|
2021
|
+
width: 100%;
|
|
2022
|
+
max-width: 120px;
|
|
2023
|
+
background: transparent;
|
|
2024
|
+
border-top: 0;
|
|
2025
|
+
border-left: 0;
|
|
2026
|
+
border-right: 0;
|
|
2027
|
+
border-bottom: 1px solid var(--string-grid-accent);
|
|
2028
|
+
padding: 0;
|
|
2029
|
+
min-height: auto;
|
|
2030
|
+
border-radius: 0;
|
|
2031
|
+
box-shadow: none;
|
|
2032
|
+
text-align: center;
|
|
2033
|
+
line-height: 1.2;
|
|
2034
|
+
}
|
|
2035
|
+
|
|
2036
|
+
[data-string-grid-layout-name] {
|
|
2037
|
+
cursor: pointer;
|
|
2038
|
+
}
|
|
2039
|
+
|
|
2040
|
+
[data-string-grid-detail-title] {
|
|
2041
|
+
cursor: pointer;
|
|
2042
|
+
}
|
|
2043
|
+
|
|
2044
|
+
[data-string-grid-layout-io-row] {
|
|
2045
|
+
display: grid;
|
|
2046
|
+
grid-template-columns: 1fr 1fr;
|
|
2047
|
+
gap: 4px;
|
|
2048
|
+
margin-top: 4px;
|
|
2049
|
+
padding-top: 4px;
|
|
2050
|
+
border-top: 1px solid var(--string-grid-panel-divider);
|
|
2051
|
+
}
|
|
2052
|
+
|
|
2053
|
+
[data-string-grid-io-btn] {
|
|
2054
|
+
width: 100%;
|
|
2055
|
+
justify-content: flex-start;
|
|
2056
|
+
}
|
|
2057
|
+
|
|
2058
|
+
[data-string-grid-layout-chip-row] {
|
|
2059
|
+
display: flex;
|
|
2060
|
+
align-items: center;
|
|
2061
|
+
justify-content: center;
|
|
2062
|
+
gap: 12px;
|
|
2063
|
+
padding: 2px 8px 10px;
|
|
2064
|
+
}
|
|
2065
|
+
|
|
2066
|
+
[data-string-grid-layout-chip] {
|
|
2067
|
+
min-width: 28px;
|
|
2068
|
+
min-height: 28px;
|
|
2069
|
+
padding: 0 10px;
|
|
2070
|
+
border: 0;
|
|
2071
|
+
border-radius: 999px;
|
|
2072
|
+
background: rgba(17, 17, 17, 0.06);
|
|
2073
|
+
color: rgba(17, 17, 17, 0.72);
|
|
2074
|
+
display: inline-flex;
|
|
2075
|
+
align-items: center;
|
|
2076
|
+
justify-content: center;
|
|
2077
|
+
font-size: 12px;
|
|
2078
|
+
font-weight: 700;
|
|
2079
|
+
letter-spacing: 0.08em;
|
|
2080
|
+
cursor: pointer;
|
|
2081
|
+
font-family: var(--string-grid-panel-font-family);
|
|
2082
|
+
}
|
|
2083
|
+
|
|
2084
|
+
[data-string-grid-layout-chip-action="settings"] {
|
|
2085
|
+
color: rgba(17, 17, 17, 0.86);
|
|
2086
|
+
}
|
|
2087
|
+
|
|
2088
|
+
[data-string-grid-layout-chip-action="settings"][data-open="true"] {
|
|
2089
|
+
color: var(--string-grid-accent);
|
|
2090
|
+
}
|
|
2091
|
+
|
|
2092
|
+
[data-string-grid-layout-chip][data-selected="true"] {
|
|
2093
|
+
color: var(--string-grid-accent);
|
|
2094
|
+
}
|
|
2095
|
+
|
|
2096
|
+
[data-string-grid-layout-settings] {
|
|
2097
|
+
padding: 0 0 8px;
|
|
2098
|
+
}
|
|
2099
|
+
|
|
2100
|
+
[data-string-grid-layout-settings-list] {
|
|
2101
|
+
display: flex;
|
|
2102
|
+
flex-direction: column;
|
|
2103
|
+
gap: 10px;
|
|
2104
|
+
}
|
|
2105
|
+
|
|
2106
|
+
[data-string-grid-layout-range] {
|
|
2107
|
+
--string-grid-layout-range-first: 28%;
|
|
2108
|
+
--string-grid-layout-range-second: 64%;
|
|
2109
|
+
--string-grid-layout-range-medium: 28%;
|
|
2110
|
+
--string-grid-layout-range-large: 64%;
|
|
2111
|
+
--string-grid-layout-range-handle-gap: 24px;
|
|
2112
|
+
display: grid;
|
|
2113
|
+
gap: 8px;
|
|
2114
|
+
padding: 0px 12px 12px;
|
|
2115
|
+
}
|
|
2116
|
+
|
|
2117
|
+
[data-string-grid-layout-range-labels] {
|
|
2118
|
+
position: relative;
|
|
2119
|
+
height: 12px;
|
|
2120
|
+
}
|
|
2121
|
+
|
|
2122
|
+
[data-string-grid-layout-range-value] {
|
|
2123
|
+
position: absolute;
|
|
2124
|
+
top: 0;
|
|
2125
|
+
min-width: 44px;
|
|
2126
|
+
padding: 0;
|
|
2127
|
+
border: 0;
|
|
2128
|
+
background: transparent;
|
|
2129
|
+
color: rgba(17, 17, 17, 0.6);
|
|
2130
|
+
font-family: var(--string-grid-panel-font-family);
|
|
2131
|
+
font-size: 11px;
|
|
2132
|
+
font-weight: 600;
|
|
2133
|
+
line-height: 1;
|
|
2134
|
+
cursor: pointer;
|
|
2135
|
+
transform: translateX(-50%);
|
|
2136
|
+
}
|
|
2137
|
+
|
|
2138
|
+
[data-string-grid-layout-range-value][data-handle="m"] {
|
|
2139
|
+
left: var(--string-grid-layout-range-first);
|
|
2140
|
+
}
|
|
2141
|
+
|
|
2142
|
+
[data-string-grid-layout-range-value][data-handle="l"] {
|
|
2143
|
+
left: var(--string-grid-layout-range-second);
|
|
2144
|
+
}
|
|
2145
|
+
|
|
2146
|
+
[data-string-grid-layout-range-track] {
|
|
2147
|
+
position: relative;
|
|
2148
|
+
min-height: 42px;
|
|
2149
|
+
border-radius: 12px;
|
|
2150
|
+
background: #DDDDDD;
|
|
2151
|
+
overflow: visible;
|
|
2152
|
+
}
|
|
2153
|
+
|
|
2154
|
+
[data-string-grid-layout-range-track][data-state="active"] {
|
|
2155
|
+
|
|
2156
|
+
}
|
|
2157
|
+
|
|
2158
|
+
[data-string-grid-layout-range-track][data-state="dragging"] {
|
|
2159
|
+
|
|
2160
|
+
}
|
|
2161
|
+
|
|
2162
|
+
[data-string-grid-layout-range-segment] {
|
|
2163
|
+
position: absolute;
|
|
2164
|
+
top: 0;
|
|
2165
|
+
bottom: 0;
|
|
2166
|
+
padding: 0;
|
|
2167
|
+
border: 0;
|
|
2168
|
+
background: transparent;
|
|
2169
|
+
color: #000000;
|
|
2170
|
+
display: inline-flex;
|
|
2171
|
+
align-items: center;
|
|
2172
|
+
justify-content: center;
|
|
2173
|
+
font-family: var(--string-grid-panel-font-family);
|
|
2174
|
+
font-size: 12px;
|
|
2175
|
+
font-weight: 500;
|
|
2176
|
+
cursor: pointer;
|
|
2177
|
+
}
|
|
2178
|
+
[data-string-grid-layout-range-segment]:hover {
|
|
2179
|
+
background: #F1F1F1;
|
|
2180
|
+
}
|
|
2181
|
+
|
|
2182
|
+
[data-string-grid-layout-range-segment][data-mode="S"] {
|
|
2183
|
+
left: 0;
|
|
2184
|
+
width: var(--string-grid-layout-range-medium);
|
|
2185
|
+
border-radius: 12px 0 0 12px;
|
|
2186
|
+
}
|
|
2187
|
+
|
|
2188
|
+
[data-string-grid-layout-range-segment][data-mode="M"] {
|
|
2189
|
+
left: var(--string-grid-layout-range-medium);
|
|
2190
|
+
width: calc(var(--string-grid-layout-range-large) - var(--string-grid-layout-range-medium));
|
|
2191
|
+
}
|
|
2192
|
+
|
|
2193
|
+
[data-string-grid-layout-range-segment][data-mode="L"] {
|
|
2194
|
+
left: var(--string-grid-layout-range-large);
|
|
2195
|
+
width: calc(100% - var(--string-grid-layout-range-large));
|
|
2196
|
+
border-radius: 0 12px 12px 0;
|
|
2197
|
+
}
|
|
2198
|
+
|
|
2199
|
+
[data-string-grid-layout-range-segment][data-selected="true"] {
|
|
2200
|
+
color: var(--string-grid-accent);
|
|
2201
|
+
}
|
|
2202
|
+
|
|
2203
|
+
|
|
2204
|
+
[data-string-grid-layout-range-divider] {
|
|
2205
|
+
position: absolute;
|
|
2206
|
+
top: -6px;
|
|
2207
|
+
bottom: -14px;
|
|
2208
|
+
width: 18px;
|
|
2209
|
+
padding: 0;
|
|
2210
|
+
border: 0;
|
|
2211
|
+
background: transparent;
|
|
2212
|
+
transform: translateX(-50%);
|
|
2213
|
+
cursor: ew-resize;
|
|
2214
|
+
touch-action: none;
|
|
2215
|
+
}
|
|
2216
|
+
|
|
2217
|
+
[data-string-grid-layout-range-divider]::before {
|
|
2218
|
+
content: "";
|
|
2219
|
+
position: absolute;
|
|
2220
|
+
top: 0;
|
|
2221
|
+
bottom: 12px;
|
|
2222
|
+
left: 50%;
|
|
2223
|
+
width: 2px;
|
|
2224
|
+
border-radius: 999px;
|
|
2225
|
+
background: rgba(17, 17, 17, 0.9);
|
|
2226
|
+
transform: translateX(-50%);
|
|
2227
|
+
}
|
|
2228
|
+
|
|
2229
|
+
[data-string-grid-layout-range-divider][data-handle-state="active"]::before {
|
|
2230
|
+
|
|
2231
|
+
}
|
|
2232
|
+
|
|
2233
|
+
[data-string-grid-layout-range-divider][data-handle-state="dragging"]::before {
|
|
2234
|
+
|
|
2235
|
+
}
|
|
2236
|
+
|
|
2237
|
+
[data-string-grid-layout-range-divider][data-handle="m"] {
|
|
2238
|
+
left: var(--string-grid-layout-range-first);
|
|
2239
|
+
}
|
|
2240
|
+
|
|
2241
|
+
[data-string-grid-layout-range-divider][data-handle="l"] {
|
|
2242
|
+
left: var(--string-grid-layout-range-second);
|
|
2243
|
+
}
|
|
2244
|
+
|
|
2245
|
+
[data-string-grid-layout-range-knob] {
|
|
2246
|
+
position: absolute;
|
|
2247
|
+
top: calc(100% + 2px);
|
|
2248
|
+
width: 8px;
|
|
2249
|
+
height: 8px;
|
|
2250
|
+
border-radius: 999px;
|
|
2251
|
+
background: #111111;
|
|
2252
|
+
border: 0;
|
|
2253
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
|
|
2254
|
+
transform-origin: top center;
|
|
2255
|
+
transform: translate(-50%, -50%) scale(1);
|
|
2256
|
+
transition: transform 0.15s ease;
|
|
2257
|
+
cursor: ew-resize;
|
|
2258
|
+
touch-action: none;
|
|
2259
|
+
}
|
|
2260
|
+
|
|
2261
|
+
[data-string-grid-layout-range-knob][data-handle="m"] {
|
|
2262
|
+
left: var(--string-grid-layout-range-first);
|
|
2263
|
+
}
|
|
2264
|
+
|
|
2265
|
+
[data-string-grid-layout-range-knob][data-handle="l"] {
|
|
2266
|
+
left: var(--string-grid-layout-range-second);
|
|
2267
|
+
}
|
|
2268
|
+
|
|
2269
|
+
[data-string-grid-layout-range-knob]::after {
|
|
2270
|
+
content: "";
|
|
2271
|
+
position: absolute;
|
|
2272
|
+
inset: -8px;
|
|
2273
|
+
}
|
|
2274
|
+
|
|
2275
|
+
[data-string-grid-layout-range-knob][data-handle-state="active"] {
|
|
2276
|
+
transform: translate(-50%, -50%) scale(1.2);
|
|
2277
|
+
}
|
|
2278
|
+
|
|
2279
|
+
[data-string-grid-layout-range-knob][data-handle-state="dragging"] {
|
|
2280
|
+
transform: translate(-50%, -50%) scale(1.4);
|
|
2281
|
+
}
|
|
2282
|
+
|
|
2283
|
+
[data-string-grid-layout-range-editor] {
|
|
2284
|
+
display: grid;
|
|
2285
|
+
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
2286
|
+
align-items: center;
|
|
2287
|
+
min-height: 42px;
|
|
2288
|
+
border-radius: 12px;
|
|
2289
|
+
background: rgba(255, 255, 255, 0.96);
|
|
2290
|
+
border: 1px solid rgba(17, 17, 17, 0.08);
|
|
2291
|
+
overflow: hidden;
|
|
2292
|
+
}
|
|
2293
|
+
|
|
2294
|
+
[data-string-grid-layout-range-editor][data-state="active"] {
|
|
2295
|
+
|
|
2296
|
+
}
|
|
2297
|
+
|
|
2298
|
+
[data-string-grid-layout-range-editor][data-state="dragging"] {
|
|
2299
|
+
|
|
2300
|
+
}
|
|
2301
|
+
|
|
2302
|
+
[data-string-grid-layout-range-editor-prefix] {
|
|
2303
|
+
display: inline-flex;
|
|
2304
|
+
align-items: center;
|
|
2305
|
+
justify-content: center;
|
|
2306
|
+
min-width: 42px;
|
|
2307
|
+
padding: 0 14px;
|
|
2308
|
+
color: rgba(17, 17, 17, 0.42);
|
|
2309
|
+
font-size: 11px;
|
|
2310
|
+
font-weight: 600;
|
|
2311
|
+
letter-spacing: 0.06em;
|
|
2312
|
+
}
|
|
2313
|
+
|
|
2314
|
+
[data-string-grid-layout-range-editor-prefix] svg {
|
|
2315
|
+
width: 14px;
|
|
2316
|
+
height: 14px;
|
|
2317
|
+
display: block;
|
|
2318
|
+
}
|
|
2319
|
+
|
|
2320
|
+
[data-string-grid-layout-range-editor-input] {
|
|
2321
|
+
min-width: 0;
|
|
2322
|
+
width: 100%;
|
|
2323
|
+
padding: 0 12px;
|
|
2324
|
+
border: 0;
|
|
2325
|
+
background: transparent;
|
|
2326
|
+
color: var(--string-grid-panel-text);
|
|
2327
|
+
text-align: center;
|
|
2328
|
+
font-family: var(--string-grid-panel-font-family);
|
|
2329
|
+
font-size: 14px;
|
|
2330
|
+
font-weight: 600;
|
|
2331
|
+
outline: none;
|
|
2332
|
+
appearance: textfield;
|
|
2333
|
+
-moz-appearance: textfield;
|
|
2334
|
+
}
|
|
2335
|
+
|
|
2336
|
+
[data-string-grid-layout-range-editor-input]::-webkit-outer-spin-button,
|
|
2337
|
+
[data-string-grid-layout-range-editor-input]::-webkit-inner-spin-button {
|
|
2338
|
+
-webkit-appearance: none;
|
|
2339
|
+
margin: 0;
|
|
2340
|
+
}
|
|
2341
|
+
|
|
2342
|
+
[data-string-grid-layout-range-editor-suffix] {
|
|
2343
|
+
align-self: stretch;
|
|
2344
|
+
display: inline-flex;
|
|
2345
|
+
align-items: center;
|
|
2346
|
+
padding: 0 8px;
|
|
2347
|
+
border-left: 1px solid #D1D1D1;
|
|
2348
|
+
color: #888888;
|
|
2349
|
+
font-size: 12px;
|
|
2350
|
+
}
|
|
2351
|
+
|
|
2352
|
+
[data-string-grid-empty-add] {
|
|
2353
|
+
font-size: 12px;
|
|
2354
|
+
}
|
|
2355
|
+
|
|
2356
|
+
[data-string-grid-empty-add-label] {
|
|
2357
|
+
font-size: 12px;
|
|
2358
|
+
font-weight: 500;
|
|
2359
|
+
}
|
|
2360
|
+
|
|
2361
|
+
[data-string-grid-list-item] {
|
|
2362
|
+
grid-template-columns: 16px minmax(0, 1fr) auto 20px;
|
|
2363
|
+
min-height: 32px;
|
|
2364
|
+
padding: 8px 10px;
|
|
2365
|
+
border-radius: 12px;
|
|
2366
|
+
}
|
|
2367
|
+
|
|
2368
|
+
[data-string-grid-list] {
|
|
2369
|
+
|
|
2370
|
+
}
|
|
2371
|
+
|
|
2372
|
+
[data-string-grid-list-item] + [data-string-grid-list-item] {
|
|
2373
|
+
margin-top: 0;
|
|
2374
|
+
}
|
|
2375
|
+
|
|
2376
|
+
[data-string-grid-list-delete] {
|
|
2377
|
+
background: transparent;
|
|
2378
|
+
}
|
|
2379
|
+
`}function fi(p,r){return p.id||r.id}function us(p){let r=0,t=p.parentElement;for(;t;)t.hasAttribute("data-string-grid-root")&&(r+=1),t=t.parentElement;return r}var ue=class extends Q{constructor(t){super(t);this.gridManager=new Cr;this.overlays=new Map;this.huds=new Map;this.elementMap=new Map;this.triggerEntries=new Map;this.triggerMeasurements=new Map;this.enabled=!0;this.needsMeasure=!1;this.hasPendingMutate=!1;this.htmlKey="grid",this.attributesToMap=[],this.viewportLayer=this.acquireViewportLayer("devtools-chrome",10011)}onInit(){this.registerBuiltInAdapters(),this.registerExternalAdapters(),this.ensureTriggerLayer()}onObjectConnected(t){let e=t.htmlElement,i=fi(e,t);e.setAttribute("data-string-grid-root","");let n=us(e);e.setAttribute("data-string-grid-depth",String(n)),e.style.setProperty("--string-grid-stack-offset","0px"),this.elementMap.set(i,e),this.gridManager.load(i);let s=this.viewportLayer.getWorldElement(this.getWorldHost()),o=new Tr(e,s);this.overlays.set(i,o);let a=new Hr(e,this.gridManager.getAdapterRegistry(),{onAdd:l=>this.handleAdd(i,l),onRemove:l=>this.handleRemove(i,l),onToggle:l=>this.handleToggle(i,l),onSettingChange:(l,d,c)=>this.handleSettingChange(i,l,d,c),onReorder:(l,d,c)=>this.handleReorder(i,l,d,c),onMoveToEnd:l=>this.handleMoveToEnd(i,l),onSelectLayout:l=>this.handleSelectLayout(i,l),onUpdateLayoutMinWidth:(l,d)=>this.handleUpdateLayoutMinWidth(i,l,d),onPreviewResponsiveLayout:(l,d,c)=>this.handlePreviewResponsiveLayout(i,l,d,c),onCommitResponsiveLayout:(l,d,c)=>this.handleCommitResponsiveLayout(i,l,d,c),onExport:()=>this.handleExport(i),onImport:()=>this.handleImport(i),onRenameInstance:(l,d)=>this.handleRenameInstance(i,l,d),onHUDOpen:()=>this.handleHUDOpen(i),onHUDClose:()=>this.handleHUDClose(i),onLayoutPanelOpen:()=>this.handleLayoutPanelOpen(i),onLayoutPanelClose:()=>this.handleLayoutPanelClose(i)});this.huds.set(i,a),a.setTargetId(i),this.ensureTriggerLayer(),this.viewportLayer.getWorldElement(this.getWorldHost()).appendChild(a.getChromeElement()),this.triggerEntries.set(i,{object:t,hud:a,depth:n}),this.renderElement(i),this.refreshHUD(i),o.setEnabled(this.enabled),a.setEnabled(this.enabled),this.scheduleTriggerSync()}onObjectDisconnected(t){let e=t.htmlElement,i=fi(e,t);this.destroyElement(i)}onResize(){for(let[t,e]of this.overlays)e.syncViewBox(),this.renderElement(t),this.refreshHUD(t);this.scheduleTriggerSync()}onScroll(){this.enabled&&(this.needsMeasure=!0)}onScrollMeasure(){if(!(!this.enabled||!this.needsMeasure)){this.collectTriggerMeasurements(),this.needsMeasure=!1;for(let[t,e]of this.triggerEntries)this.applyTriggerMeasurement(e,this.triggerMeasurements.get(t));this.hasPendingMutate=!1}}onMutate(){if(!(!this.enabled||!this.hasPendingMutate)){for(let[t,e]of this.triggerEntries)this.applyTriggerMeasurement(e,this.triggerMeasurements.get(t));this.hasPendingMutate=!1}}onDOMRebuild(){this.enabled&&this.scheduleTriggerSync()}destroy(){for(let[t]of this.overlays)this.destroyElement(t);this.gridManager.clear(),super.destroy()}setEnabled(t){if(this.enabled!==t){this.enabled=t;for(let e of this.overlays.values())e.setEnabled(t);for(let e of this.huds.values())e.setEnabled(t);if(this.applyTriggerLayerState(),t){for(let e of this.overlays.keys())this.renderElement(e);this.scheduleTriggerSync()}else this.hasPendingMutate=!1;this.emitDevtoolState()}}isEnabled(){return this.enabled}getDevtoolActiveState(){return this.enabled}setDevtoolActiveState(t){this.setEnabled(t)}handleAdd(t,e){this.gridManager.addInstance(t,e),this.renderElement(t),this.refreshHUD(t)}handleRemove(t,e){let i=this.gridManager.findInstance(t,e);if(i){let n=this.gridManager.getAdapter(i.type),s=this.overlays.get(t);n&&s&&s.clearInstance(e,n)}this.gridManager.removeInstance(t,e),this.refreshHUD(t)}handleToggle(t,e){this.gridManager.toggleVisibility(t,e),this.renderElement(t),this.refreshHUD(t)}handleSettingChange(t,e,i,n){this.gridManager.updateSetting(t,e,i,n),this.renderElement(t)}handleReorder(t,e,i,n){this.gridManager.reorderInstance(t,e,i,n),this.renderElement(t),this.refreshHUD(t)}handleMoveToEnd(t,e){this.gridManager.moveInstanceToEnd(t,e),this.renderElement(t),this.refreshHUD(t)}handleSelectLayout(t,e){this.gridManager.selectLayout(t,e),this.renderElement(t),this.refreshHUD(t)}handleUpdateLayoutMinWidth(t,e,i){this.gridManager.updateLayoutMinWidth(t,e,i),this.renderElement(t),this.refreshHUD(t)}handlePreviewResponsiveLayout(t,e,i,n){let s=this.gridManager.getLayouts(t),o=s[0],a=s[1];!o||!a||(this.gridManager.updateLayoutMinWidth(t,a.id,e,!1),this.gridManager.updateLayoutMinWidth(t,o.id,i,!1),this.gridManager.selectLayout(t,n,!1),this.renderElement(t))}handleCommitResponsiveLayout(t,e,i,n){let s=this.gridManager.getLayouts(t),o=s[0],a=s[1];!o||!a||(this.gridManager.updateLayoutMinWidth(t,a.id,e,!1),this.gridManager.updateLayoutMinWidth(t,o.id,i,!1),this.gridManager.selectLayout(t,n,!1),this.gridManager.save(t),this.renderElement(t),this.refreshHUD(t))}handleRenameInstance(t,e,i){this.gridManager.renameInstance(t,e,i),this.refreshHUD(t)}handleHUDOpen(t){this.syncSelectedLayoutToResolved(t),this.renderElement(t),this.refreshHUD(t)}handleHUDClose(t){this.renderElement(t),this.refreshHUD(t)}handleLayoutPanelOpen(t){this.renderElement(t),this.refreshHUD(t)}handleLayoutPanelClose(t){this.renderElement(t),this.refreshHUD(t)}handleExport(t){let e=this.gridManager.getLayouts(t),i=this.gridManager.getSelectedLayoutId(t),n=bt.serialize(e,i),s=t.replace(/[^a-z0-9]/gi,"-").toLowerCase()||"element";bt.toFile(`string-grid-${s}.json`,n)}handleImport(t){bt.fromFile().then(e=>{let i=bt.deserialize(e,this.gridManager.getAdapterRegistry());i&&(this.gridManager.replaceLayouts(t,i.layouts,i.selectedLayoutId),this.renderElement(t),this.refreshHUD(t))}).catch(()=>{})}renderElement(t){let e=this.overlays.get(t);if(!e)return;let{instances:i}=this.resolveActiveLayoutState(t);e.render(i,this.gridManager.getAdapterRegistry())}refreshHUD(t){let e=this.huds.get(t);if(!e)return;let{instances:i,selectedLayoutId:n,activeLayoutId:s}=this.resolveActiveLayoutState(t),o=this.gridManager.getLayouts(t);e.refresh(i,o,n,s)}resolveActiveLayoutState(t){let e=this.huds.get(t),i=this.data.viewport.windowWidth||window.innerWidth,n=this.gridManager.getResolvedLayoutId(t,i),s=e?.isHUDOpen()===!0;s||this.syncSelectedLayoutToResolved(t,n);let o=this.gridManager.getSelectedLayoutId(t);return{instances:this.gridManager.getSelectedInstances(t),selectedLayoutId:o,activeLayoutId:s?o:n}}syncSelectedLayoutToResolved(t,e){let i=e??this.gridManager.getResolvedLayoutId(t,this.data.viewport.windowWidth||window.innerWidth);this.gridManager.selectLayout(t,i,!1)}destroyElement(t){this.overlays.get(t)?.destroy(),this.overlays.delete(t),this.huds.get(t)?.destroy(),this.huds.delete(t),this.triggerEntries.delete(t),this.triggerMeasurements.delete(t),this.elementMap.get(t)?.removeAttribute("data-string-grid-root"),this.elementMap.get(t)?.removeAttribute("data-string-grid-depth"),this.elementMap.get(t)?.style.removeProperty("--string-grid-stack-offset"),this.elementMap.delete(t)}ensureTriggerLayer(){this.viewportLayer.ensure(this.getWorldHost()).setAttribute("data-string-grid-trigger-layer","")}applyTriggerLayerState(){}scheduleTriggerSync(){this.ensureTriggerLayer(),this.needsMeasure=!0,this.collectTriggerMeasurements(),this.needsMeasure=!1;for(let[t,e]of this.triggerEntries)this.applyTriggerMeasurement(e,this.triggerMeasurements.get(t));this.hasPendingMutate=!1}collectTriggerMeasurements(){for(let[t,e]of this.triggerEntries)this.triggerMeasurements.set(t,this.measureTrigger(e))}measureTrigger(t){let e=t.object,i=e.htmlElement;if(!this.enabled||!i||!i.isConnected)return{visible:!1,docX:0,docY:0,stackOffsetY:0};let n=e.getProperty("layout-width")??i.offsetWidth??i.clientWidth??0,s=e.getProperty("size"),o=e.getProperty("layout-height")??i.offsetHeight??i.clientHeight??0,a=s!=null&&s>0?s:o,l=e.getProperty("layout-doc-left")??0,d=this.getObjectDocY(e);if(n<=0||a<=0)return{visible:!1,docX:0,docY:0,stackOffsetY:0};let c=this.data.viewport.windowHeight||window.innerHeight,u=this.data.viewport.windowWidth||window.innerWidth,g=this.getViewportScrollLeft(),v=this.getViewportScrollTop(),h=l-g,m=d-v;if(m+a<0||m>c||h+n<0||h>u)return{visible:!1,docX:0,docY:0,stackOffsetY:0};let y=l+n-12-28,f=d+12,S=this.resolveTriggerStackOffset(t,y,f);return{visible:!0,docX:y,docY:f+S,stackOffsetY:S,elementDocX:l,elementDocY:d,width:n,height:a}}applyTriggerMeasurement(t,e){if(!e||!e.visible){t.hud.setAnchorVisible(!1),t.object.htmlElement.style.setProperty("--string-grid-stack-offset","0px");return}t.hud.setAnchorVisible(!0),t.object.htmlElement.style.setProperty("--string-grid-stack-offset",`${e.stackOffsetY}px`),t.hud.setAnchorPosition(e.docX,e.docY);let i=this.overlays.get(fi(t.object.htmlElement,t.object));i&&e.elementDocX!=null&&e.elementDocY!=null&&e.width!=null&&e.height!=null&&i.setPosition(e.elementDocX,e.elementDocY,e.width,e.height)}getWorldHost(){return this.data.scroll.container??document.body??document.documentElement}getObjectDocY(t){let e=t.getProperty("start"),i=t.getProperty("size");return e!=null&&i!=null&&i>0?e:t.getProperty("layout-doc-top")??0}getViewportScrollLeft(){return this.data.scroll.elementContainer?.scrollLeft??0}getViewportScrollTop(){return this.data.scroll.elementContainer?.scrollTop??0}resolveTriggerStackOffset(t,e,i){return qr(t.object.htmlElement,e,i,n=>{let s=this.objectManager.all.get(n);if(!s)return null;let o=s.getProperty("layout-width")??s.htmlElement.offsetWidth??s.htmlElement.clientWidth??0;return{docX:(s.getProperty("layout-doc-left")??0)+o-12-28,docY:this.getObjectDocY(s)+12}})}registerBuiltInAdapters(){let t=[new Vr,new _r,new zr,new Br,new Nr,new Wr,new Gr,new $r,new jr,new Ur];for(let e of t)this.gridManager.registerAdapter(e)}registerExternalAdapters(){let t=this.settings.adapters;if(t)for(let e of t)this.gridManager.registerAdapter(e)}};ue.devtool={id:"layout",label:"Layout",icon:"grid",order:20,styles:an};var St=class extends Q{constructor(t){super(t);this.entries=new Map;this.measurements=new Map;this.enabled=!1;this.needsMeasure=!1;this.hasPendingMutate=!1;this.onOverlayLayoutChangeBind=()=>{this.enabled&&this.scheduleFullSync()};this.enabled=this.defaultEnabled}get viewportLayer(){return this._viewportLayer||(this._viewportLayer=this.acquireViewportLayer(this.layerName,this.layerZIndex)),this._viewportLayer}get _overlayConfig(){return this.constructor.devtool?.overlay}get overlayId(){return this._overlayConfig?.overlayId??null}get layerName(){return this._overlayConfig?.layerName??""}get layerZIndex(){return this._overlayConfig?.zIndex??10011}get layerAttribute(){return this._overlayConfig?.layerAttribute??""}get defaultEnabled(){return this._overlayConfig?.defaultEnabled??!1}onInit(){this.ensureLayer(),this.applyEnabledState(),window.addEventListener(Yr,this.onOverlayLayoutChangeBind)}onObjectConnected(t){this.ensureLayer();let e=this.createOverlayEntry(t);e&&(this.entries.set(t.id,e),this.scheduleFullSync())}onObjectDisconnected(t){let e=this.entries.get(t.id);e&&(this.destroyOverlayEntry(e),this.entries.delete(t.id),this.measurements.delete(t.id))}setEnabled(t){this.enabled!==t&&(this.enabled=t,this.applyEnabledState(),this.onEnabledChange(t),this.scheduleFullSync(),this.emitDevtoolState())}isEnabled(){return this.enabled}getDevtoolActiveState(){return this.enabled}setDevtoolActiveState(t){this.setEnabled(t)}onEnabledChange(t){}onScroll(){this.enabled&&(this.needsMeasure=!0)}onScrollMeasure(){!this.enabled||!this.needsMeasure||(this.collectMeasurements(),this.needsMeasure=!1,this.flushMeasurements(),this.hasPendingMutate=!1)}onMutate(){!this.enabled||!this.hasPendingMutate||(this.flushMeasurements(),this.hasPendingMutate=!1)}onResize(){this.enabled&&this.scheduleFullSync()}onDOMRebuild(){this.enabled&&this.scheduleFullSync()}scheduleFullSync(){this.ensureLayer(),this.needsMeasure=!0,this.collectMeasurements(),this.needsMeasure=!1,this.flushMeasurements(),this.hasPendingMutate=!1}collectMeasurements(){this.ensureLayer();for(let[t,e]of this.entries){let i=this.computeBaseMetrics(e);this.measurements.set(t,this.measureEntry(e,i))}}flushMeasurements(){E.run(()=>{for(let[t,e]of this.entries)this.applyMeasurement(e,this.measurements.get(t))})}ensureLayer(){let t=this.viewportLayer.ensure(this.getWorldHost());return this.layerAttribute&&t.setAttribute(this.layerAttribute,""),t}applyEnabledState(){let t=this.viewportLayer.getElement();t&&(t.setAttribute("data-enabled",this.enabled?"true":"false"),this.layerAttribute&&(this.enabled?t.setAttribute(this.layerAttribute,""):t.removeAttribute(this.layerAttribute)),this.overlayId&&(this.enabled?on(this.overlayId,this.devtoolConfig?.order??0):mi(this.overlayId)),Xr())}resolveOverlayTargetId(t){return t.htmlElement.id||t.id}resolveOverlayObjectDepth(t){let e=0,i=t.parentElement;for(;i;)(i.hasAttribute("string-id")||i.hasAttribute("data-string-id"))&&(e+=1),i=i.parentElement;return e}createOverlayBadge(t){let e=document.createElement("button");return e.type="button",e.setAttribute("data-string-devtools-overlay-badge",""),e.setAttribute("data-target-id",t.targetId),t.selectorAttribute&&e.setAttribute(t.selectorAttribute,""),t.depth!=null&&e.setAttribute("data-depth",String(t.depth)),this.applyOverlayBadgeState(e,{attributes:t.attributes}),e}applyOverlayBadgeState(t,e){if(e.visible!=null&&t.setAttribute("data-visible",e.visible?"true":"false"),e.active!=null&&t.setAttribute("data-active",e.active?"true":"false"),e.disabled!=null&&t instanceof HTMLButtonElement&&(t.disabled=e.disabled),e.title!=null&&(t.title=e.title),e.html!=null&&(t.innerHTML=e.html),!!e.attributes)for(let[i,n]of Object.entries(e.attributes)){if(n==null){t.removeAttribute(i);continue}if(typeof n=="boolean"){t.setAttribute(i,n?"true":"false");continue}t.setAttribute(i,String(n))}}applyOverlayBadgePosition(t,e){if(!e){t.setAttribute("data-visible","false");return}t.setAttribute("data-visible",e.visible?"true":"false"),e.visible&&E.setProps(t,{transform:`translate3d(${Math.round(e.docX*100)/100}px, ${Math.round(e.docY*100)/100}px, 0)`})}computeBaseMetrics(t){let e=t.object,i=e.htmlElement;if(!this.enabled||!i||!i.isConnected)return this.getHiddenMetrics();let n=(e.getProperty("layout-width")??(e.getProperty("half-width")??0)*2)||i.offsetWidth||i.clientWidth||0,s=e.getProperty("size"),o=(e.getProperty("layout-height")??(e.getProperty("half-height")??0)*2)||i.offsetHeight||i.clientHeight||0,a=s!=null&&s>0?s:o,l=e.getProperty("layout-doc-left")??0,d=this.getObjectDocY(e);if(n<=0||a<=0)return this.getHiddenMetrics();let c=this.data.viewport.windowHeight||window.innerHeight,u=this.data.viewport.windowWidth||window.innerWidth,g=this.getViewportScrollLeft(),v=this.getViewportScrollTop(),h=l-g,m=d-v,b=m+a<0||m>c||h+n<0||h>u;if(b)return this.getHiddenMetrics();let y=l,f=d,S=0;if(this.overlayId){let x=vi(this.overlayId,l,d);y=x.docX,f=x.docY,S=qr(i,y,f,w=>{let M=this.objectManager.all.get(w);return M?vi(this.overlayId,M.getProperty("layout-doc-left")??0,this.getObjectDocY(M)):null})}return{visible:!0,contentX:l,contentY:d,width:n,height:a,isOffscreen:b,baseAnchorX:y,baseAnchorY:f,collisionOffset:S}}getHiddenMetrics(){return{visible:!1,contentX:0,contentY:0,width:0,height:0,isOffscreen:!0,baseAnchorX:0,baseAnchorY:0,collisionOffset:0}}getObjectDocY(t){let e=t.getProperty("start"),i=t.getProperty("size");return e!=null&&i!=null&&i>0?e:t.getProperty("layout-doc-top")??0}getViewportScrollLeft(){return this.data.scroll.elementContainer?.scrollLeft??0}getViewportScrollTop(){return this.data.scroll.elementContainer?.scrollTop??0}destroy(){this.overlayId&&mi(this.overlayId),window.removeEventListener(Yr,this.onOverlayLayoutChangeBind);for(let t of this.entries.values())this.destroyOverlayEntry(t);this.entries.clear(),this.measurements.clear(),super.destroy()}};var Kr=class extends St{get badgeAttribute(){return this.constructor.devtool?.overlay?.badgeAttribute??""}createOverlayEntry(r){let t=this.resolveOverlayTargetId(r),e=this.resolveBadgeDepth(r),i=this.createOverlayBadge({targetId:t,selectorAttribute:this.badgeAttribute,depth:e,attributes:this.getInitialBadgeAttributes(r,t,e)}),n=[],s=l=>{l.stopPropagation(),l.preventDefault(),this.onBadgeClick(o,l)};i.addEventListener("click",s),n.push(()=>i.removeEventListener("click",s));let o={object:r,targetId:t,badge:i,depth:e,extra:this.createBadgeExtra(r,i,t,e),cleanup:n},a=this.bindBadge(o);return a&&n.push(...a),this.applyBadgeEnabledState(o),this.renderBadge(o),this.viewportLayer.getWorldElement(this.getWorldHost()).appendChild(i),o}destroyOverlayEntry(r){for(let t of r.cleanup)t();this.destroyBadgeExtra(r),r.badge.remove()}measureEntry(r,t){return t.visible?{visible:!0,docX:t.baseAnchorX,docY:t.baseAnchorY+t.collisionOffset}:{visible:!1,docX:0,docY:0}}applyMeasurement(r,t){this.applyOverlayBadgePosition(r.badge,t),this.afterBadgeMeasurement(r,t)}onEnabledChange(r){for(let t of this.entries.values())this.applyBadgeEnabledState(t),this.renderBadge(t)}createBadgeExtra(r,t,e,i){}destroyBadgeExtra(r){}bindBadge(r){}resolveBadgeDepth(r){return this.resolveOverlayObjectDepth(r.htmlElement)}getInitialBadgeAttributes(r,t,e){}applyBadgeEnabledState(r){this.applyOverlayBadgeState(r.badge,{disabled:!this.enabled,attributes:{"data-module-enabled":this.enabled}})}renderBadge(r){this.applyOverlayBadgeState(r.badge,this.getBadgeState(r))}afterBadgeMeasurement(r,t){}};var ln=`
|
|
2380
|
+
[data-string-devtools-overlay-badge][data-module-enabled="false"] {
|
|
2381
|
+
display: none;
|
|
2382
|
+
}
|
|
2383
|
+
|
|
2384
|
+
[data-string-devtools-overlay-badge][data-visible="false"] {
|
|
2385
|
+
display: none;
|
|
2386
|
+
}
|
|
2387
|
+
`;var ps='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M8 3C12.4183 3 16 5.23858 16 8C16 10.7614 12.4183 13 8 13C3.58172 13 0 10.7614 0 8C0 5.23858 3.58172 3 8 3ZM8 5C6.34315 5 5 6.34315 5 8C5 9.65685 6.34315 11 8 11C9.65685 11 11 9.65685 11 8C11 6.34315 9.65685 5 8 5Z" fill="currentColor"/></svg>',gs='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M8 3C12.4183 3 16 5.23858 16 8C16 10.7614 12.4183 13 8 13C3.58172 13 0 10.7614 0 8C0 5.23858 3.58172 3 8 3ZM8 5C6.34315 5 5 6.34315 5 8C5 9.65685 6.34315 11 8 11C9.65685 11 11 9.65685 11 8C11 6.34315 9.65685 5 8 5Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M2 1L14 15Z" fill="#CCCCCC"/><path d="M2 1L14 15" stroke="currentColor"/></svg>',pe=class extends Kr{canConnect(r){return!0}createBadgeExtra(r){return{onInviewChange:()=>{let e=this.entries.get(r.id);e&&(this.renderBadge(e),this.needsMeasure=!0,this.hasPendingMutate=!0)}}}bindBadge(r){return this.events.on(r.object.getScopedEventName("object:inview"),r.extra.onInviewChange),[()=>this.events.off(r.object.getScopedEventName("object:inview"),r.extra.onInviewChange)]}onBadgeClick(r,t){let e=r.object;e.htmlElement.classList.contains("-inview")?(e.setInviewAutoBlocked(!0),e.htmlElement.classList.remove("-inview")):(e.setInviewAutoBlocked(!1),e.syncInviewClass()),this.renderBadge(r)}getBadgeState(r){let t=r.object,e=t.getProperty("is-inview")===!0,i=t.isInviewAutoBlocked(),n=t.getProperty("repeat")===!0,s=t.htmlElement.classList.contains("-inview"),o=i?!1:e?!0:n?!1:s;return{active:o,title:i?"Enable automatic -inview":"Disable automatic -inview",html:o?ps:gs,attributes:{"data-inview":e,"data-blocked":i}}}};pe.devtool={id:"inview-toggle",label:"Inview",icon:"inview",order:30,styles:ln,overlay:{layerName:"devtools-inview-toggle",zIndex:10011,layerAttribute:"data-string-inview-toggle-layer",overlayId:"inview-toggle",badgeAttribute:"data-string-inview-toggle",defaultEnabled:!0}};var dn=`
|
|
2388
|
+
/* \u2500\u2500 Ruler bars \u2500\u2500 */
|
|
2389
|
+
[data-string-rulers-top],
|
|
2390
|
+
[data-string-rulers-left] {
|
|
2391
|
+
position: absolute;
|
|
2392
|
+
z-index: 10001;
|
|
2393
|
+
display: block;
|
|
2394
|
+
cursor: crosshair;
|
|
2395
|
+
image-rendering: pixelated;
|
|
2396
|
+
transition: opacity 0.15s ease;
|
|
2397
|
+
}
|
|
2398
|
+
|
|
2399
|
+
[data-string-rulers-top] {
|
|
2400
|
+
top: 0; left: 0;
|
|
2401
|
+
width: 100%; height: 20px;
|
|
2402
|
+
pointer-events: auto;
|
|
2403
|
+
}
|
|
2404
|
+
|
|
2405
|
+
[data-string-rulers-left] {
|
|
2406
|
+
top: 0; left: 0;
|
|
2407
|
+
width: 20px; height: 100%;
|
|
2408
|
+
pointer-events: auto;
|
|
2409
|
+
}
|
|
2410
|
+
|
|
2411
|
+
/* \u2500\u2500 Corner mode toggle \u2500\u2500 */
|
|
2412
|
+
[data-string-rulers-corner] {
|
|
2413
|
+
position: absolute;
|
|
2414
|
+
top: 0; left: 0;
|
|
2415
|
+
width: 20px; height: 20px;
|
|
2416
|
+
z-index: 10002;
|
|
2417
|
+
background: #E3E3E3;
|
|
2418
|
+
display: flex;
|
|
2419
|
+
align-items: center;
|
|
2420
|
+
justify-content: center;
|
|
2421
|
+
pointer-events: auto;
|
|
2422
|
+
cursor: pointer;
|
|
2423
|
+
transition: opacity 0.15s ease, background 0.15s ease;
|
|
2424
|
+
}
|
|
2425
|
+
|
|
2426
|
+
[data-string-rulers-corner]:hover {
|
|
2427
|
+
background: #D8D8D8;
|
|
2428
|
+
}
|
|
2429
|
+
|
|
2430
|
+
[data-string-rulers-corner][data-mode="center"] {
|
|
2431
|
+
background: #D4E8FF;
|
|
2432
|
+
}
|
|
2433
|
+
[data-string-rulers-corner][data-mode="center"]:hover {
|
|
2434
|
+
background: #C4DCFA;
|
|
2435
|
+
}
|
|
2436
|
+
|
|
2437
|
+
[data-string-rulers-corner] > span {
|
|
2438
|
+
font: 10px "JetBrains Mono", monospace;
|
|
2439
|
+
color: #888888;
|
|
2440
|
+
white-space: nowrap;
|
|
2441
|
+
line-height: 1;
|
|
2442
|
+
pointer-events: none;
|
|
2443
|
+
user-select: none;
|
|
2444
|
+
}
|
|
2445
|
+
|
|
2446
|
+
[data-string-rulers-corner][data-mode="center"] > span {
|
|
2447
|
+
color: #3B82F6;
|
|
2448
|
+
}
|
|
2449
|
+
|
|
2450
|
+
/* \u2500\u2500 Layout grid canvas \u2500\u2500 */
|
|
2451
|
+
[data-string-rulers-grid] {
|
|
2452
|
+
position: absolute;
|
|
2453
|
+
top: 0; left: 0;
|
|
2454
|
+
z-index: 9998;
|
|
2455
|
+
pointer-events: none;
|
|
2456
|
+
image-rendering: pixelated;
|
|
2457
|
+
transition: opacity 0.15s ease;
|
|
2458
|
+
}
|
|
2459
|
+
|
|
2460
|
+
/* \u2500\u2500 Lines layer \u2500\u2500 */
|
|
2461
|
+
[data-string-rulers-lines] {
|
|
2462
|
+
position: absolute;
|
|
2463
|
+
top: 0;
|
|
2464
|
+
left: 0;
|
|
2465
|
+
pointer-events: none;
|
|
2466
|
+
z-index: 10000;
|
|
2467
|
+
overflow: hidden;
|
|
2468
|
+
}
|
|
2469
|
+
|
|
2470
|
+
/* \u2500\u2500 Guide lines \u2500\u2500 */
|
|
2471
|
+
[data-string-rulers-line] {
|
|
2472
|
+
position: absolute;
|
|
2473
|
+
pointer-events: auto;
|
|
2474
|
+
opacity: var(--string-rulers-line-opacity, 1);
|
|
2475
|
+
}
|
|
2476
|
+
|
|
2477
|
+
[data-string-rulers-line][data-axis="horizontal"] {
|
|
2478
|
+
border-top: 1px solid var(--string-rulers-line-color, rgba(0, 120, 255, 0.75));
|
|
2479
|
+
height: 0;
|
|
2480
|
+
cursor: ns-resize;
|
|
2481
|
+
}
|
|
2482
|
+
|
|
2483
|
+
[data-string-rulers-line][data-axis="vertical"] {
|
|
2484
|
+
border-left: 1px solid var(--string-rulers-line-color, rgba(0, 120, 255, 0.75));
|
|
2485
|
+
width: 0;
|
|
2486
|
+
cursor: ew-resize;
|
|
2487
|
+
}
|
|
2488
|
+
|
|
2489
|
+
/* \u2500\u2500 Expanded hit area via ::before \u2500\u2500
|
|
2490
|
+
Adds 5px grab zone above/below horizontal lines,
|
|
2491
|
+
and 5px left/right of vertical lines \u2014 no change to visuals. */
|
|
2492
|
+
[data-string-rulers-line][data-axis="horizontal"]::before {
|
|
2493
|
+
content: '';
|
|
2494
|
+
display: block;
|
|
2495
|
+
position: absolute;
|
|
2496
|
+
left: 0; right: 0;
|
|
2497
|
+
top: -5px;
|
|
2498
|
+
height: 11px;
|
|
2499
|
+
}
|
|
2500
|
+
|
|
2501
|
+
[data-string-rulers-line][data-axis="vertical"]::before {
|
|
2502
|
+
content: '';
|
|
2503
|
+
display: block;
|
|
2504
|
+
position: absolute;
|
|
2505
|
+
top: 0; bottom: 0;
|
|
2506
|
+
left: -5px;
|
|
2507
|
+
width: 11px;
|
|
2508
|
+
}
|
|
2509
|
+
|
|
2510
|
+
[data-string-rulers-line]:hover {
|
|
2511
|
+
border-color: rgba(255, 60, 60, 0.85);
|
|
2512
|
+
}
|
|
2513
|
+
|
|
2514
|
+
/* \u2500\u2500 Coordinate label \u2500\u2500 */
|
|
2515
|
+
[data-string-rulers-label] {
|
|
2516
|
+
position: absolute;
|
|
2517
|
+
top: 2px; left: 24px;
|
|
2518
|
+
font: 10px "JetBrains Mono", monospace;
|
|
2519
|
+
color: var(--string-rulers-line-color, rgba(0, 120, 255, 0.85));
|
|
2520
|
+
background: rgba(255,255,255,0.82);
|
|
2521
|
+
padding: 0 3px;
|
|
2522
|
+
border-radius: 3px;
|
|
2523
|
+
pointer-events: none;
|
|
2524
|
+
white-space: nowrap;
|
|
2525
|
+
line-height: 14px;
|
|
2526
|
+
}
|
|
2527
|
+
|
|
2528
|
+
[data-string-rulers-line][data-axis="vertical"] [data-string-rulers-label] {
|
|
2529
|
+
top: 24px; left: 2px;
|
|
2530
|
+
writing-mode: vertical-lr;
|
|
2531
|
+
}
|
|
2532
|
+
|
|
2533
|
+
/* \u2500\u2500 Snap: ELEMENT (amber) \u2500\u2500 */
|
|
2534
|
+
[data-string-rulers-line][data-snapping="element"][data-axis="horizontal"] {
|
|
2535
|
+
border-top-color: rgba(220, 120, 0, 0.9);
|
|
2536
|
+
}
|
|
2537
|
+
[data-string-rulers-line][data-snapping="element"][data-axis="vertical"] {
|
|
2538
|
+
border-left-color: rgba(220, 120, 0, 0.9);
|
|
2539
|
+
}
|
|
2540
|
+
[data-string-rulers-line][data-snapping="element"] [data-string-rulers-label] {
|
|
2541
|
+
color: rgba(180, 80, 0, 0.95);
|
|
2542
|
+
}
|
|
2543
|
+
|
|
2544
|
+
/* \u2500\u2500 Snap: GRID (green) \u2500\u2500 */
|
|
2545
|
+
[data-string-rulers-line][data-snapping="grid"][data-axis="horizontal"] {
|
|
2546
|
+
border-top-color: rgba(0, 170, 80, 0.9);
|
|
2547
|
+
}
|
|
2548
|
+
[data-string-rulers-line][data-snapping="grid"][data-axis="vertical"] {
|
|
2549
|
+
border-left-color: rgba(0, 170, 80, 0.9);
|
|
2550
|
+
}
|
|
2551
|
+
[data-string-rulers-line][data-snapping="grid"] [data-string-rulers-label] {
|
|
2552
|
+
color: rgba(0, 130, 60, 0.95);
|
|
2553
|
+
}
|
|
2554
|
+
|
|
2555
|
+
/* \u2500\u2500 Snap: GUIDE GAP (cyan) \u2500\u2500 */
|
|
2556
|
+
[data-string-rulers-line][data-snapping="guide"][data-axis="horizontal"] {
|
|
2557
|
+
border-top-color: rgba(0, 150, 170, 0.95);
|
|
2558
|
+
}
|
|
2559
|
+
[data-string-rulers-line][data-snapping="guide"][data-axis="vertical"] {
|
|
2560
|
+
border-left-color: rgba(0, 150, 170, 0.95);
|
|
2561
|
+
}
|
|
2562
|
+
[data-string-rulers-line][data-snapping="guide"] [data-string-rulers-label] {
|
|
2563
|
+
color: rgba(0, 120, 140, 0.98);
|
|
2564
|
+
}
|
|
2565
|
+
|
|
2566
|
+
/* \u2500\u2500 Snap: COLUMN (magenta) \u2500\u2500 */
|
|
2567
|
+
[data-string-rulers-line][data-snapping="column"][data-axis="horizontal"] {
|
|
2568
|
+
border-top-color: rgba(200, 0, 100, 0.9);
|
|
2569
|
+
}
|
|
2570
|
+
[data-string-rulers-line][data-snapping="column"][data-axis="vertical"] {
|
|
2571
|
+
border-left-color: rgba(200, 0, 100, 0.9);
|
|
2572
|
+
}
|
|
2573
|
+
[data-string-rulers-line][data-snapping="column"] [data-string-rulers-label] {
|
|
2574
|
+
color: rgba(160, 0, 80, 0.95);
|
|
2575
|
+
}
|
|
2576
|
+
|
|
2577
|
+
/* \u2500\u2500 Guide-gap references \u2500\u2500 */
|
|
2578
|
+
[data-string-rulers-line][data-string-rulers-guide-ref][data-axis="horizontal"] {
|
|
2579
|
+
border-top-color: rgba(0, 150, 170, 0.68);
|
|
2580
|
+
}
|
|
2581
|
+
[data-string-rulers-line][data-string-rulers-guide-ref][data-axis="vertical"] {
|
|
2582
|
+
border-left-color: rgba(0, 150, 170, 0.68);
|
|
2583
|
+
}
|
|
2584
|
+
|
|
2585
|
+
[data-string-rulers-gap-indicator] {
|
|
2586
|
+
position: absolute;
|
|
2587
|
+
pointer-events: none;
|
|
2588
|
+
z-index: 10002;
|
|
2589
|
+
}
|
|
2590
|
+
|
|
2591
|
+
[data-string-rulers-gap-indicator][data-axis="vertical"] {
|
|
2592
|
+
border-top: 1px dashed rgba(0, 150, 170, 0.95);
|
|
2593
|
+
}
|
|
2594
|
+
|
|
2595
|
+
[data-string-rulers-gap-indicator][data-axis="horizontal"] {
|
|
2596
|
+
border-left: 1px dashed rgba(0, 150, 170, 0.95);
|
|
2597
|
+
}
|
|
2598
|
+
|
|
2599
|
+
[data-string-rulers-gap-indicator-label] {
|
|
2600
|
+
position: absolute;
|
|
2601
|
+
font: 10px "JetBrains Mono", monospace;
|
|
2602
|
+
color: rgba(0, 120, 140, 0.98);
|
|
2603
|
+
background: rgba(255,255,255,0.92);
|
|
2604
|
+
border-radius: 3px;
|
|
2605
|
+
padding: 1px 4px;
|
|
2606
|
+
white-space: nowrap;
|
|
2607
|
+
line-height: 14px;
|
|
2608
|
+
}
|
|
2609
|
+
|
|
2610
|
+
[data-string-rulers-gap-indicator][data-axis="vertical"] [data-string-rulers-gap-indicator-label] {
|
|
2611
|
+
left: 50%;
|
|
2612
|
+
top: 50%;
|
|
2613
|
+
transform: translate(-50%, -50%);
|
|
2614
|
+
}
|
|
2615
|
+
|
|
2616
|
+
[data-string-rulers-gap-indicator][data-axis="horizontal"] [data-string-rulers-gap-indicator-label] {
|
|
2617
|
+
left: 50%;
|
|
2618
|
+
top: 50%;
|
|
2619
|
+
transform: translate(-50%, -50%);
|
|
2620
|
+
}
|
|
2621
|
+
|
|
2622
|
+
/* \u2500\u2500 Snap target element highlight \u2500\u2500 */
|
|
2623
|
+
[data-string-rulers-snap-target] {
|
|
2624
|
+
outline: 1px dashed rgba(220, 120, 0, 0.55) !important;
|
|
2625
|
+
outline-offset: 0px;
|
|
2626
|
+
}
|
|
2627
|
+
|
|
2628
|
+
/* \u2500\u2500 Ghost (preview during drag from ruler) \u2500\u2500 */
|
|
2629
|
+
[data-string-rulers-ghost] {
|
|
2630
|
+
position: absolute;
|
|
2631
|
+
pointer-events: none;
|
|
2632
|
+
opacity: calc(var(--string-rulers-line-opacity, 1) * 0.65);
|
|
2633
|
+
}
|
|
2634
|
+
|
|
2635
|
+
[data-string-rulers-ghost][data-axis="horizontal"] {
|
|
2636
|
+
border-top: 1px dashed var(--string-rulers-line-color, rgba(0, 120, 255, 0.75));
|
|
2637
|
+
height: 0;
|
|
2638
|
+
}
|
|
2639
|
+
|
|
2640
|
+
[data-string-rulers-ghost][data-axis="vertical"] {
|
|
2641
|
+
border-left: 1px dashed var(--string-rulers-line-color, rgba(0, 120, 255, 0.75));
|
|
2642
|
+
width: 0;
|
|
2643
|
+
}
|
|
2644
|
+
|
|
2645
|
+
/* Ghost snap: ELEMENT (amber) */
|
|
2646
|
+
[data-string-rulers-ghost][data-snapping="element"][data-axis="horizontal"] {
|
|
2647
|
+
border-top-style: solid;
|
|
2648
|
+
border-top-color: rgba(220, 120, 0, 0.9);
|
|
2649
|
+
opacity: 0.85;
|
|
2650
|
+
}
|
|
2651
|
+
[data-string-rulers-ghost][data-snapping="element"][data-axis="vertical"] {
|
|
2652
|
+
border-left-style: solid;
|
|
2653
|
+
border-left-color: rgba(220, 120, 0, 0.9);
|
|
2654
|
+
opacity: 0.85;
|
|
2655
|
+
}
|
|
2656
|
+
|
|
2657
|
+
/* Ghost snap: GRID (green) */
|
|
2658
|
+
[data-string-rulers-ghost][data-snapping="grid"][data-axis="horizontal"] {
|
|
2659
|
+
border-top-style: solid;
|
|
2660
|
+
border-top-color: rgba(0, 170, 80, 0.9);
|
|
2661
|
+
opacity: 0.85;
|
|
2662
|
+
}
|
|
2663
|
+
[data-string-rulers-ghost][data-snapping="grid"][data-axis="vertical"] {
|
|
2664
|
+
border-left-style: solid;
|
|
2665
|
+
border-left-color: rgba(0, 170, 80, 0.9);
|
|
2666
|
+
opacity: 0.85;
|
|
2667
|
+
}
|
|
2668
|
+
|
|
2669
|
+
/* Ghost snap: COLUMN (magenta) */
|
|
2670
|
+
[data-string-rulers-ghost][data-snapping="column"][data-axis="horizontal"] {
|
|
2671
|
+
border-top-style: solid;
|
|
2672
|
+
border-top-color: rgba(200, 0, 100, 0.9);
|
|
2673
|
+
opacity: 0.85;
|
|
2674
|
+
}
|
|
2675
|
+
[data-string-rulers-ghost][data-snapping="column"][data-axis="vertical"] {
|
|
2676
|
+
border-left-style: solid;
|
|
2677
|
+
border-left-color: rgba(200, 0, 100, 0.9);
|
|
2678
|
+
opacity: 0.85;
|
|
2679
|
+
}
|
|
2680
|
+
|
|
2681
|
+
/* Ghost snap: GUIDE GAP (cyan) */
|
|
2682
|
+
[data-string-rulers-ghost][data-snapping="guide"][data-axis="horizontal"] {
|
|
2683
|
+
border-top-style: solid;
|
|
2684
|
+
border-top-color: rgba(0, 150, 170, 0.95);
|
|
2685
|
+
opacity: 0.85;
|
|
2686
|
+
}
|
|
2687
|
+
[data-string-rulers-ghost][data-snapping="guide"][data-axis="vertical"] {
|
|
2688
|
+
border-left-style: solid;
|
|
2689
|
+
border-left-color: rgba(0, 150, 170, 0.95);
|
|
2690
|
+
opacity: 0.85;
|
|
2691
|
+
}
|
|
2692
|
+
|
|
2693
|
+
/* \u2500\u2500 Ghost coordinate label \u2500\u2500 */
|
|
2694
|
+
[data-string-rulers-ghost-label] {
|
|
2695
|
+
position: absolute;
|
|
2696
|
+
font: 10px "JetBrains Mono", monospace;
|
|
2697
|
+
color: var(--string-rulers-line-color, rgba(0, 100, 220, 0.9));
|
|
2698
|
+
background: rgba(255, 255, 255, 0.9);
|
|
2699
|
+
padding: 1px 4px;
|
|
2700
|
+
border-radius: 3px;
|
|
2701
|
+
pointer-events: none;
|
|
2702
|
+
white-space: nowrap;
|
|
2703
|
+
line-height: 14px;
|
|
2704
|
+
}
|
|
2705
|
+
|
|
2706
|
+
[data-string-rulers-ghost][data-snapping="element"] [data-string-rulers-ghost-label] {
|
|
2707
|
+
color: rgba(180, 80, 0, 0.95);
|
|
2708
|
+
}
|
|
2709
|
+
[data-string-rulers-ghost][data-snapping="grid"] [data-string-rulers-ghost-label] {
|
|
2710
|
+
color: rgba(0, 130, 60, 0.95);
|
|
2711
|
+
}
|
|
2712
|
+
[data-string-rulers-ghost][data-snapping="guide"] [data-string-rulers-ghost-label] {
|
|
2713
|
+
color: rgba(0, 120, 140, 0.98);
|
|
2714
|
+
}
|
|
2715
|
+
[data-string-rulers-ghost][data-snapping="column"] [data-string-rulers-ghost-label] {
|
|
2716
|
+
color: rgba(160, 0, 80, 0.95);
|
|
2717
|
+
}
|
|
2718
|
+
|
|
2719
|
+
[data-axis="horizontal"] [data-string-rulers-ghost-label] {
|
|
2720
|
+
top: 3px; left: 24px;
|
|
2721
|
+
}
|
|
2722
|
+
[data-axis="vertical"] [data-string-rulers-ghost-label] {
|
|
2723
|
+
left: 3px; top: 24px;
|
|
2724
|
+
}
|
|
2725
|
+
|
|
2726
|
+
/* \u2500\u2500 Fixed guide lines (center cross, etc.) \u2500\u2500 */
|
|
2727
|
+
[data-string-rulers-fixed-line] {
|
|
2728
|
+
position: absolute;
|
|
2729
|
+
pointer-events: none;
|
|
2730
|
+
}
|
|
2731
|
+
|
|
2732
|
+
[data-string-rulers-fixed-line][data-axis="horizontal"] {
|
|
2733
|
+
border-top: 1px dashed rgba(100, 100, 100, 0.35);
|
|
2734
|
+
height: 0;
|
|
2735
|
+
}
|
|
2736
|
+
|
|
2737
|
+
[data-string-rulers-fixed-line][data-axis="vertical"] {
|
|
2738
|
+
border-left: 1px dashed rgba(100, 100, 100, 0.35);
|
|
2739
|
+
width: 0;
|
|
2740
|
+
}
|
|
2741
|
+
|
|
2742
|
+
/* \u2500\u2500 Hidden state \u2500\u2500 */
|
|
2743
|
+
[data-string-rulers-hidden] [data-string-rulers-grid],
|
|
2744
|
+
[data-string-rulers-hidden] [data-string-rulers-top],
|
|
2745
|
+
[data-string-rulers-hidden] [data-string-rulers-left],
|
|
2746
|
+
[data-string-rulers-hidden] [data-string-rulers-corner],
|
|
2747
|
+
[data-string-rulers-hidden] [data-string-rulers-lines],
|
|
2748
|
+
[data-string-rulers-hidden] [data-string-rulers-line],
|
|
2749
|
+
[data-string-rulers-hidden] [data-string-rulers-fixed-line],
|
|
2750
|
+
[data-string-rulers-hidden] [data-string-rulers-gap-indicator],
|
|
2751
|
+
[data-string-rulers-hidden] [data-string-rulers-ghost] {
|
|
2752
|
+
opacity: 0;
|
|
2753
|
+
visibility: hidden;
|
|
2754
|
+
pointer-events: none;
|
|
2755
|
+
}
|
|
2756
|
+
`;var hs=0;function cn(){return`ruler-${Date.now()}-${hs++}`}var bi="string-rulers:",Zr=class{constructor(){this.elementStates=new Map}stateKey(r,t="default"){return`${r}:${t}`}storageKey(r,t="default"){return bi+r+":"+t}getLines(r,t="default"){return this.elementStates.get(this.stateKey(r,t))?.lines??[]}addLine(r,t,e,i,n="default",s,o){let a={id:cn(),axis:t,position:e,targetLabel:i,targetSelector:s,targetEdge:o},l=this.stateKey(r,n),d=this.elementStates.get(l);return d||(d={elementId:r,lines:[]},this.elementStates.set(l,d)),d.lines.push(a),this.save(r,n),a}moveLine(r,t,e,i,n="default"){let s=this.findLine(r,t,n);s&&(s.position=e,s.targetLabel=i)}removeLine(r,t,e="default"){let i=this.elementStates.get(this.stateKey(r,e));i&&(i.lines=i.lines.filter(n=>n.id!==t),this.save(r,e))}findLine(r,t,e="default"){return this.elementStates.get(this.stateKey(r,e))?.lines.find(i=>i.id===t)}save(r,t="default"){let e=this.elementStates.get(this.stateKey(r,t));if(e)try{let i=JSON.stringify(e.lines);localStorage.setItem(this.storageKey(r,t),i),t==="default"&&localStorage.setItem(bi+r,i)}catch{}}load(r,t="default"){let e=this.stateKey(r,t);try{let i=localStorage.getItem(this.storageKey(r,t));if(!i&&t==="default"&&(i=localStorage.getItem(bi+r)),!i)return;let n=JSON.parse(i);if(!Array.isArray(n))return;this.elementStates.set(e,{elementId:r,lines:n})}catch{}}clearElement(r){for(let[t]of this.elementStates)t.startsWith(r+":")&&this.elementStates.delete(t)}clearAll(){this.elementStates.clear()}};var Qr=class{constructor(r){this.candidates=[];this.opts=r}buildCandidates(r,t,e,i=window.innerWidth,n=window.innerHeight,s=[],o,a){this.candidates=[],this.candidates.push({position:0,type:"document-origin"}),r==="horizontal"?(this.candidates.push({position:e,type:"viewport-edge"}),this.candidates.push({position:e+n,type:"viewport-edge"})):(this.candidates.push({position:t,type:"viewport-edge"}),this.candidates.push({position:t+i,type:"viewport-edge"})),this.opts.snapToElements&&this.opts.snapSelector&&document.querySelectorAll(this.opts.snapSelector).forEach(l=>{let d=l.getBoundingClientRect();d.width===0&&d.height===0||(r==="horizontal"?(this.candidates.push({position:d.top+e,type:"element-top",el:l}),this.candidates.push({position:d.bottom+e,type:"element-bottom",el:l}),this.candidates.push({position:(d.top+d.bottom)/2+e,type:"element-center-y",el:l})):(this.candidates.push({position:d.left+t,type:"element-left",el:l}),this.candidates.push({position:d.right+t,type:"element-right",el:l}),this.candidates.push({position:(d.left+d.right)/2+t,type:"element-center-x",el:l})))}),this._addLayoutGridCandidates(r,t,e,i,n),this._addGuideGapCandidates(r,s,o),a&&this.candidates.push(...a)}findSnap(r){let t=this.opts.threshold,e=null;for(let i of this.candidates){let n=Math.abs(i.position-r);n<t&&(t=n,e=i)}if(this.opts.snapStep>1){let i=Math.round(r/this.opts.snapStep)*this.opts.snapStep;if(Math.abs(i-r)<t)return{position:i,type:"grid-step"}}return e?{position:e.position,type:e.type,el:e.el,gap:e.gap,referenceLineIds:e.referenceLineIds,label:e.label}:null}snapToStep(r){return this.opts.snapStep<=1?r:Math.round(r/this.opts.snapStep)*this.opts.snapStep}_addLayoutGridCandidates(r,t,e,i,n){if(!this.opts.layoutGrids?.length)return;let s=i,o=n;for(let a of this.opts.layoutGrids){if(a.type==="columns"&&r==="vertical"){let{count:l,marginLeft:d=0,marginRight:c=0,gap:u=0}=a,g=s-d-c;if(g<=0||l<=0)continue;let v=(g-(l-1)*u)/l;this.candidates.push({position:d+t,type:"grid-column-edge"}),this.candidates.push({position:s-c+t,type:"grid-column-edge"});for(let h=0;h<l;h++){let m=d+h*(v+u),b=m+v,y=(m+b)/2;h>0&&this.candidates.push({position:m+t,type:"grid-column-edge"}),h<l-1&&this.candidates.push({position:b+t,type:"grid-column-edge"}),this.candidates.push({position:y+t,type:"grid-column-center"})}}if(a.type==="rows"&&r==="horizontal"){let{height:l,gap:d=0}=a,c=l+d;if(c<=0||l<=0)continue;let u=Math.max(0,e-200),g=e+o+200,v=Math.floor(u/c)*c;for(let h=v;h<g;h+=c)this.candidates.push({position:h,type:"grid-row-edge"}),d>0&&this.candidates.push({position:h+l,type:"grid-row-edge"})}}}_addGuideGapCandidates(r,t,e){let i=t.filter(n=>n.axis===r&&n.id!==e).slice().sort((n,s)=>n.position-s.position);if(!(i.length<2))for(let n=0;n<i.length;n++){let s=i[n],o=n>0?i[n-1]:null,a=n<i.length-1?i[n+1]:null;if(o){let l=s.position-o.position;l>0&&this.candidates.push({position:s.position+l,type:"guide-gap",gap:l,referenceLineIds:[o.id,s.id]})}if(a){let l=a.position-s.position;l>0&&this.candidates.push({position:s.position-l,type:"guide-gap",gap:l,referenceLineIds:[s.id,a.id]})}}}};var yi=class{constructor(){this.id="default";this.cornerLabel="\u2197"}formatPosition(r){return r}getFixedLines(){return[]}},Si=class{constructor(){this.id="center";this.cornerLabel="+"}formatPosition(r,t,e,i){let n=i+e/2;return r-n}getFixedLines(r,t,e,i){return[{axis:"horizontal",position:i+t/2},{axis:"vertical",position:e+r/2}]}},Gt={default:new yi,center:new Si},Jr=["default","center"];var xt=20,ms="#AAAAAA",un="#E3E3E3",pn="rgba(0,0,0,0.10)",vs='10px "JetBrains Mono", monospace',fs="rgba(255, 56, 96, 0.50)",bs="rgba(255, 56, 96, 0.22)",ys="rgba(255, 56, 96, 0.05)",Ss="rgba(255, 56, 96, 0.45)",xs='8px "JetBrains Mono", monospace',gn="rgba(0, 120, 255, 0.50)",Es="rgba(0, 120, 255, 0.22)",ws="rgba(0, 120, 255, 0.05)";function ti(p,r="x",t=window.innerWidth,e=window.innerHeight){let i=p.trim().match(/^(-?[\d.]+)\s*(px|rem|%|vw|vh)?$/);if(!i)return 0;let n=parseFloat(i[1]);switch(i[2]||"px"){case"px":return n;case"rem":return n*parseFloat(getComputedStyle(document.documentElement).fontSize);case"%":return r==="y"?n/100*e:n/100*t;case"vw":return n/100*t;case"vh":return n/100*e;default:return n}}var Ms={snapStep:0,snapToElements:!0,snapThreshold:8,snapSelector:"[string],[data-string]"},Ls="rgba(255, 0, 80, 0.08)",Cs="rgba(0, 120, 255, 0.06)",ei=class{constructor(r,t={},e,i){this.lineEls=new Map;this.fixedLineEls=new Map;this.currentMode=Gt.default;this.visible=!1;this.viewportWidth=window.innerWidth;this.viewportHeight=window.innerHeight;this.contentWidth=document.documentElement.scrollWidth;this.contentHeight=document.documentElement.scrollHeight;this.viewportOffsetX=0;this.viewportOffsetY=0;this.scrollX=0;this.scrollY=0;this.renderedScrollX=-1;this.renderedScrollY=-1;this.currentLines=[];this._snapHighlightEl=null;this._guideReferenceLineIds=null;this._guideReferenceAxis=null;this._guideReferenceGap=null;this.activeDrag=null;this.lineDrag=null;this.callbacks=r,this.options={...Ms,...t},this.host=e??null,this.viewportLayer=i??new Bt("rulers",10001),this.snapEngine=new Qr({threshold:this.options.snapThreshold,snapStep:this.options.snapStep,snapToElements:this.options.snapToElements,snapSelector:this.options.snapSelector,layoutGrids:this.options.layoutGrids}),this.gridCanvas=this.createCanvas("grid"),this.topCanvas=this.createCanvas("top"),this.leftCanvas=this.createCanvas("left"),this.linesLayer=this.createLinesLayer(),this.gapIndicatorEl=this.createGapIndicator(),this.gapIndicatorLabelEl=document.createElement("span"),this.gapIndicatorLabelEl.setAttribute("data-string-rulers-gap-indicator-label",""),this.gapIndicatorEl.appendChild(this.gapIndicatorLabelEl),this.cornerEl=document.createElement("div"),this.cornerEl.setAttribute("data-string-rulers-corner",""),this.cornerEl.setAttribute("data-mode",this.currentMode.id),this.cornerLabelEl=document.createElement("span"),this.cornerLabelEl.textContent=this.currentMode.cornerLabel,this.cornerEl.appendChild(this.cornerLabelEl),this.cornerEl.addEventListener("click",()=>this.callbacks.onModeToggle());let n=this.viewportLayer.getScreenElement(),s=this.viewportLayer.getWorldElement(e);s.appendChild(this.gridCanvas),s.appendChild(this.linesLayer),this.linesLayer.appendChild(this.gapIndicatorEl),n.appendChild(this.topCanvas),n.appendChild(this.leftCanvas),n.appendChild(this.cornerEl),document.body.setAttribute("data-string-rulers-hidden",""),this.resizeObserver=new ResizeObserver(()=>{this.visible&&this.redraw()}),this.resizeObserver.observe(document.documentElement),this.bindRulerDrag(this.topCanvas,"horizontal"),this.bindRulerDrag(this.leftCanvas,"vertical")}refresh(r){this.currentLines=r,this.redraw()}updateScroll(r,t,e,i,n,s){let o=this.viewportWidth!==e||this.viewportHeight!==i||this.contentWidth!==n||this.contentHeight!==s;if(this.scrollX=r,this.scrollY=t,this.viewportWidth=e,this.viewportHeight=i,this.contentWidth=n,this.contentHeight=s,this.syncScreenChromePosition(),!this.visible)return;let a=Math.round(r),l=Math.round(t);(o||a!==this.renderedScrollX||l!==this.renderedScrollY)&&(this.renderedScrollX=a,this.renderedScrollY=l,o&&this.syncWorldDimensions(),this.drawTopRuler(this.viewportWidth),this.drawLeftRuler(this.viewportHeight),o&&this.drawGrid(this.contentWidth,this.contentHeight)),this.updateLineLabels(),this._positionGuideReferenceIndicator(),(this.fixedLineEls.size>0||this.currentMode.id!=="default")&&this.syncFixedLines()}setVisible(r){this.visible=r,r?(document.body.removeAttribute("data-string-rulers-hidden"),this.redraw()):document.body.setAttribute("data-string-rulers-hidden","")}setMode(r){this.currentMode=r,this.cornerEl.setAttribute("data-mode",r.id),this.cornerLabelEl.textContent=r.cornerLabel,this.redraw()}destroy(){this._setSnapHighlight(null),this._setGuideReference(null,null,null),this.resizeObserver.disconnect(),this.gridCanvas.remove(),this.topCanvas.remove(),this.leftCanvas.remove(),this.cornerEl.remove(),this.linesLayer.remove(),document.body.removeAttribute("data-string-rulers-hidden"),this.lineEls.clear();for(let[,r]of this.fixedLineEls)r.remove();this.fixedLineEls.clear()}redraw(){this.renderedScrollX=Math.round(this.scrollX),this.renderedScrollY=Math.round(this.scrollY),this.syncScreenChromePosition(),this.syncWorldDimensions(),this.drawTopRuler(this.viewportWidth),this.drawLeftRuler(this.viewportHeight),this.drawGrid(this.contentWidth,this.contentHeight),this.syncLineEls(this.currentLines),this.syncFixedLines(),this._positionGuideReferenceIndicator()}updateLineLabels(){for(let r of this.currentLines){let t=this.lineEls.get(r.id);t&&this.updateLineLabel(r,t.labelEl)}}createCanvas(r){let t=document.createElement("canvas");return t.setAttribute(`data-string-rulers-${r}`,""),t}createLinesLayer(){let r=document.createElement("div");return r.setAttribute("data-string-rulers-lines",""),r}createGapIndicator(){let r=document.createElement("div");return r.setAttribute("data-string-rulers-gap-indicator",""),r.setAttribute("hidden",""),r}syncWorldDimensions(){this.linesLayer.style.width=`${this.contentWidth}px`,this.linesLayer.style.height=`${this.contentHeight}px`,this.gridCanvas.style.width=`${this.contentWidth}px`,this.gridCanvas.style.height=`${this.contentHeight}px`}drawGrid(r,t){let e=this.options.layoutGrids,i=this.gridCanvas;if((i.width!==r||i.height!==t)&&(i.width=r,i.height=t,i.style.width=`${r}px`,i.style.height=`${t}px`),!e?.length)return;let n=i.getContext("2d");n.clearRect(0,0,r,t);for(let s of e)s.type==="columns"&&this._drawColumnsGrid(n,this.viewportWidth,t,s),s.type==="rows"&&this._drawRowsGrid(n,this.viewportWidth,t,s)}_drawColumnsGrid(r,t,e,i){let{count:n,marginLeft:s=0,marginRight:o=0,gap:a=0}=i,l=t-s-o;if(l<=0||n<=0)return;let d=(l-(n-1)*a)/n;r.fillStyle=i.color??Ls;for(let c=0;c<n;c++){let u=s+c*(d+a);r.fillRect(u,0,d,e)}}_drawRowsGrid(r,t,e,i){let{height:n,gap:s=0}=i,o=n+s;if(!(o<=0||n<=0)){r.fillStyle=i.color??Cs;for(let a=0;a<e;a+=o)r.fillRect(0,a,t,n)}}drawTopRuler(r){let t=xt,e=this.topCanvas;(e.width!==r||e.height!==t)&&(e.width=r,e.height=t);let i=e.getContext("2d");i.clearRect(0,0,r,t),i.fillStyle=un,i.fillRect(0,0,r,t),i.fillStyle=pn,i.fillRect(0,t-1,r,1),this._drawColumnMarkers(i,r,t),this.drawTicks(i,r,t,"top",this.scrollX)}drawLeftRuler(r){let t=xt,e=this.leftCanvas;(e.width!==t||e.height!==r)&&(e.width=t,e.height=r);let i=e.getContext("2d");i.clearRect(0,0,t,r),i.fillStyle=un,i.fillRect(0,0,t,r),i.fillStyle=pn,i.fillRect(t-1,0,1,r),this._drawRowMarkers(i,t,r),this.drawTicks(i,r,t,"left",this.scrollY)}drawTicks(r,t,e,i,n){let{tick:s,label:o}=this.pickStep(t),a=i==="top"?"vertical":"horizontal",l=i==="top",d=Math.round(e/2),c=Math.round(e*.55),u=Math.round(e*.3);r.fillStyle=ms,r.font=vs;let g=Math.ceil(n/s)*s,v=g-n;if(l){r.textAlign="center",r.textBaseline="top";for(let h=0;v+h*s<=t;h++){let m=Math.round(v+h*s),b=g+h*s,y=this.currentMode.formatPosition(b,a,t,n),f=Math.round(y)%o===0,S=f?c:u;r.fillRect(m,e-S,1,S),f&&m>4&&r.fillText(String(Math.round(y)),m,2)}}else{r.textAlign="center",r.textBaseline="middle";for(let h=0;v+h*s<=t;h++){let m=Math.round(v+h*s),b=g+h*s,y=this.currentMode.formatPosition(b,a,t,n),f=Math.round(y)%o===0,S=f?c:u;r.fillRect(e-S,m,S,1),f&&m>4&&(r.save(),r.translate(d,m),r.rotate(-Math.PI/2),r.fillText(String(Math.round(y)),0,0),r.restore())}}}pickStep(r){return r<300?{tick:5,label:25}:r<800?{tick:10,label:50}:r<1800?{tick:25,label:100}:{tick:50,label:500}}_resolveColumnLayout(){let r=this.options.columnLayout;if(!r||r.columns<=0)return null;let t=ti(r.margin,"x",this.viewportWidth,this.viewportHeight),e=ti(r.gap,"x",this.viewportWidth,this.viewportHeight),n=this.viewportWidth-2*t;if(n<=0)return null;let s=(n-(r.columns-1)*e)/r.columns;return s<=0?null:{columns:r.columns,marginPx:t,gapPx:e,colWidth:s}}_drawColumnMarkers(r,t,e){let i=this._resolveColumnLayout();if(!i)return;let{columns:n,marginPx:s,gapPx:o,colWidth:a}=i;r.fillStyle=ys;for(let l=0;l<n;l++){let d=s+l*(a+o);r.fillRect(d,0,a,e)}r.fillStyle=fs;for(let l=0;l<n;l++){let d=s+l*(a+o),c=d+a;r.fillRect(Math.round(d),0,1,e),r.fillRect(Math.round(c),0,1,e)}r.fillStyle=bs;for(let l=0;l<n;l++){let c=s+l*(a+o)+a/2;r.fillRect(Math.round(c),Math.round(e*.6),1,Math.round(e*.4))}if(a>16){r.fillStyle=Ss,r.font=xs,r.textAlign="center",r.textBaseline="middle";for(let l=0;l<n;l++){let c=s+l*(a+o)+a/2;r.fillText(String(l+1),Math.round(c),Math.round(e/2))}}}_buildColumnCandidates(r){if(r!=="vertical")return[];let t=this._resolveColumnLayout();if(!t)return[];let{columns:e,marginPx:i,gapPx:n,colWidth:s}=t,o=[];for(let a=0;a<e;a++){let l=i+a*(s+n),d=l+s,c=(l+d)/2,u=a+1;o.push({position:l+this.scrollX,type:"grid-column-edge",label:`c${u}`}),o.push({position:d+this.scrollX,type:"grid-column-edge",label:`c${u}\u25C2`}),o.push({position:c+this.scrollX,type:"grid-column-center",label:`c${u}\u2299`})}return o}_resolveRowLayout(){let r=this.options.rowLayout;if(!r)return null;let t=ti(r.size,"y",this.viewportWidth,this.viewportHeight),e=ti(r.gap,"y",this.viewportWidth,this.viewportHeight);return t<=0?null:{sizePx:t,gapPx:e,period:t+e}}_drawRowMarkers(r,t,e){let i=this._resolveRowLayout();if(!i)return;let{sizePx:n,gapPx:s,period:o}=i,a=Math.floor(this.scrollY/o)*o,l=this.scrollY+e+o;for(let d=a;d<l;d+=o){let c=Math.round(d-this.scrollY),u=Math.round(d+n-this.scrollY),g=Math.max(0,c),v=Math.min(e,u);if(v>g&&(r.fillStyle=ws,r.fillRect(0,g,t,v-g)),c>=0&&c<=e&&(r.fillStyle=gn,r.fillRect(0,c,t,1)),s>0&&u>=0&&u<=e&&(r.fillStyle=gn,r.fillRect(0,u,t,1)),n>4){let h=Math.round(d+n/2-this.scrollY);h>=0&&h<=e&&(r.fillStyle=Es,r.fillRect(0,h,Math.round(t*.45),1))}}}_buildRowCandidates(r){if(r!=="horizontal")return[];let t=this._resolveRowLayout();if(!t)return[];let{sizePx:e,gapPx:i,period:n}=t,s=this.viewportHeight,o=Math.max(0,this.scrollY-200),a=this.scrollY+s+200,l=Math.floor(o/n)*n,d=[];for(let c=l;c<a;c+=n){let u=Math.round(c/n)+1;d.push({position:c,type:"grid-row-edge",label:`r${u}`}),d.push({position:c+e/2,type:"grid-row-edge",label:`r${u}\u2299`}),i>0&&d.push({position:c+e,type:"grid-row-edge",label:`r${u}\u25C2`})}return d}syncFixedLines(){let r=this.currentMode.getFixedLines(this.viewportWidth,this.viewportHeight,this.scrollX,this.scrollY),t=new Set;for(let e of r){let i=`fixed-${e.axis}`;t.add(i);let n=this.fixedLineEls.get(i);n||(n=document.createElement("div"),n.setAttribute("data-string-rulers-fixed-line",""),n.setAttribute("data-axis",e.axis),this.linesLayer.appendChild(n),this.fixedLineEls.set(i,n)),e.axis==="horizontal"?(n.style.top=`${e.position}px`,n.style.left="0",n.style.width=`${this.contentWidth}px`):(n.style.left=`${e.position}px`,n.style.top="0",n.style.height=`${this.contentHeight}px`)}for(let[e,i]of this.fixedLineEls)t.has(e)||(i.remove(),this.fixedLineEls.delete(e))}syncLineEls(r){for(let[t]of this.lineEls)r.some(e=>e.id===t)||(this.lineEls.get(t).el.remove(),this.lineEls.delete(t));for(let t of r)this.lineEls.has(t.id)||this.createLineEl(t),this.positionLineEl(t)}createLineEl(r){let t=document.createElement("div");t.setAttribute("data-string-rulers-line",r.id),t.setAttribute("data-axis",r.axis);let e=document.createElement("span");e.setAttribute("data-string-rulers-label",""),t.appendChild(e),this.linesLayer.appendChild(t),this.lineEls.set(r.id,{el:t,labelEl:e}),t.addEventListener("pointerdown",i=>{if(i.stopPropagation(),i.button===1){i.preventDefault(),this.callbacks.onLineRemoved(r.id);return}this.startLineDrag(i,r)})}positionLineEl(r){let t=this.lineEls.get(r.id);if(!t)return;let{el:e,labelEl:i}=t;r.axis==="horizontal"?(e.style.top=`${r.position}px`,e.style.left="0",e.style.width=`${this.contentWidth}px`):(e.style.left=`${r.position}px`,e.style.top="0",e.style.height=`${this.contentHeight}px`),this.updateLineLabel(r,i)}updateLineLabel(r,t){let e=r.axis==="horizontal"?this.viewportHeight:this.viewportWidth,i=r.axis==="horizontal"?this.scrollY:this.scrollX,n=this.currentMode.formatPosition(r.position,r.axis,e,i),s=String(Math.round(n));t.textContent=r.targetLabel?`${s} ${r.targetLabel}`:s}_setGuideReference(r,t,e){if(this._guideReferenceLineIds)for(let i of this._guideReferenceLineIds)this.lineEls.get(i)?.el.removeAttribute("data-string-rulers-guide-ref");if(this._guideReferenceAxis=r,this._guideReferenceLineIds=t,this._guideReferenceGap=e,t)for(let i of t)this.lineEls.get(i)?.el.setAttribute("data-string-rulers-guide-ref","");this._positionGuideReferenceIndicator()}_positionGuideReferenceIndicator(){let r=this._guideReferenceLineIds,t=this._guideReferenceAxis,e=this._guideReferenceGap;if(!r||!t||e==null){this.gapIndicatorEl.setAttribute("hidden",""),this.gapIndicatorEl.removeAttribute("data-axis");return}let i=r.map(o=>this.currentLines.find(a=>a.id===o)).filter(o=>!!o);if(i.length!==2){this.gapIndicatorEl.setAttribute("hidden",""),this.gapIndicatorEl.removeAttribute("data-axis");return}let n=Math.min(i[0].position,i[1].position),s=Math.max(i[0].position,i[1].position);if(this.gapIndicatorEl.removeAttribute("hidden"),this.gapIndicatorEl.setAttribute("data-axis",t),this.gapIndicatorLabelEl.textContent=`${Math.round(e)}px`,t==="vertical"){let o=Math.round(this.scrollY+Math.max(xt+32,this.viewportHeight/2));this.gapIndicatorEl.style.left=`${n}px`,this.gapIndicatorEl.style.top=`${o}px`,this.gapIndicatorEl.style.width=`${Math.max(0,s-n)}px`,this.gapIndicatorEl.style.height="0"}else{let o=Math.round(this.scrollX+Math.max(xt+32,this.viewportWidth/2));this.gapIndicatorEl.style.left=`${o}px`,this.gapIndicatorEl.style.top=`${n}px`,this.gapIndicatorEl.style.width="0",this.gapIndicatorEl.style.height=`${Math.max(0,s-n)}px`}}_setSnapHighlight(r){this._snapHighlightEl!==r&&(this._snapHighlightEl?.removeAttribute("data-string-rulers-snap-target"),this._snapHighlightEl=r,r?.setAttribute("data-string-rulers-snap-target",""))}_snapCategory(r){return r==="guide-gap"?"guide":r==="grid-column-edge"||r==="grid-column-center"?"column":r==="grid-step"||r.startsWith("grid-")?"grid":"element"}_snapLabel(r,t,e){let i=r.position??t,n=this.getViewportSizeForAxis(e),s=e==="horizontal"?this.scrollY:this.scrollX,o=String(Math.round(this.currentMode.formatPosition(i,e,n,s)));return r.type==="guide-gap"&&typeof r.gap=="number"?`${o} ${Math.round(r.gap)}px`:r.label?`${o} ${r.label}`:r.el?`${o} ${this._elementLabel(r.el)}`:o}_elementLabel(r){if(r.id)return`#${r.id}`;let t=r.classList[0];if(t)return`.${t}`;let e=r.getAttribute("string")??r.getAttribute("data-string");return e?`[${e}]`:r.tagName.toLowerCase()}_elementSelector(r){if(r.id)return`#${CSS.escape(r.id)}`;let t=r.getAttribute("string");if(t)return`[string="${CSS.escape(t)}"]`;let e=r.getAttribute("data-string");return e?`[data-string="${CSS.escape(e)}"]`:r.classList[0]?`.${CSS.escape(r.classList[0])}`:null}_resolveBinding(r){if(!r)return{};if(r.el){let t;switch(r.type){case"element-top":t="top";break;case"element-bottom":t="bottom";break;case"element-center-y":t="center-y";break;case"element-left":t="left";break;case"element-right":t="right";break;case"element-center-x":t="center-x";break}return{targetLabel:this._elementLabel(r.el),targetSelector:this._elementSelector(r.el)??void 0,targetEdge:t}}if((r.type==="grid-column-edge"||r.type==="grid-column-center")&&r.label){let t=r.label.match(/^c(\d+)(◂|⊙)?$/);if(t){let e=parseInt(t[1],10)-1,i=t[2]==="\u25C2"?"col-right":t[2]==="\u2299"?"col-center":"col-left";return{targetLabel:r.label,targetSelector:`__col:${e}`,targetEdge:i}}}return r.label?{targetLabel:r.label}:{}}recalculateBindings(r){for(let t of r){if(!t.targetSelector||!t.targetEdge)continue;if(t.targetSelector.startsWith("__col:")){let n=parseInt(t.targetSelector.slice(6),10),s=this._resolveColumnLayout();if(!s||n<0||n>=s.columns)continue;let o=s.marginPx+n*(s.colWidth+s.gapPx),a=o+s.colWidth;switch(t.targetEdge){case"col-left":t.position=o+this.scrollX;break;case"col-right":t.position=a+this.scrollX;break;case"col-center":t.position=(o+a)/2+this.scrollX;break}continue}let e=document.querySelector(t.targetSelector);if(!e)continue;let i=e.getBoundingClientRect();switch(t.targetEdge){case"top":t.position=i.top+this.scrollY;break;case"bottom":t.position=i.bottom+this.scrollY;break;case"center-y":t.position=(i.top+i.bottom)/2+this.scrollY;break;case"left":t.position=i.left+this.scrollX;break;case"right":t.position=i.right+this.scrollX;break;case"center-x":t.position=(i.left+i.right)/2+this.scrollX;break}}}bindRulerDrag(r,t){r.addEventListener("pointerdown",e=>{e.preventDefault(),this.startRulerDrag(e,t)})}startRulerDrag(r,t){let e=document.createElement("div");e.setAttribute("data-string-rulers-ghost",""),e.setAttribute("data-axis",t);let i=document.createElement("span");i.setAttribute("data-string-rulers-ghost-label",""),e.appendChild(i),this.linesLayer.appendChild(e),this.snapEngine.buildCandidates(t,this.scrollX,this.scrollY,this.viewportWidth,this.viewportHeight,this.currentLines,void 0,[...this._buildColumnCandidates(t),...this._buildRowCandidates(t)]);let n=o=>{let a=this.resolveDocPositionFromPointer(t,o),l=o.shiftKey?null:this.snapEngine.findSnap(a),d=l?l.position:o.shiftKey?a:this.snapEngine.snapToStep(a);if(t==="horizontal"?(e.style.top=`${d}px`,e.style.left="0",e.style.width=`${this.contentWidth}px`):(e.style.left=`${d}px`,e.style.top="0",e.style.height=`${this.contentHeight}px`),l)e.setAttribute("data-snapping",this._snapCategory(l.type)),this._setSnapHighlight(l.el??null),this._setGuideReference(l.type==="guide-gap"?t:null,l.type==="guide-gap"?l.referenceLineIds??null:null,l.type==="guide-gap"?l.gap??null:null),i.textContent=this._snapLabel(l,d,t);else{e.removeAttribute("data-snapping"),this._setSnapHighlight(null),this._setGuideReference(null,null,null);let c=this.getViewportSizeForAxis(t),u=t==="horizontal"?this.scrollY:this.scrollX;i.textContent=String(Math.round(this.currentMode.formatPosition(d,t,c,u)))}},s=o=>{document.removeEventListener("pointermove",n),document.removeEventListener("pointerup",s),e.remove(),this._setSnapHighlight(null),this._setGuideReference(null,null,null);let a=this.resolveViewportPointerPos(t,o);if(a>xt){let l=t==="horizontal"?a+this.scrollY:a+this.scrollX,d=o.shiftKey?null:this.snapEngine.findSnap(l),c=d?d.position:o.shiftKey?l:this.snapEngine.snapToStep(l),u=this._resolveBinding(d);this.callbacks.onLineCreated(t,c,u.targetLabel,u.targetSelector,u.targetEdge)}};document.addEventListener("pointermove",n),document.addEventListener("pointerup",s),this.activeDrag={axis:t,lineId:null,ghostEl:e,startX:r.clientX,startY:r.clientY,onPointerMoveBind:n,onPointerUpBind:s}}startLineDrag(r,t){let{el:e}=this.lineEls.get(t.id);e.setPointerCapture(r.pointerId);let i=t.axis==="horizontal"?r.clientY:r.clientX,n=t.position;this.snapEngine.buildCandidates(t.axis,this.scrollX,this.scrollY,this.viewportWidth,this.viewportHeight,this.currentLines,t.id,[...this._buildColumnCandidates(t.axis),...this._buildRowCandidates(t.axis)]);let s=a=>{let l=t.axis==="horizontal"?a.clientY-i:a.clientX-i,d=Math.max(0,n+l),c=a.shiftKey?null:this.snapEngine.findSnap(d),u=c?c.position:a.shiftKey?d:this.snapEngine.snapToStep(d);c?(e.setAttribute("data-snapping",this._snapCategory(c.type)),this._setSnapHighlight(c.el??null),this._setGuideReference(c.type==="guide-gap"?t.axis:null,c.type==="guide-gap"?c.referenceLineIds??null:null,c.type==="guide-gap"?c.gap??null:null)):(e.removeAttribute("data-snapping"),this._setSnapHighlight(null),this._setGuideReference(null,null,null)),this.callbacks.onLineMoved(t.id,u,c?.el?this._elementLabel(c.el):c?.label);let g=this.lineEls.get(t.id);if(g)if(c)g.labelEl.textContent=this._snapLabel(c,u,t.axis);else{let v=this.getViewportSizeForAxis(t.axis),h=t.axis==="horizontal"?this.scrollY:this.scrollX;g.labelEl.textContent=String(Math.round(this.currentMode.formatPosition(u,t.axis,v,h)))}},o=a=>{document.removeEventListener("pointermove",s),document.removeEventListener("pointerup",o),e.removeAttribute("data-snapping"),this._setSnapHighlight(null),this._setGuideReference(null,null,null);let l=t.axis==="horizontal"?a.clientY-i:a.clientX-i,d=Math.max(0,n+l),c=a.shiftKey?null:this.snapEngine.findSnap(d),u=c?c.position:a.shiftKey?d:this.snapEngine.snapToStep(d);if((t.axis==="horizontal"?u-this.scrollY:u-this.scrollX)<=xt)this.callbacks.onLineRemoved(t.id);else{let v=this._resolveBinding(c);this.callbacks.onDragCommit(t.id,u,v.targetLabel,v.targetSelector,v.targetEdge)}};document.addEventListener("pointermove",s),document.addEventListener("pointerup",o),this.lineDrag={lineId:t.id,axis:t.axis,el:e,startPointer:i,startPosition:n,onPointerMoveBind:s,onPointerUpBind:o}}syncScreenChromePosition(){let r=this.host;if(!r||r===document.body||r===document.documentElement)this.viewportOffsetX=0,this.viewportOffsetY=0;else{let t=r.getBoundingClientRect();this.viewportOffsetX=Math.round(t.left),this.viewportOffsetY=Math.round(t.top)}this.topCanvas.style.left=`${this.viewportOffsetX}px`,this.topCanvas.style.top=`${this.viewportOffsetY}px`,this.topCanvas.style.width=`${this.viewportWidth}px`,this.topCanvas.style.height=`${xt}px`,this.leftCanvas.style.left=`${this.viewportOffsetX}px`,this.leftCanvas.style.top=`${this.viewportOffsetY}px`,this.leftCanvas.style.width=`${xt}px`,this.leftCanvas.style.height=`${this.viewportHeight}px`,this.cornerEl.style.left=`${this.viewportOffsetX}px`,this.cornerEl.style.top=`${this.viewportOffsetY}px`}getViewportSizeForAxis(r){return r==="horizontal"?this.viewportHeight:this.viewportWidth}resolveViewportPointerPos(r,t){let e=r==="horizontal"?t.clientY:t.clientX,i=r==="horizontal"?this.viewportOffsetY:this.viewportOffsetX;return e-i}resolveDocPositionFromPointer(r,t){let e=this.resolveViewportPointerPos(r,t);return r==="horizontal"?e+this.scrollY:e+this.scrollX}};var ri="__string-rulers-global__",Ts=[{type:"keyboard",key:"R",shiftKey:!0}],ge=class extends Q{constructor(t){super(t);this.manager=new Zr;this.overlay=null;this.visible=!1;this.dockDisabled=!1;this.currentModeId="default";this._kbHandlers=[];this._elHandlers=[];this._evHandlers=[];this.htmlKey="rulers",this.attributesToMap=[],this.viewportLayer=this.acquireViewportLayer("devtools-rulers",10001)}onInit(){this.applyStyleSettings(),this.mountOverlay()}onSettingsChange(){this.applyStyleSettings()}onSubscribe(){let t=this.settings.triggers,e=Array.isArray(t)?t:Ts;this._bindTriggers(e)}onUnsubscribe(){this._unbindTriggers()}onFrame(t){if(!this.visible||!this.overlay)return;let e=t.scroll.elementContainer,i=t.scroll.direction==="horizontal"?0:e.scrollTop,n=t.scroll.direction==="horizontal"?e.scrollLeft:0;this.overlay.updateScroll(n,i,t.viewport.windowWidth,t.viewport.windowHeight,t.viewport.contentWidth,t.viewport.contentHeight)}onResize(){if(!this.overlay)return;this.syncOverlayMetrics();let t=this.manager.getLines(ri,this.currentModeId);this.overlay.recalculateBindings(t),this.manager.save(ri,this.currentModeId),this.overlay.refresh(t)}destroy(){this._unbindTriggers(),this.overlay?.destroy(),this.overlay=null,this.manager.clearAll(),this.clearStyleSettings(),super.destroy()}toggle(){this.setVisible(!this.visible)}show(){this.setVisible(!0)}hide(){this.setVisible(!1)}isVisible(){return this.visible}getDevtoolActiveState(){return this.visible}setDevtoolActiveState(t){this.setDockActive(t)}_bindTriggers(t){for(let e of t)if(e.type==="keyboard"){let i=n=>{n.key===e.key&&n.shiftKey===(e.shiftKey??!1)&&n.ctrlKey===(e.ctrlKey??!1)&&n.altKey===(e.altKey??!1)&&n.metaKey===(e.metaKey??!1)&&(n.preventDefault(),this._applyAction(e.action))};window.addEventListener("keydown",i),this._kbHandlers.push(i)}else if(e.type==="element"){let i=e.event??"click";document.querySelectorAll(e.selector).forEach(n=>{let s=()=>this._applyAction(e.action);n.addEventListener(i,s),this._elHandlers.push({el:n,event:i,fn:s})})}else if(e.type==="event"){let i=()=>this._applyAction(e.action);this.events.on(e.name,i),this._evHandlers.push({name:e.name,fn:i})}}_unbindTriggers(){for(let t of this._kbHandlers)window.removeEventListener("keydown",t);this._kbHandlers=[];for(let{el:t,event:e,fn:i}of this._elHandlers)t.removeEventListener(e,i);this._elHandlers=[];for(let{name:t,fn:e}of this._evHandlers)this.events.off(t,e);this._evHandlers=[]}_applyAction(t="toggle"){this.dockDisabled||(t==="show"?this.show():t==="hide"?this.hide():this.toggle())}setVisible(t){t&&this.dockDisabled||this.visible!==t&&(this.visible=t,this.overlay?.setVisible(t),Xr(),this.emitDevtoolState())}setDockActive(t){if(this.dockDisabled=!t,t){this.setVisible(!0);return}this.setVisible(!1)}mountOverlay(){if(this.overlay)return;let t=ri;try{let m=localStorage.getItem("string-rulers:mode");m&&Gt[m]&&(this.currentModeId=m)}catch{}this.manager.load(t,this.currentModeId);let e=this.settings,i=typeof e["rulers-snap"]=="number"?e["rulers-snap"]:0,n=typeof e["rulers-snap-elements"]=="boolean"?e["rulers-snap-elements"]:!0,s=typeof e["rulers-snap-threshold"]=="number"?e["rulers-snap-threshold"]:8,o=typeof e["rulers-snap-selector"]=="string"?e["rulers-snap-selector"]:"[string],[data-string]",a=this._resolveGrids(e.grid),l=typeof e["rulers-columns"]=="number"?e["rulers-columns"]:0,d=typeof e["rulers-margin"]=="string"?e["rulers-margin"]:"0px",c=typeof e["rulers-gap"]=="string"?e["rulers-gap"]:"0px",u=l>0?{columns:l,margin:d,gap:c}:void 0,g=typeof e["rulers-rows"]=="string"?e["rulers-rows"]:"",v=typeof e["rulers-rows-gap"]=="string"?e["rulers-rows-gap"]:"0px",h=g?{size:g,gap:v}:void 0;this.overlay=new ei({onLineCreated:(m,b,y,f,S)=>{this.manager.addLine(t,m,b,y,this.currentModeId,f,S),this.overlay.refresh(this.manager.getLines(t,this.currentModeId))},onLineMoved:(m,b,y)=>{this.manager.moveLine(t,m,b,y,this.currentModeId),this.overlay.refresh(this.manager.getLines(t,this.currentModeId))},onLineRemoved:m=>{this.manager.removeLine(t,m,this.currentModeId),this.overlay.refresh(this.manager.getLines(t,this.currentModeId))},onDragCommit:(m,b,y,f,S)=>{this.manager.moveLine(t,m,b,y,this.currentModeId);let x=this.manager.findLine(t,m,this.currentModeId);x&&(x.targetSelector=f,x.targetEdge=S),this.manager.save(t,this.currentModeId),this.overlay.refresh(this.manager.getLines(t,this.currentModeId))},onModeToggle:()=>this.cycleMode()},{snapStep:i,snapToElements:n,snapThreshold:s,snapSelector:o,layoutGrids:a,columnLayout:u,rowLayout:h},this.data.scroll.container,this.viewportLayer),this.syncOverlayMetrics(),this.overlay.setMode(Gt[this.currentModeId]),this.overlay.setVisible(this.visible),this.overlay.refresh(this.manager.getLines(t,this.currentModeId))}cycleMode(){let e=(Jr.indexOf(this.currentModeId)+1)%Jr.length;this.switchMode(Jr[e])}switchMode(t){let e=ri;this.manager.save(e,this.currentModeId),this.currentModeId=t,this.manager.load(e,t),this.overlay?.setMode(Gt[t]),this.overlay?.refresh(this.manager.getLines(e,t));try{localStorage.setItem("string-rulers:mode",t)}catch{}}applyStyleSettings(){let t=this.settings,e=typeof t["rulers-color"]=="string"?t["rulers-color"]:"rgba(0, 120, 255, 0.75)",i=typeof t["rulers-opacity"]=="number"?t["rulers-opacity"]:1,n=Math.max(0,Math.min(1,i));document.documentElement.style.setProperty("--string-rulers-line-color",e),document.documentElement.style.setProperty("--string-rulers-line-opacity",String(n))}clearStyleSettings(){document.documentElement.style.removeProperty("--string-rulers-line-color"),document.documentElement.style.removeProperty("--string-rulers-line-opacity")}_resolveGrids(t){if(t){if(Array.isArray(t))return t;if(typeof t=="object")return[t]}}syncOverlayMetrics(){if(!this.overlay)return;let t=this.data.scroll.elementContainer,e=this.data.scroll.direction==="horizontal"?0:t.scrollTop,i=this.data.scroll.direction==="horizontal"?t.scrollLeft:0;this.overlay.updateScroll(i,e,this.data.viewport.windowWidth,this.data.viewport.windowHeight,this.data.viewport.contentWidth,this.data.viewport.contentHeight)}};ge.devtool={id:"rulers",label:"Rulers",icon:"rulers",order:10,styles:dn};var hn=`
|
|
2757
|
+
[data-string-offsets-item] {
|
|
2758
|
+
position: absolute;
|
|
2759
|
+
top: 0;
|
|
2760
|
+
left: 0;
|
|
2761
|
+
overflow: visible;
|
|
2762
|
+
pointer-events: none;
|
|
2763
|
+
}
|
|
2764
|
+
|
|
2765
|
+
[data-string-offsets-item][data-visible="false"] {
|
|
2766
|
+
display: none;
|
|
2767
|
+
}
|
|
2768
|
+
|
|
2769
|
+
[data-string-offsets-box],
|
|
2770
|
+
[data-string-offsets-zone],
|
|
2771
|
+
[data-string-offsets-marker] {
|
|
2772
|
+
top: 0;
|
|
2773
|
+
left: 0;
|
|
2774
|
+
box-sizing: border-box;
|
|
2775
|
+
will-change: transform;
|
|
2776
|
+
}
|
|
2777
|
+
|
|
2778
|
+
[data-string-offsets-box],
|
|
2779
|
+
[data-string-offsets-zone] {
|
|
2780
|
+
position: absolute;
|
|
2781
|
+
pointer-events: none;
|
|
2782
|
+
}
|
|
2783
|
+
|
|
2784
|
+
[data-string-offsets-marker] {
|
|
2785
|
+
position: absolute;
|
|
2786
|
+
pointer-events: none;
|
|
2787
|
+
}
|
|
2788
|
+
|
|
2789
|
+
[data-string-offsets-marker][data-visible="false"] {
|
|
2790
|
+
display: none;
|
|
2791
|
+
}
|
|
2792
|
+
|
|
2793
|
+
[data-string-offsets-marker][hidden] {
|
|
2794
|
+
display: none !important;
|
|
2795
|
+
}
|
|
2796
|
+
|
|
2797
|
+
[data-string-offsets-box] {
|
|
2798
|
+
background: transparent;
|
|
2799
|
+
border: 1px dashed rgba(113, 113, 113, 1);
|
|
2800
|
+
}
|
|
2801
|
+
|
|
2802
|
+
[data-string-offsets-item][data-inview="true"] [data-string-offsets-box] {
|
|
2803
|
+
border-color: rgba(17, 17, 17, 0.38);
|
|
2804
|
+
}
|
|
2805
|
+
|
|
2806
|
+
[data-string-offsets-zone] {
|
|
2807
|
+
border: 1px dashed rgba(17, 17, 17, 0.14);
|
|
2808
|
+
background-color: rgb(255 255 255 / 30%);
|
|
2809
|
+
background-image: repeating-linear-gradient(135deg, rgb(17 17 17 / 26%) 0px, rgba(17, 17, 17, 0.035) 2px, rgba(255, 255, 255, 0) 2px, rgba(255, 255, 255, 0) 8px);
|
|
2810
|
+
}
|
|
2811
|
+
|
|
2812
|
+
[data-string-offsets-zone][data-edge="top"],
|
|
2813
|
+
[data-string-offsets-zone][data-edge="bottom"] {
|
|
2814
|
+
border-color: rgba(17, 17, 17, 0.16);
|
|
2815
|
+
}
|
|
2816
|
+
|
|
2817
|
+
[data-string-offsets-zone][data-empty="true"] {
|
|
2818
|
+
opacity: 0.7;
|
|
2819
|
+
}
|
|
2820
|
+
|
|
2821
|
+
[data-string-offsets-marker] {
|
|
2822
|
+
padding: 4px 6px 4px 4px;
|
|
2823
|
+
border-radius: 8px;
|
|
2824
|
+
display: flex;
|
|
2825
|
+
align-items: center;
|
|
2826
|
+
justify-content: center;
|
|
2827
|
+
gap: 1px;
|
|
2828
|
+
white-space: nowrap;
|
|
2829
|
+
color: #111111;
|
|
2830
|
+
background-color: rgba(255, 255, 255, 1);
|
|
2831
|
+
opacity: 1;
|
|
2832
|
+
}
|
|
2833
|
+
|
|
2834
|
+
[data-string-offsets-marker] svg {
|
|
2835
|
+
width: 10px;
|
|
2836
|
+
height: 10px;
|
|
2837
|
+
display: block;
|
|
2838
|
+
flex: 0 0 auto;
|
|
2839
|
+
}
|
|
2840
|
+
|
|
2841
|
+
[data-string-offsets-marker-value] {
|
|
2842
|
+
display: block;
|
|
2843
|
+
font-size: 10px;
|
|
2844
|
+
line-height: 1;
|
|
2845
|
+
font-weight: 500;
|
|
2846
|
+
}
|
|
2847
|
+
|
|
2848
|
+
[data-string-offsets-marker][data-empty="true"] {
|
|
2849
|
+
opacity: 0.56;
|
|
2850
|
+
}
|
|
2851
|
+
`;var Ps=`
|
|
2852
|
+
<svg viewBox="0 0 16 16" aria-hidden="true">
|
|
2853
|
+
<path d="M8 2v9" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" />
|
|
2854
|
+
<path d="M4.5 8.5L8 12l3.5-3.5" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" />
|
|
2855
|
+
</svg>`,Os=`
|
|
2856
|
+
<svg viewBox="0 0 16 16" aria-hidden="true">
|
|
2857
|
+
<path d="M8 14V5" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" />
|
|
2858
|
+
<path d="M4.5 7.5L8 4l3.5 3.5" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" />
|
|
2859
|
+
</svg>`;function mn(p){let r=Math.round(p*10)/10;return Object.is(r,-0)?"0":Number.isInteger(r)?`${r>0?"+":""}${r}`:`${r>0?"+":""}${r}`}function $t(p,r){return`translate3d(${Math.round(p*100)/100}px, ${Math.round(r*100)/100}px, 0)`}var As=72,ii=28;function ks(p){let r=0,t=p.parentElement;for(;t;)(t.hasAttribute("string-id")||t.hasAttribute("data-string-id"))&&(r+=1),t=t.parentElement;return r}var he=class extends St{constructor(){super(...arguments);this.entryEnabled=new Map}canConnect(t){return!0}createOverlayEntry(t){this.entryEnabled.set(t.id,!0);let e=this.resolveOverlayTargetId(t),i=document.createElement("div");i.setAttribute("data-string-offsets-item",""),i.setAttribute("data-target-id",e),i.style.position="absolute",i.style.top="0",i.style.left="0",i.style.overflow="visible",i.style.pointerEvents="none";let n=document.createElement("div");n.setAttribute("data-string-offsets-box","");let s=document.createElement("div");s.setAttribute("data-string-offsets-zone",""),s.setAttribute("data-edge","top");let o=document.createElement("div");o.setAttribute("data-string-offsets-zone",""),o.setAttribute("data-edge","bottom");let a=document.createElement("div");a.setAttribute("data-string-offsets-marker",""),a.setAttribute("data-edge","top"),a.setAttribute("data-target-id",e),a.innerHTML=Ps;let l=document.createElement("span");l.setAttribute("data-string-offsets-marker-value",""),a.appendChild(l);let d=document.createElement("div");d.setAttribute("data-string-offsets-marker",""),d.setAttribute("data-edge","bottom"),d.setAttribute("data-target-id",e),d.innerHTML=Os;let c=document.createElement("span");c.setAttribute("data-string-offsets-marker-value",""),d.appendChild(c);let u=this.createOverlayBadge({targetId:e,selectorAttribute:"data-string-offsets-badge",depth:this.resolveOverlayObjectDepth(t.htmlElement)});this.applyOverlayBadgeState(u,{html:mr,title:this.enabled?"Hide offsets":"Show offsets"});let g=h=>{h.stopPropagation(),h.preventDefault(),this.setEntryEnabled(t.id,!this.isEntryEnabled(t.id))};u.addEventListener("click",g),i.appendChild(s),i.appendChild(o),i.appendChild(n);let v=this.viewportLayer.getWorldElement(this.getWorldHost());return v.appendChild(i),v.appendChild(a),v.appendChild(d),v.appendChild(u),{object:t,root:i,box:n,topZone:s,bottomZone:o,topMarker:a,bottomMarker:d,topMarkerValue:l,bottomMarkerValue:c,badge:u,badgeDepth:ks(t.htmlElement),onBadgeClick:g}}destroyOverlayEntry(t){t.badge.removeEventListener("click",t.onBadgeClick),t.root.remove(),t.topMarker.remove(),t.bottomMarker.remove(),t.badge.remove(),this.entryEnabled.delete(t.object.id)}measureEntry(t,e){let i=t.object;if(!e.visible)return this.hiddenMeasurement(i);let{contentX:n,contentY:s,width:o,height:a,baseAnchorX:l,baseAnchorY:d,collisionOffset:c}=e,u=this.isEntryEnabled(i.id),g=i.getProperty("layout-border-radius")??"0px",v=i.getProperty("enter-vp")??"bottom",h=i.getProperty("exit-vp")??"top",m=i.getProperty("enter-el")??"top",b=i.getProperty("exit-el")??"bottom",y=i.getProperty("inview-start-position"),f=i.getProperty("inview-end-position"),S=m==="bottom"?s+a:s,x=b==="top"?s:s+a,w=y!=null?y+this.getViewportAnchorOffset(v):S,M=f!=null?f+this.getViewportAnchorOffset(h):x,k=Math.min(S,w),C=Math.abs(w-S),R=Math.min(x,M),P=Math.abs(M-x),A=n+o-6,_=w,T=M,D=l,F=d+c,H=this.getViewportScrollLeft(),z=this.getViewportScrollTop(),G=this.data.viewport.windowHeight||window.innerHeight,j=this.data.viewport.windowWidth||window.innerWidth,Z=Math.min(n,A-As),U=Math.max(n+o,A),st=Math.min(s,k,R,_-ii,T-ii);return Math.max(s+a,k+C,R+P,_+ii,T+ii)-z<0||st-z>G||U-H<0||Z-H>j?this.hiddenMeasurement(i):{visible:!0,overlayVisible:this.enabled&&u,badgeVisible:this.enabled,inview:i.getProperty("is-inview")===!0,boxDocX:n,boxDocY:s,width:o,height:a,borderRadius:g,topZoneDocX:n,topZoneDocY:k,topZoneWidth:o,topZoneHeight:Math.max(C,1),topZoneEmpty:C===0,bottomZoneDocX:n,bottomZoneDocY:R,bottomZoneWidth:o,bottomZoneHeight:Math.max(P,1),bottomZoneEmpty:P===0,topMarkerDocX:A,topMarkerDocY:_,topMarkerValue:mn(w-S),bottomMarkerDocX:A,bottomMarkerDocY:T,bottomMarkerValue:mn(M-x),badgeDocX:D,badgeDocY:F}}applyMeasurement(t,e){if(!e){t.root.setAttribute("data-visible","false"),t.topMarker.setAttribute("data-visible","false"),t.bottomMarker.setAttribute("data-visible","false"),t.topMarkerValue.textContent="",t.bottomMarkerValue.textContent="",t.topMarker.setAttribute("hidden",""),t.bottomMarker.setAttribute("hidden",""),t.badge.setAttribute("hidden","");return}if(t.root.setAttribute("data-visible",e.visible&&e.overlayVisible?"true":"false"),t.root.setAttribute("data-inview",e.inview?"true":"false"),t.badge.setAttribute("data-active",e.overlayVisible?"true":"false"),t.badge.title=e.overlayVisible?"Hide offsets for this element":"Show offsets for this element",!e.visible||!e.badgeVisible){t.topMarker.setAttribute("data-visible","false"),t.bottomMarker.setAttribute("data-visible","false"),t.topMarkerValue.textContent="",t.bottomMarkerValue.textContent="",t.topMarker.setAttribute("hidden",""),t.bottomMarker.setAttribute("hidden",""),t.badge.setAttribute("hidden","");return}t.topMarker.removeAttribute("hidden"),t.bottomMarker.removeAttribute("hidden"),t.badge.removeAttribute("hidden"),t.topMarker.setAttribute("data-visible","true"),t.bottomMarker.setAttribute("data-visible","true"),e.overlayVisible||(t.topMarker.setAttribute("data-visible","false"),t.bottomMarker.setAttribute("data-visible","false"),t.topMarker.setAttribute("hidden",""),t.bottomMarker.setAttribute("hidden","")),E.setProps(t.box,{width:`${e.width}px`,height:`${e.height}px`,borderRadius:e.borderRadius,transform:$t(e.boxDocX,e.boxDocY)}),E.setProps(t.topZone,{width:`${e.topZoneWidth}px`,height:`${e.topZoneHeight}px`,transform:$t(e.topZoneDocX,e.topZoneDocY)}),t.topZone.setAttribute("data-empty",e.topZoneEmpty?"true":"false"),E.setProps(t.bottomZone,{width:`${e.bottomZoneWidth}px`,height:`${e.bottomZoneHeight}px`,transform:$t(e.bottomZoneDocX,e.bottomZoneDocY)}),t.bottomZone.setAttribute("data-empty",e.bottomZoneEmpty?"true":"false"),e.overlayVisible?(t.topMarkerValue.textContent=e.topMarkerValue,E.setProps(t.topMarker,{transform:`${$t(e.topMarkerDocX,e.topMarkerDocY)} translate(-100%, -116%)`}),t.topMarker.setAttribute("data-offset-value",e.topMarkerValue),t.topMarker.setAttribute("data-empty",e.topZoneEmpty?"true":"false"),t.topMarker.title=`Inview enter offset: ${e.topMarkerValue}`,t.bottomMarkerValue.textContent=e.bottomMarkerValue,E.setProps(t.bottomMarker,{transform:`${$t(e.bottomMarkerDocX,e.bottomMarkerDocY)} translate(-100%, 16%)`}),t.bottomMarker.setAttribute("data-offset-value",e.bottomMarkerValue),t.bottomMarker.setAttribute("data-empty",e.bottomZoneEmpty?"true":"false"),t.bottomMarker.title=`Inview exit offset: ${e.bottomMarkerValue}`):(t.topMarkerValue.textContent="",t.bottomMarkerValue.textContent=""),E.setProps(t.badge,{transform:$t(e.badgeDocX,e.badgeDocY)})}hiddenMeasurement(t){return{visible:!1,overlayVisible:this.enabled&&this.isEntryEnabled(t.id),badgeVisible:this.enabled,inview:t.getProperty("is-inview")===!0,boxDocX:0,boxDocY:0,width:0,height:0,borderRadius:"0px",topZoneDocX:0,topZoneDocY:0,topZoneWidth:0,topZoneHeight:1,topZoneEmpty:!0,bottomZoneDocX:0,bottomZoneDocY:0,bottomZoneWidth:0,bottomZoneHeight:1,bottomZoneEmpty:!0,topMarkerDocX:0,topMarkerDocY:0,topMarkerValue:"0",bottomMarkerDocX:0,bottomMarkerDocY:0,bottomMarkerValue:"0",badgeDocX:0,badgeDocY:0}}isEntryEnabled(t){return this.entryEnabled.get(t)!==!1}setEntryEnabled(t,e){this.entryEnabled.set(t,e),this.enabled&&this.scheduleFullSync()}getViewportAnchorOffset(t){return t==="bottom"||t==="right"?t==="right"?this.data.viewport.windowWidth||window.innerWidth:this.data.viewport.windowHeight||window.innerHeight:0}};he.devtool={id:"offsets",label:"Offsets",icon:"offsets",order:25,styles:hn,overlay:{layerName:"devtools-offsets",zIndex:10012,layerAttribute:"data-string-offsets-layer",overlayId:"offsets"}};var vn=`
|
|
2860
|
+
[data-string-progress-summary] {
|
|
2861
|
+
display: flex;
|
|
2862
|
+
flex-direction: column;
|
|
2863
|
+
gap: 10px;
|
|
2864
|
+
padding: 2px 6px 6px;
|
|
2865
|
+
}
|
|
2866
|
+
|
|
2867
|
+
[data-string-progress-control] {
|
|
2868
|
+
display: grid;
|
|
2869
|
+
gap: 8px;
|
|
2870
|
+
}
|
|
2871
|
+
|
|
2872
|
+
[data-string-progress-slider] {
|
|
2873
|
+
width: 100%;
|
|
2874
|
+
margin: 0;
|
|
2875
|
+
appearance: none;
|
|
2876
|
+
-webkit-appearance: none;
|
|
2877
|
+
background: transparent;
|
|
2878
|
+
cursor: pointer;
|
|
2879
|
+
}
|
|
2880
|
+
|
|
2881
|
+
[data-string-progress-slider]:focus-visible {
|
|
2882
|
+
outline: none;
|
|
2883
|
+
}
|
|
2884
|
+
|
|
2885
|
+
[data-string-progress-slider]::-webkit-slider-runnable-track {
|
|
2886
|
+
height: 20px;
|
|
2887
|
+
border-radius: 8px;
|
|
2888
|
+
background:
|
|
2889
|
+
linear-gradient(
|
|
2890
|
+
90deg,
|
|
2891
|
+
#ffba95 0%,
|
|
2892
|
+
#ffba95 var(--string-progress-slider-fill, 0%),
|
|
2893
|
+
rgba(17, 17, 17, 0.08) var(--string-progress-slider-fill, 0%),
|
|
2894
|
+
rgba(17, 17, 17, 0.08) 100%
|
|
2895
|
+
);
|
|
2896
|
+
}
|
|
2897
|
+
|
|
2898
|
+
[data-string-progress-slider]::-moz-range-track {
|
|
2899
|
+
height: 8px;
|
|
2900
|
+
border-radius: 999px;
|
|
2901
|
+
background: rgba(17, 17, 17, 0.08);
|
|
2902
|
+
}
|
|
2903
|
+
|
|
2904
|
+
[data-string-progress-slider]::-moz-range-progress {
|
|
2905
|
+
height: 8px;
|
|
2906
|
+
border-radius: 999px;
|
|
2907
|
+
background: linear-gradient(90deg, var(--string-dev-accent) 0%, #ff8b4d 100%);
|
|
2908
|
+
}
|
|
2909
|
+
|
|
2910
|
+
[data-string-progress-slider]::-webkit-slider-thumb {
|
|
2911
|
+
-webkit-appearance: none;
|
|
2912
|
+
width: 20px;
|
|
2913
|
+
height: 20px;
|
|
2914
|
+
border-radius: 8px;
|
|
2915
|
+
background: var(--string-dev-accent);
|
|
2916
|
+
}
|
|
2917
|
+
|
|
2918
|
+
[data-string-progress-slider]::-moz-range-thumb {
|
|
2919
|
+
width: 14px;
|
|
2920
|
+
height: 14px;
|
|
2921
|
+
border: 2px solid #fff;
|
|
2922
|
+
border-radius: 999px;
|
|
2923
|
+
background: var(--string-dev-accent);
|
|
2924
|
+
box-shadow: 0 2px 8px rgba(17, 17, 17, 0.16);
|
|
2925
|
+
}
|
|
2926
|
+
|
|
2927
|
+
[data-string-progress-slider]:focus-visible::-webkit-slider-thumb {
|
|
2928
|
+
box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.12), 0 2px 8px rgba(17, 17, 17, 0.16);
|
|
2929
|
+
}
|
|
2930
|
+
|
|
2931
|
+
[data-string-progress-slider]:focus-visible::-moz-range-thumb {
|
|
2932
|
+
box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.12), 0 2px 8px rgba(17, 17, 17, 0.16);
|
|
2933
|
+
}
|
|
2934
|
+
|
|
2935
|
+
[data-string-progress-meta] {
|
|
2936
|
+
display: grid;
|
|
2937
|
+
gap: 2px;
|
|
2938
|
+
}
|
|
2939
|
+
|
|
2940
|
+
[data-string-progress-row] {
|
|
2941
|
+
display: grid;
|
|
2942
|
+
grid-template-columns: 50% minmax(0, 1fr);
|
|
2943
|
+
align-items: baseline;
|
|
2944
|
+
font-size: 10px;
|
|
2945
|
+
font-weight: 500;
|
|
2946
|
+
background-color: #F1F1F1;
|
|
2947
|
+
|
|
2948
|
+
border-radius: 8px;
|
|
2949
|
+
}
|
|
2950
|
+
|
|
2951
|
+
[data-string-progress-label] {
|
|
2952
|
+
padding: 8px;
|
|
2953
|
+
border-right: 1px solid rgba(17, 17, 17, 0.08);
|
|
2954
|
+
}
|
|
2955
|
+
|
|
2956
|
+
[data-string-progress-value] {
|
|
2957
|
+
min-width: 0;
|
|
2958
|
+
color: var(--string-dev-panel-text);
|
|
2959
|
+
font-weight: 500;
|
|
2960
|
+
text-align: right;
|
|
2961
|
+
white-space: nowrap;
|
|
2962
|
+
overflow: hidden;
|
|
2963
|
+
text-overflow: ellipsis;
|
|
2964
|
+
padding: 8px;
|
|
2965
|
+
}
|
|
2966
|
+
`;function nt(p){if(!Number.isFinite(p)||p<=0)return 0;if(p>=1)return 1;let r=1e-4;return p>1-r?1:p<r?0:p}function xi(p){let r=nt(p)*100;return`${Math.round(r*10)/10}%`}function fn(p){if(!Number.isFinite(p))return"0";let r=Math.round(p*10)/10;return Object.is(r,-0)?"0":Number.isInteger(r)?String(r):r.toFixed(1)}var me=class extends St{constructor(t){super(t);this.openEntryId=null;this.onDocumentPointerDownBind=t=>{this.onDocumentPointerDown(t)};this.htmlKey="progress",this.attributesToMap=[...this.attributesToMap,{key:"easing",type:"easing",fallback:this.settings.easing}]}onInit(){super.onInit(),document.addEventListener("pointerdown",this.onDocumentPointerDownBind)}destroy(){document.removeEventListener("pointerdown",this.onDocumentPointerDownBind),this.clearAllProgressOverrides(),this.openEntryId=null,super.destroy()}createOverlayEntry(t){let e=this.resolveOverlayTargetId(t),i=document.createElement("div");i.setAttribute("data-string-devtools-overlay-chrome",""),i.setAttribute("data-string-devtools-theme",""),i.setAttribute("data-target-id",e),i.setAttribute("hidden",""),i.setAttribute("string-isolation",""),i.setAttribute("data-string-isolation","");let n=this.createOverlayBadge({targetId:e,selectorAttribute:"data-string-progress-badge",attributes:{"data-open":"false","aria-label":`Open progress details for ${e}`}});this.applyOverlayBadgeState(n,{html:At("progress")});let s=document.createElement("div");s.setAttribute("data-string-devtools-overlay-panel",""),s.setAttribute("data-string-devtools-panel",""),s.setAttribute("data-string-progress-panel",""),s.setAttribute("data-open","false"),s.setAttribute("data-target-id",e),s.setAttribute("string-isolation",""),s.setAttribute("data-string-isolation","");let o=document.createElement("div");o.setAttribute("data-string-devtools-panel-header","");let a=document.createElement("span");a.setAttribute("data-string-devtools-panel-icon",""),a.innerHTML=At("progress");let l=document.createElement("span");l.setAttribute("data-string-devtools-panel-title",""),l.textContent=e;let d=document.createElement("button");d.type="button",d.setAttribute("data-string-devtools-icon-button",""),d.setAttribute("aria-label",`Close progress details for ${e}`),d.innerHTML=`
|
|
2967
|
+
<svg viewBox="0 0 16 16" aria-hidden="true">
|
|
2968
|
+
<path d="M2 2L14 14" fill="none" stroke="currentColor"/>
|
|
2969
|
+
<path d="M2 14L14 2" fill="none" stroke="currentColor"/>
|
|
2970
|
+
</svg>
|
|
2971
|
+
`,d.addEventListener("click",h=>{h.stopPropagation(),this.closePanel(e)}),o.appendChild(a),o.appendChild(l),o.appendChild(d);let c=document.createElement("div");c.setAttribute("data-string-progress-summary",""),c.innerHTML=`
|
|
2972
|
+
<div data-string-progress-control>
|
|
2973
|
+
<input
|
|
2974
|
+
type="range"
|
|
2975
|
+
min="0"
|
|
2976
|
+
max="1000"
|
|
2977
|
+
step="1"
|
|
2978
|
+
value="0"
|
|
2979
|
+
aria-label="Preview progress for ${e}"
|
|
2980
|
+
data-string-progress-slider
|
|
2981
|
+
/>
|
|
2982
|
+
</div>
|
|
2983
|
+
<div data-string-progress-meta>
|
|
2984
|
+
<div data-string-progress-row>
|
|
2985
|
+
<span data-string-progress-label>Eased</span>
|
|
2986
|
+
<span data-string-progress-value data-field="eased">0%</span>
|
|
2987
|
+
</div>
|
|
2988
|
+
<div data-string-progress-row>
|
|
2989
|
+
<span data-string-progress-label>Raw</span>
|
|
2990
|
+
<span data-string-progress-value data-field="raw">0%</span>
|
|
2991
|
+
</div>
|
|
2992
|
+
<div data-string-progress-row>
|
|
2993
|
+
<span data-string-progress-label>Range</span>
|
|
2994
|
+
<span data-string-progress-value data-field="range">0 -> 0</span>
|
|
2995
|
+
</div>
|
|
2996
|
+
</div>
|
|
2997
|
+
`;let u=h=>{if(h.stopPropagation(),h.preventDefault(),this.openEntryId===e){this.closePanel(e);return}this.openPanel(e)},g=c.querySelector("[data-string-progress-slider]"),v=()=>{let h=nt(Number(g.value)/1e3);this.setEntryProgressOverride(t,h)};return n.addEventListener("click",u),g.addEventListener("input",v),s.addEventListener("pointerdown",h=>h.stopPropagation()),s.appendChild(o),s.appendChild(c),i.appendChild(n),i.appendChild(s),this.viewportLayer.getWorldElement(this.getWorldHost()).appendChild(i),this.applyEntryEnabledState(i),{object:t,chrome:i,badge:n,panel:s,title:l,slider:g,easedValue:c.querySelector('[data-field="eased"]'),rawValue:c.querySelector('[data-field="raw"]'),rangeValue:c.querySelector('[data-field="range"]'),onBadgeClick:u,onSliderInput:v}}destroyOverlayEntry(t){let e=t.object.htmlElement.id||t.object.id;this.openEntryId===e&&(this.clearEntryProgressOverride(t.object),this.openEntryId=null),t.badge.removeEventListener("click",t.onBadgeClick),t.slider.removeEventListener("input",t.onSliderInput),t.chrome.remove()}measureEntry(t,e){let i=t.object,s=i.htmlElement.id||i.id,o=this.data.scroll.transformedCurrent,a=i.getProperty("key")||"--progress",l=i.getProperty("start-position")??i.getProperty("progress-start-position")??0,d=i.getProperty("difference-position")??i.getProperty("progress-difference-position")??0,c=i.getProperty("end-position")??l+d,u=this.resolveEntryRawProgress(i,o),g=this.resolveEasedProgress(i,u);return e.visible?{visible:!0,docX:e.baseAnchorX,docY:e.baseAnchorY+e.collisionOffset,targetLabel:s,progress:g,rawProgress:u,startPosition:l,endPosition:c,currentScroll:o,key:a}:{visible:!1,docX:0,docY:0,targetLabel:s,progress:0,rawProgress:0,startPosition:0,endPosition:0,currentScroll:o,key:a}}applyMeasurement(t,e){if(!e||!e.visible){t.chrome.setAttribute("hidden","");return}t.chrome.removeAttribute("hidden"),E.setProps(t.chrome,{transform:`translate3d(${Math.round(e.docX*100)/100}px, ${Math.round(e.docY*100)/100}px, 0)`}),E.setVar(t.slider,"--string-progress-slider-fill",`${Math.round(nt(e.rawProgress)*1e3)/10}%`);let i=String(Math.round(nt(e.rawProgress)*1e3));t.slider.value!==i&&(t.slider.value=i),t.title.textContent=e.targetLabel,t.easedValue.textContent=xi(e.progress),t.rawValue.textContent=xi(e.rawProgress),t.rangeValue.textContent=`${fn(e.startPosition)} -> ${fn(e.endPosition)}`,t.badge.title=`${e.targetLabel}: ${xi(e.progress)}`}onEnabledChange(t){for(let e of this.entries.values())this.applyEntryEnabledState(e.chrome);t||(this.closeAllPanels(),this.clearAllProgressOverrides())}applyEntryEnabledState(t){t.style.display=this.enabled?"":"none"}openPanel(t){this.closeAllPanels(),this.openEntryId=t;for(let e of this.entries.values())if((e.object.htmlElement.id||e.object.id)===t){e.badge.setAttribute("data-open","true"),e.panel.setAttribute("data-open","true");break}}closePanel(t){for(let e of this.entries.values())if((e.object.htmlElement.id||e.object.id)===t){e.badge.setAttribute("data-open","false"),e.panel.setAttribute("data-open","false"),this.clearEntryProgressOverride(e.object);break}this.openEntryId===t&&(this.openEntryId=null)}closeAllPanels(){for(let t of this.entries.values())t.badge.setAttribute("data-open","false"),t.panel.setAttribute("data-open","false"),this.clearEntryProgressOverride(t.object);this.openEntryId=null}onDocumentPointerDown(t){if(!this.openEntryId)return;let e=t.target;if(e instanceof Node){for(let i of this.entries.values())if(i.chrome.contains(e))return;this.closeAllPanels()}}resolveEntryRawProgress(t,e){let i=t.getProperty(ut);if(i!=null)return nt(i);let n=t.getProperty("start-position")??t.getProperty("progress-start-position")??0,s=t.getProperty("difference-position")??t.getProperty("progress-difference-position")??0;return nt(s===0?0:(e-n)/s)}resolveEasedProgress(t,e){let i=t.getProperty("easing");return typeof i=="function"?nt(i(e)):e}setEntryProgressOverride(t,e){t.setProperty(ut,nt(e)),this.applyObjectProgress(t,e),this.scheduleFullSync()}clearEntryProgressOverride(t){if(t.getProperty(ut)==null)return;t.setProperty(ut,null);let e=this.resolveEntryRawProgress(t,this.data.scroll.transformedCurrent);this.applyObjectProgress(t,e),this.scheduleFullSync()}clearAllProgressOverrides(){for(let t of this.entries.values())t.object.setProperty(ut,null)}applyObjectProgress(t,e){let i=nt(e),n=t.getProperty("easing"),s=typeof n=="function"?nt(n(i)):i,o=t.getProperty("key");t.setProperty("progress-raw",i),t.setProperty("progress-value",s),t.setProperty("progress-applied",s);let a=t.getProperty("event-progress-name")??t.getScopedEventName("object:progress");t.setProperty("event-progress-name",a),a&&this.events.emit(a,s),this.tools.styleTxn.run(()=>{o&&t.getProperty("self-disable")!==!0&&this.tools.styleTxn.setVar(t.htmlElement,o,s);for(let l of t.mirrorObjects){let d=l.applyProgress(i,typeof n=="function"?n:void 0);l.setProperty("progress",d),o&&this.tools.styleTxn.setVar(l.htmlElement,o,d)}})}};me.devtool={id:"progress",label:"Progress",icon:"progress",order:35,styles:vn,overlay:{layerName:"devtools-progress",zIndex:10013,layerAttribute:"data-string-progress-layer",overlayId:"progress"}};function bn(p){return typeof p=="object"&&p!==null&&"getDevtoolDefinition"in p&&typeof p.getDevtoolDefinition=="function"}function Ds(){return"ontouchstart"in window||navigator.maxTouchPoints>0}var et=class et{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 ar;this.devtoolsFpsLastSampleTime=0;this.devtoolsFpsFrameCount=0;this.observerContainerResize=null;this.devtoolsAccessToken="";this.devtoolsAccessState="unknown";this.devtoolsAccessRequestId=0;this.pendingDevtoolUses=[];this.hasStarted=!1;this.devtoolsAccessLastMessage="none";this.canRebuild=!0;this.debouncedResize=Ni(()=>{this.queueResize(!1)},30);this.root=document.body,this.window=window,this.tools=new He,this.data=new Ut,this.eventManager=new kt,this.moduleManager=new ye(this.data),this.objectManager=new Ee(this.data,this.moduleManager,this.eventManager,this.tools),this.centers=new pr,this.hoverManager=new gr,this.devtools=new br,this.context={events:this.eventManager,data:this.data,tools:this.tools,settings:{},centers:this.centers,hover:this.hoverManager,objectManager:this.objectManager},this.cursorController=new be(1,this.context),this.scrollManager=new Ce(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.onScrollConfigChangeBind=this.onScrollConfigChange.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,onModeChange:this.onScrollConfigChangeBind}),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.updateDevtoolsFPS(r)}),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 accessDevtoolToken(r){let t=r.trim();if(this.devtoolsAccessToken=t,t.length===0){this.devtoolsAccessState="unknown";return}this.validateDevtoolsAccess(t)}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 et.i||(et.i=new et),et.i}reuse(r){return this.moduleManager.find(r)}use(r,t=null){this.shouldDeferDevtoolModule(r,t)||this.instantiateModule(r,t)}instantiateModule(r,t=null){let e={...this.context.settings,...t},i=new r({events:this.eventManager,data:this.data,tools:this.tools,settings:e,centers:this.centers,hover:this.hoverManager,objectManager:this.objectManager});this.moduleManager.register(i),bn(i)&&this.devtools.register(i.getDevtoolDefinition()),this.hasStarted&&(this.objectManager.attachModule(i),i.onInit(),i.onResize(),i.onScroll(this.data),i.onFrame(this.data))}shouldDeferDevtoolModule(r,t){return!(r===Q||r.prototype instanceof Q)||this.devtoolsAccessState==="granted"?!1:(this.pendingDevtoolUses.push({objectClass:r,settings:t}),this.devtoolsAccessToken.length>0&&this.devtoolsAccessState!=="pending"&&this.validateDevtoolsAccess(this.devtoolsAccessToken),!0)}async validateDevtoolsAccess(r){let t=++this.devtoolsAccessRequestId;this.devtoolsAccessState="pending";try{let e=await fetch(`${et.DEVTOOLS_ACCESS_URL}?token=${encodeURIComponent(r)}`),i=await this.resolveDevtoolsAccessResponse(e);if(t!==this.devtoolsAccessRequestId||r!==this.devtoolsAccessToken)return;if(this.devtoolsAccessState=i?"granted":"denied",!i){this.logDevtoolsAccess("denied"),this.pendingDevtoolUses=[];return}this.logDevtoolsAccess("granted");let n=[...this.pendingDevtoolUses];this.pendingDevtoolUses=[],n.forEach(({objectClass:s,settings:o})=>{this.instantiateModule(s,o)})}catch{if(t!==this.devtoolsAccessRequestId||r!==this.devtoolsAccessToken)return;this.devtoolsAccessState="denied",this.logDevtoolsAccess("error"),this.pendingDevtoolUses=[]}}logDevtoolsAccess(r){if(this.devtoolsAccessLastMessage!==r){if(this.devtoolsAccessLastMessage=r,r==="granted"){console.info(`${et.DEVTOOLS_LOG_PREFIX} Access granted. Devtools modules are enabled.`);return}if(r==="denied"){console.warn(`${et.DEVTOOLS_LOG_PREFIX} Access denied. Devtools modules were not enabled. Check accessDevtoolToken.`);return}console.warn(`${et.DEVTOOLS_LOG_PREFIX} Access check failed. Devtools modules were not enabled.`)}}async resolveDevtoolsAccessResponse(r){if(!r.ok)return!1;if((r.headers.get("content-type")?.toLowerCase()??"").includes("application/json")){let i=await r.json();return typeof i=="boolean"?i:i&&typeof i=="object"&&"allowed"in i?i.allowed===!0:!1}return(await r.text()).trim().toLowerCase()==="true"}registerScrollMode(r,t){let e;if(typeof t=="function"&&t.prototype instanceof rt){let i=t;e=new i(this.context)}else e=t(this.context);e.name||(e.name=r),this.scrollManager.registerMode(r,e)}on(r,t,e=""){this.eventManager.on(r,t,e)}emit(r,t){this.eventManager.emit(r,t)}off(r,t,e=""){this.eventManager.off(r,t,e)}addScrollMark(r){this.scrollManager.addScrollMark(r)}removeScrollMark(r){this.scrollManager.removeScrollMark(r)}start(r){this.hasStarted=!0,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(je);let t=window.getComputedStyle(document.documentElement).fontSize,e=parseFloat(t);this.context.data.viewport.baseRem=e,document.documentElement.classList.add("-string"),this.syncDebugScrollState(),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 t=this.tools.domAttribute.process({element:r,key:"copy-from",fallback:""});t&&t.length>0&&this.objectManager.linkMirror(t,r)}),this.moduleManager.onResize(),this.moduleManager.onScroll(),this.moduleManager.onFrame()}setupSettings(r){this.context.settings={...this.context.settings,...r},typeof r.accessDevtoolToken=="string"&&(this.accessDevtoolToken=r.accessDevtoolToken),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(t=>{for(let e=0;e<t.length;e++){let i=t[e];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 t=this.pendingResizeForce;this.pendingResizeForce=!1,this.onResize(t)}))}onMouseMoveEvent(r){this.cursorController.onMouseMove(r),this.moduleManager.onMouseMove(r),q.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()}onScrollConfigChange(){this.moduleManager.onScrollConfigChange(),this.syncDebugScrollState(),this.moduleManager.onScroll(),this.moduleManager.onScrollMeasure(),this.moduleManager.onFrame(),E.run(()=>{this.moduleManager.onMutate()})}syncDebugScrollState(){let r=document.documentElement,t=window.innerWidth<1024;r.setAttribute("data-string-scroll-mode",String(this.data.scroll.mode)),r.setAttribute("data-string-scroll-device",t?"mobile":"desktop")}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),q.measure(()=>{this.moduleManager.onScrollMeasure()}),this.lastScrollEmitted=this.data.scroll.current),q.mutate(()=>{E.begin(),this.moduleManager.onMutate(),E.commit()}),this.eventManager.emit("update",null),q.flush()}updateDevtoolsFPS(r){this.devtoolsFpsLastSampleTime===0&&(this.devtoolsFpsLastSampleTime=r),this.devtoolsFpsFrameCount+=1;let t=r-this.devtoolsFpsLastSampleTime;if(t<1e3)return;let e=this.devtoolsFpsFrameCount*1e3/t;this.devtools.setFPS(e),this.devtoolsFpsFrameCount=0,this.devtoolsFpsLastSampleTime=r}onResize(r=!1){if(this.canRebuild==!1)return;let t=this.data.scroll.container,e=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=e.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 d=Ds(),c=i>1024,u=this.prevWidth!==i,g=this.prevHeight!==n,v=Math.abs(this.prevHeight-n),h=this.context.data.viewport.contentHeight!==s,m=u||!d&&g||d&&v>150||h;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,this.syncDebugScrollState(),e.bottomPosition=this.context.data.viewport.contentHeight-n,(u||typeof r=="boolean"&&r)&&this.moduleManager.onResizeWidth(),m||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:c,widthChanged:u,heightChanged:g,scrollHeightChanged:h,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){let t=this.resolveScrollToValue(r);t!=null&&this.scrollManager.get().scrollTo(t.position,t.immediate)}resolveScrollToValue(r){if(typeof r=="number")return{position:r,immediate:!1};if(typeof r=="string"||r instanceof HTMLElement){let s=this.resolveElementScrollPosition(r);return s==null?null:{position:s,immediate:!1}}let t=r.immediate===!0,e=r.offset??0;if("position"in r)return{position:r.position+e,immediate:t};let i="selector"in r?r.selector:r.element,n=this.resolveElementScrollPosition(i);return n==null?null:{position:n+e,immediate:t}}resolveElementScrollPosition(r){let t=typeof r=="string"?document.querySelector(r):r;if(!(t instanceof HTMLElement))return null;let e=this.data.scroll.container??document.body??document.documentElement,i=this.data.scroll.elementContainer??document.documentElement,n=this.tools.transformNullify.process({element:t});if(e===document.body||e===document.documentElement)return n.top+i.scrollTop;let s=e.getBoundingClientRect();return n.top-s.top+e.scrollTop}destroy(){this.hasStarted=!1,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()}};et.DEVTOOLS_ACCESS_URL="https://access.fiddle.digital/",et.DEVTOOLS_LOG_PREFIX="[StringTune Devtools]";var Ei=et;0&&(module.exports={CursorReactiveModule,DOMBatcher,GridAdapter,ScrollController,StringAnchor,StringCursor,StringData,StringDelayLerpTracker,StringDevIconRegistry,StringDevInviewToggle,StringDevLayout,StringDevModule,StringDevOffsets,StringDevOverlayRegistry,StringDevProgress,StringDevRulers,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
2998
|
//# sourceMappingURL=index.cjs.map
|