@zylem/game-lib 0.9.8 → 0.9.10

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.
@@ -0,0 +1,24 @@
1
+ import{b as Ne,d as H,k as D,y as J,z as F}from"./chunk-HDOXKVQA.js";import{e as ce,h as me,i as he,j as Ye,k as Ze,l as Ke,m as ge,o as Je,p as $e}from"./chunk-BZEZIHM7.js";import{g as _e}from"./chunk-PCFF4LLO.js";import{l as L}from"./chunk-UG22Z42P.js";import{b as x}from"./chunk-B6GDESCB.js";import{d as v,g as Ue,h as de}from"./chunk-UM5VNQPY.js";import{b as Qe,c as et}from"./chunk-ICJ2E2OV.js";import{c as K,e as We,f as je}from"./chunk-2HSR5XDQ.js";import{t as nt}from"./chunk-2XMG3NJS.js";import{b as tt}from"./chunk-7GYFZKK7.js";import{c as k}from"./chunk-D2PATZCC.js";import{k as it}from"./chunk-3LXDHDJB.js";import{D as Se,a as ve}from"./chunk-CI7A5N6G.js";import{k as qe}from"./chunk-YW2GTHCV.js";import{a as Xe,b as E}from"./chunk-AIQ6IVT5.js";import{c as Ae,d as V,e as ze,h as Ve,i as Oe,j as He,k as pe,l as O,m as Fe}from"./chunk-4QLJUQSJ.js";import{c as fe,h as ye,j as be}from"./chunk-7WRQ2UAN.js";function St(){return{pressed:!1,released:!1,held:0}}function wt(){return{value:0,held:0}}function $(a){let e=new Map;if(!a)return e;for(let[t,n]of Object.entries(a)){if(!n||n.length===0)continue;let i=[];for(let o of n){let[s,r]=(o||"").split(".");if(!s||!r)continue;let l=s.toLowerCase(),p=r.toLowerCase();if(l==="buttons"){let u={a:"A",b:"B",x:"X",y:"Y",start:"Start",select:"Select",l:"L",r:"R"}[p];u&&i.push({category:"buttons",property:u})}else if(l==="directions"){let u={up:"Up",down:"Down",left:"Left",right:"Right"}[p];u&&i.push({category:"directions",property:u})}else if(l==="shoulders"){let u={ltrigger:"LTrigger",rtrigger:"RTrigger"}[p];u&&i.push({category:"shoulders",property:u})}else if(l==="axes"){let u={left:{property:"Horizontal",direction:-1},right:{property:"Horizontal",direction:1},up:{property:"Vertical",direction:-1},down:{property:"Vertical",direction:1},secondaryleft:{property:"SecondaryHorizontal",direction:-1},secondaryright:{property:"SecondaryHorizontal",direction:1},secondaryup:{property:"SecondaryVertical",direction:-1},secondarydown:{property:"SecondaryVertical",direction:1}}[p];u&&i.push({category:"axes",property:u.property,axisDirection:u.direction})}}i.length>0&&e.set(t,i)}return e}function m(a,e){return!a&&!e?St():a?e?{pressed:a.pressed||e.pressed,released:a.released||e.released,held:a.held+e.held}:{...a}:{...e}}function w(a,e){return!a&&!e?wt():a?e?{value:a.value+e.value,held:a.held+e.held}:{...a}:{...e}}var A=class{keyStates=new Map;keyButtonStates=new Map;analogStates=new Map;compiledMapping;includeDefaultBase=!0;onKeyDown=({key:e})=>this.keyStates.set(e,!0);onKeyUp=({key:e})=>this.keyStates.set(e,!1);constructor(e,t){this.includeDefaultBase=t?.includeDefaultBase??!0,this.compiledMapping=$(e??null),window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp)}dispose(){window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp),this.keyStates.clear(),this.keyButtonStates.clear(),this.analogStates.clear()}isKeyPressed(e){return this.keyStates.get(e)||!1}handleButtonState(e,t){let n=this.keyButtonStates.get(e);n||(n={pressed:!1,released:!1,held:0},this.keyButtonStates.set(e,n));let i=this.isKeyPressed(e);return n.pressed=i&&n.held===0,n.released=!i&&n.held>0,n.held=i?n.held+t:0,n}handleAnalogState(e,t,n){let i=`${e}:${t}`,o=this.analogStates.get(i);return o||(o={value:0,held:0},this.analogStates.set(i,o)),o.value=this.getAxisValue(e,t),o.held=o.value!==0?o.held+n:0,o}applyCustomMapping(e,t){if(this.compiledMapping.size===0)return e;let n=new Map;for(let[i,o]of this.compiledMapping.entries()){let s=null;for(let r of o)if(r.category==="axes")n.has(r.property)||n.set(r.property,0),this.isKeyPressed(i)&&n.set(r.property,n.get(r.property)+r.axisDirection);else{s||(s=this.handleButtonState(i,t));let l=e[r.category]??={};l[r.property]=m(l[r.property],s)}}if(n.size>0){e.axes||(e.axes={});for(let[i,o]of n.entries()){let s=`custom:${i}`,r=this.analogStates.get(s);r||(r={value:0,held:0},this.analogStates.set(s,r)),r.value=o,r.held=o!==0?r.held+t:0,e.axes[i]=w(e.axes[i],r)}}return e}getInput(e){let t={};return this.includeDefaultBase&&(t.buttons={A:this.handleButtonState("z",e),B:this.handleButtonState("x",e),X:this.handleButtonState("a",e),Y:this.handleButtonState("s",e),Start:this.handleButtonState(" ",e),Select:this.handleButtonState("Enter",e),L:this.handleButtonState("q",e),R:this.handleButtonState("e",e)},t.directions={Up:this.handleButtonState("ArrowUp",e),Down:this.handleButtonState("ArrowDown",e),Left:this.handleButtonState("ArrowLeft",e),Right:this.handleButtonState("ArrowRight",e)},t.shoulders={LTrigger:this.handleButtonState("Q",e),RTrigger:this.handleButtonState("E",e)}),this.applyCustomMapping(t,e)}getName(){return"keyboard"}getAxisValue(e,t){return(this.isKeyPressed(t)?1:0)-(this.isKeyPressed(e)?1:0)}isConnected(){return!0}};var W=class{gamepadIndex;connected=!1;buttonStates={};analogStates={};onConnected=e=>{e.gamepad.index===this.gamepadIndex&&(this.connected=!0)};onDisconnected=e=>{e.gamepad.index===this.gamepadIndex&&(this.connected=!1)};constructor(e){this.gamepadIndex=e,window.addEventListener("gamepadconnected",this.onConnected),window.addEventListener("gamepaddisconnected",this.onDisconnected)}dispose(){window.removeEventListener("gamepadconnected",this.onConnected),window.removeEventListener("gamepaddisconnected",this.onDisconnected),this.buttonStates={},this.analogStates={}}handleButtonState(e,t,n){let i=this.buttonStates[e];i||(i={pressed:!1,released:!1,held:0},this.buttonStates[e]=i);let o=t.buttons[e].pressed;return i.pressed=o&&i.held===0,i.released=!o&&i.held>0,i.held=o?i.held+n:0,i}handleAnalogState(e,t,n){let i=this.analogStates[e];return i||(i={value:0,held:0},this.analogStates[e]=i),i.value=t.axes[e],i.held=i.value!==0?i.held+n:0,i}getInput(e){let t=navigator.getGamepads()[this.gamepadIndex];return t?{buttons:{A:this.handleButtonState(0,t,e),B:this.handleButtonState(1,t,e),X:this.handleButtonState(2,t,e),Y:this.handleButtonState(3,t,e),Start:this.handleButtonState(9,t,e),Select:this.handleButtonState(8,t,e),L:this.handleButtonState(4,t,e),R:this.handleButtonState(5,t,e)},directions:{Up:this.handleButtonState(12,t,e),Down:this.handleButtonState(13,t,e),Left:this.handleButtonState(14,t,e),Right:this.handleButtonState(15,t,e)},axes:{Horizontal:this.handleAnalogState(0,t,e),Vertical:this.handleAnalogState(1,t,e),SecondaryHorizontal:this.handleAnalogState(2,t,e),SecondaryVertical:this.handleAnalogState(3,t,e)},shoulders:{LTrigger:this.handleButtonState(6,t,e),RTrigger:this.handleButtonState(7,t,e)}}:{}}getName(){return`gamepad-${this.gamepadIndex+1}`}isConnected(){return this.connected}};import{subscribe as Ct}from"valtio/vanilla";var xt=.002;function j(a,e,t){return Math.max(e,Math.min(t,a))}function Et(a){if(a instanceof HTMLCanvasElement)return a;let e=a.querySelector("canvas");if(e instanceof HTMLCanvasElement)return e;for(let t of a.querySelectorAll("*")){let n=t.shadowRoot;if(!n)continue;let i=n.querySelector("canvas");if(i instanceof HTMLCanvasElement)return i}return null}var U=class{buttonStates=new Map;analogStates=new Map;compiledMapping;movementX=0;movementY=0;pointerX=.5;pointerY=.5;pointerCenterX=0;pointerCenterY=0;mouseButtonDown=new Set;sensitivity;usePointerLock;lookMode;isLocked=!1;targetElement;debugUnsubscribe=null;updatePointerPosition(e,t){this.pointerX=e/window.innerWidth,this.pointerY=t/window.innerHeight;let n=Et(this.targetElement);if(n){let i=n.getBoundingClientRect();if(i.width>0&&i.height>0){let o=i.left+i.width/2,s=i.top+i.height/2;this.pointerCenterX=j((e-o)/(i.width/2),-1,1),this.pointerCenterY=j((t-s)/(i.height/2),-1,1);return}}this.pointerCenterX=j((this.pointerX-.5)*2,-1,1),this.pointerCenterY=j((this.pointerY-.5)*2,-1,1)}onMouseMove=e=>{this.updatePointerPosition(e.clientX,e.clientY),!(v.enabled||this.lookMode==="screenCenter")&&(this.movementX+=e.movementX,this.movementY+=e.movementY)};onMouseDown=e=>{let t=e.target;t instanceof HTMLCanvasElement&&this.targetElement.contains(t)&&(this.mouseButtonDown.add(e.button),this.usePointerLock&&!this.isLocked&&!v.enabled&&this.targetElement.requestPointerLock())};onMouseUp=e=>{this.mouseButtonDown.delete(e.button)};onContextMenu=e=>{e.preventDefault()};onPointerLockChange=()=>{this.isLocked=document.pointerLockElement===this.targetElement};constructor(e,t){this.sensitivity=e?.sensitivity??xt,this.lookMode=e?.lookMode??"delta",this.usePointerLock=e?.pointerLock??!1,this.compiledMapping=$(e?.mapping??null),this.targetElement=t??document.body,window.addEventListener("mousemove",this.onMouseMove),this.targetElement.addEventListener("mousedown",this.onMouseDown),this.targetElement.addEventListener("mouseup",this.onMouseUp),this.targetElement.addEventListener("contextmenu",this.onContextMenu),this.usePointerLock&&(document.addEventListener("pointerlockchange",this.onPointerLockChange),this.debugUnsubscribe=Ct(v,()=>{v.enabled&&document.pointerLockElement===this.targetElement&&document.exitPointerLock()}))}dispose(){window.removeEventListener("mousemove",this.onMouseMove),this.targetElement.removeEventListener("mousedown",this.onMouseDown),this.targetElement.removeEventListener("mouseup",this.onMouseUp),this.targetElement.removeEventListener("contextmenu",this.onContextMenu),document.removeEventListener("pointerlockchange",this.onPointerLockChange),this.debugUnsubscribe?.(),this.debugUnsubscribe=null,this.isLocked&&document.exitPointerLock(),this.buttonStates.clear(),this.analogStates.clear(),this.mouseButtonDown.clear(),this.movementX=0,this.movementY=0}handleMouseButton(e,t){let n=this.buttonStates.get(e);n||(n={pressed:!1,released:!1,held:0},this.buttonStates.set(e,n));let i=this.mouseButtonDown.has(e);return n.pressed=i&&n.held===0,n.released=!i&&n.held>0,n.held=i?n.held+t:0,n}handleMovementAxis(e,t){let n=this.analogStates.get(e);n||(n={value:0,held:0},this.analogStates.set(e,n));let i=e==="x"?this.movementX:this.movementY;return n.value=Math.max(-1,Math.min(1,i*this.sensitivity)),n.held=n.value!==0?n.held+t:0,n}applyCustomMapping(e,t){if(this.compiledMapping.size===0)return e;let n=new Map,i={leftbutton:()=>this.handleMouseButton(0,t),rightbutton:()=>this.handleMouseButton(2,t),middlebutton:()=>this.handleMouseButton(1,t)};for(let[o,s]of this.compiledMapping.entries()){let r=o.toLowerCase();for(let l of s)if(l.category==="axes")n.has(l.property)||n.set(l.property,0),r==="movex"?n.set(l.property,n.get(l.property)+Math.max(-1,Math.min(1,this.movementX*this.sensitivity))*l.axisDirection):r==="movey"?n.set(l.property,n.get(l.property)+Math.max(-1,Math.min(1,this.movementY*this.sensitivity))*l.axisDirection):r in i&&this.mouseButtonDown.has(this.buttonIndexForAction(r))&&n.set(l.property,n.get(l.property)+l.axisDirection);else{let p=i[r];if(p){let g=p();if(g){let u=e[l.category]??={};u[l.property]=m(u[l.property],g)}}}}if(n.size>0){e.axes||(e.axes={});for(let[o,s]of n.entries()){let r=`custom:${o}`,l=this.analogStates.get(r);l||(l={value:0,held:0},this.analogStates.set(r,l)),l.value=Math.max(-1,Math.min(1,s)),l.held=s!==0?l.held+t:0,e.axes[o]=w(e.axes[o],l)}}return e}buttonIndexForAction(e){switch(e){case"leftbutton":return 0;case"middlebutton":return 1;case"rightbutton":return 2;default:return-1}}getInput(e){v.enabled&&(this.movementX=0,this.movementY=0);let t={value:0,held:0},n=this.lookMode==="delta",i={axes:{Horizontal:t,Vertical:t,SecondaryHorizontal:n?this.handleMovementAxis("x",e):t,SecondaryVertical:n?this.handleMovementAxis("y",e):t},shoulders:{LTrigger:this.handleMouseButton(0,e),RTrigger:this.handleMouseButton(2,e)},pointer:{x:this.pointerX,y:this.pointerY,centerX:this.pointerCenterX,centerY:this.pointerCenterY}};return this.movementX=0,this.movementY=0,this.applyCustomMapping(i,e)}getName(){return"mouse"}isConnected(){return!0}};function N(a={}){if(typeof window>"u"||typeof navigator>"u")return!1;let e=navigator.userAgent,t=/android/i.test(e)||/iPad|iPhone|iPod/.test(e),n="ontouchstart"in window||navigator.maxTouchPoints>0,i=typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)").matches:!1,o=a.viewportSize?.width??window.innerWidth??0,s=a.viewportSize?.height??window.innerHeight??0,r=Math.max(o,s),l=r===0||r<=1024;return a.allowViewportOnly&&a.viewportSize?l:t||(n||i)&&l}var Gt=["A","B","X","Y","Start","Select","L","R","LTrigger","RTrigger","Up","Down","Left","Right"],Tt=new Set(["flex","flexGrow","flexShrink","fontWeight","lineHeight","opacity","order","zIndex","zoom"]),Rt={A:{size:72,label:"A",position:{right:98,bottom:44}},B:{size:72,label:"B",position:{right:24,bottom:108}},X:{size:72,label:"X",position:{right:172,bottom:108}},Y:{size:72,label:"Y",position:{right:98,bottom:172}},Start:{size:64,label:"Start",position:{left:"50%",top:24,transform:"translateX(28px)"}},Select:{size:64,label:"Select",position:{left:"50%",top:24,transform:"translateX(-108px)"}},L:{size:62,label:"L",position:{left:28,bottom:184}},R:{size:62,label:"R",position:{right:236,bottom:184}},LTrigger:{size:76,label:"LT",position:{left:24,top:24}},RTrigger:{size:76,label:"RT",position:{right:24,top:24}},Up:{enabled:!1,size:64,label:"Up"},Down:{enabled:!1,size:64,label:"Down"},Left:{enabled:!1,size:64,label:"Left"},Right:{enabled:!1,size:64,label:"Right"}},Pt={left:{size:140,thumbSize:58,maxDistance:44,deadzone:.12,directionThreshold:.34,horizontalAxis:"Horizontal",verticalAxis:"Vertical",emitDirections:!0,position:{left:24,bottom:24}},right:{size:140,thumbSize:58,maxDistance:44,deadzone:.12,directionThreshold:.34,horizontalAxis:"SecondaryHorizontal",verticalAxis:"SecondaryVertical",emitDirections:!1,position:{right:24,bottom:236}}},X=class{config;targetElement;buttonStates=new Map;analogStates=new Map;buttons=new Map;joysticks=new Map;rootElement=null;enabled=!1;onPointerMove=e=>{for(let t of this.joysticks.values())t.pointerId===e.pointerId&&(this.consumeEvent(e),this.updateJoystickFromPoint(t,e.clientX,e.clientY))};onPointerUp=e=>{for(let t of this.buttons.values())t.pointerId===e.pointerId&&(this.consumeEvent(e),this.releaseButton(t));for(let t of this.joysticks.values())t.pointerId===e.pointerId&&(this.consumeEvent(e),this.releaseJoystick(t))};onWindowBlur=()=>{for(let e of this.buttons.values())this.releaseButton(e);for(let e of this.joysticks.values())this.releaseJoystick(e)};constructor(e,t){this.config=e??{},this.targetElement=t??document.body,this.enabled=this.resolveEnabledState(),this.enabled&&(this.mountControls(),window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerUp),window.addEventListener("blur",this.onWindowBlur))}getInput(e){if(!this.enabled)return{};let t={};for(let n of this.buttons.values()){let i=this.handleButtonState(`button:${n.slot}`,n.pointerId!==null,e);this.assignButtonState(t,this.resolveButtonTarget(n.slot),i)}for(let n of this.joysticks.values()){let i=this.handleAnalogState(`joystick:${n.id}:x`,n.valueX,e),o=this.handleAnalogState(`joystick:${n.id}:y`,n.valueY,e);this.assignAxisState(t,n.config.horizontalAxis,i),this.assignAxisState(t,n.config.verticalAxis,o),n.config.emitDirections&&(this.assignButtonState(t,this.resolveButtonTarget("Left"),this.handleButtonState(`joystick:${n.id}:left`,n.valueX<=-n.config.directionThreshold,e)),this.assignButtonState(t,this.resolveButtonTarget("Right"),this.handleButtonState(`joystick:${n.id}:right`,n.valueX>=n.config.directionThreshold,e)),this.assignButtonState(t,this.resolveButtonTarget("Up"),this.handleButtonState(`joystick:${n.id}:up`,n.valueY<=-n.config.directionThreshold,e)),this.assignButtonState(t,this.resolveButtonTarget("Down"),this.handleButtonState(`joystick:${n.id}:down`,n.valueY>=n.config.directionThreshold,e)))}return t}getName(){return"virtual-touch"}isConnected(){return this.enabled}dispose(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerUp),window.removeEventListener("blur",this.onWindowBlur),this.rootElement?.remove(),this.rootElement=null,this.buttons.clear(),this.joysticks.clear(),this.buttonStates.clear(),this.analogStates.clear()}resolveEnabledState(){return typeof window>"u"||typeof document>"u"?!1:this.config.enabled===!0?!0:this.config.enabled===!1?!1:N()}mountControls(){this.rootElement=document.createElement("div"),this.rootElement.className="zylem-virtual-touch",this.rootElement.dataset.zylemTouchRoot="true",this.rootElement.style.position="absolute",this.rootElement.style.inset="0",this.rootElement.style.pointerEvents="none",this.rootElement.style.touchAction="none",this.rootElement.style.userSelect="none",this.rootElement.style.WebkitUserSelect="none",this.rootElement.style.WebkitTouchCallout="none",this.rootElement.style.color="rgba(245, 247, 255, 0.96)",this.rootElement.style.zIndex="20",this.appendClassName(this.rootElement,this.config.className),_(this.rootElement,this.config.style),this.rootElement.addEventListener("contextmenu",e=>e.preventDefault());for(let[e,t]of this.resolveButtons())this.rootElement.appendChild(this.createButton(e,t));for(let[e,t]of this.resolveJoysticks())this.rootElement.appendChild(this.createJoystick(e,t));this.targetElement.appendChild(this.rootElement)}resolveButtons(){if(this.config.buttons===!1)return[];let e=this.config.buttons,t=[];for(let n of Gt){let i=Rt[n],o=e?.[n];if(o===!1)continue;let s={...i,...o??{},style:{...i.style,...o?.style},position:{...i.position,...o?.position},label:o?.label??i.label??n,size:o?.size??i.size??72};s.enabled!==!1&&t.push([n,s])}return t}resolveJoysticks(){if(this.config.joysticks===!1)return[];let e=this.config.joysticks,t=[];for(let n of["left","right"]){let i=Pt[n],o=e?.[n];if(o===!1)continue;let s={...i,...o??{},style:{...i.style,...o?.style},position:{...i.position,...o?.position},svg:{...i.svg,...o?.svg},size:o?.size??i.size??140,thumbSize:o?.thumbSize??i.thumbSize??58,maxDistance:o?.maxDistance??i.maxDistance??44,deadzone:o?.deadzone??i.deadzone??.12,directionThreshold:o?.directionThreshold??i.directionThreshold??.34,horizontalAxis:o?.horizontalAxis??i.horizontalAxis??"Horizontal",verticalAxis:o?.verticalAxis??i.verticalAxis??"Vertical",emitDirections:o?.emitDirections??i.emitDirections??!1};s.enabled!==!1&&t.push([n,s])}return t}createButton(e,t){let n=document.createElement("button"),i=document.createElement("div");n.type="button",n.ariaLabel=t.label,n.className=`zylem-virtual-touch__button zylem-virtual-touch__button--${e}`,n.dataset.zylemTouchButton=e,n.dataset.active="false",n.style.position="absolute",n.style.width=`${t.size}px`,n.style.height=`${t.size}px`,n.style.padding="0",n.style.margin="0",n.style.border="0",n.style.background="transparent",n.style.pointerEvents="auto",n.style.touchAction="none",n.style.cursor="pointer",n.style.appearance="none",n.style.outline="none",n.style.userSelect="none",n.style.WebkitTapHighlightColor="transparent",_(n,t.position),_(n,t.style),this.appendClassName(n,t.className),i.className="zylem-virtual-touch__button-content",i.style.width="100%",i.style.height="100%",i.style.pointerEvents="none",i.style.transform="scale(1)",i.style.transformOrigin="center",i.style.transition="transform 120ms ease, opacity 120ms ease",i.style.opacity="0.92",i.innerHTML=t.svg??Mt(t.label),n.appendChild(i),n.addEventListener("pointerdown",s=>{if(!at(s))return;let r=this.buttons.get(e);!r||r.pointerId!==null||(this.consumeEvent(s),r.pointerId=s.pointerId,this.updateButtonVisual(r,!0))});let o={slot:e,config:t,element:n,content:i,pointerId:null};return this.buttons.set(e,o),n}createJoystick(e,t){let n=document.createElement("div"),i=document.createElement("div"),o=document.createElement("div");n.className=`zylem-virtual-touch__joystick zylem-virtual-touch__joystick--${e}`,n.dataset.zylemTouchJoystick=e,n.dataset.active="false",n.style.position="absolute",n.style.width=`${t.size}px`,n.style.height=`${t.size}px`,n.style.pointerEvents="auto",n.style.touchAction="none",n.style.userSelect="none",_(n,t.position),_(n,t.style),this.appendClassName(n,t.className),i.className="zylem-virtual-touch__joystick-base",i.style.position="absolute",i.style.inset="0",i.style.pointerEvents="none",i.style.opacity="0.88",i.style.transition="opacity 120ms ease",i.innerHTML=t.svg?.base??It(),o.className="zylem-virtual-touch__joystick-thumb",o.style.position="absolute",o.style.left="50%",o.style.top="50%",o.style.width=`${t.thumbSize}px`,o.style.height=`${t.thumbSize}px`,o.style.pointerEvents="none",o.style.transform="translate(-50%, -50%) translate(0px, 0px)",o.style.transition="transform 60ms linear, opacity 120ms ease",o.style.opacity="0.94",o.innerHTML=t.svg?.thumb??Lt(),n.append(i,o);let s={id:e,config:t,element:n,base:i,thumb:o,pointerId:null,centerX:0,centerY:0,rawX:0,rawY:0,valueX:0,valueY:0};return this.joysticks.set(e,s),n.addEventListener("pointerdown",r=>{if(!at(r))return;let l=this.joysticks.get(e);if(!l||l.pointerId!==null)return;this.consumeEvent(r);let p=l.element.getBoundingClientRect();l.pointerId=r.pointerId,l.centerX=p.left+p.width/2,l.centerY=p.top+p.height/2,this.updateJoystickVisual(l,!0),this.updateJoystickFromPoint(l,r.clientX,r.clientY)}),n}handleButtonState(e,t,n){let i=this.buttonStates.get(e);return i||(i={pressed:!1,released:!1,held:0},this.buttonStates.set(e,i)),i.pressed=t&&i.held===0,i.released=!t&&i.held>0,i.held=t?i.held+n:0,i}handleAnalogState(e,t,n){let i=this.analogStates.get(e);return i||(i={value:0,held:0},this.analogStates.set(e,i)),i.value=t,i.held=t!==0?i.held+n:0,i}assignAxisState(e,t,n){e.axes||(e.axes={}),e.axes[t]=w(e.axes[t],n)}assignButtonState(e,t,n){if(t.category==="buttons"){e.buttons??={},e.buttons[t.property]=m(e.buttons[t.property],n);return}if(t.category==="directions"){e.directions??={},e.directions[t.property]=m(e.directions[t.property],n);return}e.shoulders??={},e.shoulders[t.property]=m(e.shoulders[t.property],n)}resolveButtonTarget(e){switch(e){case"LTrigger":case"RTrigger":return{category:"shoulders",property:e};case"Up":case"Down":case"Left":case"Right":return{category:"directions",property:e};default:return{category:"buttons",property:e}}}updateJoystickFromPoint(e,t,n){let i=t-e.centerX,o=n-e.centerY,s=Math.hypot(i,o),r=e.config.maxDistance,l=s>r&&s>0?r/s:1;e.rawX=i*l,e.rawY=o*l;let p=Bt(e.rawX/r,e.rawY/r,e.config.deadzone);e.valueX=p.x,e.valueY=p.y,e.thumb.style.transform=`translate(-50%, -50%) translate(${e.rawX}px, ${e.rawY}px)`}releaseButton(e){e.pointerId=null,this.updateButtonVisual(e,!1)}releaseJoystick(e){e.pointerId=null,e.rawX=0,e.rawY=0,e.valueX=0,e.valueY=0,e.thumb.style.transform="translate(-50%, -50%) translate(0px, 0px)",this.updateJoystickVisual(e,!1)}updateButtonVisual(e,t){e.element.dataset.active=String(t),e.content.style.transform=t?"scale(0.94)":"scale(1)",e.content.style.opacity=t?"1":"0.92"}updateJoystickVisual(e,t){e.element.dataset.active=String(t),e.base.style.opacity=t?"1":"0.88",e.thumb.style.opacity=t?"1":"0.94"}consumeEvent(e){e.cancelable&&e.preventDefault(),e.stopPropagation()}appendClassName(e,t){t&&(e.className=`${e.className} ${t}`.trim())}};function _(a,e){if(e)for(let[t,n]of Object.entries(e)){if(n==null)continue;let i=typeof n=="number"&&!Tt.has(t)?`${n}px`:String(n);t.includes("-")?a.style.setProperty(t,i):a.style[t]=i}}function Bt(a,e,t){let n=Math.hypot(a,e);if(n===0||n<=t)return{x:0,y:0};let o=Math.min(1,(n-t)/Math.max(1-t,1e-4))/n;return{x:a*o,y:e*o}}function Mt(a){let e=kt(a);return`
2
+ <svg viewBox="0 0 100 100" width="100%" height="100%" aria-hidden="true">
3
+ <circle cx="50" cy="50" r="45" fill="rgba(12,18,24,0.72)" stroke="currentColor" stroke-width="4" />
4
+ <circle cx="50" cy="50" r="34" fill="rgba(255,255,255,0.06)" stroke="rgba(255,255,255,0.12)" stroke-width="1.5" />
5
+ <text
6
+ x="50"
7
+ y="56"
8
+ text-anchor="middle"
9
+ font-family="ui-sans-serif, system-ui, sans-serif"
10
+ font-size="${e.length>2?24:34}"
11
+ font-weight="700"
12
+ fill="currentColor"
13
+ >${e}</text>
14
+ </svg>
15
+ `}function It(){return`
16
+ <svg viewBox="0 0 140 140" width="100%" height="100%" aria-hidden="true">
17
+ <circle cx="70" cy="70" r="62" fill="rgba(10,16,20,0.64)" stroke="currentColor" stroke-width="4" />
18
+ <circle cx="70" cy="70" r="40" fill="rgba(255,255,255,0.04)" stroke="rgba(255,255,255,0.12)" stroke-width="1.5" />
19
+ </svg>
20
+ `}function Lt(){return`
21
+ <svg viewBox="0 0 64 64" width="100%" height="100%" aria-hidden="true">
22
+ <circle cx="32" cy="32" r="28" fill="rgba(22,30,38,0.9)" stroke="currentColor" stroke-width="3.5" />
23
+ </svg>
24
+ `}function kt(a){return a.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function at(a){return a.pointerType==="touch"}var q=class{inputMap=new Map;currentInputs={};previousInputs={};targetElement;mouseTargetElement;constructor(e,t){this.targetElement=t?.targetElement,this.mouseTargetElement=t?.mouseTargetElement??t?.targetElement;let n=this.buildPlayerEntries(e);for(let{player:i,config:o,gamepadIndex:s,isP1:r}of n)this.addConfigurableProviders(i,o,r),this.addInputProvider(i,new W(s))}configure(e){let t=this.buildPlayerEntries(e);for(let{player:n,config:i,isP1:o}of t){let r=(this.inputMap.get(n)??[]).filter(l=>l instanceof A||l instanceof U||l instanceof X?(l.dispose(),!1):!0);this.inputMap.set(n,[...this.createConfigurableProviders(i,o),...r])}}addInputProvider(e,t){this.inputMap.has(e)||this.inputMap.set(e,[]),this.inputMap.get(e)?.push(t)}dispose(){for(let e of this.inputMap.values())for(let t of e)t.dispose?.();this.inputMap.clear(),this.currentInputs={},this.previousInputs={}}getInputs(e){let t={};return this.inputMap.forEach((n,i)=>{let o=`p${i}`,s=n.reduce((r,l)=>{let p=l.getInput(e);return this.mergeInputs(r,p)},{});t[o]={playerNumber:i,...s}}),t}buildPlayerEntries(e){return[{player:1,config:e?.p1,gamepadIndex:0,isP1:!0},{player:2,config:e?.p2,gamepadIndex:1,isP1:!1},{player:3,config:e?.p3,gamepadIndex:2,isP1:!1},{player:4,config:e?.p4,gamepadIndex:3,isP1:!1},{player:5,config:e?.p5,gamepadIndex:4,isP1:!1},{player:6,config:e?.p6,gamepadIndex:5,isP1:!1},{player:7,config:e?.p7,gamepadIndex:6,isP1:!1},{player:8,config:e?.p8,gamepadIndex:7,isP1:!1}]}addConfigurableProviders(e,t,n){for(let i of this.createConfigurableProviders(t,n))this.addInputProvider(e,i)}createConfigurableProviders(e,t){let n=[];if(e?.key){let i=e.includeDefaults??t;n.push(new A(e.key,{includeDefaultBase:i}))}else t&&n.push(new A);return e?.mouse&&n.push(new U(e.mouse,this.mouseTargetElement)),e?.touch&&n.push(new X(e.touch,this.targetElement)),n}mergeInputs(e,t){return{buttons:{A:m(e.buttons?.A,t.buttons?.A),B:m(e.buttons?.B,t.buttons?.B),X:m(e.buttons?.X,t.buttons?.X),Y:m(e.buttons?.Y,t.buttons?.Y),Start:m(e.buttons?.Start,t.buttons?.Start),Select:m(e.buttons?.Select,t.buttons?.Select),L:m(e.buttons?.L,t.buttons?.L),R:m(e.buttons?.R,t.buttons?.R)},directions:{Up:m(e.directions?.Up,t.directions?.Up),Down:m(e.directions?.Down,t.directions?.Down),Left:m(e.directions?.Left,t.directions?.Left),Right:m(e.directions?.Right,t.directions?.Right)},axes:{Horizontal:w(e.axes?.Horizontal,t.axes?.Horizontal),Vertical:w(e.axes?.Vertical,t.axes?.Vertical),SecondaryHorizontal:w(e.axes?.SecondaryHorizontal,t.axes?.SecondaryHorizontal),SecondaryVertical:w(e.axes?.SecondaryVertical,t.axes?.SecondaryVertical)},shoulders:{LTrigger:m(e.shoulders?.LTrigger,t.shoulders?.LTrigger),RTrigger:m(e.shoulders?.RTrigger,t.shoulders?.RTrigger)},pointer:t.pointer??e.pointer}}};var Q=class{_previousTime;_currentTime;_startTime;_delta;_elapsed;_timescale;_document;_pageVisibilityHandler;constructor(){this._previousTime=0,this._currentTime=0,this._startTime=we(),this._delta=0,this._elapsed=0,this._timescale=1,this._document=null,this._pageVisibilityHandler=null}connect(e){this._document=e,e.hidden!==void 0&&(this._pageVisibilityHandler=Dt.bind(this),e.addEventListener("visibilitychange",this._pageVisibilityHandler,!1))}disconnect(){this._pageVisibilityHandler!==null&&(this._document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this._pageVisibilityHandler=null),this._document=null}getDelta(){return this._delta/1e3}getElapsed(){return this._elapsed/1e3}getTimescale(){return this._timescale}setTimescale(e){return this._timescale=e,this}reset(){return this._currentTime=we()-this._startTime,this}dispose(){this.disconnect()}update(e){return this._pageVisibilityHandler!==null&&this._document.hidden===!0?this._delta=0:(this._previousTime=this._currentTime,this._currentTime=(e!==void 0?e:we())-this._startTime,this._delta=(this._currentTime-this._previousTime)*this._timescale,this._elapsed+=this._delta),this}};function we(){return performance.now()}function Dt(){this._document.hidden===!1&&this.reset()}var Y={FourByThree:1.3333333333333333,SixteenByNine:1.7777777777777777,NineBySixteen:.5625,TwentyOneByNine:2.3333333333333335,OneByOne:1},ee=class{container;canvas;aspectRatio;onResize;handleResizeBound;resizeObserver=null;constructor(e){this.container=e.container,this.canvas=e.canvas,this.aspectRatio=(typeof e.aspectRatio=="number",e.aspectRatio),this.onResize=e.onResize,this.handleResizeBound=this.apply.bind(this)}attach(){window.addEventListener("resize",this.handleResizeBound),typeof ResizeObserver<"u"&&(this.resizeObserver=new ResizeObserver(this.handleResizeBound),this.resizeObserver.observe(this.container)),this.apply()}detach(){window.removeEventListener("resize",this.handleResizeBound),this.resizeObserver?.disconnect(),this.resizeObserver=null}measure(){let e=this.container.getBoundingClientRect(),t=Math.round(e.width||this.container.clientWidth||0),n=Math.round(e.height||this.container.clientHeight||0);if(t>0&&n>0){if(t/n>this.aspectRatio){let p=n;return{width:Math.round(p*this.aspectRatio),height:p}}let r=t,l=Math.round(r/this.aspectRatio);return{width:r,height:l}}if(t>0){let s=t,r=Math.round(s/this.aspectRatio);return{width:s,height:r}}if(n>0){let s=n;return{width:Math.round(s*this.aspectRatio),height:s}}let i=window.innerWidth,o=Math.round(i/this.aspectRatio);return{width:i,height:o}}apply(){let{width:e,height:t}=this.measure();this.canvas.style.width=`${e}px`,this.canvas.style.height=`${t}px`,this.onResize?.(e,t)}};var ot={NES:{displayAspect:1.3333333333333333,resolutions:[{key:"256x240",width:256,height:240,notes:"Standard NTSC; effective 240p."}]},SNES:{displayAspect:1.3333333333333333,resolutions:[{key:"256x224",width:256,height:224,notes:"Common 240p-equivalent mode."},{key:"512x448",width:512,height:448,notes:"Hi-res interlaced (480i)."}]},N64:{displayAspect:1.3333333333333333,resolutions:[{key:"320x240",width:320,height:240,notes:"Common 240p mode."},{key:"640x480",width:640,height:480,notes:"Higher resolution (480i)."}]},PS1:{displayAspect:1.3333333333333333,resolutions:[{key:"320x240",width:320,height:240,notes:"Progressive 240p common."},{key:"640x480",width:640,height:480,notes:"Interlaced 480i for higher detail."}]},PS2:{displayAspect:1.3333333333333333,resolutions:[{key:"640x480",width:640,height:480,notes:"480i/480p baseline."},{key:"720x480",width:720,height:480,notes:"480p (widescreen capable in some titles)."},{key:"1280x720",width:1280,height:720,notes:"720p (select titles)."}]},PS5:{displayAspect:1.7777777777777777,resolutions:[{key:"720x480",width:720,height:480,notes:"Legacy compatibility."},{key:"1280x720",width:1280,height:720,notes:"720p."},{key:"1920x1080",width:1920,height:1080,notes:"1080p."},{key:"2560x1440",width:2560,height:1440,notes:"1440p."},{key:"3840x2160",width:3840,height:2160,notes:"4K (up to 120Hz)."},{key:"7680x4320",width:7680,height:4320,notes:"8K (limited)."}]},XboxOne:{displayAspect:1.7777777777777777,resolutions:[{key:"1280x720",width:1280,height:720,notes:"720p (original)."},{key:"1920x1080",width:1920,height:1080,notes:"1080p (original)."},{key:"3840x2160",width:3840,height:2160,notes:"4K UHD (S/X models)."}]},MobilePortrait:{displayAspect:.5625,resolutions:[{key:"360x640",width:360,height:640,notes:"Low-density phone portrait baseline."},{key:"720x1280",width:720,height:1280,notes:"HD phone portrait."},{key:"1080x1920",width:1080,height:1920,notes:"Full HD phone portrait."}]}};function Ce(a){return ot[a].displayAspect}function xe(a,e){let t=ot[a]?.resolutions||[];if(!e)return t[0];let n=e.toLowerCase().replace(/\s+/g,"").replace("\xD7","x");return t.find(i=>i.key.toLowerCase()===n)}function Ee(a){if(!a)return null;let t=String(a).toLowerCase().trim().replace(/\s+/g,"").replace("\xD7","x").match(/^(\d+)x(\d+)$/);if(!t)return null;let n=parseInt(t[1],10),i=parseInt(t[2],10);return!Number.isFinite(n)||!Number.isFinite(i)?null:{width:n,height:i}}var Ge=null,Te=class{constructor(e,t,n,i,o,s,r,l,p,g,u,d,S){this.id=e;this.globals=t;this.stages=n;this.debug=i;this.time=o;this.input=s;this.aspectRatio=r;this.internalResolution=l;this.fullscreen=p;this.bodyBackground=g;this.container=u;this.containerId=d;this.canvas=S}};function At(a={}){return a.deviceProfile==="mobile"?!0:a.deviceProfile==="desktop"?!1:a.viewportSize?N({viewportSize:a.viewportSize,allowViewportOnly:!0}):N()}function zt(a,e){if(e)return e;if(a){let i=document.getElementById(a);if(i)return i}let t=a||"zylem-root",n=document.createElement("main");return n.setAttribute("id",t),n.style.position="relative",n.style.width="100%",n.style.height="100%",document.body.appendChild(n),n}function Vt(a){let e=a?.id??"zylem";return{id:e,globals:a?.globals??{},stages:a?.stages??[],debug:!!a?.debug,time:a?.time??0,input:a?.input,aspectRatio:Y.SixteenByNine,fullscreen:!0,bodyBackground:"#000000",containerId:e}}var rt=360;function st(a,e){if(!a)return;if(typeof a=="string"){if(a==="native")return Ge;let i=Ee(a);if(i)return i;if(e){let o=xe(e,a);if(o)return{width:o.width,height:o.height}}return}let t=a.width,n=a.height;if(Number.isFinite(t)&&Number.isFinite(n))return{width:t,height:n}}function Ot(a,e,t,n){if(typeof a=="number")return a;if(typeof a=="string")return Y[a]??t;if(e)try{return Ce(e)||t}catch{return t}return n?n.width/n.height:t}function Ht(a){let e=Number.isFinite(a)&&a>0?a:Y.SixteenByNine;if(e>=1){let i=rt;return{width:Math.round(i*e),height:i}}let t=rt,n=Math.round(t/e);return{width:t,height:n}}function Z(a,e={}){let t=Vt({id:a?.id??"zylem",debug:!!a?.debug,time:a?.time??0,input:a?.input,stages:a?.stages??[],globals:a?.globals??{}}),n=a?.containerId??t.containerId,i=zt(n,a?.container??null),o=a?.mobile,s=At(e),r=s?o?.preset??a?.preset:a?.preset,l=st(a?.resolution,a?.preset),p=st(o?.resolution,o?.preset??a?.preset),g=(s?lt(p):void 0)??lt(l),u=s?o?.aspectRatio??a?.aspectRatio:a?.aspectRatio,d=Ot(u,r,t.aspectRatio,g),S=Ft(s,p,l,d),f=a?.fullscreen??t.fullscreen,G=a?.bodyBackground??t.bodyBackground,P=a?.canvas??void 0,B=Ut(a?.input??t.input,o?.controls);return new Te(a?.id??t.id,a?.globals??t.globals,a?.stages??t.stages,!!(a?.debug??t.debug),a?.time??t.time,B,d,S,f,G,i,n,P)}function lt(a){if(a)return a}function Ft(a,e,t,n){if(a)return e===Ge?void 0:e??Ht(n);if(t!==Ge)return t}function Ut(a,e){if(!e)return a;let n=_e("p1",{enabled:"auto",...e===!0?{}:e});return L(n,a??{})}function Nt(a){return{...a}}var te=class{id;container;canvas;bodyBackground;fullscreen;aspectRatio;ratioDelegate=null;overlayContainer=null;constructor(e){this.id=e.id,this.container=this.ensureContainer(e.containerId??e.id,e.container),this.canvas=e.canvas??document.createElement("canvas"),this.bodyBackground=e.bodyBackground,this.fullscreen=!!e.fullscreen,this.aspectRatio=(typeof e.aspectRatio=="number",e.aspectRatio)}applyBodyBackground(){this.bodyBackground&&(document.body.style.background=this.bodyBackground)}mountCanvas(){this.mountChildren(this.canvas)}mountRenderer(e,t){this.mountChildren(e),this.canvas=e,this.attachAspectRatio(t)}getOverlayContainer(){return this.ensureOverlayContainer()}centerIfFullscreen(){if(!this.fullscreen)return;let e=this.container.style;e.display="flex",e.alignItems="center",e.justifyContent="center",e.position="relative",e.inset="0"}attachAspectRatio(e){this.ratioDelegate?(this.ratioDelegate.canvas=this.canvas,this.ratioDelegate.onResize=e,this.ratioDelegate.aspectRatio=this.aspectRatio,this.ratioDelegate.apply()):(this.ratioDelegate=new ee({container:this.container,canvas:this.canvas,aspectRatio:this.aspectRatio,onResize:e}),this.ratioDelegate.attach())}setAspectRatio(e){this.aspectRatio=e,this.ratioDelegate&&(this.ratioDelegate.aspectRatio=e,this.ratioDelegate.apply())}reapplyLayout(){this.ratioDelegate?.apply()}destroy(){this.ratioDelegate?.detach(),this.ratioDelegate=null}mountChildren(e){for(;this.container.firstChild;)this.container.removeChild(this.container.firstChild);this.container.appendChild(e),this.container.appendChild(this.ensureOverlayContainer())}ensureOverlayContainer(){if(this.overlayContainer)return this.overlayContainer;let e=document.createElement("div");return e.dataset.zylemOverlayRoot="true",e.style.position="absolute",e.style.inset="0",e.style.pointerEvents="none",e.style.touchAction="none",e.style.zIndex="10",this.overlayContainer=e,e}ensureContainer(e,t){if(t)return t;if(e){let o=document.getElementById(e);if(o)return o}let n=e||this.id||"zylem-root",i=document.createElement("main");return i.setAttribute("id",n),i.style.position="relative",i.style.width="100%",i.style.height="100%",document.body.appendChild(i),i}};import _t from"stats.js";import{subscribe as Xt}from"valtio/vanilla";var ut="zylem-fps-host",ne=class{statsRef=null;unsubscribe=null;host=null;onFpsHost=e=>{let t=e.detail;this.host=t?.element??null,this.attachStats()};constructor(){typeof window<"u"&&window.addEventListener(ut,this.onFpsHost),this.updateDebugUI(),this.unsubscribe=Xt(v,()=>{this.updateDebugUI()})}begin(){this.statsRef?.begin()}end(){this.statsRef?.end()}styleForPanel(e){e.style.position="relative",e.style.top="auto",e.style.right="auto",e.style.bottom="auto",e.style.left="auto",e.style.zIndex="auto"}detachStats(){let e=this.statsRef?.dom;e?.parentNode&&e.parentNode.removeChild(e)}attachStats(){if(this.statsRef){if(!this.host){this.detachStats();return}this.styleForPanel(this.statsRef.dom),this.statsRef.dom.parentNode!==this.host&&this.host.appendChild(this.statsRef.dom)}}updateDebugUI(){v.enabled&&!this.statsRef?(this.statsRef=new _t,this.statsRef.showPanel(0),this.attachStats()):!v.enabled&&this.statsRef&&(this.detachStats(),this.statsRef=null)}dispose(){typeof window<"u"&&window.removeEventListener(ut,this.onFpsHost),this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null),this.detachStats(),this.statsRef=null,this.host=null}};var ie=class{loadingHandlers=[];stageLoadingUnsubscribes=[];onLoading(e){return this.loadingHandlers.push(e),()=>{this.loadingHandlers=this.loadingHandlers.filter(t=>t!==e)}}emit(e){for(let n of this.loadingHandlers)try{n(e)}catch(i){console.error("Game loading handler failed",i)}let t=`loading:${e.type}`;E.emit(t,e)}wireStageLoading(e,t){let n=e.onLoading(i=>{this.emit({type:i.type,message:i.message??"",progress:i.progress??0,current:i.current,total:i.total,stageName:e.uuid??`Stage ${t}`,stageIndex:t})});typeof n=="function"&&this.stageLoadingUnsubscribes.push(n)}unwireAllStages(){for(let e of this.stageLoadingUnsubscribes)try{e()}catch{}this.stageLoadingUnsubscribes=[]}dispose(){this.unwireAllStages(),this.loadingHandlers=[]}};import{getZylemBridge as Yt}from"@zylem/bridge";import{nanoid as Zt}from"nanoid";var ae=class{container=null;camera=null;rendererManager=null;gameCanvas=null;config=null;stage=null;mounted=!1;setGameCanvas(e){this.gameCanvas=e,this.tryMount()}setConfig(e){this.config=e,this.tryMount()}setContainer(e){this.container=e,this.tryMount()}setStage(e){this.stage=e,this.mounted&&this.gameCanvas?.reapplyLayout()}setCamera(e){this.camera=e,this.tryMount()}setRendererManager(e){this.rendererManager=e,this.tryMount()}tryMount(){this.mounted||!this.container||!this.gameCanvas||(this.rendererManager?this.mountWithRendererManager():this.camera&&this.mountWithCamera())}mountWithRendererManager(){if(!this.rendererManager||!this.gameCanvas)return;let e=this.rendererManager.getDomElement();this.gameCanvas.mountRenderer(e,(t,n)=>{if(!this.rendererManager)return;let i=this.config?.internalResolution;if(i)this.rendererManager.setPixelRatio(1),this.rendererManager.resize(i.width,i.height),this.stage?.resize(i.width,i.height);else{let o=window.devicePixelRatio||1;this.rendererManager.setPixelRatio(o),this.rendererManager.resize(t,n),this.stage?.resize(t,n)}}),this.mounted=!0}mountWithCamera(){if(!this.camera||!this.gameCanvas)return;let e=this.camera.getDomElement();this.gameCanvas.mountRenderer(e,(t,n)=>{if(!this.camera)return;let i=this.config?.internalResolution;if(i)this.camera.setPixelRatio(1),this.camera.resize(i.width,i.height);else{let o=window.devicePixelRatio||1;this.camera.setPixelRatio(o),this.camera.resize(t,n)}}),this.mounted=!0}reset(){this.camera=null,this.stage=null,this.mounted=!1}dispose(){this.container=null,this.camera=null,this.rendererManager=null,this.gameCanvas=null,this.config=null,this.stage=null,this.mounted=!1}};var oe=class a{id;initialGlobals={};customSetup=null;customUpdate=null;customDestroy=null;stages=[];stageMap=new Map;currentStageId="";previousTimeStamp=0;totalTime=0;timer;inputManager;wrapperRef;globalInputConfig;defaultCamera=null;rendererManager=null;container=null;canvas=null;aspectRatioDelegate=null;resolvedConfig=null;gameCanvas=null;animationFrameId=null;isDisposed=!1;loadInFlight=!1;hasStarted=!1;debugDelegate=null;loadingDelegate=new ie;rendererObserver=new ae;eventBusUnsubscribes=[];thumbnailUnsubscribes=[];lastPublishedGameConfig=null;gameBridge=new Je;cutscenePreview=new nt(()=>this.currentStage()?.wrappedStage??null,e=>this.gameBridge.publishCutsceneStatus(e),{},e=>this.gameBridge.publishCutsceneView(e));catalogUnsubscribe=null;gameUpdateParams={};stageSetupParams={};stageUpdateParams={};frameCallback=e=>this.loop(e);sourceOptions;displayRuntime;static FRAME_LIMIT=120;static FRAME_DURATION=1e3/a.FRAME_LIMIT;static MAX_DELTA_SECONDS=1/30;constructor(e,t,n={}){this.wrapperRef=t,this.timer=new Q,this.timer.connect(document),this.sourceOptions={...e},this.displayRuntime={...n};let i=Z(e,this.displayRuntime);this.globalInputConfig=i.input,this.id=i.id,this.stages=i.stages||[],this.container=i.container,this.canvas=i.canvas??null,this.resolvedConfig=i,this.loadGameCanvas(i),this.container=this.gameCanvas?.container??this.container,this.inputManager=new q(i.input,{targetElement:this.gameCanvas?.getOverlayContainer(),mouseTargetElement:this.gameCanvas?.container}),this.loadDebugOptions(e),this.setGlobals(e),Qe(),et(),this.gameBridge.connect({resolveEntity:o=>this.currentStage()?.wrappedStage?.entityDelegate.childrenMap.get(o)??null,setStageVariable:(o,s)=>{let r=this.currentStage()?.wrappedStage?.state;r&&(r.variables[o]=s)},createEntity:(o,s,r)=>{this.createCatalogEntity(o,s,r)},applySceneOperation:(o,s)=>{this.currentStage()?.wrappedStage?.debugDelegate?.applySceneOperation(o,s)},pickEntity:o=>this.pickEntityAtNdc(o),cutscene:this.cutscenePreview,cameraPose:()=>this.cutscenePreview.cameraPose(),levelSync:o=>{this.currentStage()?.wrappedStage?.debugDelegate?.syncLevel(o)},levelPlay:o=>{this.currentStage()?.wrappedStage?.debugDelegate?.playLevel(o)},levelClose:()=>{this.currentStage()?.wrappedStage?.debugDelegate?.closeLevel()},applySwatches:o=>{let s=this.currentStage()?.wrappedStage?.debugDelegate;return s?s.applySwatches(o):{results:o.uuids.flatMap(r=>o.swatches.map(l=>({uuid:r,kind:l.kind,source:l.source,ok:!1,reason:"entity-not-found"}))),entries:[]}}}),this.publishEntityCatalog(),this.catalogUnsubscribe=je(()=>this.publishEntityCatalog())}pickEntityAtNdc(e){let t=this.currentStage()?.wrappedStage,n=t?.debugDelegate?.pickAtNdc(e.x,e.y);if(!t||!n)return null;let i=t.entityDelegate.childrenMap.get(n.uuid);return i?this.buildEntitySummary(i)??{uuid:n.uuid,name:n.name||"Unnamed",type:ge(i),position:he(i).position,rotation:he(i).rotation,scale:me(i)}:null}publishEntityCatalog(){this.gameBridge.publishCatalog(We())}createCatalogEntity(e,t,n){let i=this.currentStage()?.wrappedStage,o=K(e);if(!i||!o)return;let s=n?.position??{x:0,y:0,z:0},r=o.create({position:s,props:{...o.defaultProps??{},...t??{}}});r&&Promise.resolve(r).then(async l=>{l&&(await i.entityDelegate.spawnEntity(l),$e({opId:Zt(10),kind:"create",label:`Add ${o.label}`,entries:[{uuid:l.uuid,typeId:e,...t&&Object.keys(t).length>0?{props:t}:{}}]}))}).catch(l=>{console.error("entity:create failed",l)})}setDisplayRuntime(e){this.displayRuntime={...e};let t=Z(this.sourceOptions,this.displayRuntime);this.resolvedConfig=t,this.rendererObserver.setConfig(t),this.gameCanvas?.setAspectRatio(t.aspectRatio),this.publishGameConfig()}loadGameCanvas(e){this.gameCanvas=new te({id:e.id,container:e.container,containerId:e.containerId,canvas:this.canvas??void 0,bodyBackground:e.bodyBackground,fullscreen:e.fullscreen,aspectRatio:e.aspectRatio}),this.gameCanvas.applyBodyBackground(),this.gameCanvas.mountCanvas(),this.gameCanvas.centerIfFullscreen(),this.rendererObserver.setGameCanvas(this.gameCanvas),this.resolvedConfig&&this.rendererObserver.setConfig(this.resolvedConfig),this.container&&this.rendererObserver.setContainer(this.container),this.subscribeToEventBus()}loadDebugOptions(e){e.debug!==void 0&&(v.enabled=!!e.debug),this.debugDelegate=new ne}isLoading(){return this.loadInFlight}async loadStage(e,t=0,n){if(this.loadInFlight){console.warn("loadStage ignored: a stage load is already in progress");return}this.loadInFlight=!0;try{await this.performLoadStage(e,t,n)}finally{this.loadInFlight=!1}}async performLoadStage(e,t=0,n){let i=n?tt(n):null;this.cutscenePreview.releaseStage();let o=this.currentStage()??null,s=o?.wrappedStage??null,r=s?.scene?.scene??null,l=s?.cameraManagerRef?.primaryCamera?.camera??s?.cameraRef?.camera??null;i&&this.rendererManager?.initialized&&o&&r&&l&&this.rendererManager.beginSnapshotTransition(i,r,l),this.unloadCurrentStage();let g=e.options[0];if(this.loadingDelegate.wireStageLoading(e,t),this.rendererManager||(this.rendererManager=new Ne,await this.rendererManager.initRenderer()),x.setRenderer(this.rendererManager.renderer),await e.load(this.id,g?.camera,this.rendererManager),this.stageMap.set(e.wrappedStage.uuid,e),this.currentStageId=e.wrappedStage.uuid,this.defaultCamera=e.wrappedStage.cameraRef,this.wireEntityThumbnails(e),this.rendererObserver.setStage(e.wrappedStage??null),this.rendererManager&&this.rendererObserver.setRendererManager(this.rendererManager),this.applyInputConfig(e),e.onInputConfigChanged=()=>this.applyInputConfig(e),this.hasStarted&&e.wrappedStage&&!e.wrappedStage.hasSetup){let u=this.params(),d={...this.stageSetupParams};d.inputs=u.inputs,d.globals=u.globals,d.camera=u.camera,d.stage=u.stage,d.game=u.game,d.me=e.wrappedStage,e.start(d)}this.publishGameConfig(),this.publishStageSnapshot(),this.cutscenePreview.stageReady()}applyInputConfig(e){let t=L(this.globalInputConfig??{},e.inputConfig??{});this.inputManager.configure(t)}setGlobalInputConfig(e){this.globalInputConfig=e;let t=this.currentStage();t&&this.applyInputConfig(t)}unloadCurrentStage(){if(!this.currentStageId)return;let e=this.getStage(this.currentStageId);if(e){if(this.clearEntityThumbnailWiring(),x.clear(),e.onInputConfigChanged=null,e?.wrappedStage){try{e.wrappedStage.nodeDestroy({me:e.wrappedStage,globals:V.globals})}catch(t){console.error("Failed to destroy previous stage",t)}e.wrappedStage=null}e.dispose(),this.stageMap.delete(this.currentStageId),this.currentStageId="",this.defaultCamera=null,this.rendererObserver.reset()}}setGlobals(e){this.initialGlobals={...e.globals};for(let t in this.initialGlobals){let n=this.initialGlobals[t];n===void 0&&console.error(`global ${t} is undefined`),ze(t,n)}}params(){let e=this.currentStage(),t=this.timer.getDelta(),n=this.inputManager.getInputs(t),i=e?.wrappedStage?.cameraRef||this.defaultCamera,o=this.gameUpdateParams;return o.delta=t,o.inputs=n,o.globals=He(),o.me=this,o.camera=i,o.stage=e,o.game=this.wrapperRef,o}start(){let e=this.currentStage(),t=this.params(),n=this.stageSetupParams;n.inputs=t.inputs,n.globals=t.globals,n.camera=t.camera,n.stage=t.stage,n.game=t.game,n.me=e.wrappedStage,e.start(n),this.customSetup&&this.customSetup(t),this.hasStarted=!0,this.loop(0)}step(e){let t=this.currentStage();if(!t||!t.wrappedStage)return;let n=this.params(),i=e!==void 0?e:n.delta,o=Math.min(Math.max(i,0),a.MAX_DELTA_SECONDS);n.delta=o,this.customUpdate&&this.customUpdate(n);let s=this.currentStage();if(s!==t||!s?.wrappedStage){this.totalTime+=o,V.time=this.totalTime;return}let r=this.stageUpdateParams;r.delta=n.delta,r.inputs=n.inputs,r.globals=n.globals,r.camera=n.camera,r.stage=n.stage,r.game=n.game,r.me=t.wrappedStage,t.wrappedStage?.nodeUpdate(r),this.totalTime+=o,V.time=this.totalTime}loop(e){this.debugDelegate?.begin(),Ue()||(this.timer.update(e),this.step(),this.previousTimeStamp=e),this.debugDelegate?.end(),this.outOfLoop(),this.gameBridge.publishSelectedPoses(),this.cutscenePreview.frame(),this.isDisposed||(this.animationFrameId=requestAnimationFrame(this.frameCallback))}dispose(){this.isDisposed=!0,this.cutscenePreview.unload(),this.catalogUnsubscribe?.(),this.catalogUnsubscribe=null,this.gameBridge.disconnect(),this.animationFrameId!==null&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null),this.unloadCurrentStage(),this.debugDelegate&&(this.debugDelegate.dispose(),this.debugDelegate=null),this.eventBusUnsubscribes.forEach(e=>e()),this.eventBusUnsubscribes=[],this.rendererObserver.dispose(),this.inputManager.dispose(),this.rendererManager&&(x.setRenderer(null),this.rendererManager.dispose(),this.rendererManager=null),x.clear(),Yt().channel.reset(),this.timer.dispose(),this.customDestroy&&this.customDestroy({me:this,globals:V.globals}),O()}outOfLoop(){let e=this.currentStage();e&&e.wrappedStage.outOfLoop()}getStage(e){return this.stageMap.get(e)}currentStage(){return this.getStage(this.currentStageId)}onLoading(e){return this.loadingDelegate.onLoading(e)}buildStageConfigPayload(){let e=this.currentStage();if(!e?.wrappedStage)return null;let t=e.wrappedStage.state,n=t.backgroundColor,i=typeof n=="string"?n:`#${n.getHexString()}`;return{id:e.wrappedStage.uuid,backgroundColor:i,backgroundImage:t.backgroundImage,gravity:{x:t.gravity.x,y:t.gravity.y,z:t.gravity.z},inputs:t.inputs,variables:t.variables}}buildEntitySummary(e){if(e.options?.editorOwned||H(e.options))return null;let t=Ye(e),n=t?.position??ye(e.options?.position,fe),i=t?.rotation??{x:0,y:0,z:0},o=t?.scale??me(e),s=t?.quaternion,r=x.get(e.uuid);return{uuid:e.uuid,name:e.name||"Unnamed",type:ge(e),position:n,rotation:i,scale:o,quaternion:s,thumbnail:r?.dataUrl??null,bounds:r?.bounds}}buildEntitiesPayload(){let e=this.currentStage();if(!e?.wrappedStage)return[];let t=[];return e.wrappedStage.entityDelegate.childrenMap.forEach(n=>{let i=this.buildEntitySummary(n);i&&t.push(i)}),t}wireEntityThumbnails(e){if(this.clearEntityThumbnailWiring(),!e.wrappedStage)return;let t=s=>{if(s.options?.editorOwned||!this.gameBridge.wantsThumbnails()||H(s.options))return;let r=s.group??s.mesh??null;r&&x.ensure(s.uuid,r).then(l=>{l&&!this.isDisposed&&this.gameBridge.queueThumbnails([{uuid:s.uuid,url:l.dataUrl,bounds:l.bounds}])})},n=e.wrappedStage.onEntityAdded(s=>{if(this.gameBridge.wantsEntityUpdates()){let r=this.buildEntitySummary(s);r&&this.gameBridge.queueEntityUpsert([r])}t(s)},{replayExisting:!0});this.thumbnailUnsubscribes.push(n);let i=s=>{if(!s.success)return;let r=e.wrappedStage?.entityDelegate.childrenMap.get(s.entityId);r&&(x.invalidate(s.entityId),t(r))};E.on("entity:model:loaded",i),this.thumbnailUnsubscribes.push(()=>{E.off("entity:model:loaded",i)});let o=s=>{x.invalidate(s.entityId),this.gameBridge.wantsEntityUpdates()&&this.gameBridge.queueEntityRemoved([s.entityId])};E.on("entity:destroyed",o),this.thumbnailUnsubscribes.push(()=>{E.off("entity:destroyed",o)}),this.wireEditorBackfill(e)}wireEditorBackfill(e){let t=this.gameBridge.onEditorAttached(()=>{if(!(this.isDisposed||this.currentStage()!==e)){this.lastPublishedGameConfig=null,this.publishGameConfig(),this.publishStageSnapshot();for(let n of e.wrappedStage?.entityDelegate.childrenMap.values()??[]){let i=n;if(i.options?.editorOwned||H(i.options))continue;let o=i.group??i.mesh??null;o&&x.ensure(i.uuid,o).then(s=>{s&&!this.isDisposed&&this.gameBridge.queueThumbnails([{uuid:i.uuid,url:s.dataUrl,bounds:s.bounds}])})}}});this.thumbnailUnsubscribes.push(t)}clearEntityThumbnailWiring(){this.thumbnailUnsubscribes.forEach(e=>{try{e()}catch{}}),this.thumbnailUnsubscribes=[]}buildGameConfigPayload(){return this.resolvedConfig?{id:this.resolvedConfig.id,aspectRatio:this.resolvedConfig.aspectRatio,fullscreen:this.resolvedConfig.fullscreen,bodyBackground:this.resolvedConfig.bodyBackground,internalResolution:this.resolvedConfig.internalResolution,debug:this.resolvedConfig.debug}:null}publishGameConfig(){let e=this.buildGameConfigPayload();if(!e)return;let t=JSON.stringify(e);t!==this.lastPublishedGameConfig&&(this.lastPublishedGameConfig=t,this.gameBridge.publishConfig(e))}publishStageSnapshot(){this.gameBridge.publishStageSnapshot({stage:this.buildStageConfigPayload(),entities:this.buildEntitiesPayload()})}subscribeToEventBus(){this.eventBusUnsubscribes.push(Ae.on("game:state:updated",e=>{this.gameBridge.publishVariable({path:e.path,value:e.value,previousValue:e.previousValue})}))}};async function pt(a){let{getGameDefaultConfig:e}=await import("./game-default-Y7TULWXQ.js"),t={...e()},n=[],i=[],o=[];Object.values(a).forEach(r=>{if(r instanceof J)i.push(r);else if(r instanceof Se)o.push(r);else if(r instanceof ve)o.push(r);else if(r?.constructor?.name==="Object"&&typeof r=="object"){let l=Object.assign({...e()},{...r});n.push(l)}}),n.forEach(r=>{t=Object.assign(t,{...r})});let s=t;return s.input=n[0].input,i.forEach(r=>{r.addEntities(o)}),i.length?s.stages=i:s.stages[0].addEntities(o),s}function dt(a){return!!a.find(t=>t instanceof J)}function Re(a){for(let e of a)if(e&&typeof e=="object"&&!(e instanceof J)&&!(e instanceof ve)&&!(e instanceof Se)){let t=e;if(t.globals)return t.globals}}import{proxy as Kt}from"valtio/vanilla";import{get as Jt,set as $t}from"idb-keyval";import{pack as Wt,unpack as jt}from"msgpackr";var h=Kt({previous:null,current:null,next:null,isLoading:!1}),re={staticRegistry:new Map,registerStaticStage(a,e){this.staticRegistry.set(a,e)},async loadStageData(a){try{let e=await Jt(a);if(e)return jt(e)}catch(e){console.warn(`Failed to load stage ${a} from storage`,e)}if(this.staticRegistry.has(a))return this.staticRegistry.get(a);throw new Error(`Stage ${a} not found in storage and static loading not fully implemented.`)},async transitionForward(a,e){if(!h.isLoading){h.isLoading=!0;try{h.current&&await $t(h.current.id,Wt(h.current)),h.previous=h.current,h.current=h.next,h.current?.id!==a&&(e?h.current=await e(a):h.current=await this.loadStageData(a)),h.next=null}catch(t){console.error("Failed to transition stage:",t)}finally{h.isLoading=!1}}},async preloadNext(a,e){e?h.next=await e(a):h.next=await this.loadStageData(a)}};var Pe={async createFromBlueprint(a){let e=F({});if(a.entities)for(let t of a.entities)try{let n=await it.createFromBlueprint(t);e.add(n)}catch(n){console.error(`Failed to create entity ${t.id} for stage ${a.id}`,n)}return e}};var se=class{wrappedGame=null;options;setupCallbacks=[];updateCallbacks=[];destroyCallbacks=[];pendingLoadingCallbacks=[];globalChangeCallbacks=[];globalChangesCallbacks=[];activeGlobalSubscriptions=[];eventDelegate=new Xe;pendingInputConfig=null;displayRuntime={};refErrorMessage="lost reference to game";constructor(e){this.options=e,dt(e)||this.options.push(F());let t=Re(e);t&&pe(t)}onSetup(...e){return this.setupCallbacks.push(...e),this}onUpdate(...e){return this.updateCallbacks.push(...e),this}onDestroy(...e){return this.destroyCallbacks.push(...e),this}setInputConfiguration(...e){let t=L(...e);return this.pendingInputConfig=t,this.wrappedGame&&this.wrappedGame.setGlobalInputConfig(t),this}async start(){O();let e=Re(this.options);e&&pe(e);let t=await this.load();return this.wrappedGame=t,this.setOverrides(),this.registerGlobalSubscriptions(),t.start(),this}setDisplayRuntime(e){return this.displayRuntime={...this.displayRuntime,...e},this.wrappedGame&&this.wrappedGame.setDisplayRuntime(this.displayRuntime),this}setDeviceProfile(e){return this.setDisplayRuntime({deviceProfile:e})}setViewportSize(e,t){return this.setDisplayRuntime({viewportSize:{width:e,height:t}})}async load(){let e=await pt(this.options),t=Z(e,this.displayRuntime);this.pendingInputConfig&&(t.input=L(t.input??{},this.pendingInputConfig));let n=new oe({...e,...t},this,this.displayRuntime);for(let i of this.pendingLoadingCallbacks)n.onLoading(i);return await n.loadStage(e.stages[0]),n}setOverrides(){if(!this.wrappedGame){console.error(this.refErrorMessage);return}this.wrappedGame.customSetup=e=>{this.setupCallbacks.forEach(t=>t(e))},this.wrappedGame.customUpdate=e=>{this.updateCallbacks.forEach(t=>t(e))},this.wrappedGame.customDestroy=e=>{this.destroyCallbacks.forEach(t=>t(e))}}onGlobalChange(e,t){return this.globalChangeCallbacks.push({path:e,callback:t}),this}onGlobalChanges(e,t){return this.globalChangesCallbacks.push({paths:e,callback:t}),this}registerGlobalSubscriptions(){for(let{path:e,callback:t}of this.globalChangeCallbacks){let n=Ve(e,i=>{t(i,this.getCurrentStage())});this.activeGlobalSubscriptions.push(n)}for(let{paths:e,callback:t}of this.globalChangesCallbacks){let n=Oe(e,i=>{t(i,this.getCurrentStage())});this.activeGlobalSubscriptions.push(n)}}getCurrentStage(){return this.wrappedGame?.currentStage()??null}experimental={getRuntime:()=>this.getCurrentStage()?.wrappedStage?.world?.simulation??null};async pause(){de(!0)}async resume(){de(!1),this.wrappedGame&&(this.wrappedGame.previousTimeStamp=0,this.wrappedGame.timer.reset())}step(e=1/60){if(!this.wrappedGame){console.error(this.refErrorMessage);return}this.wrappedGame.step(e)}async reset(e){if(!this.wrappedGame){console.error(this.refErrorMessage);return}this.wrappedGame.isLoading()||await this.wrappedGame.loadStage(this.wrappedGame.stages[0],0,e?.transition)}previousStage(e){if(!this.wrappedGame){console.error(this.refErrorMessage);return}if(this.wrappedGame.isLoading())return;let t=this.wrappedGame.currentStageId,n=this.wrappedGame.stages.findIndex(o=>o.wrappedStage?.uuid===t),i=this.wrappedGame.stages[n-1];if(!i){console.error("previous stage called on first stage");return}this.wrappedGame.loadStage(i,n-1,e?.transition)}async loadStageFromId(e){if(!this.wrappedGame){console.error(this.refErrorMessage);return}try{let t=await re.loadStageData(e),n=await Pe.createFromBlueprint(t);await this.wrappedGame.loadStage(n),h.current=t}catch(t){console.error(`Failed to load stage ${e}`,t)}}nextStage(e){if(!this.wrappedGame){console.error(this.refErrorMessage);return}if(this.wrappedGame.isLoading())return;if(h.next){console.log("next stage called");let o=h.next.id;if(re.transitionForward(o),h.current){Pe.createFromBlueprint(h.current).then(s=>{this.wrappedGame?.loadStage(s,0,e?.transition)});return}}let t=this.wrappedGame.currentStageId,n=this.wrappedGame.stages.findIndex(o=>o.wrappedStage?.uuid===t),i=this.wrappedGame.stages[n+1];if(!i){console.error("next stage called on last stage");return}this.wrappedGame.loadStage(i,n+1,e?.transition)}async goToStage(){}async end(){}dispose(){this.eventDelegate.dispose();for(let e of this.activeGlobalSubscriptions)e();this.activeGlobalSubscriptions=[],this.wrappedGame&&(this.wrappedGame.dispose(),this.wrappedGame=null),Fe(),O(),qe.clearSharedMaterialCache()}dispatch(e,t){this.eventDelegate.dispatch(e,t),E.emit(e,t)}listen(e,t){return this.eventDelegate.listen(e,t)}onLoading(e){return this.wrappedGame?this.wrappedGame.onLoading(e):(this.pendingLoadingCallbacks.push(e),()=>{this.pendingLoadingCallbacks=this.pendingLoadingCallbacks.filter(t=>t!==e),this.wrappedGame})}};function qt(...a){return new se(a)}function Qt(a,e,t){return ce(e,n=>en(a,n),t)}async function en(a,e){let t=K(e.typeId);if(!t)return;let n=e.pose.position??{x:0,y:0,z:0},i=await t.create({position:n,props:{...t.defaultProps??{}}});i&&(await a.spawnEntity(i),Ke(i,e.pose),e.pose.scale&&Ze(i))}import{Euler as tn,Quaternion as nn,Vector2 as an}from"three";function on(a){return{spawn:async(e,t,n)=>{let i=await Promise.resolve(a(t,n));return e.add(i),i},spawnRelative:async(e,t,n=new an(0,1))=>{if(!e.body){console.warn("body missing for entity during spawnRelative");return}let{x:i,y:o,z:s}=e.body.translation(),r=e._rotation2DAngle??0;try{let u=e.body.rotation(),d=new nn(u.x,u.y,u.z,u.w);r=new tn().setFromQuaternion(d,"XYZ").z}catch{}let l=Math.sin(-r)*(n.x??0),p=Math.cos(-r)*(n.y??0),g=await Promise.resolve(a(i+l,o+p));return t.add(g),g}}}import{subscribe as rn}from"valtio/vanilla";var Be="STAGE_STATE_CHANGE";function sn(){return rn(k,()=>{let a={entities:k.entities,variables:k.variables};window.dispatchEvent(new CustomEvent(Be,{detail:a}))})}function ln(){let a={entities:k.entities,variables:k.variables};window.dispatchEvent(new CustomEvent(Be,{detail:a}))}import{MathUtils as un,Vector3 as pn}from"three";var ct={targetKey:"primary",offset:new pn(0,0,0),lerpFactor:.1};function dn(a){let e={...ct,...a,offset:be(a?.offset,ct.offset)},t=null;return{priority:0,enabled:!0,onAttach(){t=null},update(n,i){let o=n.targets[e.targetKey];if(!o)return i;let s=o.position.clone().add(e.offset),r=D(i);if(!t)t=s.clone();else{let l=un.clamp(e.lerpFactor,0,1),p=1-Math.pow(1-l,n.dt*60);t.lerp(s,p)}return r.position.copy(t),r.lookAt=o.position.clone(),r},onDetach(){t=null}}}import{MathUtils as Me,Vector3 as mt}from"three";var cn={x:"delay",y:"settle",z:"delay"},ht=["x","y","z"];function mn(a){let e={...cn,...a?.axes},t=a?.targetKey??"primary",n=a?.lerpFactor??.1,i=a?.window??0,o=a?.settleSpeed??.75,s=a?.settleTime??.15,r=a?.settleLerp??.08,l=a?.lookahead??0,p=null,g=null,u=null,d={x:0,y:0,z:0},S=new mt,f=new mt,G=()=>{p=null,g=null,u=null,d.x=d.y=d.z=0,S.set(0,0,0)};return{priority:0,enabled:!0,onAttach:G,onDetach:G,update(P,B){let M=P.targets[t];if(!M)return B;let b=M.position,y=p??b.clone(),C=g??b.clone(),I=u??b.clone();p=y,g=C,u=I;let T=P.dt,z=T>1e-8?1/T:0,yt=gt(n,T),bt=gt(r,T);if(l>0){f.set(0,0,0);for(let c of ht)e[c]==="delay"&&(f[c]=(b[c]-I[c])*z);f.lengthSq()>1e-8&&S.copy(f).normalize()}for(let c of ht){let De=e[c];if(De==="off"){y[c]=b[c];continue}let vt=Math.abs((b[c]-I[c])*z);if(De==="settle"){vt<=o?(d[c]+=T,d[c]>=s&&(C[c]=b[c])):d[c]=0,y[c]=Me.lerp(y[c],C[c],bt);continue}let ue=b[c];l>0&&(ue+=S[c]*l),!(Math.abs(ue-y[c])<=i)&&(y[c]=Me.lerp(y[c],ue,yt))}I.copy(b);let R=D(B),Ie=y.x-b.x,Le=y.y-b.y,ke=y.z-b.z;return R.position.x+=Ie,R.position.y+=Le,R.position.z+=ke,R.lookAt&&(R.lookAt.x+=Ie,R.lookAt.y+=Le,R.lookAt.z+=ke),R}}}function gt(a,e){let t=Me.clamp(a,0,1);return 1-Math.pow(1-t,e*60)}import{MathUtils as le}from"three";function hn(a){let e=a?.sampleInput??(()=>({})),t=le.clamp(a?.edgeMargin??.08,0,.5),n=a?.edgeSpeed??12,i=a?.panSpeed??16,o=a?.followLerp??.12,s=a?.breakFollowOnPan??!0,r=a?.followKey??null,l=!1,p=null,g=()=>{p=null,l=!1};return{priority:0,enabled:!0,onAttach:g,onDetach:g,setFollowKey(u){r=u,l=!1},update(u,d){let S=d.lookAt??d.position,f=p??S.clone();p=f;let G=e()??{},P=G.pan?.x??0,B=G.pan?.y??0,M=gn(G.pointer,t);(Math.abs(P)>.01||Math.abs(B)>.01||M.x!==0||M.y!==0)&&s&&(l=!0);let y=!l&&r?u.targets[r]:void 0;if(y){let z=fn(o,u.dt);f.x=le.lerp(f.x,y.position.x,z),f.z=le.lerp(f.z,y.position.z,z)}else f.x+=(P*i+M.x*n)*u.dt,f.z+=(-B*i+M.y*n)*u.dt;let C=D(d),I=f.x-S.x,T=f.z-S.z;return C.position.x+=I,C.position.z+=T,C.lookAt&&(C.lookAt.x+=I,C.lookAt.z+=T),C}}}function gn(a,e){if(!a||e<=0)return{x:0,y:0};let t=a.centered?(a.x+1)/2:a.x,n=a.centered?(a.y+1)/2:a.y;return{x:ft(t,e),y:ft(n,e)}}function ft(a,e){return a<e?-((e-a)/e):a>1-e?(a-(1-e))/e:0}function fn(a,e){let t=le.clamp(a,0,1);return 1-Math.pow(1-t,e*60)}import{DoubleSide as yn}from"three";import{texture as bn,uv as vn}from"three/tsl";import{MeshBasicNodeMaterial as Sn}from"three/webgpu";function wn(a,e,t){let n=e.cameraRef;if(!n.renderTarget){let s=t?.width??512,r=t?.height??512;n.createRenderTarget(s,r)}let i=n.getRenderTexture();if(!i){console.warn("setCameraFeed: Failed to obtain render texture from camera.");return}if(!a.mesh){console.warn("setCameraFeed: Entity has no mesh to apply the camera feed to.");return}let o=new Sn({map:i,toneMapped:!1,side:yn});o.colorNode=bn(i,vn().flipY()),a.mesh.material=o}export{Y as a,Ce as b,xe as c,Ee as d,Nt as e,h as f,re as g,se as h,qt as i,Qt as j,on as k,Be as l,sn as m,ln as n,dn as o,mn as p,hn as q,wn as r};
@@ -2,7 +2,7 @@ import { k as CutsceneEasing, V as Vec3Def, h as CutsceneScene, n as CameraShot,
2
2
  export { A as AudioItemSchema, q as AudioTrack, l as CameraKeyframe, c as CameraKeyframeSchema, m as CameraPoseDef, d as CameraShotSchema, j as CutsceneCameraKind, b as CutsceneCameraSchema, C as CutsceneDefinitionSchema, u as CutsceneEvent, e as CutsceneEventSchema, a as CutsceneSceneSchema, r as CutsceneTrack, f as CutsceneTrackSchema, D as DollyPathSchema, E as EventItemSchema, p as EventTrack, S as SceneTransitionSchema, t as ShotBlend } from './cutscene-definition-C479fkei.js';
3
3
  import { f as CameraBehavior, d as CameraContext, C as CameraPose, l as ZylemCamera } from './zylem-camera-BA3VPFlS.js';
4
4
  import { Z as ZylemTransitionShader } from './stage-transition-CmGpV4tc.js';
5
- import { Z as ZylemStage, q as Stage } from './stage-Dez16Gxm.js';
5
+ import { Z as ZylemStage, q as Stage } from './stage-BO-E42In.js';
6
6
  import { g as SongDefinition } from './song-definition-rEKksP0B.js';
7
7
  import { CutsceneStatusPayload, CutsceneViewPayload, CutsceneLoadPayload, CameraPosePayload } from '@zylem/bridge';
8
8
  import '@sinclair/typebox';
@@ -13,8 +13,8 @@ import '@zylem/behaviors/core';
13
13
  import 'three/webgpu';
14
14
  import './base-node-idopiSw5.js';
15
15
  import './base-node-life-cycle-BK9xebT9.js';
16
- import './entity-type-map-BMaPY8cd.js';
17
- import './entity-CY75JJSw.js';
16
+ import './entity-type-map-CnxOtV01.js';
17
+ import './entity-B8VygThO.js';
18
18
  import './vector-D3eDzvcA.js';
19
19
  import './material-D1IVeQc5.js';
20
20
  import './collision-builder-BckxkdmA.js';
@@ -24,7 +24,7 @@ import './selection-bounds-BKmSo9aG.js';
24
24
  import '@zylem/behaviors/particle-emitter';
25
25
  import 'three/addons/lines/webgpu/Line2.js';
26
26
  import './game-interfaces-vF5sRi1n.js';
27
- import './placement-session-BNQoL7Jb.js';
27
+ import './placement-session-DfvCaGxX.js';
28
28
  import './transform-gizmo-DappLQ9w.js';
29
29
 
30
30
  /**
package/dist/core.d.ts CHANGED
@@ -1,14 +1,14 @@
1
- import { S as StageStateInterface } from './game-uQd7k6-m.js';
2
- export { A as AspectRatio, f as AspectRatioValue, D as DeviceProfile, G as Game, b as GameConfigLike, d as GameDeviceConfig, a as GameLoadingEvent, R as ResolutionInput, e as ResolveGameConfigRuntime, j as RetroPreset, k as RetroPresetKey, l as RetroResolution, c as createGame, g as gameConfig, h as getDisplayAspect, i as getPresetResolution, p as parseResolution } from './game-uQd7k6-m.js';
1
+ import { S as StageStateInterface } from './game-CoNlUzGO.js';
2
+ export { A as AspectRatio, f as AspectRatioValue, D as DeviceProfile, G as Game, b as GameConfigLike, d as GameDeviceConfig, a as GameLoadingEvent, R as ResolutionInput, e as ResolveGameConfigRuntime, j as RetroPreset, k as RetroPresetKey, l as RetroResolution, c as createGame, g as gameConfig, h as getDisplayAspect, i as getPresetResolution, p as parseResolution } from './game-CoNlUzGO.js';
3
3
  export { G as GameInputConfig, a as GameInputPlayerConfig, K as KeyboardMapping, M as MouseConfig, b as MouseMapping, V as VirtualTouchButtonConfig, d as VirtualTouchButtonSlot, c as VirtualTouchButtonsConfig, e as VirtualTouchConfig, f as VirtualTouchJoystickConfig, g as VirtualTouchJoysticksConfig, h as VirtualTouchPosition, i as VirtualTouchStyle, Z as ZylemGameConfig } from './game-interfaces-vF5sRi1n.js';
4
- import { q as Stage, C as CameraWrapper } from './stage-Dez16Gxm.js';
5
- export { e as CameraManager, d as CameraOptions, l as FirstPersonOptions, f as FirstPersonPerspective, k as Fixed2DOptions, F as Fixed2DPerspective, n as IsometricOptions, I as IsometricPerspective, P as PerspectiveOptions, R as RenderBundleManager, p as RenderStrategyManager, m as SecondPersonOptions, g as SecondPersonPerspective, S as StageConfigLike, a as StageOptions, j as ThirdPersonOptions, T as ThirdPersonPerspective, o as TopDownOptions, h as TopDownPerspective, b as createCamera, i as createPerspective, c as createStage, s as stageConfig } from './stage-Dez16Gxm.js';
4
+ import { q as Stage, C as CameraWrapper } from './stage-BO-E42In.js';
5
+ export { e as CameraManager, d as CameraOptions, l as FirstPersonOptions, f as FirstPersonPerspective, k as Fixed2DOptions, F as Fixed2DPerspective, n as IsometricOptions, I as IsometricPerspective, P as PerspectiveOptions, R as RenderBundleManager, p as RenderStrategyManager, m as SecondPersonOptions, g as SecondPersonPerspective, S as StageConfigLike, a as StageOptions, j as ThirdPersonOptions, T as ThirdPersonPerspective, o as TopDownOptions, h as TopDownPerspective, b as createCamera, i as createPerspective, c as createStage, s as stageConfig } from './stage-BO-E42In.js';
6
6
  import { LevelBuffer, LevelEntry, LevelDocument } from '@zylem/bridge';
7
7
  export { LevelBuffer, LevelDocument } from '@zylem/bridge';
8
8
  import { B as BaseNode, N as NodeInterface } from './base-node-idopiSw5.js';
9
9
  import { Vector2 } from 'three';
10
- import { G as GameEntity, d as GameEntityOptions } from './entity-CY75JJSw.js';
11
- export { A as ArmPlacementOptions, P as PlacementSession } from './placement-session-BNQoL7Jb.js';
10
+ import { G as GameEntity, d as GameEntityOptions } from './entity-B8VygThO.js';
11
+ export { A as ArmPlacementOptions, P as PlacementSession } from './placement-session-DfvCaGxX.js';
12
12
  import { S as StageBlueprint } from './blueprints-TbGY-h53.js';
13
13
  import { a as SetupContext, k as LoadedContext, U as UpdateContext, D as DestroyContext, l as CleanupContext } from './base-node-life-cycle-BK9xebT9.js';
14
14
  export { L as LoadingEvent, S as StageNavigationOptions } from './base-node-life-cycle-BK9xebT9.js';
@@ -22,7 +22,7 @@ import './default-controls-CAKJ5zlo.js';
22
22
  import './events.js';
23
23
  import 'mitt';
24
24
  import '@zylem/behaviors/core';
25
- import './entity-type-map-BMaPY8cd.js';
25
+ import './entity-type-map-CnxOtV01.js';
26
26
  import './material-D1IVeQc5.js';
27
27
  import 'three/webgpu';
28
28
  import './selection-bounds-BKmSo9aG.js';
package/dist/core.js CHANGED
@@ -1 +1 @@
1
- import{a as b,b as c,c as d,d as e,e as f,f as M,g as N,h as O,i as P,j as Q,k as R,l as S,m as T,n as U,o as V,p as W,q as X,r as Y}from"./chunk-NPA6GUGE.js";import{a,c as q,d as r,e as s,f as t,g as u,h as v,i as w,j as x,l as y,m as z,n as A,o as B,p as C,q as D,r as E,s as F,t as G,u as H,v as I,w as J,x as K,z as L}from"./chunk-BIZOIGCZ.js";import{e as g}from"./chunk-26EJFYDX.js";import"./chunk-WBQ5TNRZ.js";import"./chunk-BH53MBAZ.js";import"./chunk-PCFF4LLO.js";import"./chunk-UG22Z42P.js";import"./chunk-Y5IU6IA5.js";import"./chunk-B6GDESCB.js";import"./chunk-SIRFF4DY.js";import"./chunk-273CUPEO.js";import"./chunk-UM5VNQPY.js";import"./chunk-ICJ2E2OV.js";import"./chunk-2HSR5XDQ.js";import"./chunk-2XMG3NJS.js";import{a as p}from"./chunk-7GYFZKK7.js";import"./chunk-QGIYILYI.js";import"./chunk-D2PATZCC.js";import"./chunk-3LXDHDJB.js";import"./chunk-BJYXY2FB.js";import"./chunk-YWH5HQDT.js";import"./chunk-UNCP6V7I.js";import"./chunk-CI7A5N6G.js";import"./chunk-EVYHPR3J.js";import"./chunk-XRP4JJXL.js";import"./chunk-YW2GTHCV.js";import"./chunk-5WRFDAZN.js";import"./chunk-2NO4YCLR.js";import"./chunk-T6O2SGH5.js";import"./chunk-AIQ6IVT5.js";import"./chunk-QXVH6POE.js";import"./chunk-UUOPT2N4.js";import"./chunk-4QLJUQSJ.js";import{a as h,b as i,c as j,d as k,g as l,h as m,i as n,j as o}from"./chunk-7WRQ2UAN.js";import"./chunk-VUJXR5K5.js";import"./chunk-WOT6VMZA.js";export{b as AspectRatio,G as CameraManager,y as CameraPipeline,H as CameraWrapper,B as FirstPersonPerspective,A as Fixed2DPerspective,O as Game,C as IsometricPerspective,x as Perspectives,t as RenderBundleManager,u as RenderStrategyManager,S as STAGE_STATE_CHANGE,E as SecondPersonPerspective,N as StageManager,z as ThirdPersonPerspective,D as TopDownPerspective,i as VEC2_ONE,h as VEC2_ZERO,k as VEC3_ONE,j as VEC3_ZERO,I as createCamera,V as createFollowTarget,P as createGame,F as createPerspective,W as createPlatformFollow,L as createStage,X as createStrategyPan,p as crossfadeTransitionShader,U as dispatchStageState,R as entitySpawner,f as gameConfig,v as getActiveLevelDocument,c as getDisplayAspect,d as getPresetResolution,T as initStageStateDispatcher,s as isManagedRenderEntity,a as isWebGPUSupported,l as normalizeVec2,m as normalizeVec3,e as parseResolution,q as resolveRenderCategory,Y as setCameraFeed,w as setStageFrameProfilerEnabled,J as stageConfig,M as stageState,g as streamLevel,Q as streamLevelOnStage,n as toThreeVector2,o as toThreeVector3,r as usesManagedRenderPath,K as vessel};
1
+ import{a as b,b as c,c as d,d as e,e as f,f as M,g as N,h as O,i as P,j as Q,k as R,l as S,m as T,n as U,o as V,p as W,q as X,r as Y}from"./chunk-KFI5UDI6.js";import{a,c as q,d as r,e as s,f as t,g as u,h as v,i as w,j as x,l as y,m as z,n as A,o as B,p as C,q as D,r as E,s as F,t as G,u as H,v as I,w as J,x as K,z as L}from"./chunk-HDOXKVQA.js";import{e as g}from"./chunk-BZEZIHM7.js";import"./chunk-WBQ5TNRZ.js";import"./chunk-BH53MBAZ.js";import"./chunk-PCFF4LLO.js";import"./chunk-UG22Z42P.js";import"./chunk-Y5IU6IA5.js";import"./chunk-B6GDESCB.js";import"./chunk-SIRFF4DY.js";import"./chunk-273CUPEO.js";import"./chunk-UM5VNQPY.js";import"./chunk-ICJ2E2OV.js";import"./chunk-2HSR5XDQ.js";import"./chunk-2XMG3NJS.js";import{a as p}from"./chunk-7GYFZKK7.js";import"./chunk-QGIYILYI.js";import"./chunk-D2PATZCC.js";import"./chunk-3LXDHDJB.js";import"./chunk-BJYXY2FB.js";import"./chunk-YWH5HQDT.js";import"./chunk-UNCP6V7I.js";import"./chunk-CI7A5N6G.js";import"./chunk-EVYHPR3J.js";import"./chunk-XRP4JJXL.js";import"./chunk-YW2GTHCV.js";import"./chunk-5WRFDAZN.js";import"./chunk-2NO4YCLR.js";import"./chunk-T6O2SGH5.js";import"./chunk-AIQ6IVT5.js";import"./chunk-QXVH6POE.js";import"./chunk-UUOPT2N4.js";import"./chunk-4QLJUQSJ.js";import{a as h,b as i,c as j,d as k,g as l,h as m,i as n,j as o}from"./chunk-7WRQ2UAN.js";import"./chunk-VUJXR5K5.js";import"./chunk-WOT6VMZA.js";export{b as AspectRatio,G as CameraManager,y as CameraPipeline,H as CameraWrapper,B as FirstPersonPerspective,A as Fixed2DPerspective,O as Game,C as IsometricPerspective,x as Perspectives,t as RenderBundleManager,u as RenderStrategyManager,S as STAGE_STATE_CHANGE,E as SecondPersonPerspective,N as StageManager,z as ThirdPersonPerspective,D as TopDownPerspective,i as VEC2_ONE,h as VEC2_ZERO,k as VEC3_ONE,j as VEC3_ZERO,I as createCamera,V as createFollowTarget,P as createGame,F as createPerspective,W as createPlatformFollow,L as createStage,X as createStrategyPan,p as crossfadeTransitionShader,U as dispatchStageState,R as entitySpawner,f as gameConfig,v as getActiveLevelDocument,c as getDisplayAspect,d as getPresetResolution,T as initStageStateDispatcher,s as isManagedRenderEntity,a as isWebGPUSupported,l as normalizeVec2,m as normalizeVec3,e as parseResolution,q as resolveRenderCategory,Y as setCameraFeed,w as setStageFrameProfilerEnabled,J as stageConfig,M as stageState,g as streamLevel,Q as streamLevelOnStage,n as toThreeVector2,o as toThreeVector3,r as usesManagedRenderPath,K as vessel};
@@ -1,4 +1,4 @@
1
- import { G as GameEntity } from './entity-CY75JJSw.js';
1
+ import { G as GameEntity } from './entity-B8VygThO.js';
2
2
 
3
3
  type DebugTools = 'select' | 'translate' | 'rotate' | 'scale' | 'delete' | 'add' | 'brush' | 'clip' | 'shear' | 'none';
4
4
  /** Tools that manipulate a selected entity's transform via the gizmo. */
package/dist/debug.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- export { D as DEFAULT_SNAP_SETTINGS, w as DebugEntityResolver, v as DebugTools, S as SnapSettings, T as TRANSFORM_TOOLS, x as TransformTool, d as debugState, k as getHoveredEntity, j as getHoveredEntityId, e as getSelectedEntity, g as getSelectedEntityId, h as getSelectedEntityIds, m as getSnapSettings, t as isPickMode, u as isTransformTool, r as registerDebugEntityResolver, l as resolveDebugEntity, p as setAddType, s as setDebugTool, o as setGridVisible, i as setHoveredEntityId, a as setPaused, q as setPickMode, b as setSelectedEntity, c as setSelectedEntityId, f as setSelectedEntityIds, n as setSnapSettings } from './debug-state-JRneI6c2.js';
1
+ export { D as DEFAULT_SNAP_SETTINGS, w as DebugEntityResolver, v as DebugTools, S as SnapSettings, T as TRANSFORM_TOOLS, x as TransformTool, d as debugState, k as getHoveredEntity, j as getHoveredEntityId, e as getSelectedEntity, g as getSelectedEntityId, h as getSelectedEntityIds, m as getSnapSettings, t as isPickMode, u as isTransformTool, r as registerDebugEntityResolver, l as resolveDebugEntity, p as setAddType, s as setDebugTool, o as setGridVisible, i as setHoveredEntityId, a as setPaused, q as setPickMode, b as setSelectedEntity, c as setSelectedEntityId, f as setSelectedEntityIds, n as setSnapSettings } from './debug-state-zLtbTVix.js';
2
2
  export { G as GizmoAxis, a as GizmoDelta, b as GizmoMode, d as GizmoRay, T as TransformGizmo, c as closestAxisValue, i as intersectPlane } from './transform-gizmo-DappLQ9w.js';
3
3
  import { Scene, Object3D, Vector3 } from 'three';
4
4
  import { c as Vec3 } from './vector-D3eDzvcA.js';
5
- import { G as GameEntity } from './entity-CY75JJSw.js';
5
+ import { G as GameEntity } from './entity-B8VygThO.js';
6
6
  export { S as SELECTION_BOUNDS_MARGIN, a as SELECTION_THIN_AXIS_FRACTION, c as SELECTION_THIN_AXIS_MAX, b as SELECTION_THIN_AXIS_MIN, d as SelectionBoundsProvider, m as measureObjectSelectionBounds, p as padSelectionBounds, r as resolveSelectionBounds } from './selection-bounds-BKmSo9aG.js';
7
7
  import { WebGPURenderer } from 'three/webgpu';
8
8
  import '@zylem/behaviors/core';
@@ -379,6 +379,13 @@ type GameEntityOptions = {
379
379
  color?: Color;
380
380
  size?: Vec3Input;
381
381
  position?: Vec3Input;
382
+ /** Spawn orientation as Euler angles in radians, applied in XYZ order. */
383
+ rotation?: Vec3Input;
384
+ /**
385
+ * Spawn scale. Colliders are scaled with the render object. An actor
386
+ * sizes its model from this instead.
387
+ */
388
+ scale?: Vec3Input;
382
389
  /**
383
390
  * Spawn visibility behavior:
384
391
  * - `undefined` (default): hidden while `spawnEntity` runs, revealed once
@@ -1,6 +1,6 @@
1
1
  import { Vector3, Sprite, Texture, Color, Box3, Object3D, ColorRepresentation, Light, Fog, FogExp2, Scene, Raycaster } from 'three';
2
2
  import { B as BaseNode } from './base-node-idopiSw5.js';
3
- import { G as GameEntity, d as GameEntityOptions } from './entity-CY75JJSw.js';
3
+ import { G as GameEntity, d as GameEntityOptions } from './entity-B8VygThO.js';
4
4
  import { d as Vec3Components, e as Vec3Input, b as Vec2Input } from './vector-D3eDzvcA.js';
5
5
  import { U as UpdateContext, a as SetupContext, D as DestroyContext, l as CleanupContext } from './base-node-life-cycle-BK9xebT9.js';
6
6
  import { T as TexturePath, g as MaterialOptions } from './material-D1IVeQc5.js';
package/dist/entity.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { ak as ScreenAnchor } from './entity-type-map-BMaPY8cd.js';
2
- export { A as ACTOR_TYPE, a1 as AmbientLightOptions, B as BOX_TYPE, F as CONE_TYPE, L as CYLINDER_TYPE, C as CollisionShapeType, D as DISK_TYPE, a3 as DirectionalLightOptions, am as EntityForType, al as EntityTypeMap, a9 as FOG_TYPE, a2 as HemisphereLightOptions, $ as LIGHT_TYPE, ac as LINE_TYPE, a6 as LightShadowOptions, af as LinePickResult, o as OnEnterParams, p as OnExitParams, O as OnHeldParams, W as PARTICLE_SYSTEM_TYPE, Q as PILL_TYPE, P as PLANE_TYPE, I as PYRAMID_TYPE, a4 as PointLightOptions, R as RECT_TYPE, w as RectShape, S as SPHERE_TYPE, f as SPRITE_TYPE, a5 as SpotLightOptions, h as SpriteAnimation, g as SpriteImage, i as SpriteSheet, T as TEXT_TYPE, n as ZONE_TYPE, r as ZylemActor, Z as ZylemBox, E as ZylemCone, K as ZylemCylinder, y as ZylemDisk, a8 as ZylemFog, ai as ZylemFogHeightOptions, aj as ZylemFogNoiseOptions, ag as ZylemFogOptions, ah as ZylemFogType, _ as ZylemLight, a0 as ZylemLightOptions, ab as ZylemLine, ae as ZylemLineOptions, V as ZylemParticleSystem, X as ZylemParticleSystemOptions, N as ZylemPill, k as ZylemPlane, H as ZylemPyramid, v as ZylemRect, b as ZylemSphere, e as ZylemSprite, t as ZylemText, m as ZylemZone, q as createActor, c as createBox, z as createCone, J as createCylinder, x as createDisk, a7 as createFog, Y as createLight, aa as createLine, U as createParticleSystem, M as createPill, j as createPlane, G as createPyramid, u as createRect, a as createSphere, d as createSprite, s as createText, l as createZone, ad as pickZylemLine } from './entity-type-map-BMaPY8cd.js';
3
- import { G as GameEntity, d as GameEntityOptions, F as EntityBuilder, I as EntityMeshBuilder, J as EntityCollisionBuilder } from './entity-CY75JJSw.js';
4
- export { C as CollisionComponent, e as boxCollision, f as coneCollision, c as create, g as cylinderCollision, h as pillCollision, i as planeCollision, p as pyramidCollision, s as sphereCollision, z as zoneCollision } from './entity-CY75JJSw.js';
1
+ import { ak as ScreenAnchor } from './entity-type-map-CnxOtV01.js';
2
+ export { A as ACTOR_TYPE, a1 as AmbientLightOptions, B as BOX_TYPE, F as CONE_TYPE, L as CYLINDER_TYPE, C as CollisionShapeType, D as DISK_TYPE, a3 as DirectionalLightOptions, am as EntityForType, al as EntityTypeMap, a9 as FOG_TYPE, a2 as HemisphereLightOptions, $ as LIGHT_TYPE, ac as LINE_TYPE, a6 as LightShadowOptions, af as LinePickResult, o as OnEnterParams, p as OnExitParams, O as OnHeldParams, W as PARTICLE_SYSTEM_TYPE, Q as PILL_TYPE, P as PLANE_TYPE, I as PYRAMID_TYPE, a4 as PointLightOptions, R as RECT_TYPE, w as RectShape, S as SPHERE_TYPE, f as SPRITE_TYPE, a5 as SpotLightOptions, h as SpriteAnimation, g as SpriteImage, i as SpriteSheet, T as TEXT_TYPE, n as ZONE_TYPE, r as ZylemActor, Z as ZylemBox, E as ZylemCone, K as ZylemCylinder, y as ZylemDisk, a8 as ZylemFog, ai as ZylemFogHeightOptions, aj as ZylemFogNoiseOptions, ag as ZylemFogOptions, ah as ZylemFogType, _ as ZylemLight, a0 as ZylemLightOptions, ab as ZylemLine, ae as ZylemLineOptions, V as ZylemParticleSystem, X as ZylemParticleSystemOptions, N as ZylemPill, k as ZylemPlane, H as ZylemPyramid, v as ZylemRect, b as ZylemSphere, e as ZylemSprite, t as ZylemText, m as ZylemZone, q as createActor, c as createBox, z as createCone, J as createCylinder, x as createDisk, a7 as createFog, Y as createLight, aa as createLine, U as createParticleSystem, M as createPill, j as createPlane, G as createPyramid, u as createRect, a as createSphere, d as createSprite, s as createText, l as createZone, ad as pickZylemLine } from './entity-type-map-CnxOtV01.js';
3
+ import { G as GameEntity, d as GameEntityOptions, F as EntityBuilder, I as EntityMeshBuilder, J as EntityCollisionBuilder } from './entity-B8VygThO.js';
4
+ export { C as CollisionComponent, e as boxCollision, f as coneCollision, c as create, g as cylinderCollision, h as pillCollision, i as planeCollision, p as pyramidCollision, s as sphereCollision, z as zoneCollision } from './entity-B8VygThO.js';
5
5
  import { Color, Mesh } from 'three';
6
6
  import { B as BaseNode } from './base-node-idopiSw5.js';
7
7
  import { b as Vec2Input, e as Vec3Input } from './vector-D3eDzvcA.js';
@@ -1,8 +1,8 @@
1
1
  import { e as InputPlayerNumber, f as InputProvider, I as Inputs, a as SetupContext, U as UpdateContext, D as DestroyContext, m as IGame, h as SetupFunction, g as UpdateFunction, j as DestroyFunction, S as StageNavigationOptions } from './base-node-life-cycle-BK9xebT9.js';
2
2
  import { G as GameInputConfig, B as BaseGlobals, Z as ZylemGameConfig } from './game-interfaces-vF5sRi1n.js';
3
3
  import { B as BaseNode } from './base-node-idopiSw5.js';
4
- import { B as BaseEntityInterface, q as Stage } from './stage-Dez16Gxm.js';
5
- import { E as GameEntityLifeCycle } from './entity-CY75JJSw.js';
4
+ import { B as BaseEntityInterface, q as Stage } from './stage-BO-E42In.js';
5
+ import { E as GameEntityLifeCycle } from './entity-B8VygThO.js';
6
6
  import { Color, Vector3 } from 'three';
7
7
  import { d as Vec3Components } from './vector-D3eDzvcA.js';
8
8
  import { D as DefaultTouchControlsOptions } from './default-controls-CAKJ5zlo.js';
@@ -1 +1 @@
1
- import{z as e}from"./chunk-BIZOIGCZ.js";import"./chunk-26EJFYDX.js";import"./chunk-WBQ5TNRZ.js";import"./chunk-BH53MBAZ.js";import"./chunk-UG22Z42P.js";import"./chunk-Y5IU6IA5.js";import"./chunk-SIRFF4DY.js";import"./chunk-273CUPEO.js";import"./chunk-UM5VNQPY.js";import"./chunk-2HSR5XDQ.js";import"./chunk-D2PATZCC.js";import"./chunk-BJYXY2FB.js";import"./chunk-UNCP6V7I.js";import"./chunk-CI7A5N6G.js";import"./chunk-EVYHPR3J.js";import"./chunk-XRP4JJXL.js";import"./chunk-YW2GTHCV.js";import"./chunk-5WRFDAZN.js";import"./chunk-2NO4YCLR.js";import"./chunk-T6O2SGH5.js";import"./chunk-AIQ6IVT5.js";import"./chunk-QXVH6POE.js";import"./chunk-UUOPT2N4.js";import"./chunk-4QLJUQSJ.js";import"./chunk-7WRQ2UAN.js";import"./chunk-WOT6VMZA.js";import{proxy as t}from"valtio/vanilla";var s=()=>({id:"zylem",globals:{},stages:[e()],debug:!1,time:0,input:void 0}),a=t({...s()});function o(){return{id:a.id??"zylem",globals:a.globals??{},stages:a.stages??[e()],debug:a.debug,time:a.time,input:a.input}}export{o as getGameDefaultConfig};
1
+ import{z as e}from"./chunk-HDOXKVQA.js";import"./chunk-BZEZIHM7.js";import"./chunk-WBQ5TNRZ.js";import"./chunk-BH53MBAZ.js";import"./chunk-UG22Z42P.js";import"./chunk-Y5IU6IA5.js";import"./chunk-SIRFF4DY.js";import"./chunk-273CUPEO.js";import"./chunk-UM5VNQPY.js";import"./chunk-2HSR5XDQ.js";import"./chunk-D2PATZCC.js";import"./chunk-BJYXY2FB.js";import"./chunk-UNCP6V7I.js";import"./chunk-CI7A5N6G.js";import"./chunk-EVYHPR3J.js";import"./chunk-XRP4JJXL.js";import"./chunk-YW2GTHCV.js";import"./chunk-5WRFDAZN.js";import"./chunk-2NO4YCLR.js";import"./chunk-T6O2SGH5.js";import"./chunk-AIQ6IVT5.js";import"./chunk-QXVH6POE.js";import"./chunk-UUOPT2N4.js";import"./chunk-4QLJUQSJ.js";import"./chunk-7WRQ2UAN.js";import"./chunk-WOT6VMZA.js";import{proxy as t}from"valtio/vanilla";var s=()=>({id:"zylem",globals:{},stages:[e()],debug:!1,time:0,input:void 0}),a=t({...s()});function o(){return{id:a.id??"zylem",globals:a.globals??{},stages:a.stages??[e()],debug:a.debug,time:a.time,input:a.input}}export{o as getGameDefaultConfig};
@@ -1,4 +1,4 @@
1
- import { G as GameEntity, a as PlacementPointContext } from './entity-CY75JJSw.js';
1
+ import { G as GameEntity, a as PlacementPointContext } from './entity-B8VygThO.js';
2
2
  import { e as Vec3Input, d as Vec3Components } from './vector-D3eDzvcA.js';
3
3
 
4
4
  /**
@@ -1,7 +1,7 @@
1
1
  import { B as BaseNode } from './base-node-idopiSw5.js';
2
- import { d as GameEntityOptions, H as HoverAreaOptions, G as GameEntity, P as PointerAreaContext, D as DroppableAreaOptions, a as PlacementPointContext } from './entity-CY75JJSw.js';
3
- export { b as PointerTargetEntity } from './entity-CY75JJSw.js';
4
- export { A as ArmPlacementOptions, E as EntityRepresentative, a as EntityRepresentativeOptions, P as PlacementSession, R as RepresentativeFrame, b as RepresentativeLook, c as RepresentativeSource, e as entityRepresentative } from './placement-session-BNQoL7Jb.js';
2
+ import { d as GameEntityOptions, H as HoverAreaOptions, G as GameEntity, P as PointerAreaContext, D as DroppableAreaOptions, a as PlacementPointContext } from './entity-B8VygThO.js';
3
+ export { b as PointerTargetEntity } from './entity-B8VygThO.js';
4
+ export { A as ArmPlacementOptions, E as EntityRepresentative, a as EntityRepresentativeOptions, P as PlacementSession, R as RepresentativeFrame, b as RepresentativeLook, c as RepresentativeSource, e as entityRepresentative } from './placement-session-DfvCaGxX.js';
5
5
  import './base-node-life-cycle-BK9xebT9.js';
6
6
  import 'three';
7
7
  import './stage-transition-CmGpV4tc.js';
package/dist/public.d.ts CHANGED
@@ -1,17 +1,17 @@
1
- export { A as AspectRatio, f as AspectRatioValue, D as DeviceProfile, G as Game, b as GameConfigLike, d as GameDeviceConfig, a as GameLoadingEvent, R as ResolutionInput, e as ResolveGameConfigRuntime, j as RetroPreset, k as RetroPresetKey, l as RetroResolution, c as createGame, g as gameConfig, h as getDisplayAspect, i as getPresetResolution, p as parseResolution } from './game-uQd7k6-m.js';
1
+ export { A as AspectRatio, f as AspectRatioValue, D as DeviceProfile, G as Game, b as GameConfigLike, d as GameDeviceConfig, a as GameLoadingEvent, R as ResolutionInput, e as ResolveGameConfigRuntime, j as RetroPreset, k as RetroPresetKey, l as RetroResolution, c as createGame, g as gameConfig, h as getDisplayAspect, i as getPresetResolution, p as parseResolution } from './game-CoNlUzGO.js';
2
2
  export { G as GameInputConfig, a as GameInputPlayerConfig, K as KeyboardMapping, M as MouseConfig, b as MouseMapping, V as VirtualTouchButtonConfig, d as VirtualTouchButtonSlot, c as VirtualTouchButtonsConfig, e as VirtualTouchConfig, f as VirtualTouchJoystickConfig, g as VirtualTouchJoysticksConfig, h as VirtualTouchPosition, i as VirtualTouchStyle, Z as ZylemGameConfig } from './game-interfaces-vF5sRi1n.js';
3
- export { e as CameraManager, d as CameraOptions, C as CameraWrapper, l as FirstPersonOptions, f as FirstPersonPerspective, k as Fixed2DOptions, F as Fixed2DPerspective, n as IsometricOptions, I as IsometricPerspective, P as PerspectiveOptions, R as RenderBundleManager, p as RenderStrategyManager, m as SecondPersonOptions, g as SecondPersonPerspective, S as StageConfigLike, a as StageOptions, j as ThirdPersonOptions, T as ThirdPersonPerspective, o as TopDownOptions, h as TopDownPerspective, b as createCamera, i as createPerspective, c as createStage, s as stageConfig } from './stage-Dez16Gxm.js';
3
+ export { e as CameraManager, d as CameraOptions, C as CameraWrapper, l as FirstPersonOptions, f as FirstPersonPerspective, k as Fixed2DOptions, F as Fixed2DPerspective, n as IsometricOptions, I as IsometricPerspective, P as PerspectiveOptions, R as RenderBundleManager, p as RenderStrategyManager, m as SecondPersonOptions, g as SecondPersonPerspective, S as StageConfigLike, a as StageOptions, j as ThirdPersonOptions, T as ThirdPersonPerspective, o as TopDownOptions, h as TopDownPerspective, b as createCamera, i as createPerspective, c as createStage, s as stageConfig } from './stage-BO-E42In.js';
4
4
  export { CameraFeedOptions, FollowTargetOptions, LevelStage, PlatformAxisMode, PlatformAxisModes, PlatformFollowOptions, RenderCategory, STAGE_STATE_CHANGE, StageManager, StageStateChangeEvent, StrategyPanBehavior, StrategyPanInput, StrategyPanOptions, StrategyPointer, StreamLevelOptions, StreamLevelResult, Vect3, createFollowTarget, createPlatformFollow, createStrategyPan, dispatchStageState, entitySpawner, getActiveLevelDocument, initStageStateDispatcher, isManagedRenderEntity, resolveRenderCategory, setCameraFeed, setStageFrameProfilerEnabled, stageState, streamLevel, streamLevelOnStage, usesManagedRenderPath, vessel } from './core.js';
5
5
  export { BRIDGE_READY_EVENT, BridgeChannel, BridgeDebugTool, BridgeHandler, GameLoadingPayload as BridgeLoadingPayload, BridgeMessageType, BridgeMessages, BridgeNdc, BridgeVec3, CameraPosePayload, CutsceneLoadPayload, CutscenePlaybackState, CutsceneStatusPayload, CutsceneViewPayload, EditorToGameMessages, EntityApplySwatchPayload, EntityPickPayload, EntityPickResultPayload, EntitySummaryPayload, EntitySwatchAppliedPayload, EntityThumbnailPayload, GameConfigPayload, GameToEditorMessages, GameVariablePayload, LevelBuffer, LevelDocument, StageConfigPayload, StageSnapshotPayload, SwatchApplyFailureReason, SwatchApplyResult, SwatchKind, SwatchSpec, ZylemBridge, announceBridgeReady, applySwatchesToSelection, getZylemBridge } from '@zylem/bridge';
6
- export { A as ArmPlacementOptions, E as EntityRepresentative, a as EntityRepresentativeOptions, P as PlacementSession, R as RepresentativeFrame, b as RepresentativeLook, c as RepresentativeSource, e as entityRepresentative } from './placement-session-BNQoL7Jb.js';
6
+ export { A as ArmPlacementOptions, E as EntityRepresentative, a as EntityRepresentativeOptions, P as PlacementSession, R as RepresentativeFrame, b as RepresentativeLook, c as RepresentativeSource, e as entityRepresentative } from './placement-session-DfvCaGxX.js';
7
7
  export { f as EntityBlueprint, j as EntityJson, d as EntityJsonSchema, E as EntitySchema, i as LineEntityData, L as LineEntityDataSchema, h as SpriteEntityData, b as SpriteEntityDataSchema, S as StageBlueprint, k as StageJson, e as StageJsonSchema, c as StageSchema, g as TextEntityData, T as TextEntityDataSchema, V as Vector2Schema, a as Vector3TupleSchema } from './blueprints-TbGY-h53.js';
8
8
  export { A as AnalogState, d as ButtonName, B as ButtonState, c as InputGamepad, b as InputPlayer, e as InputPlayerNumber, f as InputProvider, I as Inputs, L as LoadingEvent, a as SetupContext, S as StageNavigationOptions, U as UpdateContext } from './base-node-life-cycle-BK9xebT9.js';
9
9
  export { S as StageTransitionConfig, a as StageTransitionEasing, Z as ZylemTransitionShader, c as crossfadeTransitionShader } from './stage-transition-CmGpV4tc.js';
10
10
  export { g as CameraAction, f as CameraBehavior, d as CameraContext, e as CameraPerspective, k as CameraPipeline, h as CameraPipelineState, C as CameraPose, j as CameraProjection, P as PerspectiveType, a as Perspectives, c as PoseDelta, T as TransformLike, V as Viewport, Z as ZylemPostEffect, b as ZylemRenderer, i as isWebGPUSupported } from './zylem-camera-BA3VPFlS.js';
11
11
  export { S as StageEntity } from './entity-BIf_a4dl.js';
12
12
  export { f as VEC2_ONE, g as VEC2_ZERO, h as VEC3_ONE, i as VEC3_ZERO, V as Vec2, a as Vec2Components, b as Vec2Input, c as Vec3, d as Vec3Components, e as Vec3Input, n as normalizeVec2, j as normalizeVec3, t as toThreeVector2, k as toThreeVector3 } from './vector-D3eDzvcA.js';
13
- export { A as ACTOR_TYPE, a1 as AmbientLightOptions, B as BOX_TYPE, F as CONE_TYPE, L as CYLINDER_TYPE, C as CollisionShapeType, D as DISK_TYPE, a3 as DirectionalLightOptions, am as EntityForType, al as EntityTypeMap, a9 as FOG_TYPE, a2 as HemisphereLightOptions, $ as LIGHT_TYPE, ac as LINE_TYPE, a6 as LightShadowOptions, af as LinePickResult, o as OnEnterParams, p as OnExitParams, O as OnHeldParams, W as PARTICLE_SYSTEM_TYPE, Q as PILL_TYPE, P as PLANE_TYPE, I as PYRAMID_TYPE, a4 as PointLightOptions, R as RECT_TYPE, w as RectShape, S as SPHERE_TYPE, f as SPRITE_TYPE, ak as ScreenAnchor, a5 as SpotLightOptions, h as SpriteAnimation, g as SpriteImage, i as SpriteSheet, T as TEXT_TYPE, n as ZONE_TYPE, r as ZylemActor, Z as ZylemBox, E as ZylemCone, K as ZylemCylinder, y as ZylemDisk, a8 as ZylemFog, ai as ZylemFogHeightOptions, aj as ZylemFogNoiseOptions, ag as ZylemFogOptions, ah as ZylemFogType, _ as ZylemLight, a0 as ZylemLightOptions, ab as ZylemLine, ae as ZylemLineOptions, V as ZylemParticleSystem, X as ZylemParticleSystemOptions, N as ZylemPill, k as ZylemPlane, H as ZylemPyramid, v as ZylemRect, b as ZylemSphere, e as ZylemSprite, t as ZylemText, m as ZylemZone, q as createActor, c as createBox, z as createCone, J as createCylinder, x as createDisk, a7 as createFog, Y as createLight, aa as createLine, U as createParticleSystem, M as createPill, j as createPlane, G as createPyramid, u as createRect, a as createSphere, d as createSprite, s as createText, l as createZone, ad as pickZylemLine } from './entity-type-map-BMaPY8cd.js';
14
- export { A as Action, C as CollisionComponent, D as DroppableAreaOptions, G as GameEntity, d as GameEntityOptions, H as HoverAreaOptions, a as PlacementPointContext, P as PointerAreaContext, b as PointerTargetEntity, e as boxCollision, f as coneCollision, c as create, g as cylinderCollision, B as getRotation, h as pillCollision, i as planeCollision, p as pyramidCollision, k as rotateEuler, r as rotateInDirection, l as rotateX, m as rotateY, j as rotateYEuler, n as rotateZ, y as setRotation, u as setRotationDegrees, w as setRotationDegreesX, v as setRotationDegreesY, x as setRotationDegreesZ, q as setRotationX, o as setRotationY, t as setRotationZ, s as sphereCollision, z as zoneCollision } from './entity-CY75JJSw.js';
13
+ export { A as ACTOR_TYPE, a1 as AmbientLightOptions, B as BOX_TYPE, F as CONE_TYPE, L as CYLINDER_TYPE, C as CollisionShapeType, D as DISK_TYPE, a3 as DirectionalLightOptions, am as EntityForType, al as EntityTypeMap, a9 as FOG_TYPE, a2 as HemisphereLightOptions, $ as LIGHT_TYPE, ac as LINE_TYPE, a6 as LightShadowOptions, af as LinePickResult, o as OnEnterParams, p as OnExitParams, O as OnHeldParams, W as PARTICLE_SYSTEM_TYPE, Q as PILL_TYPE, P as PLANE_TYPE, I as PYRAMID_TYPE, a4 as PointLightOptions, R as RECT_TYPE, w as RectShape, S as SPHERE_TYPE, f as SPRITE_TYPE, ak as ScreenAnchor, a5 as SpotLightOptions, h as SpriteAnimation, g as SpriteImage, i as SpriteSheet, T as TEXT_TYPE, n as ZONE_TYPE, r as ZylemActor, Z as ZylemBox, E as ZylemCone, K as ZylemCylinder, y as ZylemDisk, a8 as ZylemFog, ai as ZylemFogHeightOptions, aj as ZylemFogNoiseOptions, ag as ZylemFogOptions, ah as ZylemFogType, _ as ZylemLight, a0 as ZylemLightOptions, ab as ZylemLine, ae as ZylemLineOptions, V as ZylemParticleSystem, X as ZylemParticleSystemOptions, N as ZylemPill, k as ZylemPlane, H as ZylemPyramid, v as ZylemRect, b as ZylemSphere, e as ZylemSprite, t as ZylemText, m as ZylemZone, q as createActor, c as createBox, z as createCone, J as createCylinder, x as createDisk, a7 as createFog, Y as createLight, aa as createLine, U as createParticleSystem, M as createPill, j as createPlane, G as createPyramid, u as createRect, a as createSphere, d as createSprite, s as createText, l as createZone, ad as pickZylemLine } from './entity-type-map-CnxOtV01.js';
14
+ export { A as Action, C as CollisionComponent, D as DroppableAreaOptions, G as GameEntity, d as GameEntityOptions, H as HoverAreaOptions, a as PlacementPointContext, P as PointerAreaContext, b as PointerTargetEntity, e as boxCollision, f as coneCollision, c as create, g as cylinderCollision, B as getRotation, h as pillCollision, i as planeCollision, p as pyramidCollision, k as rotateEuler, r as rotateInDirection, l as rotateX, m as rotateY, j as rotateYEuler, n as rotateZ, y as setRotation, u as setRotationDegrees, w as setRotationDegreesX, v as setRotationDegreesY, x as setRotationDegreesZ, q as setRotationX, o as setRotationY, t as setRotationZ, s as sphereCollision, z as zoneCollision } from './entity-B8VygThO.js';
15
15
  export { IconSize, IconSizePreset, TemplateFactory, boxMesh, coneMesh, createCooldownIcon, createEntity, createEntityFactory, cylinderMesh, destroy, pillMesh, pyramidMesh, sphereMesh } from './entity.js';
16
16
  export { BehaviorDescriptor, BehaviorHandle, BehaviorRef, BehaviorSystem, BehaviorSystemFactory, BoundaryRicochet3DCoordinator, BoundaryRicochet3DEntity, BoundaryRicochetCoordinator, BoundaryRicochetEntity, BoundaryRicochetUpdate, BurstParticlePresetOptions, CooldownBehavior, CooldownConfig, CooldownEntry, CooldownHandle, CooldownOptions, DefineBehaviorConfig, Destructible3DBehavior, Destructible3DBehaviorOptions, Destructible3DColliderOptions, Destructible3DFragmentColliderShape, Destructible3DFragmentPhysicsOptions, Destructible3DHandle, DestructibleMesh, DestructiblePrebakeWorkerAPI, FacingAngle2DEntity, FirstPersonBehavior, FirstPersonBehaviorOptions, FirstPersonContext, FirstPersonEntity, FirstPersonEvent, FirstPersonFSM, FirstPersonInputComponent, FirstPersonMovementComponent, FirstPersonPresentation, FirstPersonShooterCoordinator, FirstPersonShooterEntity, FirstPersonShooterInput, FirstPersonState, FirstPersonStateComponent, FractureOptions, FractureOptionsInput, JumpConfig2D, JumpConfig3D, JumpContext2D, JumpContext3D, JumpInput2D, JumpInput3D, JumpState2D, JumpState3D, Jumper2DBehavior, Jumper2DBehaviorOptions, Jumper2DEntity, Jumper2DEvent, Jumper2DFSM, Jumper2DState, Jumper3DBehavior, Jumper3DBehaviorOptions, Jumper3DEntity, Jumper3DEvent, Jumper3DFSM, Jumper3DState, MultidirectionalSpaceShooterCoordinator, MultidirectionalSpaceShooterEntity, MultidirectionalSpaceShooterInput, ParticleEffectDefinition, ParticleEmitterBehavior, ParticleEmitterBehaviorOptions, ParticleEmitterHandle, ParticleMagicAgency, ParticleMagicAlignment, ParticleMagicModifierInput, ParticleMagicModifierOptions, ParticleMagicOrder, ParticleMagicRealityEffect, ParticleMagicTemperament, ParticlePresetMaterialOptions, PhysicsBodyComponent, PlainBufferGeometryPayload, PlainFractureOptions, Platformer2DBehavior, Platformer2DBehaviorOptions, Platformer2DCollisionContext, Platformer2DContext, Platformer2DEntity, Platformer2DEvent, Platformer2DFSM, Platformer2DInputComponent, Platformer2DMovementComponent, Platformer2DState, Platformer2DStateComponent, Platformer3DBehavior, Platformer3DBehaviorOptions, Platformer3DContext, Platformer3DEntity, Platformer3DEvent, Platformer3DFSM, Platformer3DInputComponent, Platformer3DMovementComponent, Platformer3DState, Platformer3DStateComponent, PlatformerCollisionContext, PlayerInput, PrebakeWorkerRequest, PrebakeWorkerResponse, ResolvedAim2D, Ricochet2DBehavior, Ricochet2DCollisionContext, Ricochet2DEvent, Ricochet2DFSM, Ricochet2DHandle, Ricochet2DOptions, Ricochet2DResult, Ricochet2DState, Ricochet3DBehavior, Ricochet3DCallback, Ricochet3DCollisionContext, Ricochet3DEvent, Ricochet3DFSM, Ricochet3DHandle, Ricochet3DOptions, Ricochet3DResult, Ricochet3DState, RicochetCallback, ScreenVisibilityBehavior, ScreenVisibilityChangeContext, ScreenVisibilityFSM, ScreenVisibilityHandle, ScreenVisibilityOptions, ScreenVisibilitySize, ScreenVisibilitySnapshot, ScreenWrapBehavior, ScreenWrapEvent, ScreenWrapFSM, ScreenWrapOptions, ScreenWrapState, SemanticParticlePresetOptions, Shooter2DAimFireInput, Shooter2DBehavior, Shooter2DBehaviorOptions, Shooter2DFireArgs, Shooter2DHandle, Shooter2DProjectileFactory, Shooter2DSourceEntity, Shooter2DStageLike, Shooter2DStateComponent, Shooter2DTarget, ThrusterBehavior, ThrusterBehaviorOptions, ThrusterEntity, ThrusterEvent, ThrusterFSM, ThrusterFSMContext, ThrusterInputComponent, ThrusterMovementComponent, ThrusterState, ThrusterStateComponent, TopDownMovementBehavior, TopDownMovementBehaviorOptions, TopDownMovementComponent, TopDownMovementEntity, TopDownMovementHandle, TopDownMovementInputComponent, TopDownMovementStateComponent, TopDownShooterCoordinator, TopDownShooterEntity, TopDownShooterInput, TransformComponent, Vec3Like, ViewmodelConfig, VoronoiOptions, WorldBoundary2DBehavior, WorldBoundary2DBounds, WorldBoundary2DEvent, WorldBoundary2DFSM, WorldBoundary2DHandle, WorldBoundary2DHit, WorldBoundary2DHits, WorldBoundary2DOptions, WorldBoundary2DPosition, WorldBoundary2DState, WorldBoundary3DBehavior, WorldBoundary3DBounds, WorldBoundary3DEvent, WorldBoundary3DFSM, WorldBoundary3DHandle, WorldBoundary3DHit, WorldBoundary3DHits, WorldBoundary3DOptions, WorldBoundary3DPosition, WorldBoundary3DState, computeWorldBoundary2DHits, computeWorldBoundary3DHits, createFirstPersonInputComponent, createFirstPersonMovementComponent, createFirstPersonStateComponent, createJumpConfig2D, createJumpConfig3D, createJumpInput2D, createJumpInput3D, createJumpState2D, createJumpState3D, createPhysicsBodyComponent, createPlatformer2DInputComponent, createPlatformer2DMovementComponent, createPlatformer2DStateComponent, createPlatformer3DInputComponent, createPlatformer3DMovementComponent, createPlatformer3DStateComponent, createShooter2DStateComponent, createThrusterInputComponent, createThrusterMovementComponent, createThrusterStateComponent, createTopDownMovementComponent, createTopDownMovementInputComponent, createTopDownMovementStateComponent, createTransformComponent, defineBehavior, fireCooldown, fireShooter2DIfRequested, getCooldown, getCooldownStore, getEntityFacingAngle2D, hasAnyWorldBoundary2DHit, hasAnyWorldBoundary3DHit, particleEffect, particlePresets, registerCooldown, resetCooldown, resolveAim2D, tickCooldowns, updateBoundaryRicochet, useBehavior } from '@zylem/behaviors';
17
17
  export { RUNTIME_BOUNDARY_2D_BEHAVIOR_KEY, RUNTIME_DYNAMIC_CIRCLE_BODY_2D_BEHAVIOR_KEY, RUNTIME_GOAL_ZONE_2D_BEHAVIOR_KEY, RUNTIME_PLAYER_INPUT_2D_BEHAVIOR_KEY, RUNTIME_RICOCHET_2D_BEHAVIOR_KEY, RUNTIME_TRIGGER_REGION_2D_BEHAVIOR_KEY, RuntimeBoundary2DBehavior, RuntimeBoundary2DOptions, RuntimeDynamicCircleBody2DBehavior, RuntimeDynamicCircleBody2DHandle, RuntimeDynamicCircleBody2DOptions, RuntimeGoalZone2DBehavior, RuntimeGoalZone2DEvent, RuntimeGoalZone2DHandle, RuntimeGoalZone2DOptions, RuntimePlayerInput2DBehavior, RuntimePlayerInput2DOptions, RuntimeRicochet2DBehavior, RuntimeRicochet2DEvent, RuntimeRicochet2DHandle, RuntimeRicochet2DOptions, RuntimeTriggerRegion2DBehavior, RuntimeTriggerRegion2DEvent, RuntimeTriggerRegion2DHandle, RuntimeTriggerRegion2DOptions, bindRuntimeDynamicCircleBody2DHandle, emitRuntimeGoal, emitRuntimeRicochet, emitRuntimeTriggerRegionEnter } from '@zylem/behaviors/runtime-2d';
@@ -27,7 +27,7 @@ export { Howl } from 'howler';
27
27
  export { o as AudioClip, A as AudioClipSchema, k as EffectType, E as Envelope, h as InstrumentDefinition, I as InstrumentDefinitionSchema, i as InstrumentEffect, a as InstrumentEffectSchema, j as InstrumentPreset, b as InstrumentPresetSchema, n as NoteClip, N as NoteClipSchema, O as OscillatorType, m as SongClip, d as SongClipSchema, g as SongDefinition, S as SongDefinitionSchema, r as SongLoop, f as SongLoopSchema, p as SongNote, e as SongNoteSchema, l as SongTrack, c as SongTrackSchema, q as TimeSignature, T as TimeSignatureSchema } from './song-definition-rEKksP0B.js';
28
28
  export { w as AudioItem, A as AudioItemSchema, q as AudioTrack, l as CameraKeyframe, c as CameraKeyframeSchema, m as CameraPoseDef, n as CameraShot, d as CameraShotSchema, o as CameraTrack, i as CutsceneCamera, j as CutsceneCameraKind, b as CutsceneCameraSchema, g as CutsceneDefinition, C as CutsceneDefinitionSchema, k as CutsceneEasing, u as CutsceneEvent, e as CutsceneEventSchema, h as CutsceneScene, a as CutsceneSceneSchema, r as CutsceneTrack, f as CutsceneTrackSchema, s as DollyPath, D as DollyPathSchema, v as EventItem, E as EventItemSchema, p as EventTrack, x as SceneTransition, S as SceneTransitionSchema, y as SceneTransitionType, t as ShotBlend, V as Vec3Def } from './cutscene-definition-C479fkei.js';
29
29
  export { CUTSCENE_BEHAVIOR_KEY, CutsceneCameraBehavior, CutsceneFrame, CutsceneHost, CutscenePlayer, CutscenePlayerEvents, CutscenePlayerOptions, CutscenePlayerState, CutscenePreviewController, CutsceneStageLike, EvaluatedPose, StageCutsceneHostOptions, TargetLookup, activeShot, cameraTracks, createCutscenePlayer, createStageCutsceneHost, cutsceneLength, dollyPointAt, easeValue, evaluateCameraPose, evaluateCutscene, itemsBetween, lerpPose, lerpVec3, previousShot, sampleDollyPath, sceneAt, setCutsceneTransitionShaders, shotAt } from './cinematics.js';
30
- export { D as DEFAULT_SNAP_SETTINGS, w as DebugEntityResolver, v as DebugTools, S as SnapSettings, T as TRANSFORM_TOOLS, x as TransformTool, d as debugState, k as getHoveredEntity, j as getHoveredEntityId, e as getSelectedEntity, g as getSelectedEntityId, h as getSelectedEntityIds, m as getSnapSettings, t as isPickMode, u as isTransformTool, r as registerDebugEntityResolver, l as resolveDebugEntity, p as setAddType, s as setDebugTool, o as setGridVisible, i as setHoveredEntityId, a as setPaused, q as setPickMode, b as setSelectedEntity, c as setSelectedEntityId, f as setSelectedEntityIds, n as setSnapSettings } from './debug-state-JRneI6c2.js';
30
+ export { D as DEFAULT_SNAP_SETTINGS, w as DebugEntityResolver, v as DebugTools, S as SnapSettings, T as TRANSFORM_TOOLS, x as TransformTool, d as debugState, k as getHoveredEntity, j as getHoveredEntityId, e as getSelectedEntity, g as getSelectedEntityId, h as getSelectedEntityIds, m as getSnapSettings, t as isPickMode, u as isTransformTool, r as registerDebugEntityResolver, l as resolveDebugEntity, p as setAddType, s as setDebugTool, o as setGridVisible, i as setHoveredEntityId, a as setPaused, q as setPickMode, b as setSelectedEntity, c as setSelectedEntityId, f as setSelectedEntityIds, n as setSnapSettings } from './debug-state-zLtbTVix.js';
31
31
  export { G as GizmoAxis, a as GizmoDelta, b as GizmoMode, d as GizmoRay, T as TransformGizmo, c as closestAxisValue, i as intersectPlane } from './transform-gizmo-DappLQ9w.js';
32
32
  export { ConstructionGrid, EntityFocusContext, EntityThumbnailCache, EntityThumbnailCacheEntry, EntityThumbnailResult, Quat, degreesToRadians, entityThumbnailCache, eulerToQuaternion, focusEntity, quaternionToEuler, radiansToDegrees, registerEntityFocusContext, snapScale, snapToIncrement, snapVec3 } from './debug.js';
33
33
  export { S as SELECTION_BOUNDS_MARGIN, a as SELECTION_THIN_AXIS_FRACTION, c as SELECTION_THIN_AXIS_MAX, b as SELECTION_THIN_AXIS_MIN, d as SelectionBoundsProvider, m as measureObjectSelectionBounds, p as padSelectionBounds, r as resolveSelectionBounds } from './selection-bounds-BKmSo9aG.js';
package/dist/public.js CHANGED
@@ -1 +1 @@
1
- import{a as $m,b as en,c as rn,d as tn}from"./chunk-FZNEWOC5.js";import{a as on}from"./chunk-JCGW5PIR.js";import{a as an,b as pn,c as mn,d as nn,e as fn,f as xn,g as ln,h as sn,i as cn,j as dn,k as yn,l as vn,m as En,n as Sn,o as An,p as hn}from"./chunk-47DG7I7M.js";import{A as In,B as Jn,C as Kn,a as Rn,b as Pn,c as Ln,d as On,e as bn,f as Tn,g as Zn,h as Dn,i as gn,j as un,k as wn,l as Gn,m as Hn,n as _n,o as Fn,p as jn,q as kn,r as Bn,s as Cn,t as Mn,u as Vn,v as Wn,w as Yn,x as zn,y as Nn,z as qn}from"./chunk-KSEP7AUF.js";import{A as Nm,B as qm,C as Im,D as Jm,E as Km,a as Am,b as hm,c as Rm,d as Pm,e as Lm,f as Om,g as bm,h as Tm,i as Zm,j as Dm,k as gm,l as um,m as wm,n as Gm,o as Hm,p as _m,q as Fm,r as jm,s as km,t as Bm,u as Cm,v as Mm,w as Vm,x as Wm,y as Ym,z as zm}from"./chunk-IPWUDOV5.js";import{a as Qm,b as Um,c as Xm}from"./chunk-7QF6YTEZ.js";import"./chunk-ORIDWL3T.js";import{a as y,b as v,c as E,d as S,e as A,f as h}from"./chunk-YFXNZ2RS.js";import{a as R,b as P,c as L,d as O,e as b,f as T,g as Z,h as D,i as g,j as u,k as w,l as G,m as H,n as _,o as F,p as j,q as k,r as B,s as C,t as M,u as V,v as W,w as Y}from"./chunk-4DAITCJS.js";import"./chunk-BIGH6D34.js";import"./chunk-ELQN62PQ.js";import{a as Vi,b as Wi,c as em,d as rm,e as tm,f as om}from"./chunk-ZZO4CKRU.js";import{a as pp,c as ip,d as mp,e as np,f as fp,g as xp}from"./chunk-2PFNNGTV.js";import{a as Yi,b as zi,c as Ni,d as qi,e as Ii,f as Ji,g as Ki,h as Qi,i as Ui,j as Xi,k as $i}from"./chunk-NVVLLWIM.js";import"./chunk-VMXSE3EC.js";import{a as am,b as pm,c as im,d as mm,e as nm,f as fm,g as xm,h as lm,i as sm,j as cm,k as dm}from"./chunk-YNX3Q3CL.js";import{a as ym,b as vm,c as Em,d as Sm}from"./chunk-WQ3WMMZD.js";import{a as Fe,b as je,c as ke,d as Be,e as qe,f as Qp,g as Up,h as fi,i as xi,j as li,k as si,l as ci,m as di,n as yi,o as vi,p as Ei,q as Si,r as Ai}from"./chunk-NPA6GUGE.js";import{a as _e,c as Za,d as Da,e as ga,f as Rp,g as Pp,h as wp,i as Hp,j as _p,l as Fp,m as jp,n as kp,o as Bp,p as Cp,q as Mp,r as Vp,s as Wp,t as Yp,u as zp,v as Np,w as qp,x as Jp,z as Kp}from"./chunk-BIZOIGCZ.js";import{e as Ue,n as pr}from"./chunk-26EJFYDX.js";import{b as Ep}from"./chunk-WBQ5TNRZ.js";import{a as Ip}from"./chunk-BH53MBAZ.js";import{a as Ce,b as Me,c as Ve,d as We,e as Ye,f as ze,g as Ne}from"./chunk-PCFF4LLO.js";import{a as Pe,b as Le,c as Oe,d as be,e as Te,f as Ze,g as De,h as ge,i as ue,j as we,k as Ge,l as He}from"./chunk-UG22Z42P.js";import{c as d}from"./chunk-Y5IU6IA5.js";import{a as he,b as Re}from"./chunk-B6GDESCB.js";import{c as Dp,d as gp,e as up,f as Gp}from"./chunk-SIRFF4DY.js";import{a as Ke,b as Qe,c as Xe,d as $e,e as er,f as rr,g as tr,h as or,i as ar}from"./chunk-273CUPEO.js";import{B as Ee,C as Se,D as Ae,a as U,b as X,c as $,d as ee,e as re,f as te,h as oe,j as ae,l as pe,m as ie,n as me,o as ne,p as fe,q as xe,u as le,v as se,w as ce,x as de,y as ye,z as ve}from"./chunk-UM5VNQPY.js";import"./chunk-ICJ2E2OV.js";import"./chunk-2HSR5XDQ.js";import{a as ua,b as wa,c as Ga,d as Ha,e as _a,f as Fa,g as ja,h as ka,i as Ba,j as Ca,k as Ma,l as Va,m as Wa,n as Ya,o as za,p as Na,q as qa,r as lp,s as sp,t as cp}from"./chunk-2XMG3NJS.js";import{a as Ta}from"./chunk-7GYFZKK7.js";import{a as Ia,b as Ja,c as Ka,d as Qa,e as Ua,f as Xa,g as $a,h as ep,i as rp,j as tp,k as op,l as ap}from"./chunk-QGIYILYI.js";import{h as Lp,i as Op,j as bp,k as Tp,l as Zp}from"./chunk-D2PATZCC.js";import{a as hi,b as Ri,c as Pi,d as Li,e as Oi}from"./chunk-5NQGXW75.js";import{a as Xp,b as $p,c as ei,d as ri,e as ti,f as oi,g as ai,h as pi,i as ii,j as mi,l as ni}from"./chunk-3LXDHDJB.js";import{a as dp,b as yp,c as vp,d as Sp,e as Ap,f as hp}from"./chunk-BJYXY2FB.js";import{A as lt,B as st,C as ct,D as dt,E as yt,J as Tt,K as Zt,L as Dt,M as gt,N as ut,O as wt,b as Cr,c as Mr,d as Vr,e as Wr,f as Yr,g as zr,h as Nr,i as qr,j as Ir,k as Jr,l as Kr,m as Qr,n as Ur,o as Xr,p as $r,q as et,r as rt,s as tt,t as ot,u as at,v as pt,w as it,x as mt,y as nt,z as xt}from"./chunk-YWH5HQDT.js";import{d as ft,e as Lt,f as Ot,g as bt}from"./chunk-UNCP6V7I.js";import{E as Br,c as ur,d as wr,e as Gr,f as Hr,g as _r,h as Fr,i as jr,j as kr}from"./chunk-CI7A5N6G.js";import{b as gr}from"./chunk-EVYHPR3J.js";import{a as dr,b as yr,c as vr,d as Er,e as Sr,f as Ar,g as hr,h as Rr,i as Pr,j as Lr,k as Or,l as br,m as Tr,n as Zr,o as Dr}from"./chunk-XRP4JJXL.js";import{c as e,d as r,g as t,h as o,i as a,j as p,l as i,m,n,o as f,p as x,q as l,r as s,s as c}from"./chunk-YW2GTHCV.js";import"./chunk-5WRFDAZN.js";import"./chunk-2NO4YCLR.js";import"./chunk-T6O2SGH5.js";import{a as Ie,b as Je}from"./chunk-AIQ6IVT5.js";import"./chunk-QXVH6POE.js";import{a as vt,b as Et,c as St,d as At,e as ht,f as Rt,g as Pt}from"./chunk-UUOPT2N4.js";import{e as z,f as N,g as q,h as I,i as J,j as K,m as Q}from"./chunk-4QLJUQSJ.js";import{a as ir,b as mr,c as nr,d as fr,g as xr,h as lr,i as sr,j as cr}from"./chunk-7WRQ2UAN.js";import{a as bi,b as Ti,c as Zi,d as Di,e as gi,f as ui,g as wi,h as Gi,i as Hi,j as _i,k as Fi,l as ji,m as ki,n as Bi,o as Ci,p as Mi}from"./chunk-6XFXPIVB.js";import{$ as wo,A as oo,Aa as aa,B as ao,Ba as pa,C as po,Ca as ia,D as io,Da as ma,E as mo,Ea as na,F as no,Fa as fa,G as fo,Ga as xa,H as xo,Ha as la,I as lo,Ia as sa,J as so,Ja as ca,K as co,Ka as da,L as yo,La as ya,M as vo,Ma as va,N as Eo,Na as Ea,O as So,Oa as Sa,P as Ao,Pa as Aa,Q as ho,Qa as ha,R as Ro,Ra,S as Po,Sa as Pa,T as Lo,Ta as La,U as Oo,Ua as Oa,V as bo,Va as ba,W as To,X as Zo,Y as Do,Z as go,_ as uo,aa as Go,b as Gt,ba as Ho,c as Ht,ca as _o,d as _t,da as Fo,e as Ft,ea as jo,f as jt,fa as ko,g as kt,ga as Bo,h as Bt,ha as Co,i as Ct,ia as Mo,j as Mt,ja as Vo,k as Vt,ka as Wo,l as Wt,la as Yo,m as Yt,ma as zo,n as zt,na as No,o as Nt,oa as qo,p as qt,pa as Io,q as It,qa as Jo,r as Jt,ra as Ko,s as Kt,sa as Qo,t as Qt,ta as Uo,u as Ut,ua as Xo,v as Xt,va as $o,w as $t,wa as ea,x as eo,xa as ra,y as ro,ya as ta,z as to,za as oa}from"./chunk-VUJXR5K5.js";import"./chunk-WOT6VMZA.js";export{dp as ACTOR_TYPE,Fe as AspectRatio,Ki as AudioClipSchema,sm as AudioItemSchema,Nr as BOX_TYPE,tn as BRIDGE_READY_EVENT,Gt as BoundaryRicochet3DCoordinator,Ht as BoundaryRicochetCoordinator,Ur as CONE_TYPE,ua as CUTSCENE_BEHAVIOR_KEY,ot as CYLINDER_TYPE,im as CameraKeyframeSchema,Yp as CameraManager,Fp as CameraPipeline,fm as CameraShotSchema,zp as CameraWrapper,Wn as ColorJsonSchema,Gp as ConstructionGrid,_t as CooldownBehavior,wa as CutsceneCameraBehavior,mm as CutsceneCameraSchema,dm as CutsceneDefinitionSchema,xm as CutsceneEventSchema,cp as CutscenePreviewController,pm as CutsceneSceneSchema,cm as CutsceneTrackSchema,$ as DEFAULT_SNAP_SETTINGS,xt as DISK_TYPE,v as DROPPABLE_AREA_TYPE,Ft as Destructible3DBehavior,jt as DestructibleMesh,nm as DollyPathSchema,Dn as EntityJsonSchema,Pn as EntitySchema,he as EntityThumbnailCache,Ie as EventEmitterDelegate,lm as EventItemSchema,Sp as FOG_TYPE,kt as FirstPersonBehavior,Bt as FirstPersonEvent,Ct as FirstPersonFSM,Bp as FirstPersonPerspective,Wt as FirstPersonPresentation,Mt as FirstPersonShooterCoordinator,Vt as FirstPersonState,kp as Fixed2DPerspective,c as Fn,Yt as FractureOptions,fi as Game,pr as GameBridge,Kn as GameConfigJsonSchema,Jn as GameDeviceConfigJsonSchema,Vn as GameInputConfigSchema,Mn as GameInputPlayerConfigSchema,y as HOVER_AREA_TYPE,om as Howl,Ni as InstrumentDefinitionSchema,zi as InstrumentEffectSchema,Yi as InstrumentPresetSchema,Cp as IsometricPerspective,zt as Jumper2DBehavior,Nt as Jumper2DEvent,qt as Jumper2DFSM,It as Jumper2DState,Jt as Jumper3DBehavior,Kt as Jumper3DEvent,Qt as Jumper3DFSM,Ut as Jumper3DState,un as KeyboardMappingSchema,gt as LIGHT_TYPE,ai as LINE_TYPE,Tn as LineEntityDataSchema,Cn as MouseConfigSchema,wn as MouseMappingSchema,Xt as MultidirectionalSpaceShooterCoordinator,Ji as NoteClipSchema,hi as PARTICLE_SYSTEM_TYPE,it as PILL_TYPE,ct as PLANE_TYPE,et as PYRAMID_TYPE,$t as ParticleEmitterBehavior,_p as Perspectives,eo as Platformer2DBehavior,ro as Platformer2DEvent,to as Platformer2DFSM,oo as Platformer2DState,ao as Platformer3DBehavior,po as Platformer3DEvent,io as Platformer3DFSM,mo as Platformer3DState,Tt as RECT_TYPE,wi as RUNTIME_BOUNDARY_2D_BEHAVIOR_KEY,Gi as RUNTIME_DYNAMIC_CIRCLE_BODY_2D_BEHAVIOR_KEY,Hi as RUNTIME_GOAL_ZONE_2D_BEHAVIOR_KEY,_i as RUNTIME_PLAYER_INPUT_2D_BEHAVIOR_KEY,Fi as RUNTIME_RICOCHET_2D_BEHAVIOR_KEY,ji as RUNTIME_TRIGGER_REGION_2D_BEHAVIOR_KEY,Rp as RenderBundleManager,Pp as RenderStrategyManager,In as ResolutionInputSchema,no as Ricochet2DBehavior,fo as Ricochet2DEvent,xo as Ricochet2DFSM,lo as Ricochet2DState,so as Ricochet3DBehavior,co as Ricochet3DEvent,yo as Ricochet3DFSM,vo as Ricochet3DState,bi as RuntimeBoundary2DBehavior,Ti as RuntimeDynamicCircleBody2DBehavior,Zi as RuntimeGoalZone2DBehavior,Di as RuntimePlayerInput2DBehavior,gi as RuntimeRicochet2DBehavior,ui as RuntimeTriggerRegion2DBehavior,vt as SELECTION_BOUNDS_MARGIN,Et as SELECTION_THIN_AXIS_FRACTION,At as SELECTION_THIN_AXIS_MAX,St as SELECTION_THIN_AXIS_MIN,Jr as SPHERE_TYPE,ri as SPRITE_TYPE,ci as STAGE_STATE_CHANGE,am as SceneTransitionSchema,Eo as ScreenVisibilityBehavior,So as ScreenVisibilityFSM,Ao as ScreenWrapBehavior,ho as ScreenWrapEvent,Ro as ScreenWrapFSM,Po as ScreenWrapState,Vp as SecondPersonPerspective,Lo as Shooter2DBehavior,Ep as SimulationBody,Qi as SongClipSchema,$i as SongDefinitionSchema,Xi as SongLoopSchema,qi as SongNoteSchema,Ii as SongTrackSchema,Zn as SpriteEntityDataSchema,Nn as StageAssetLoaderConfigSchema,dn as StageBodyKind,yn as StageBoundaryDim,qn as StageConfigJsonSchema,vn as StageEventType,zn as StageGLTFAssetLoaderConfigSchema,gn as StageJsonSchema,Up as StageManager,En as StageRicochetDim,Sn as StageRicochetReflection,Ln as StageSchema,An as StageTopDownPlane,Xp as TEXT_TYPE,U as TRANSFORM_TOOLS,On as TextEntityDataSchema,jp as ThirdPersonPerspective,Oo as ThrusterBehavior,bo as ThrusterEvent,To as ThrusterFSM,Zo as ThrusterState,Ui as TimeSignatureSchema,Do as TopDownMovementBehavior,Mp as TopDownPerspective,go as TopDownShooterCoordinator,up as TransformGizmo,mr as VEC2_ONE,ir as VEC2_ZERO,fr as VEC3_ONE,nr as VEC3_ZERO,Yn as Vec3ComponentsSchema,Rn as Vector2Schema,bn as Vector3TupleSchema,_n as VirtualTouchButtonConfigSchema,jn as VirtualTouchButtonsConfigSchema,Bn as VirtualTouchConfigSchema,Fn as VirtualTouchJoystickConfigSchema,kn as VirtualTouchJoysticksConfigSchema,Hn as VirtualTouchPositionSchema,Gn as VirtualTouchStyleSchema,uo as WorldBoundary2DBehavior,wo as WorldBoundary2DEvent,Go as WorldBoundary2DFSM,Ho as WorldBoundary2DState,_o as WorldBoundary3DBehavior,Fo as WorldBoundary3DEvent,jo as WorldBoundary3DFSM,ko as WorldBoundary3DState,Lt as ZONE_TYPE,yp as ZylemActor,qr as ZylemBox,Xr as ZylemCone,at as ZylemCylinder,lt as ZylemDisk,S as ZylemDroppableArea,Ap as ZylemFog,on as ZylemGameElement,E as ZylemHoverArea,ut as ZylemLight,ii as ZylemLine,Ri as ZylemParticleSystem,mt as ZylemPill,dt as ZylemPlane,rt as ZylemPyramid,Zt as ZylemRect,Kr as ZylemSphere,ti as ZylemSprite,$p as ZylemText,Ot as ZylemZone,G as abs,ka as activeShot,en as announceBridgeReady,o as applyEntityGlow,rn as applySwatchesToSelection,Ip as applyTransformChanges,w as asin,u as atan,tp as audibleTrackIds,Ia as beatsPerBar,Ka as beatsToSeconds,ki as bindRuntimeDynamicCircleBody2DHandle,ur as boxCollision,Cr as boxMesh,pn as buildBoxCollider,nn as buildCapsuleCollider,xn as buildConvexHullCollider,fn as buildCylinderCollider,sn as buildHeightfieldCollider,an as buildRuntimeBody,mn as buildSphereCollider,ln as buildTrimeshCollider,cn as bundleRuntimeCollision,Om as callFunc,za as cameraTracks,Z as clamp,Q as clearGlobalSubscriptions,ap as clipsAt,Dp as closestAxisValue,Bo as computeWorldBoundary2DHits,Co as computeWorldBoundary3DHits,Gr as coneCollision,Vr as coneMesh,g as cos,Br as create,vp as createActor,R as createBackgroundShader,Ir as createBox,Np as createCamera,$r as createCone,Li as createCooldownIcon,qa as createCutscenePlayer,pt as createCylinder,st as createDisk,h as createDroppableArea,ft as createEntity,ni as createEntityFactory,t as createEntityGlowMaterial,Mo as createFirstPersonInputComponent,Vo as createFirstPersonMovementComponent,Wo as createFirstPersonStateComponent,hp as createFog,vi as createFollowTarget,xi as createGame,N as createGlobal,A as createHoverArea,pp as createInstrument,Yo as createJumpConfig2D,zo as createJumpConfig3D,No as createJumpInput2D,qo as createJumpInput3D,Io as createJumpState2D,Jo as createJumpState3D,wt as createLight,mi as createLine,i as createNodeMaterialFromTSL,Pi as createParticleSystem,Wp as createPerspective,Ko as createPhysicsBodyComponent,nt as createPill,yt as createPlane,Ei as createPlatformFollow,Qo as createPlatformer2DInputComponent,Uo as createPlatformer2DMovementComponent,Xo as createPlatformer2DStateComponent,$o as createPlatformer3DInputComponent,ea as createPlatformer3DMovementComponent,ra as createPlatformer3DStateComponent,tt as createPyramid,Dt as createRect,ta as createShooter2DStateComponent,hn as createSimulation,fp as createSongPlayer,Qr as createSphere,oi as createSprite,Kp as createStage,sp as createStageCutsceneHost,Si as createStrategyPan,ei as createText,oa as createThrusterInputComponent,aa as createThrusterMovementComponent,pa as createThrusterStateComponent,ia as createTopDownMovementComponent,ma as createTopDownMovementInputComponent,na as createTopDownMovementStateComponent,fa as createTransformComponent,Hm as createTransformStore,Op as createVariable,bt as createZone,Ta as crossfadeTransitionShader,Na as cutsceneLength,_r as cylinderCollision,Yr as cylinderMesh,ep as dbToGain,ee as debugState,Ne as defaultTouchControls,xa as defineBehavior,or as degreesToRadians,Lm as delay,Oi as destroy,yi as dispatchStageState,Ca as dollyPointAt,M as dot,Ga as easeValue,Bi as emitRuntimeGoal,Ci as emitRuntimeRicochet,Mi as emitRuntimeTriggerRegionEnter,rm as encodeWav,tm as encodeWavBlob,mp as ensureAudio,d as entityRepresentative,si as entitySpawner,Re as entityThumbnailCache,Xe as eulerToQuaternion,Va as evaluateCameraPose,Wa as evaluateCutscene,H as exp,bm as fadeOpacity,la as fireCooldown,sa as fireShooter2DIfRequested,s as float,B as floor,Qe as focusEntity,C as fract,rp as gainToDb,qe as gameConfig,wp as getActiveLevelDocument,xp as getActiveSongPlayer,ca as getCooldown,da as getCooldownStore,je as getDisplayAspect,ya as getEntityFacingAngle2D,q as getGlobal,K as getGlobals,Se as getHoveredEntity,ye as getHoveredEntityId,Wm as getPosition,ke as getPresetResolution,Dr as getRotation,Ee as getSelectedEntity,me as getSelectedEntityId,fe as getSelectedEntityIds,le as getSnapSettings,bp as getVariable,Ym as getVelocity,$m as getZylemBridge,ym as globalChange,vm as globalChanges,va as hasAnyWorldBoundary2DHit,Ea as hasAnyWorldBoundary3DHit,di as initStageStateDispatcher,gp as intersectPlane,np as isAudioReady,p as isGLSLShader,ga as isManagedRenderEntity,ie as isPickMode,a as isTSLShader,X as isTransformTool,_e as isWebGPUSupported,Ya as itemsBetween,We as joystickBaseSvg,Ye as joystickThumbSvg,V as length,_a as lerpPose,Ha as lerpVec3,ip as loadTone,j as max,Rt as measureObjectSelectionBounds,He as mergeInputConfigs,Xa as midiToFrequency,$a as midiToNoteName,k as min,b as mix,Y as mod,_m as move,hm as moveBy,Vm as moveForwardXY,Rm as moveTo,Fm as moveX,Bm as moveXY,Cm as moveXZ,jm as moveY,km as moveZ,O as normalize,xr as normalizeVec2,lr as normalizeVec3,e as objectVertexShader,I as onGlobalChange,J as onGlobalChanges,Zm as onPress,Dm as onRelease,Tp as onVariableChange,Zp as onVariableChanges,gr as packCollisionGroups,ht as padSelectionBounds,um as parallel,Be as parseResolution,Sa as particleEffect,Aa as particlePresets,pi as pickZylemLine,Fr as pillCollision,zr as pillMesh,Wi as pingPongBeep,jr as planeCollision,L as positionWorld,P as positionWorldDirection,_ as pow,Ba as previousShot,Hr as pyramidCollision,Wr as pyramidMesh,$e as quaternionToEuler,ar as radiansToDegrees,ha as registerCooldown,re as registerDebugEntityResolver,Ke as registerEntityFocusContext,em as renderSong,wm as repeat,Gm as repeatForever,Ra as resetCooldown,Am as resetEntityOpacity,Mm as resetVelocity,Pa as resolveAim2D,Ve as resolveButtonAccent,te as resolveDebugEntity,Za as resolveRenderCategory,Pt as resolveSelectionBounds,Me as resolveTouchTheme,Vi as ricochetSound,Pm as rotateBy,vr as rotateEuler,dr as rotateInDirection,Sr as rotateX,Er as rotateY,yr as rotateYEuler,Ar as rotateZ,Ma as sampleDollyPath,Fa as sceneAt,op as scheduleSong,Xm as screenCenterLookDeltas,Um as screenCenterLookTargets,Qa as secondsToBeats,gm as sequence,de as setAddType,Ai as setCameraFeed,lp as setCutsceneTransitionShaders,ae as setDebugTool,z as setGlobal,ce as setGridVisible,ve as setHoveredEntityId,oe as setPaused,pe as setPickMode,zm as setPosition,Nm as setPositionX,qm as setPositionY,Im as setPositionZ,Tr as setRotation,Zr as setRotationDegrees,Lr as setRotationDegreesX,Rr as setRotationDegreesY,br as setRotationDegreesZ,Pr as setRotationX,hr as setRotationY,Or as setRotationZ,Ae as setSelectedEntity,ne as setSelectedEntityId,xe as setSelectedEntityIds,se as setSnapSettings,Hp as setStageFrameProfilerEnabled,Lp as setVariable,Qm as shortestAngleDelta,ja as shotAt,D as sin,T as smoothstep,tr as snapScale,er as snapToIncrement,rr as snapVec3,Ja as songLengthBeats,Ua as songLengthSeconds,wr as sphereCollision,Mr as sphereMesh,qp as stageConfig,Qp as stageState,r as standardShader,F as step,Ue as streamLevel,li as streamLevelOnStage,Tm as throttle,La as tickCooldowns,f as time,sr as toThreeVector2,cr as toThreeVector3,ze as touchButtonSvg,Ce as touchThemes,m as uniform,Oa as updateBoundaryRicochet,Pe as useArrowsForAxes,Oe as useArrowsForDirections,Le as useArrowsForSecondaryAxes,ba as useBehavior,Ze as useIJKLForAxes,De as useIJKLForDirections,we as useMouse,ge as useMouseLook,ue as useScreenCenterLook,Ge as useVirtualControls,Te as useWASDForAxes,be as useWASDForDirections,Da as usesManagedRenderPath,n as uv,Em as variableChange,Sm as variableChanges,W as vec2,x as vec3,l as vec4,Jp as vessel,Km as wrapAround3D,Jm as wrapAroundXY,kr as zoneCollision,Je as zylemEventBus};
1
+ import{a as $m,b as en,c as rn,d as tn}from"./chunk-FZNEWOC5.js";import{a as on}from"./chunk-JCGW5PIR.js";import{a as an,b as pn,c as mn,d as nn,e as fn,f as xn,g as ln,h as sn,i as cn,j as dn,k as yn,l as vn,m as En,n as Sn,o as An,p as hn}from"./chunk-47DG7I7M.js";import{A as In,B as Jn,C as Kn,a as Rn,b as Pn,c as Ln,d as On,e as bn,f as Tn,g as Zn,h as Dn,i as gn,j as un,k as wn,l as Gn,m as Hn,n as _n,o as Fn,p as jn,q as kn,r as Bn,s as Cn,t as Mn,u as Vn,v as Wn,w as Yn,x as zn,y as Nn,z as qn}from"./chunk-KSEP7AUF.js";import{A as Nm,B as qm,C as Im,D as Jm,E as Km,a as Am,b as hm,c as Rm,d as Pm,e as Lm,f as Om,g as bm,h as Tm,i as Zm,j as Dm,k as gm,l as um,m as wm,n as Gm,o as Hm,p as _m,q as Fm,r as jm,s as km,t as Bm,u as Cm,v as Mm,w as Vm,x as Wm,y as Ym,z as zm}from"./chunk-IPWUDOV5.js";import{a as Qm,b as Um,c as Xm}from"./chunk-7QF6YTEZ.js";import"./chunk-ORIDWL3T.js";import{a as y,b as v,c as E,d as S,e as A,f as h}from"./chunk-YFXNZ2RS.js";import{a as R,b as P,c as L,d as O,e as b,f as T,g as Z,h as D,i as g,j as u,k as w,l as G,m as H,n as _,o as F,p as j,q as k,r as B,s as C,t as M,u as V,v as W,w as Y}from"./chunk-4DAITCJS.js";import"./chunk-BIGH6D34.js";import"./chunk-ELQN62PQ.js";import{a as Vi,b as Wi,c as em,d as rm,e as tm,f as om}from"./chunk-ZZO4CKRU.js";import{a as pp,c as ip,d as mp,e as np,f as fp,g as xp}from"./chunk-2PFNNGTV.js";import{a as Yi,b as zi,c as Ni,d as qi,e as Ii,f as Ji,g as Ki,h as Qi,i as Ui,j as Xi,k as $i}from"./chunk-NVVLLWIM.js";import"./chunk-VMXSE3EC.js";import{a as am,b as pm,c as im,d as mm,e as nm,f as fm,g as xm,h as lm,i as sm,j as cm,k as dm}from"./chunk-YNX3Q3CL.js";import{a as ym,b as vm,c as Em,d as Sm}from"./chunk-WQ3WMMZD.js";import{a as Fe,b as je,c as ke,d as Be,e as qe,f as Qp,g as Up,h as fi,i as xi,j as li,k as si,l as ci,m as di,n as yi,o as vi,p as Ei,q as Si,r as Ai}from"./chunk-KFI5UDI6.js";import{a as _e,c as Za,d as Da,e as ga,f as Rp,g as Pp,h as wp,i as Hp,j as _p,l as Fp,m as jp,n as kp,o as Bp,p as Cp,q as Mp,r as Vp,s as Wp,t as Yp,u as zp,v as Np,w as qp,x as Jp,z as Kp}from"./chunk-HDOXKVQA.js";import{e as Ue,o as pr}from"./chunk-BZEZIHM7.js";import{b as Ep}from"./chunk-WBQ5TNRZ.js";import{a as Ip}from"./chunk-BH53MBAZ.js";import{a as Ce,b as Me,c as Ve,d as We,e as Ye,f as ze,g as Ne}from"./chunk-PCFF4LLO.js";import{a as Pe,b as Le,c as Oe,d as be,e as Te,f as Ze,g as De,h as ge,i as ue,j as we,k as Ge,l as He}from"./chunk-UG22Z42P.js";import{c as d}from"./chunk-Y5IU6IA5.js";import{a as he,b as Re}from"./chunk-B6GDESCB.js";import{c as Dp,d as gp,e as up,f as Gp}from"./chunk-SIRFF4DY.js";import{a as Ke,b as Qe,c as Xe,d as $e,e as er,f as rr,g as tr,h as or,i as ar}from"./chunk-273CUPEO.js";import{B as Ee,C as Se,D as Ae,a as U,b as X,c as $,d as ee,e as re,f as te,h as oe,j as ae,l as pe,m as ie,n as me,o as ne,p as fe,q as xe,u as le,v as se,w as ce,x as de,y as ye,z as ve}from"./chunk-UM5VNQPY.js";import"./chunk-ICJ2E2OV.js";import"./chunk-2HSR5XDQ.js";import{a as ua,b as wa,c as Ga,d as Ha,e as _a,f as Fa,g as ja,h as ka,i as Ba,j as Ca,k as Ma,l as Va,m as Wa,n as Ya,o as za,p as Na,q as qa,r as lp,s as sp,t as cp}from"./chunk-2XMG3NJS.js";import{a as Ta}from"./chunk-7GYFZKK7.js";import{a as Ia,b as Ja,c as Ka,d as Qa,e as Ua,f as Xa,g as $a,h as ep,i as rp,j as tp,k as op,l as ap}from"./chunk-QGIYILYI.js";import{h as Lp,i as Op,j as bp,k as Tp,l as Zp}from"./chunk-D2PATZCC.js";import{a as hi,b as Ri,c as Pi,d as Li,e as Oi}from"./chunk-5NQGXW75.js";import{a as Xp,b as $p,c as ei,d as ri,e as ti,f as oi,g as ai,h as pi,i as ii,j as mi,l as ni}from"./chunk-3LXDHDJB.js";import{a as dp,b as yp,c as vp,d as Sp,e as Ap,f as hp}from"./chunk-BJYXY2FB.js";import{A as lt,B as st,C as ct,D as dt,E as yt,J as Tt,K as Zt,L as Dt,M as gt,N as ut,O as wt,b as Cr,c as Mr,d as Vr,e as Wr,f as Yr,g as zr,h as Nr,i as qr,j as Ir,k as Jr,l as Kr,m as Qr,n as Ur,o as Xr,p as $r,q as et,r as rt,s as tt,t as ot,u as at,v as pt,w as it,x as mt,y as nt,z as xt}from"./chunk-YWH5HQDT.js";import{d as ft,e as Lt,f as Ot,g as bt}from"./chunk-UNCP6V7I.js";import{E as Br,c as ur,d as wr,e as Gr,f as Hr,g as _r,h as Fr,i as jr,j as kr}from"./chunk-CI7A5N6G.js";import{b as gr}from"./chunk-EVYHPR3J.js";import{a as dr,b as yr,c as vr,d as Er,e as Sr,f as Ar,g as hr,h as Rr,i as Pr,j as Lr,k as Or,l as br,m as Tr,n as Zr,o as Dr}from"./chunk-XRP4JJXL.js";import{c as e,d as r,g as t,h as o,i as a,j as p,l as i,m,n,o as f,p as x,q as l,r as s,s as c}from"./chunk-YW2GTHCV.js";import"./chunk-5WRFDAZN.js";import"./chunk-2NO4YCLR.js";import"./chunk-T6O2SGH5.js";import{a as Ie,b as Je}from"./chunk-AIQ6IVT5.js";import"./chunk-QXVH6POE.js";import{a as vt,b as Et,c as St,d as At,e as ht,f as Rt,g as Pt}from"./chunk-UUOPT2N4.js";import{e as z,f as N,g as q,h as I,i as J,j as K,m as Q}from"./chunk-4QLJUQSJ.js";import{a as ir,b as mr,c as nr,d as fr,g as xr,h as lr,i as sr,j as cr}from"./chunk-7WRQ2UAN.js";import{a as bi,b as Ti,c as Zi,d as Di,e as gi,f as ui,g as wi,h as Gi,i as Hi,j as _i,k as Fi,l as ji,m as ki,n as Bi,o as Ci,p as Mi}from"./chunk-6XFXPIVB.js";import{$ as wo,A as oo,Aa as aa,B as ao,Ba as pa,C as po,Ca as ia,D as io,Da as ma,E as mo,Ea as na,F as no,Fa as fa,G as fo,Ga as xa,H as xo,Ha as la,I as lo,Ia as sa,J as so,Ja as ca,K as co,Ka as da,L as yo,La as ya,M as vo,Ma as va,N as Eo,Na as Ea,O as So,Oa as Sa,P as Ao,Pa as Aa,Q as ho,Qa as ha,R as Ro,Ra,S as Po,Sa as Pa,T as Lo,Ta as La,U as Oo,Ua as Oa,V as bo,Va as ba,W as To,X as Zo,Y as Do,Z as go,_ as uo,aa as Go,b as Gt,ba as Ho,c as Ht,ca as _o,d as _t,da as Fo,e as Ft,ea as jo,f as jt,fa as ko,g as kt,ga as Bo,h as Bt,ha as Co,i as Ct,ia as Mo,j as Mt,ja as Vo,k as Vt,ka as Wo,l as Wt,la as Yo,m as Yt,ma as zo,n as zt,na as No,o as Nt,oa as qo,p as qt,pa as Io,q as It,qa as Jo,r as Jt,ra as Ko,s as Kt,sa as Qo,t as Qt,ta as Uo,u as Ut,ua as Xo,v as Xt,va as $o,w as $t,wa as ea,x as eo,xa as ra,y as ro,ya as ta,z as to,za as oa}from"./chunk-VUJXR5K5.js";import"./chunk-WOT6VMZA.js";export{dp as ACTOR_TYPE,Fe as AspectRatio,Ki as AudioClipSchema,sm as AudioItemSchema,Nr as BOX_TYPE,tn as BRIDGE_READY_EVENT,Gt as BoundaryRicochet3DCoordinator,Ht as BoundaryRicochetCoordinator,Ur as CONE_TYPE,ua as CUTSCENE_BEHAVIOR_KEY,ot as CYLINDER_TYPE,im as CameraKeyframeSchema,Yp as CameraManager,Fp as CameraPipeline,fm as CameraShotSchema,zp as CameraWrapper,Wn as ColorJsonSchema,Gp as ConstructionGrid,_t as CooldownBehavior,wa as CutsceneCameraBehavior,mm as CutsceneCameraSchema,dm as CutsceneDefinitionSchema,xm as CutsceneEventSchema,cp as CutscenePreviewController,pm as CutsceneSceneSchema,cm as CutsceneTrackSchema,$ as DEFAULT_SNAP_SETTINGS,xt as DISK_TYPE,v as DROPPABLE_AREA_TYPE,Ft as Destructible3DBehavior,jt as DestructibleMesh,nm as DollyPathSchema,Dn as EntityJsonSchema,Pn as EntitySchema,he as EntityThumbnailCache,Ie as EventEmitterDelegate,lm as EventItemSchema,Sp as FOG_TYPE,kt as FirstPersonBehavior,Bt as FirstPersonEvent,Ct as FirstPersonFSM,Bp as FirstPersonPerspective,Wt as FirstPersonPresentation,Mt as FirstPersonShooterCoordinator,Vt as FirstPersonState,kp as Fixed2DPerspective,c as Fn,Yt as FractureOptions,fi as Game,pr as GameBridge,Kn as GameConfigJsonSchema,Jn as GameDeviceConfigJsonSchema,Vn as GameInputConfigSchema,Mn as GameInputPlayerConfigSchema,y as HOVER_AREA_TYPE,om as Howl,Ni as InstrumentDefinitionSchema,zi as InstrumentEffectSchema,Yi as InstrumentPresetSchema,Cp as IsometricPerspective,zt as Jumper2DBehavior,Nt as Jumper2DEvent,qt as Jumper2DFSM,It as Jumper2DState,Jt as Jumper3DBehavior,Kt as Jumper3DEvent,Qt as Jumper3DFSM,Ut as Jumper3DState,un as KeyboardMappingSchema,gt as LIGHT_TYPE,ai as LINE_TYPE,Tn as LineEntityDataSchema,Cn as MouseConfigSchema,wn as MouseMappingSchema,Xt as MultidirectionalSpaceShooterCoordinator,Ji as NoteClipSchema,hi as PARTICLE_SYSTEM_TYPE,it as PILL_TYPE,ct as PLANE_TYPE,et as PYRAMID_TYPE,$t as ParticleEmitterBehavior,_p as Perspectives,eo as Platformer2DBehavior,ro as Platformer2DEvent,to as Platformer2DFSM,oo as Platformer2DState,ao as Platformer3DBehavior,po as Platformer3DEvent,io as Platformer3DFSM,mo as Platformer3DState,Tt as RECT_TYPE,wi as RUNTIME_BOUNDARY_2D_BEHAVIOR_KEY,Gi as RUNTIME_DYNAMIC_CIRCLE_BODY_2D_BEHAVIOR_KEY,Hi as RUNTIME_GOAL_ZONE_2D_BEHAVIOR_KEY,_i as RUNTIME_PLAYER_INPUT_2D_BEHAVIOR_KEY,Fi as RUNTIME_RICOCHET_2D_BEHAVIOR_KEY,ji as RUNTIME_TRIGGER_REGION_2D_BEHAVIOR_KEY,Rp as RenderBundleManager,Pp as RenderStrategyManager,In as ResolutionInputSchema,no as Ricochet2DBehavior,fo as Ricochet2DEvent,xo as Ricochet2DFSM,lo as Ricochet2DState,so as Ricochet3DBehavior,co as Ricochet3DEvent,yo as Ricochet3DFSM,vo as Ricochet3DState,bi as RuntimeBoundary2DBehavior,Ti as RuntimeDynamicCircleBody2DBehavior,Zi as RuntimeGoalZone2DBehavior,Di as RuntimePlayerInput2DBehavior,gi as RuntimeRicochet2DBehavior,ui as RuntimeTriggerRegion2DBehavior,vt as SELECTION_BOUNDS_MARGIN,Et as SELECTION_THIN_AXIS_FRACTION,At as SELECTION_THIN_AXIS_MAX,St as SELECTION_THIN_AXIS_MIN,Jr as SPHERE_TYPE,ri as SPRITE_TYPE,ci as STAGE_STATE_CHANGE,am as SceneTransitionSchema,Eo as ScreenVisibilityBehavior,So as ScreenVisibilityFSM,Ao as ScreenWrapBehavior,ho as ScreenWrapEvent,Ro as ScreenWrapFSM,Po as ScreenWrapState,Vp as SecondPersonPerspective,Lo as Shooter2DBehavior,Ep as SimulationBody,Qi as SongClipSchema,$i as SongDefinitionSchema,Xi as SongLoopSchema,qi as SongNoteSchema,Ii as SongTrackSchema,Zn as SpriteEntityDataSchema,Nn as StageAssetLoaderConfigSchema,dn as StageBodyKind,yn as StageBoundaryDim,qn as StageConfigJsonSchema,vn as StageEventType,zn as StageGLTFAssetLoaderConfigSchema,gn as StageJsonSchema,Up as StageManager,En as StageRicochetDim,Sn as StageRicochetReflection,Ln as StageSchema,An as StageTopDownPlane,Xp as TEXT_TYPE,U as TRANSFORM_TOOLS,On as TextEntityDataSchema,jp as ThirdPersonPerspective,Oo as ThrusterBehavior,bo as ThrusterEvent,To as ThrusterFSM,Zo as ThrusterState,Ui as TimeSignatureSchema,Do as TopDownMovementBehavior,Mp as TopDownPerspective,go as TopDownShooterCoordinator,up as TransformGizmo,mr as VEC2_ONE,ir as VEC2_ZERO,fr as VEC3_ONE,nr as VEC3_ZERO,Yn as Vec3ComponentsSchema,Rn as Vector2Schema,bn as Vector3TupleSchema,_n as VirtualTouchButtonConfigSchema,jn as VirtualTouchButtonsConfigSchema,Bn as VirtualTouchConfigSchema,Fn as VirtualTouchJoystickConfigSchema,kn as VirtualTouchJoysticksConfigSchema,Hn as VirtualTouchPositionSchema,Gn as VirtualTouchStyleSchema,uo as WorldBoundary2DBehavior,wo as WorldBoundary2DEvent,Go as WorldBoundary2DFSM,Ho as WorldBoundary2DState,_o as WorldBoundary3DBehavior,Fo as WorldBoundary3DEvent,jo as WorldBoundary3DFSM,ko as WorldBoundary3DState,Lt as ZONE_TYPE,yp as ZylemActor,qr as ZylemBox,Xr as ZylemCone,at as ZylemCylinder,lt as ZylemDisk,S as ZylemDroppableArea,Ap as ZylemFog,on as ZylemGameElement,E as ZylemHoverArea,ut as ZylemLight,ii as ZylemLine,Ri as ZylemParticleSystem,mt as ZylemPill,dt as ZylemPlane,rt as ZylemPyramid,Zt as ZylemRect,Kr as ZylemSphere,ti as ZylemSprite,$p as ZylemText,Ot as ZylemZone,G as abs,ka as activeShot,en as announceBridgeReady,o as applyEntityGlow,rn as applySwatchesToSelection,Ip as applyTransformChanges,w as asin,u as atan,tp as audibleTrackIds,Ia as beatsPerBar,Ka as beatsToSeconds,ki as bindRuntimeDynamicCircleBody2DHandle,ur as boxCollision,Cr as boxMesh,pn as buildBoxCollider,nn as buildCapsuleCollider,xn as buildConvexHullCollider,fn as buildCylinderCollider,sn as buildHeightfieldCollider,an as buildRuntimeBody,mn as buildSphereCollider,ln as buildTrimeshCollider,cn as bundleRuntimeCollision,Om as callFunc,za as cameraTracks,Z as clamp,Q as clearGlobalSubscriptions,ap as clipsAt,Dp as closestAxisValue,Bo as computeWorldBoundary2DHits,Co as computeWorldBoundary3DHits,Gr as coneCollision,Vr as coneMesh,g as cos,Br as create,vp as createActor,R as createBackgroundShader,Ir as createBox,Np as createCamera,$r as createCone,Li as createCooldownIcon,qa as createCutscenePlayer,pt as createCylinder,st as createDisk,h as createDroppableArea,ft as createEntity,ni as createEntityFactory,t as createEntityGlowMaterial,Mo as createFirstPersonInputComponent,Vo as createFirstPersonMovementComponent,Wo as createFirstPersonStateComponent,hp as createFog,vi as createFollowTarget,xi as createGame,N as createGlobal,A as createHoverArea,pp as createInstrument,Yo as createJumpConfig2D,zo as createJumpConfig3D,No as createJumpInput2D,qo as createJumpInput3D,Io as createJumpState2D,Jo as createJumpState3D,wt as createLight,mi as createLine,i as createNodeMaterialFromTSL,Pi as createParticleSystem,Wp as createPerspective,Ko as createPhysicsBodyComponent,nt as createPill,yt as createPlane,Ei as createPlatformFollow,Qo as createPlatformer2DInputComponent,Uo as createPlatformer2DMovementComponent,Xo as createPlatformer2DStateComponent,$o as createPlatformer3DInputComponent,ea as createPlatformer3DMovementComponent,ra as createPlatformer3DStateComponent,tt as createPyramid,Dt as createRect,ta as createShooter2DStateComponent,hn as createSimulation,fp as createSongPlayer,Qr as createSphere,oi as createSprite,Kp as createStage,sp as createStageCutsceneHost,Si as createStrategyPan,ei as createText,oa as createThrusterInputComponent,aa as createThrusterMovementComponent,pa as createThrusterStateComponent,ia as createTopDownMovementComponent,ma as createTopDownMovementInputComponent,na as createTopDownMovementStateComponent,fa as createTransformComponent,Hm as createTransformStore,Op as createVariable,bt as createZone,Ta as crossfadeTransitionShader,Na as cutsceneLength,_r as cylinderCollision,Yr as cylinderMesh,ep as dbToGain,ee as debugState,Ne as defaultTouchControls,xa as defineBehavior,or as degreesToRadians,Lm as delay,Oi as destroy,yi as dispatchStageState,Ca as dollyPointAt,M as dot,Ga as easeValue,Bi as emitRuntimeGoal,Ci as emitRuntimeRicochet,Mi as emitRuntimeTriggerRegionEnter,rm as encodeWav,tm as encodeWavBlob,mp as ensureAudio,d as entityRepresentative,si as entitySpawner,Re as entityThumbnailCache,Xe as eulerToQuaternion,Va as evaluateCameraPose,Wa as evaluateCutscene,H as exp,bm as fadeOpacity,la as fireCooldown,sa as fireShooter2DIfRequested,s as float,B as floor,Qe as focusEntity,C as fract,rp as gainToDb,qe as gameConfig,wp as getActiveLevelDocument,xp as getActiveSongPlayer,ca as getCooldown,da as getCooldownStore,je as getDisplayAspect,ya as getEntityFacingAngle2D,q as getGlobal,K as getGlobals,Se as getHoveredEntity,ye as getHoveredEntityId,Wm as getPosition,ke as getPresetResolution,Dr as getRotation,Ee as getSelectedEntity,me as getSelectedEntityId,fe as getSelectedEntityIds,le as getSnapSettings,bp as getVariable,Ym as getVelocity,$m as getZylemBridge,ym as globalChange,vm as globalChanges,va as hasAnyWorldBoundary2DHit,Ea as hasAnyWorldBoundary3DHit,di as initStageStateDispatcher,gp as intersectPlane,np as isAudioReady,p as isGLSLShader,ga as isManagedRenderEntity,ie as isPickMode,a as isTSLShader,X as isTransformTool,_e as isWebGPUSupported,Ya as itemsBetween,We as joystickBaseSvg,Ye as joystickThumbSvg,V as length,_a as lerpPose,Ha as lerpVec3,ip as loadTone,j as max,Rt as measureObjectSelectionBounds,He as mergeInputConfigs,Xa as midiToFrequency,$a as midiToNoteName,k as min,b as mix,Y as mod,_m as move,hm as moveBy,Vm as moveForwardXY,Rm as moveTo,Fm as moveX,Bm as moveXY,Cm as moveXZ,jm as moveY,km as moveZ,O as normalize,xr as normalizeVec2,lr as normalizeVec3,e as objectVertexShader,I as onGlobalChange,J as onGlobalChanges,Zm as onPress,Dm as onRelease,Tp as onVariableChange,Zp as onVariableChanges,gr as packCollisionGroups,ht as padSelectionBounds,um as parallel,Be as parseResolution,Sa as particleEffect,Aa as particlePresets,pi as pickZylemLine,Fr as pillCollision,zr as pillMesh,Wi as pingPongBeep,jr as planeCollision,L as positionWorld,P as positionWorldDirection,_ as pow,Ba as previousShot,Hr as pyramidCollision,Wr as pyramidMesh,$e as quaternionToEuler,ar as radiansToDegrees,ha as registerCooldown,re as registerDebugEntityResolver,Ke as registerEntityFocusContext,em as renderSong,wm as repeat,Gm as repeatForever,Ra as resetCooldown,Am as resetEntityOpacity,Mm as resetVelocity,Pa as resolveAim2D,Ve as resolveButtonAccent,te as resolveDebugEntity,Za as resolveRenderCategory,Pt as resolveSelectionBounds,Me as resolveTouchTheme,Vi as ricochetSound,Pm as rotateBy,vr as rotateEuler,dr as rotateInDirection,Sr as rotateX,Er as rotateY,yr as rotateYEuler,Ar as rotateZ,Ma as sampleDollyPath,Fa as sceneAt,op as scheduleSong,Xm as screenCenterLookDeltas,Um as screenCenterLookTargets,Qa as secondsToBeats,gm as sequence,de as setAddType,Ai as setCameraFeed,lp as setCutsceneTransitionShaders,ae as setDebugTool,z as setGlobal,ce as setGridVisible,ve as setHoveredEntityId,oe as setPaused,pe as setPickMode,zm as setPosition,Nm as setPositionX,qm as setPositionY,Im as setPositionZ,Tr as setRotation,Zr as setRotationDegrees,Lr as setRotationDegreesX,Rr as setRotationDegreesY,br as setRotationDegreesZ,Pr as setRotationX,hr as setRotationY,Or as setRotationZ,Ae as setSelectedEntity,ne as setSelectedEntityId,xe as setSelectedEntityIds,se as setSnapSettings,Hp as setStageFrameProfilerEnabled,Lp as setVariable,Qm as shortestAngleDelta,ja as shotAt,D as sin,T as smoothstep,tr as snapScale,er as snapToIncrement,rr as snapVec3,Ja as songLengthBeats,Ua as songLengthSeconds,wr as sphereCollision,Mr as sphereMesh,qp as stageConfig,Qp as stageState,r as standardShader,F as step,Ue as streamLevel,li as streamLevelOnStage,Tm as throttle,La as tickCooldowns,f as time,sr as toThreeVector2,cr as toThreeVector3,ze as touchButtonSvg,Ce as touchThemes,m as uniform,Oa as updateBoundaryRicochet,Pe as useArrowsForAxes,Oe as useArrowsForDirections,Le as useArrowsForSecondaryAxes,ba as useBehavior,Ze as useIJKLForAxes,De as useIJKLForDirections,we as useMouse,ge as useMouseLook,ue as useScreenCenterLook,Ge as useVirtualControls,Te as useWASDForAxes,be as useWASDForDirections,Da as usesManagedRenderPath,n as uv,Em as variableChange,Sm as variableChanges,W as vec2,x as vec3,l as vec4,Jp as vessel,Km as wrapAround3D,Jm as wrapAroundXY,kr as zoneCollision,Je as zylemEventBus};
@@ -1,16 +1,16 @@
1
1
  import { B as BaseNode } from './base-node-idopiSw5.js';
2
2
  import { h as SetupFunction, g as UpdateFunction, j as DestroyFunction, a as SetupContext, U as UpdateContext, D as DestroyContext, L as LoadingEvent } from './base-node-life-cycle-BK9xebT9.js';
3
3
  import { Box3, Scene, Color, Object3D, Vector3, BufferGeometry, Material, Group, Texture, Camera } from 'three';
4
- import { an as ZylemWorld, al as EntityTypeMap } from './entity-type-map-BMaPY8cd.js';
4
+ import { an as ZylemWorld, al as EntityTypeMap } from './entity-type-map-CnxOtV01.js';
5
5
  import { E as Entity, L as LifecycleFunction, S as StageEntity } from './entity-BIf_a4dl.js';
6
- import { G as GameEntity, d as GameEntityOptions, b as PointerTargetEntity } from './entity-CY75JJSw.js';
6
+ import { G as GameEntity, d as GameEntityOptions, b as PointerTargetEntity } from './entity-B8VygThO.js';
7
7
  import { l as ZylemCamera, R as RendererManager, e as CameraPerspective, d as CameraContext, C as CameraPose, P as PerspectiveType, f as CameraBehavior, g as CameraAction, h as CameraPipelineState, V as Viewport, Z as ZylemPostEffect } from './zylem-camera-BA3VPFlS.js';
8
8
  import { f as ZylemShader } from './material-D1IVeQc5.js';
9
9
  import { a as SimulationBody } from './simulation-body-zQw-emOr.js';
10
10
  import { e as Vec3Input, b as Vec2Input, d as Vec3Components } from './vector-D3eDzvcA.js';
11
11
  import { StageEvents } from './events.js';
12
12
  import { G as GameInputConfig } from './game-interfaces-vF5sRi1n.js';
13
- import { A as ArmPlacementOptions, P as PlacementSession } from './placement-session-BNQoL7Jb.js';
13
+ import { A as ArmPlacementOptions, P as PlacementSession } from './placement-session-DfvCaGxX.js';
14
14
  import { SwatchApplyResult, SceneOperationEntry, LevelSyncPayload, LevelDocument, EntityApplySwatchPayload, SceneOperationPayload } from '@zylem/bridge';
15
15
  import { BehaviorSystem, BehaviorEntityLink, BehaviorRuntime, BehaviorSystemFactory, BehaviorRef } from '@zylem/behaviors/core';
16
16
  import { d as GizmoRay } from './transform-gizmo-DappLQ9w.js';
@@ -53,6 +53,8 @@ declare class CameraManager implements EditorCameraHost {
53
53
  private _screenSpacePanIds;
54
54
  /** Side, top, and isometric views that have already been placed on the gameplay camera. */
55
55
  private _framedEditorViews;
56
+ /** True after the free camera has copied the gameplay pose once. */
57
+ private _freePoseCaptured;
56
58
  /** World boxes of stage entities, read when an orthographic view is first shown. */
57
59
  private _entityBounds;
58
60
  /** Game camera to restore when the editor releases the main view. */
@@ -1392,6 +1394,8 @@ declare class StageEntityDelegate {
1392
1394
  */
1393
1395
  spawnEntity(child: BaseNode): Promise<void>;
1394
1396
  handleLateModelReady(entity: GameEntity<any>): void;
1397
+ /** Apply the `rotation` and `scale` options before the body is spawned. */
1398
+ private applySpawnTransform;
1395
1399
  /**
1396
1400
  * Register an entity for bundle or instanced rendering when opted in via
1397
1401
  * `category: 'environment'` or `category: 'pack'`.