@volter/game-editor 0.5.65 → 0.5.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BUNDLED_NOTICES +1962 -363
- package/catalog/entries/bake.json +0 -1
- package/catalog/entries/blender.json +2 -2
- package/catalog/entries/reflections.json +2 -4
- package/catalog/project-source/src/lib/bake/asset-seed.ts +1 -2
- package/catalog/project-source/src/lib/bake/clip-layering.ts +3 -4
- package/catalog/project-source/src/lib/bake/gltf-bake.ts +1 -1
- package/catalog/project-source/src/lib/bake/params.ts +3 -5
- package/catalog/project-source/src/lib/bake/rest-relative-animation.ts +2 -3
- package/dist/.vite/manifest.json +2406 -2182
- package/dist/assets/{AssetBudgetPanel-J9--TZPU.js → AssetBudgetPanel-csYWK2H4.js} +8 -8
- package/dist/assets/{AudioViewer-CR7333fe.js → AudioViewer-BH_LUYs5.js} +1 -1
- package/dist/assets/{BVHLoader-6bQIXhMX.js → BVHLoader-Jkzh8hMf.js} +1 -1
- package/dist/assets/BufferGeometryUtils-CAbuTPOA.js +1 -0
- package/dist/assets/{CCDIKSolver-CD7vLpsK.js → CCDIKSolver-D4NvkJ8d.js} +1 -1
- package/dist/assets/{CSS3DRenderer-CL7ABLVK.js → CSS3DRenderer-CAS2WZZy.js} +1 -1
- package/dist/assets/CanvasSceneViewport-BlsRTk-X.js +1 -0
- package/dist/assets/ColladaLoader-DxYB89DA.js +3 -0
- package/dist/assets/{ColorInput-DQBNrW-K.js → ColorInput-CPQNsDf1.js} +1 -1
- package/dist/assets/{ConvexGeometry-CAzXlPVG.js → ConvexGeometry-Dinf-sev.js} +1 -1
- package/dist/assets/{ConvexHull-BINCESFp.js → ConvexHull-CrJ8FY-w.js} +1 -1
- package/dist/assets/{DecalGeometry-160KRdfg.js → DecalGeometry-owkbefLa.js} +1 -1
- package/dist/assets/EffectComposer-BHDH-NLz.js +1 -0
- package/dist/assets/EntityModelDocument-DuQivdvc.js +1 -0
- package/dist/assets/EnvironmentAssetDocument-CnTEMn3A.js +1 -0
- package/dist/assets/FBXLoader-BMUbIhtE.js +1 -0
- package/dist/assets/Fbo-DrK7CWlB.js +1 -0
- package/dist/assets/{FontLoader-CvGoVI5a.js → FontLoader-BR_K6Baw.js} +2 -2
- package/dist/assets/GLTFExporter-BZqAQJbw.js +1 -0
- package/dist/assets/{GameplaySessionTimeline-B52W3FVZ.js → GameplaySessionTimeline-Crqwv2fP.js} +1 -1
- package/dist/assets/Gltf-7cVbZUzT.js +2 -0
- package/dist/assets/ImageViewer-BkFie7Hm.js +1 -0
- package/dist/assets/InspectorObjectPreview-Dl3tyJBn.js +1 -0
- package/dist/assets/JsonAssetDocument-BUFzubHM.js +2 -0
- package/dist/assets/{LineSegments2-CsOpKSiM.js → LineSegments2-Cicm_Hu1.js} +2 -2
- package/dist/assets/LiveModuleDocument-C3OQxiba.js +1 -0
- package/dist/assets/LutAssetDocument-DVzd1RZ9.js +1 -0
- package/dist/assets/{MTLLoader-_Xzd4_0p.js → MTLLoader-Bg_grNiT.js} +2 -2
- package/dist/assets/{MarchingCubes-Bsp4wrzd.js → MarchingCubes-a78AL3HB.js} +1 -1
- package/dist/assets/MeshBVH-BCSLNEeP.js +1 -0
- package/dist/assets/ModelAssetDocument-pN84goRT.js +1 -0
- package/dist/assets/{NonThreeAuthoringBootstrap-C3woOMxX.js → NonThreeAuthoringBootstrap-BKNejRiW.js} +1 -1
- package/dist/assets/{OBJLoader-BhIC6Hwo.js → OBJLoader-BiwzVj5b.js} +2 -2
- package/dist/assets/Object3DDocumentToolbar-D5Bg5FEf.js +1 -0
- package/dist/assets/Object3DDocumentViewport-DFHqru3a.js +2 -0
- package/dist/assets/Object3DPreview-BTtZ-41z.js +2 -0
- package/dist/assets/OnlineAssetDetail-BAqozdAp.js +1 -0
- package/dist/assets/{OrbitControls-DLpayAaK.js → OrbitControls-CzKVCORl.js} +1 -1
- package/dist/assets/{OrbitControls-CM3bPray.js → OrbitControls-CzTRRI7x.js} +1 -1
- package/dist/assets/{OrthographicCamera-bQozawrh.js → OrthographicCamera-CSDDsvu7.js} +1 -1
- package/dist/assets/{PLYLoader-DYQqs5Ik.js → PLYLoader-QxrxxMpE.js} +2 -2
- package/dist/assets/{PerspectiveCamera-CQ2lh01o.js → PerspectiveCamera-DzD_NfVh.js} +1 -1
- package/dist/assets/PlayBar-qVJpgwJt.js +2 -0
- package/dist/assets/QuarksAssetDocument-B4vBlUsS.js +2 -0
- package/dist/assets/RGBELoader-WQ7xZofE.js +1 -0
- package/dist/assets/RectAreaLightUniformsLib-CwcuoVqt.js +1 -0
- package/dist/assets/{RenderPass-DPrn-Uky.js → RenderPass-C_CeQNdh.js} +1 -1
- package/dist/assets/{ResolutionPicker-C67vs1F3.js → ResolutionPicker-DpHVJxn5.js} +1 -1
- package/dist/assets/RootSelectionOverlay-BxvsunO4.js +1 -0
- package/dist/assets/{RoundedBox-BDGBg6QZ.js → RoundedBox-B_cZ0NFy.js} +1 -1
- package/dist/assets/{RoundedBoxGeometry-CyUuYPfW.js → RoundedBoxGeometry-Y4rcSIvX.js} +1 -1
- package/dist/assets/STLLoader-Bej_Nkpr.js +1 -0
- package/dist/assets/{SelectionBox-D_75KrNW.js → SelectionBox-Cn9vm7f9.js} +1 -1
- package/dist/assets/ShaderAssetDocument-Dx2x8CLr.js +12 -0
- package/dist/assets/{ShaderPass-QYRpPuFJ.js → ShaderPass-qtkA7CQ8.js} +1 -1
- package/dist/assets/{ShadowEditor-DkImwu1Y.js → ShadowEditor-BEIUkrHL.js} +1 -1
- package/dist/assets/SimplifyModifier-D2EesGr2.js +1 -0
- package/dist/assets/{SkeletonUtils-Cps8GOC6.js → SkeletonUtils-C8ayciDc.js} +1 -1
- package/dist/assets/{Sky-CQKCgYDs.js → Sky-BBpnAJZV.js} +1 -1
- package/dist/assets/SourceAssetViewer-BpMbbuy6.js +1 -0
- package/dist/assets/StageHost-lB8f---y.js +2 -0
- package/dist/assets/{StoryPreviewMount-DjyxRCXu.js → StoryPreviewMount-BIfxmkYh.js} +1 -1
- package/dist/assets/{TDSLoader-D_T8XJ81.js → TDSLoader-rHl5Uwc0.js} +1 -1
- package/dist/assets/{TextGeometry-DOWAEUV0.js → TextGeometry-BRHSufuM.js} +1 -1
- package/dist/assets/ThreeBoardDocument-BHV92Ia3.js +2 -0
- package/dist/assets/{ThreeIsolationSceneContent-C8C8whSF.js → ThreeIsolationSceneContent-BqtgDHBK.js} +1 -1
- package/dist/assets/{ToolObject3DPreview-BRoDWe4Q.js → ToolObject3DPreview-CcaPJTyH.js} +1 -1
- package/dist/assets/Toolbar-keHcSvDD.js +1 -0
- package/dist/assets/{TrackballControls-DfznuQTh.js → TrackballControls-Cce-6Ff5.js} +1 -1
- package/dist/assets/{TransientHint-BB1fwrvK.js → TransientHint-Dlslh3oX.js} +1 -1
- package/dist/assets/{UnrealBloomPass-CR-cS_K5.js → UnrealBloomPass-DiseEiFK.js} +2 -2
- package/dist/assets/{VideoViewer-C6kocgIU.js → VideoViewer-naGSXHd6.js} +1 -1
- package/dist/assets/ViewportShadingMenu-C7Hdhtca.js +1 -0
- package/dist/assets/{active-ingest-CT6jSGhr.js → active-ingest-DEgq9JiA.js} +3 -3
- package/dist/assets/{animation-clock-CnjZqfJp.js → animation-clock-lTIb6nk3.js} +1 -1
- package/dist/assets/animation-mixers.service-2O2rVwQf.js +1 -0
- package/dist/assets/asset-budget-asset.menu-9NhdHAC9.js +1 -0
- package/dist/assets/asset-budget.action-yg6-luUJ.js +1 -0
- package/dist/assets/asset-budget.document-B46_VFqa.js +1 -0
- package/dist/assets/asset-budget.menu-DuH07N-e.js +1 -0
- package/dist/assets/{asset-editor-persistence-BBaONOJt.js → asset-editor-persistence-BVtzjadu.js} +1 -1
- package/dist/assets/{asset-loaders-BOy5Ss8k.js → asset-loaders-BxG1LykH.js} +2 -2
- package/dist/assets/{assets-BuSoGjBX.js → assets-Do88ZdV_.js} +1 -1
- package/dist/assets/{audio-unlock.service-CfUgUQVy.js → audio-unlock.service-BJH0mWvX.js} +1 -1
- package/dist/assets/{audio.utility-C6K6jem8.js → audio.utility-Cp4aVYFU.js} +1 -1
- package/dist/assets/autoplay.service-FxpRy7Ev.js +1 -0
- package/dist/assets/{babylon-authoring-adapter-CL02gWDn.js → babylon-authoring-adapter-B_8iE8fK.js} +1 -1
- package/dist/assets/{binding-resolver-Dsh-6Vor.js → binding-resolver-BWwG10zJ.js} +2 -2
- package/dist/assets/blender-emscripten-engine-CEsWgnR7.js +2 -0
- package/dist/assets/{blender-node-editor.document-iIDkB9sI.js → blender-node-editor.document-DTgwy8KC.js} +1 -1
- package/dist/assets/blender-properties-tab-DWSJpkxq.js +3 -0
- package/dist/assets/blender-runtime-host-OGjPjTrG.js +4 -0
- package/dist/assets/{blender-runtime-skin-DyQ9B6CR.js → blender-runtime-skin-DymtXlpt.js} +37 -39
- package/dist/assets/blender-runtime.document-CzH2ohHR.js +8 -0
- package/dist/assets/{blender-timeline.document-77fx96N7.js → blender-timeline.document-BRy_QPHt.js} +1 -1
- package/dist/assets/{blender-uv-editor.document-fsT7B4gV.js → blender-uv-editor.document-D-AbUCqz.js} +1 -1
- package/dist/assets/{blender-version.status-o6dBm3n6.js → blender-version.status-B7flzX_7.js} +1 -1
- package/dist/assets/{blender-wali-engine-wTOcrOMC.js → blender-wali-engine-D3iKpzn9.js} +1 -1
- package/dist/assets/blender.command-BVHtgTQy.js +1 -0
- package/dist/assets/blender.environment-CG-pC7sk.js +1 -0
- package/dist/assets/{blender.style-Dcem5f_T.js → blender.style-CxfbTFcE.js} +1 -1
- package/dist/assets/{board-guides-DziKSTss.js → board-guides-C3usUZZk.js} +1 -1
- package/dist/assets/body-marks-D8iaje6y.js +1 -0
- package/dist/assets/bridge.command-BF9u6r0A.js +3 -0
- package/dist/assets/browserAll-38aBu-cf.js +1 -0
- package/dist/assets/{build-profiles.document-kW8iw8Xj.js → build-profiles.document-DO7oNRuo.js} +2 -2
- package/dist/assets/{build-progress.status-BNRLytg2.js → build-progress.status-COeNVhYd.js} +1 -1
- package/dist/assets/{build-session-C_sg3CEn.js → build-session-IWIriS5P.js} +1 -1
- package/dist/assets/{build.action-lYjTLb7K.js → build.action-DlkFvZf6.js} +1 -1
- package/dist/assets/{build.command-DIGgUPU_.js → build.command-DPqQIYj_.js} +1 -1
- package/dist/assets/{build.header-CKajx5U3.js → build.header-CNLG-pV8.js} +1 -1
- package/dist/assets/{build.menu-BdU0QXny.js → build.menu-hUlH6loi.js} +1 -1
- package/dist/assets/{build.service-CbBAyeu3.js → build.service-C86Td3_9.js} +1 -1
- package/dist/assets/{camera-KEsKvOL7.js → camera-CKbyBXMe.js} +1 -1
- package/dist/assets/camera-authoring-Ci3KnE-W.js +1 -0
- package/dist/assets/{camera-runtime.inspector-B7unX4g1.js → camera-runtime.inspector-DdR3P2BF.js} +1 -1
- package/dist/assets/canvas-entry-runtime-E5YjSgre.js +2 -0
- package/dist/assets/canvas-preview-frames-CiAx7dpV.js +1 -0
- package/dist/assets/{capability-coverage-Czas4C18.js → capability-coverage-CfUeULDN.js} +5 -5
- package/dist/assets/city-EkhAOo5s.exr +0 -0
- package/dist/assets/{collaboration-presence-DLoZ7EA3.js → collaboration-presence-CSLFNT7m.js} +1 -1
- package/dist/assets/{collider-Bw0mXlsW.js → collider-DRSaLRM9.js} +1 -1
- package/dist/assets/{component-board.service-DCwcUssB.js → component-board.service-B7Sv8b7m.js} +2 -2
- package/dist/assets/component-board.service-B8UHw8dn.js +2 -0
- package/dist/assets/component-contracts.service-LFGekycZ.js +1 -0
- package/dist/assets/{component-verbs.command-7xzfjGMZ.js → component-verbs.command-D4SvFjfG.js} +1 -1
- package/dist/assets/component-verbs.service-TGvWxf2b.js +1 -0
- package/dist/assets/{config-CEZk921y.js → config-DB_RH-hO.js} +3 -3
- package/dist/assets/{configurations-DTBMdaTL.js → configurations-C2qgJNnW.js} +1 -1
- package/dist/assets/{connection.status-BifnQdOs.js → connection.status-CG7X2brL.js} +1 -1
- package/dist/assets/{console-bridge-CHcb-xk5.js → console-bridge-B5Ltae37.js} +1 -1
- package/dist/assets/{constraint-De8f1Uiq.js → constraint-C_Jj7dXy.js} +1 -1
- package/dist/assets/constraints.inspector-D6QZJS4b.js +1 -0
- package/dist/assets/courtyard-DqlebbpC.exr +0 -0
- package/dist/assets/coverage.service-Clo86874.js +3 -0
- package/dist/assets/{create-runtime-CVCc1BDx.js → create-runtime-lmA910XT.js} +1 -1
- package/dist/assets/{curve-7Q79VgU4.js → curve-6-TR6dNb.js} +1 -1
- package/dist/assets/{data-asset-4hjS642k.js → data-asset-BNbd309U.js} +1 -1
- package/dist/assets/{data-ref-CQI28C0D.js → data-ref-Dvmd7eb1.js} +1 -1
- package/dist/assets/{debug-bridge-CCohG-d-.js → debug-bridge-BUNhgyY6.js} +1 -1
- package/dist/assets/{debug-registry-Dgvitx8M.js → debug-registry-B3Cnne3x.js} +1 -1
- package/dist/assets/deferred-ingest-play-7V8OrW3e.js +2 -0
- package/dist/assets/design-time-layers-g9VS6amb.js +1 -0
- package/dist/assets/design-time-mount.service-HtMr_vBd.js +2 -0
- package/dist/assets/design-time-react-mount-Dx6fJ-Hg.js +1 -0
- package/dist/assets/{directional-shadow-fit-BVkOKAv2.js → directional-shadow-fit-Cjz_Eg2b.js} +1 -1
- package/dist/assets/{document-preview-three-Kbg2GCLm.js → document-preview-three-C3y0syYQ.js} +1 -1
- package/dist/assets/{dom-authoring-adapter-CY8C7f4T.js → dom-authoring-adapter-CEeFyatF.js} +1 -1
- package/dist/assets/{draco3d-BBUTcNkz.js → draco3d-FKy0apkb.js} +1 -1
- package/dist/assets/drei-asset-caches-jJoHXbTj.js +2 -0
- package/dist/assets/{edit-mode-audio.service-Bzetwd5B.js → edit-mode-audio.service-DZTnrW6t.js} +1 -1
- package/dist/assets/edit-mode-authoring-D_BiHCQj.js +1 -0
- package/dist/assets/{edit-mode-networking.service-YCX6RRb_.js → edit-mode-networking.service-BzMI2VxO.js} +1 -1
- package/dist/assets/editor-api-Bzmo0o8_.js +1 -0
- package/dist/assets/{entry-adjudication-Cq8Yeb74.js → entry-adjudication-BYy7TXOB.js} +1 -1
- package/dist/assets/{events-156d8d12.esm-ErOhDXXB.js → events-156d8d12.esm-C734MYnx.js} +7 -7
- package/dist/assets/{extend-B-eOccUm.js → extend-CLG0ymiX.js} +1 -1
- package/dist/assets/forest-P_CQY3b_.exr +0 -0
- package/dist/assets/fork-menu-De7HU6_H.js +1 -0
- package/dist/assets/{frame-debugger-store-D1Mf_5up.js → frame-debugger-store-BZgIOlU6.js} +1 -1
- package/dist/assets/{game-DHOZVb-7.js → game-D5EJoILQ.js} +1 -1
- package/dist/assets/{game-contract-seams-a5YXejOu.js → game-contract-seams-TCpIMmHP.js} +1 -1
- package/dist/assets/{game-css-scope-transform-Eng4wS8E.js → game-css-scope-transform-NbpajQr-.js} +1 -1
- package/dist/assets/game-document.service-6eRlrI-d.js +1 -0
- package/dist/assets/game-eval.command-hKnSMlX0.js +2 -0
- package/dist/assets/{game-input-seams-CIQdetRw.js → game-input-seams-BC6xhZy3.js} +1 -1
- package/dist/assets/{game-module-access-B2mFxv-i.js → game-module-access-ry3xb1Ix.js} +1 -1
- package/dist/assets/{gameplay-export-BoKXm51x.js → gameplay-export-DiLQuPpn.js} +1 -1
- package/dist/assets/gameplay-replay-Bsre-1K8.js +1 -0
- package/dist/assets/{gameplay-rng-trap-CTNhm-UW.js → gameplay-rng-trap-BhRx_CtU.js} +1 -1
- package/dist/assets/gameplay.command-BqiyGn-I.js +1 -0
- package/dist/assets/{generation-jobs-BQrXbGp_.js → generation-jobs-BYcpgeGk.js} +1 -1
- package/dist/assets/generation.service-O81IqA-6.js +1 -0
- package/dist/assets/{generations-DzUogZsM.js → generations-CsGQ3twi.js} +1 -1
- package/dist/assets/{generations.status-CgOUBCum.js → generations.status-C3YU0_ml.js} +1 -1
- package/dist/assets/godot.style-DxJaFWOP.js +1 -0
- package/dist/assets/godot.view-BFsHk8b2.js +1 -0
- package/dist/assets/{hosted-asset-materialization-CiIvWkGU.js → hosted-asset-materialization-Bk-plQF6.js} +2 -2
- package/dist/assets/{ibl-override-material-BlmCxFKq.js → ibl-override-material-BhbGwgS1.js} +1 -1
- package/dist/assets/{index-mjWQmGhM.js → index-0n9eSzwT.js} +1 -1
- package/dist/assets/index-B4bmKkgY.css +1 -0
- package/dist/assets/index-BLo2LE8C.js +3404 -0
- package/dist/assets/index-BWW4-DBH.js +1 -0
- package/dist/assets/index-CLcsjKUs.js +1 -0
- package/dist/assets/index-CU5YUq-x.js +134 -0
- package/dist/assets/{index-DUpHH6JR.js → index-Cb6o_Td_.js} +1 -1
- package/dist/assets/index-Ckxb31Yz.js +1500 -0
- package/dist/assets/index-CnpsJMao.js +1 -0
- package/dist/assets/index-Cr23XhNm.js +1 -0
- package/dist/assets/index-DO1rWQ_r.js +487 -0
- package/dist/assets/{index-BcCBqgM_.js → index-DUh02lTr.js} +1 -1
- package/dist/assets/index-DXEHfb0b.js +1 -0
- package/dist/assets/{index-V1R-e5Bd.js → index-wRCvCebM.js} +1 -1
- package/dist/assets/{inference-diagnostics-Dhmtfbq_.js → inference-diagnostics-YW0yJkKx.js} +1 -1
- package/dist/assets/{ingest-BbYMC2vQ.js → ingest-BlQnR7s3.js} +1 -1
- package/dist/assets/ingest-boot-viewport-uG9jQ1zm.js +1 -0
- package/dist/assets/ingest-siblings-DRQXSWax.js +1 -0
- package/dist/assets/{ingest-source-persistence-C_6Hiyra.js → ingest-source-persistence-DH6ioCOu.js} +1 -1
- package/dist/assets/{ingest.service-BTDnQfM1.js → ingest.service-GeaWMaZX.js} +1 -1
- package/dist/assets/{input-manager-DH_hGW6d.js → input-manager-Cxx3RJgG.js} +1 -1
- package/dist/assets/{input-router-BNQvtIqw.js → input-router-FzxO5ld6.js} +1 -1
- package/dist/assets/{inspect-BZfi3mmo.js → inspect-BRgDdtVk.js} +1 -1
- package/dist/assets/instances.command-CFOMPSj3.js +1 -0
- package/dist/assets/{instruments-CKR02Y8I.js → instruments-IKn-vvNb.js} +1 -1
- package/dist/assets/interior-Bo_lba15.exr +0 -0
- package/dist/assets/{json-history-resource-BbxllWfV.js → json-history-resource-r-9q_hxP.js} +1 -1
- package/dist/assets/{light-D-_wsKTq.js → light-CFAor97k.js} +1 -1
- package/dist/assets/light-camera-factory-D1sgz3YB.js +1 -0
- package/dist/assets/live-mixers-BRkRHd6g.js +1 -0
- package/dist/assets/{loader-CaF_I7Yt.js → loader-BbMsvIxP.js} +1 -1
- package/dist/assets/machine.document-CgmsOh-s.js +24 -0
- package/dist/assets/machines.finder-nxiCgQc2.js +1 -0
- package/dist/assets/matcap-texture-Dh65bX5V.js +1 -0
- package/dist/assets/{material-CpAdjDxn.js → material-D5kXEZWQ.js} +1 -1
- package/dist/assets/{material-factory-Bz6h__6g.js → material-factory-0Qb0VuZ5.js} +1 -1
- package/dist/assets/material-preview.view-DqNcpd_b.js +1 -0
- package/dist/assets/{mesh-B3WPtNKO.js → mesh-BKPgNTwh.js} +1 -1
- package/dist/assets/{mesh-shadow-CZnXrw_l.js → mesh-shadow-BDQP4mHs.js} +1 -1
- package/dist/assets/model-asset-sections.service-DWPLmkqa.js +1 -0
- package/dist/assets/model-inspection-Cxfg_Fei.js +1 -0
- package/dist/assets/model.layout-BpZE1W9V.js +1 -0
- package/dist/assets/{models.finder-G2jQgIRu.js → models.finder-DHW17ZEa.js} +1 -1
- package/dist/assets/module-mode-CRfHyIMS.js +2 -0
- package/dist/assets/mount-canvas-ingest-root-BZZ8M3Lu.js +2 -0
- package/dist/assets/mount-dom-ingest-root-D1GV6Jjt.js +2 -0
- package/dist/assets/{mount-game-6t9cKNo4.js → mount-game-F9e76auh.js} +1 -1
- package/dist/assets/mount-ingest-root-B5D-Lmmk.js +2 -0
- package/dist/assets/{mount-manifest-CGVxhmAw.js → mount-manifest-cYRhgHfo.js} +1 -1
- package/dist/assets/mount-three-ingest-root-BNnouaBn.js +1 -0
- package/dist/assets/{mounted-authoring-Dmg5xmhP.js → mounted-authoring-TIN5EnCb.js} +1 -1
- package/dist/assets/{mounted-story-viewport-source-DjP6RA9U.js → mounted-story-viewport-source-CAlEmE0_.js} +1 -1
- package/dist/assets/{native-debug-module-CWicoSGD.js → native-debug-module-j-MekcLS.js} +1 -1
- package/dist/assets/{navigation-CIiCx-SM.js → navigation-DmR1BDVo.js} +1 -1
- package/dist/assets/{navmesh.menu-CAKiH8PW.js → navmesh.menu-FhL1pGx1.js} +1 -1
- package/dist/assets/{navmesh.service-jgDWlgj1.js → navmesh.service-usyDeJlm.js} +1 -1
- package/dist/assets/{network.utility-CEu5nHf7.js → network.utility-BPh4hTmh.js} +1 -1
- package/dist/assets/night-CvV4Gybt.exr +0 -0
- package/dist/assets/{object3d-authoring-subject-CH5sI2oP.js → object3d-authoring-subject-CyE4rQ2A.js} +1 -1
- package/dist/assets/oid-transform-BOqL6YH6.js +2 -0
- package/dist/assets/{particles-Y626p22p.js → particles-C47L-dda.js} +1 -1
- package/dist/assets/particles-factory-CRqPLdS7.js +1 -0
- package/dist/assets/pixi-authoring-adapter-C5Ikqj5-.js +1 -0
- package/dist/assets/{pixi-live-write-target-DuWydlWb.js → pixi-live-write-target-OWBk79dp.js} +1 -1
- package/dist/assets/pixi-primitive-D5igywJ_.js +1 -0
- package/dist/assets/pixi-react-root-factory-9lZ0Yz-n.js +1 -0
- package/dist/assets/play-mode-DomOvQie.js +22 -0
- package/dist/assets/play.command-DoqjH-Pp.js +2 -0
- package/dist/assets/{playtest-BXIL1JEF.js → playtest-BnFenMBW.js} +1 -1
- package/dist/assets/{pose-guard-6Osb2cFu.js → pose-guard-Bb3gZOzk.js} +1 -1
- package/dist/assets/{product-DFhyARJj.js → product-CTDJoVo5.js} +1 -1
- package/dist/assets/{profiler.action-CaXJDp3t.js → profiler.action-C_OFGkDw.js} +1 -1
- package/dist/assets/{profiler.menu-BIMF6Bi4.js → profiler.menu-BJbnVoo4.js} +1 -1
- package/dist/assets/{profiler.utility-BExw9wBO.js → profiler.utility-qpfhuwRw.js} +1 -1
- package/dist/assets/project-authoring-session-BV-MM8Fl.js +2 -0
- package/dist/assets/{project-provenance-BoP3nrle.js → project-provenance-4ldz-EOG.js} +1 -1
- package/dist/assets/{properties-bone-constraints.inspector-ByT6p7S-.js → properties-bone-constraints.inspector-C-ByIdg1.js} +1 -1
- package/dist/assets/{properties-bone.inspector-z4qJwKO5.js → properties-bone.inspector-CXY0xCQB.js} +1 -1
- package/dist/assets/{properties-collection.inspector-D0_3ijWU.js → properties-collection.inspector-DIfkZAel.js} +1 -1
- package/dist/assets/{properties-constraints.inspector-CESzjuls.js → properties-constraints.inspector-BaunL5nT.js} +1 -1
- package/dist/assets/{properties-data.inspector-hG8Wgyzb.js → properties-data.inspector-DQD-jfO2.js} +1 -1
- package/dist/assets/{properties-material.inspector-CzY0JCQ6.js → properties-material.inspector-A0HZ4SX6.js} +1 -1
- package/dist/assets/{properties-modifiers.inspector-3dDhwf7g.js → properties-modifiers.inspector-GUnVhVwZ.js} +1 -1
- package/dist/assets/{properties-object.inspector-CiarfxkT.js → properties-object.inspector-Chsfa4Xa.js} +1 -1
- package/dist/assets/{properties-output.inspector-DKJxmKSD.js → properties-output.inspector-U7ZmD0Me.js} +1 -1
- package/dist/assets/{properties-particles.inspector-CCEdYWGm.js → properties-particles.inspector-umkW-OlI.js} +1 -1
- package/dist/assets/{properties-physics.inspector-B2c0KUyA.js → properties-physics.inspector-CLVBlWwL.js} +1 -1
- package/dist/assets/{properties-render.inspector-Bcm0HLRW.js → properties-render.inspector-D0u9taKy.js} +1 -1
- package/dist/assets/{properties-scene.inspector-PIM_eTb_.js → properties-scene.inspector-JwGCZQAx.js} +1 -1
- package/dist/assets/{properties-texture.inspector-CgFlnyr8.js → properties-texture.inspector-B1vC28pw.js} +1 -1
- package/dist/assets/{properties-view-layer.inspector-DGjF_Aqo.js → properties-view-layer.inspector-BuUKyBFp.js} +1 -1
- package/dist/assets/{properties-world.inspector-CrMvaRvB.js → properties-world.inspector-VXUj4dT4.js} +1 -1
- package/dist/assets/r3f-design-session-qJ2v5SrB.js +2 -0
- package/dist/assets/r3f-physics-binding-C8OqNRG2.js +1 -0
- package/dist/assets/{r3f-root-factory-z9llD1OU.js → r3f-root-factory-DjGnbU4n.js} +1 -1
- package/dist/assets/r3f-source-authoring-adapter-CG9heazM.js +12 -0
- package/dist/assets/{rapier-physics-bridge-CMoeVo3Y.js → rapier-physics-bridge-B-EK7KYV.js} +1 -1
- package/dist/assets/react-inspector.service-DWeXDHJq.js +1 -0
- package/dist/assets/{react-root-CEz5NTck.js → react-root-DGLRLr-F.js} +1 -1
- package/dist/assets/react-story-board-CSqHY0Cg.js +1 -0
- package/dist/assets/{react-three-fiber.esm-CycrbDlA.js → react-three-fiber.esm-BxIoqVh1.js} +1 -1
- package/dist/assets/{react-three-rapier.esm-CEfKpvxT.js → react-three-rapier.esm-BYzLhdSV.js} +1 -1
- package/dist/assets/react-world-authoring-adapter-BMT9kLWU.js +1 -0
- package/dist/assets/{realm-services-CobQsq_X.js → realm-services-D25JHoqD.js} +1 -1
- package/dist/assets/{reflection-probe-Don-M3Fj.js → reflection-probe-CqXWlicu.js} +1 -1
- package/dist/assets/{reflection-probe-capture.inspector-CmFUoJCx.js → reflection-probe-capture.inspector-B7Qa30vB.js} +1 -1
- package/dist/assets/regions-DWeEBnE2.js +1 -0
- package/dist/assets/{register-render-vitals-BiZk29b2.js → register-render-vitals-BO7x64kR.js} +1 -1
- package/dist/assets/{registry-02YZjMNp.js → registry-DlTluc4x.js} +1 -1
- package/dist/assets/{render-audio-control-vMRlePWb.js → render-audio-control-DCa_bOBI.js} +1 -1
- package/dist/assets/{render-batch-system-0vq7p0VC.js → render-batch-system-CzCp9YKM.js} +1 -1
- package/dist/assets/{render-control-Df3yTiyr.js → render-control-BNQr1eNO.js} +1 -1
- package/dist/assets/{render-env-D2IV2x5k.js → render-env-emvlfeTG.js} +1 -1
- package/dist/assets/{render-features-CPQ_e568.js → render-features-COF7MSQ9.js} +1 -1
- package/dist/assets/{render-settings-Bw4W9SYF.js → render-settings-C_kIMq8Y.js} +1 -1
- package/dist/assets/{resolve-three-SZE_WWUM.js → resolve-three-C-nx-QdA.js} +13 -13
- package/dist/assets/{root-seam-contract-Z0VWX3Bk.js → root-seam-contract-C7GOxf5x.js} +1 -1
- package/dist/assets/{run-ticks-settled-C4ksViyA.js → run-ticks-settled-B0cTtmhQ.js} +1 -1
- package/dist/assets/{scene-capture-CGYF-Viw.js → scene-capture-CLOc7GXc.js} +1 -1
- package/dist/assets/{scene-capture-BQKzU0NT.js → scene-capture-D10Nxkvp.js} +1 -1
- package/dist/assets/scene-document.service-B7kAVTko.js +2 -0
- package/dist/assets/{scene-framing-Cat0GtyJ.js → scene-framing-50N7SKuX.js} +1 -1
- package/dist/assets/{scene-index-B6BZOHMk.js → scene-index-Bce459yu.js} +1 -1
- package/dist/assets/{scene-query-C7_N-TpI.js → scene-query-IUZhw6pA.js} +1 -1
- package/dist/assets/{schema-kl9-2B_J.js → schema-Iy-mbzll.js} +1 -1
- package/dist/assets/sculpt.layout-D-K5cLw6.js +1 -0
- package/dist/assets/{seeded-random-i3mtgBKZ.js → seeded-random-CN0scLZj.js} +1 -1
- package/dist/assets/{session-CZ5JPg-z.js → session-CsR0lApe.js} +24 -15
- package/dist/assets/{setup-audio-S8GQF91f.js → setup-audio-BJ18gvXZ.js} +1 -1
- package/dist/assets/setup-particles-B6H-GbAA.js +1 -0
- package/dist/assets/{setup-physics-BeZ7-LKD.js → setup-physics-GugbTT0J.js} +1 -1
- package/dist/assets/{setup-renderer-DVXaSGin.js → setup-renderer-wt_a-p8r.js} +20 -20
- package/dist/assets/shading.layout-CZZHKBer.js +1 -0
- package/dist/assets/{sim-clock-CLflx7kg.js → sim-clock-DEfbb_-P.js} +1 -1
- package/dist/assets/{soft-particle-depth-DGvfQDi1.js → soft-particle-depth-CKUS1j0Y.js} +1 -1
- package/dist/assets/source-object3d-authoring-adapter-CfHQLFAL.js +1 -0
- package/dist/assets/{source-persistence-backend-C-aR-B_Y.js → source-persistence-backend-_-JMEXxE.js} +1 -1
- package/dist/assets/{spark-renderer-lifecycle-ynWESJcv.js → spark-renderer-lifecycle-9mnMW3Z4.js} +1 -1
- package/dist/assets/{spark.module-4pXQoz5d.js → spark.module-CXth-y_a.js} +1 -1
- package/dist/assets/stage-keyboard-C0FdDLOQ.js +1 -0
- package/dist/assets/stage-overlay-set-CwhCzbOy.js +1 -0
- package/dist/assets/stage-presence-markers-DVMDKiB-.js +1 -0
- package/dist/assets/stage-transform-tools-B09Z7v0o.js +1 -0
- package/dist/assets/standard-viewport-dressing-GUUr6GuK.js +20 -0
- package/dist/assets/{state-watch.action-BOvQR2qt.js → state-watch.action-CgF8qoFC.js} +1 -1
- package/dist/assets/{state-watch.menu-CNLvDeeY.js → state-watch.menu-CIMncESW.js} +1 -1
- package/dist/assets/{state-watch.utility-Bg1tTTQU.js → state-watch.utility-zTHkUALC.js} +1 -1
- package/dist/assets/static-batch-advisor-DqfXWRUq.js +1 -0
- package/dist/assets/story-capture-COQgezzl.js +1 -0
- package/dist/assets/story-documents-DQ0KORmd.js +3 -0
- package/dist/assets/story-documents.service-DOSaqPqv.js +1 -0
- package/dist/assets/story-documents.service-Gb7oUkbg.js +1 -0
- package/dist/assets/{story-media-presence-BHzk2IV5.js → story-media-presence-nW3zJqKv.js} +1 -1
- package/dist/assets/story-pixi-preview-COPTEsHo.js +1 -0
- package/dist/assets/story-presentation-CxADj5oz.js +1 -0
- package/dist/assets/{story-three-preview-BHEDZzcl.js → story-three-preview-C9W__8Or.js} +2 -2
- package/dist/assets/{structural-ids-Dc-7rEwi.js → structural-ids-CblajJQK.js} +1 -1
- package/dist/assets/studio-CysTBGIb.exr +0 -0
- package/dist/assets/sunrise-Dj0psFrf.exr +0 -0
- package/dist/assets/sunset-Bw3x2Bot.exr +0 -0
- package/dist/assets/{surface-state-DaxyruCj.js → surface-state-BAUJu6GY.js} +1 -1
- package/dist/assets/{system-runner-DkOjxEBt.js → system-runner-D_DtVrer.js} +1 -1
- package/dist/assets/team-playtest.service--79O6xkx.js +1 -0
- package/dist/assets/{three-CDSueJyJ.js → three-DSsr_Lvp.js} +1 -1
- package/dist/assets/{three-authoring-adapter-CmSQ3Vui.js → three-authoring-adapter-Yqsank46.js} +1 -1
- package/dist/assets/three-authoring.service-BDos-bRt.js +2 -0
- package/dist/assets/{three-ingest-runtime-QzDYk6tU.js → three-ingest-runtime-DWijtqQ8.js} +1 -1
- package/dist/assets/{three-projection-core-BmKMZ-nf.js → three-projection-core-kubBTx0s.js} +1 -1
- package/dist/assets/three-story-model-BraQFA9h.js +1 -0
- package/dist/assets/three-viewport-presentation-BL7Uc2i6.js +1 -0
- package/dist/assets/{three.module-D396a9Mn.js → three.module-IFn-4i31.js} +1 -1
- package/dist/assets/three.quarks.esm-CRKGjKAH.js +1039 -0
- package/dist/assets/transform-mode-request-Cu7ewbtr.js +1 -0
- package/dist/assets/{transform-writer-BhBBTx33.js → transform-writer-DXxrI4t7.js} +1 -1
- package/dist/assets/transport.header-CeND8Vzh.js +1 -0
- package/dist/assets/{trigger-volume-BNK2XzPL.js → trigger-volume-BCVRS3NM.js} +1 -1
- package/dist/assets/{tuples-CIQ4Bn1U.js → tuples-DKDGrN1t.js} +1 -1
- package/dist/assets/ui-board-document-DD2CAEAo.js +2 -0
- package/dist/assets/unity.style-vCmLw4gI.js +1 -0
- package/dist/assets/unity.view-DIn2S6Do.js +1 -0
- package/dist/assets/unreal.style-BQn-HhOX.js +1 -0
- package/dist/assets/unreal.view-adNBETZK.js +1 -0
- package/dist/assets/user-data-CZqsJDk-.js +1 -0
- package/dist/assets/{utility-view-state-BHypxA33.js → utility-view-state-DYJY8V8O.js} +1 -1
- package/dist/assets/uv-editing.layout-A8RA-cbM.js +1 -0
- package/dist/assets/{vgai-shared-three-Bc5PvpLM.js → vgai-shared-three-D_RAEumG.js} +1 -1
- package/dist/assets/{viewport-root-presentation-CWsE56K6.js → viewport-root-presentation-C9M98VNM.js} +1 -1
- package/dist/assets/{viewport-shading-BuA88e_A.js → viewport-shading-BzcvgJhK.js} +1 -1
- package/dist/assets/viewport-shading-boundary-CBvvzS-p.js +84 -0
- package/dist/assets/{viewport-surface-status-B3om4Kcf.js → viewport-surface-status-BFmnWp7z.js} +1 -1
- package/dist/assets/voxel-surface-ROWYug7H.js +1 -0
- package/dist/assets/webgl-frame-capture-CRKX73E9.js +1 -0
- package/dist/assets/webworkerAll-CehoCtFb.js +1 -0
- package/dist/assets/{worker-UrMcrc5_.js → worker-B7zhIsFh.js} +2 -2
- package/dist/assets/world-documents-DErHq15h.js +1 -0
- package/dist/assets/world-root-stage-binding-BIymcQ4K.js +1 -0
- package/dist/assets/{world-state-BWG-IcOd.js → world-state-ZGDGY_Xl.js} +1 -1
- package/dist/assets/{writer-B-KovzkA.js → writer-BPbm4_my.js} +5 -5
- package/dist/assets/xstate-animation-binding-Cvd4JbEY.js +1 -0
- package/dist/assets/{xstate-animation-meta-Q3u9zh_m.js → xstate-animation-meta-B3OZR8Q2.js} +1 -1
- package/dist/vgai-shared-three.json +1 -1
- package/dist-node/cli.js +317 -73
- package/dist-node/create.js +59 -19
- package/package.json +16 -13
- package/src/index.ts +6 -0
- package/template/.agents/skills/vgai-3d-models/SKILL.md +3 -3
- package/template/.agents/skills/vgai-threejs-authoring/SKILL.md +4 -9
- package/template/.claude/skills/vgai-3d-models/SKILL.md +3 -3
- package/template/.claude/skills/vgai-threejs-authoring/SKILL.md +4 -9
- package/template/.github/skills/vgai-3d-models/SKILL.md +3 -3
- package/template/.github/skills/vgai-threejs-authoring/SKILL.md +4 -9
- package/template/AGENTS.md +1 -1
- package/template/check-idioms.ts +4 -5
- package/template/package.json +9 -9
- package/template/tsconfig.json +1 -0
- package/template/vgai.adapter.ts +1 -0
- package/template-dotfiles/gitignore +2 -0
- package/workbench/src/media/game-cover.css +1 -1
- package/catalog/project-source/src/lib/bake/mesh-slice.ts +0 -157
- package/dist/assets/BufferGeometryUtils-Nz37EVXf.js +0 -1
- package/dist/assets/CanvasSceneViewport-Bpi6gVTC.js +0 -1
- package/dist/assets/ColladaLoader-aVOPIsCh.js +0 -3
- package/dist/assets/EXRLoader-Cdans_oJ.js +0 -1
- package/dist/assets/EffectComposer-DQxfsXBZ.js +0 -1
- package/dist/assets/EntityModelDocument-Ccvw66N9.js +0 -1
- package/dist/assets/EnvironmentAssetDocument-Dg-Qq6O6.js +0 -1
- package/dist/assets/FBXLoader-B4MoUtAn.js +0 -1
- package/dist/assets/Fbo-Dz-Soul3.js +0 -1
- package/dist/assets/GLTFExporter-HgrCle4L.js +0 -1
- package/dist/assets/Gltf-UHVWKz65.js +0 -2
- package/dist/assets/HDRLoader-THU88oVD.js +0 -5
- package/dist/assets/ImageViewer-Tn7s_MnW.js +0 -1
- package/dist/assets/InspectorObjectPreview-CVejvLRg.js +0 -1
- package/dist/assets/JsonAssetDocument-C7VGcLhu.js +0 -3
- package/dist/assets/MeshBVH-BiDHDcu-.js +0 -1
- package/dist/assets/ModelAssetDocument-F5GACirk.js +0 -1
- package/dist/assets/Object3DDocumentViewport-DB7T0NTl.js +0 -2
- package/dist/assets/Object3DPreview-DL8oi7Xs.js +0 -2
- package/dist/assets/OnlineAssetDetail-C6z9RvYK.js +0 -2
- package/dist/assets/PlayBar-BR-Vg3Jb.js +0 -2
- package/dist/assets/RGBELoader-BgBcQv8j.js +0 -1
- package/dist/assets/RectAreaLightUniformsLib-CMMoWfll.js +0 -1
- package/dist/assets/RootSelectionOverlay-BZPlxmXU.js +0 -1
- package/dist/assets/STLLoader-Dyv3lsxY.js +0 -1
- package/dist/assets/SimplifyModifier-C8ayvRzd.js +0 -1
- package/dist/assets/SourceAssetViewer-2SWQoUut.js +0 -12
- package/dist/assets/StageHost-BN-IoTef.js +0 -2
- package/dist/assets/ThreeBoardDocument-CVncZyIq.js +0 -2
- package/dist/assets/asset-budget-asset.menu-Di3KiQCd.js +0 -1
- package/dist/assets/asset-budget.action-DCzzcuTh.js +0 -1
- package/dist/assets/asset-budget.document-BWU8wnVW.js +0 -1
- package/dist/assets/asset-budget.menu-BGZpT_31.js +0 -1
- package/dist/assets/autoplay.service-BZBGNSvt.js +0 -1
- package/dist/assets/blender-emscripten-engine-9ZIRYNhe.js +0 -2
- package/dist/assets/blender-properties-tab-C5CyPydi.js +0 -3
- package/dist/assets/blender-runtime-host-BpBwGv7r.js +0 -4
- package/dist/assets/blender-runtime.document-lIYhhPtv.js +0 -8
- package/dist/assets/blender.command-BtJeWk-A.js +0 -1
- package/dist/assets/body-marks-h_xDxiDE.js +0 -1
- package/dist/assets/bridge.command-o5gDNEwa.js +0 -3
- package/dist/assets/browserAll-DeWblVez.js +0 -1
- package/dist/assets/canvas-entry-runtime-SfBxaR9M.js +0 -2
- package/dist/assets/component-board.service-DidCyM4O.js +0 -2
- package/dist/assets/component-verbs.service-Bv9jId3q.js +0 -1
- package/dist/assets/constraints.inspector-B9U9Yj-u.js +0 -1
- package/dist/assets/coverage.service-VTX5Mcsx.js +0 -3
- package/dist/assets/deferred-ingest-play-DCJi_Pgu.js +0 -2
- package/dist/assets/design-time-layers-wYgOTgni.js +0 -1
- package/dist/assets/design-time-mount.service-BzY21e1F.js +0 -2
- package/dist/assets/design-time-react-mount-DM9WLrF2.js +0 -1
- package/dist/assets/edit-mode-authoring-B47TfLqu.js +0 -1
- package/dist/assets/editor-api-BoJIcyZG.js +0 -1
- package/dist/assets/fflate.module-DPuTF8aG.js +0 -6
- package/dist/assets/fork-menu-BoVyw2Wu.js +0 -1
- package/dist/assets/game-document.service-DbRfx2V0.js +0 -1
- package/dist/assets/game-eval.command-D-7Dxbj_.js +0 -2
- package/dist/assets/gameplay-replay-e5umMlXv.js +0 -1
- package/dist/assets/gameplay.command-DxcVYX6F.js +0 -1
- package/dist/assets/generation.service-CDIgObuw.js +0 -1
- package/dist/assets/index-96FBF1Oj.js +0 -1
- package/dist/assets/index-BAWkB0dv.js +0 -1
- package/dist/assets/index-BDnS2b6S.js +0 -1
- package/dist/assets/index-BjTCPEQ7.js +0 -134
- package/dist/assets/index-CVCb_ImQ.js +0 -1
- package/dist/assets/index-CZd9o7Lu.js +0 -1
- package/dist/assets/index-D2fNXpHa.css +0 -1
- package/dist/assets/index-GIL7oGEO.js +0 -4894
- package/dist/assets/index-OrYXPk3Z.js +0 -487
- package/dist/assets/ingest-boot-viewport-D5rI_Kk_.js +0 -1
- package/dist/assets/ingest-siblings-Bop2kqVl.js +0 -1
- package/dist/assets/instances.command-D6UkZNO8.js +0 -1
- package/dist/assets/light-camera-factory-CWbbe9gI.js +0 -1
- package/dist/assets/live-behaviors-Bxq49Maz.js +0 -1
- package/dist/assets/matcap-texture-CVfalpWT.js +0 -1
- package/dist/assets/model-asset-sections.service-CHhFS3ZX.js +0 -1
- package/dist/assets/model.layout-BJUEQYUI.js +0 -1
- package/dist/assets/module-mode-DVBLT9d-.js +0 -2
- package/dist/assets/mount-canvas-ingest-root-DDuAWf_C.js +0 -2
- package/dist/assets/mount-dom-ingest-root-D_EiBgpn.js +0 -2
- package/dist/assets/mount-ingest-root-glv2SSWf.js +0 -2
- package/dist/assets/mount-three-ingest-root-hrUt9VVU.js +0 -1
- package/dist/assets/particles-factory-DnLOHXT8.js +0 -1
- package/dist/assets/pasteboard-materialize-BqSS4QzV.js +0 -20
- package/dist/assets/pasteboard.action-DU3UHtJG.js +0 -2
- package/dist/assets/pixi-authoring-adapter-CjibysC3.js +0 -1
- package/dist/assets/pixi-primitive-DlWbUPN9.js +0 -1
- package/dist/assets/pixi-react-root-factory-DYsznYRQ.js +0 -1
- package/dist/assets/play-mode-BFU2PCkG.js +0 -22
- package/dist/assets/play.command-BpqqLqkq.js +0 -2
- package/dist/assets/project-authoring-session-Bnt6icLr.js +0 -2
- package/dist/assets/r3f-design-session-D-4yyDO9.js +0 -2
- package/dist/assets/r3f-physics-binding-BBo8oma9.js +0 -1
- package/dist/assets/r3f-source-authoring-adapter-w6Bc60K-.js +0 -13
- package/dist/assets/react-inspector.service-B_neRnSK.js +0 -1
- package/dist/assets/react-story-board-BDDwiE2H.js +0 -1
- package/dist/assets/react-world-authoring-adapter-DmrwM3py.js +0 -1
- package/dist/assets/runtime-inspection-l2iFQSsg.js +0 -1
- package/dist/assets/scene-document.service-qkDjUrlP.js +0 -2
- package/dist/assets/sculpt.layout-zJF55yCR.js +0 -1
- package/dist/assets/setup-particles-GCXlnkj_.js +0 -1
- package/dist/assets/shading.layout-DULYZV6M.js +0 -1
- package/dist/assets/source-object3d-authoring-adapter-B-L6Ha6f.js +0 -1
- package/dist/assets/stage-invalidation-DBg3C3Ta.js +0 -1
- package/dist/assets/stage-keyboard-n-5kKH-m.js +0 -1
- package/dist/assets/stage-overlay-set-B9zp2sLB.js +0 -1
- package/dist/assets/stage-presence-markers-DiGI6A45.js +0 -1
- package/dist/assets/standard-viewport-dressing-CzjAe_0A.js +0 -7
- package/dist/assets/static-batch-advisor-B13QEH7d.js +0 -1
- package/dist/assets/story-capture-_gC8dXV-.js +0 -1
- package/dist/assets/story-documents--TDLaPeL.js +0 -3
- package/dist/assets/story-documents.service-BiS_YbNQ.js +0 -1
- package/dist/assets/story-documents.service-CxOPYJ2j.js +0 -1
- package/dist/assets/story-pixi-preview-BUrOJZXS.js +0 -1
- package/dist/assets/story-presentation-j2AVN-mK.js +0 -1
- package/dist/assets/team-playtest.service-DqOinFVA.js +0 -1
- package/dist/assets/three-authoring.service-iuHLwtf1.js +0 -2
- package/dist/assets/three-viewport-presentation-QBQpSdMh.js +0 -1
- package/dist/assets/three.quarks.esm-B1C61jGo.js +0 -1039
- package/dist/assets/transport.header-B-6HQlU2.js +0 -1
- package/dist/assets/ui-board-document-Bwtt--xp.js +0 -2
- package/dist/assets/use-live-actor-state-DErbWQWF.js +0 -1
- package/dist/assets/user-data-BB2Of6Ht.js +0 -1
- package/dist/assets/uv-editing.layout-BEKHxmHw.js +0 -1
- package/dist/assets/viewport-shading-boundary-B_-_gABg.js +0 -82
- package/dist/assets/voxel-surface-DtcsSWRL.js +0 -1
- package/dist/assets/webgl-frame-capture-FlF9zQmW.js +0 -1
- package/dist/assets/webworkerAll-CM2o_dnz.js +0 -1
- package/dist/assets/world-documents-147tiFZe.js +0 -1
- package/dist/assets/world-root-stage-binding-vwTrtBz6.js +0 -1
- package/dist/assets/xstate-animation-binding-Brd0NST6.js +0 -1
- package/dist/assets/xstate-behavior.action-B8UluFBK.js +0 -1
- package/dist/assets/xstate-behavior.document-CKAsE45I.js +0 -1
- package/dist/assets/xstate-behavior.inspector-vJJyuifc.js +0 -1
- package/dist/assets/xstate-behavior.menu-BXbPICIh.js +0 -1
- package/dist/assets/xstate-inspection-BsZv8LS9.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{X as a}from"./index-Ckxb31Yz.js";const r=new Set;function i(t,e,n){return JSON.stringify([t,e,n])}function d(t,e,n){const o=i(t,e,n);r.has(o)||(r.add(o),a.warn(`No declaration covers \`${e}\` in ${t}, so the editor GUESSED \`${n}\` from its text. Declare it (a typed prop on the component, a token value that states its own kind) and the editor reads the declaration instead of a heuristic.`,"inspector"))}export{d as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{installSceneCapture2D as p}from"./scene-capture-
|
|
1
|
+
import{installSceneCapture2D as p}from"./scene-capture-CLOc7GXc.js";import"./resolve-three-C-nx-QdA.js";import"./index-Ckxb31Yz.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./three.module-IFn-4i31.js";import"./capability-coverage-CfUeULDN.js";import"./game-contract-seams-TCpIMmHP.js";import"./json-history-resource-r-9q_hxP.js";import"./dom-authoring-adapter-CEeFyatF.js";import"./react-world-authoring-adapter-BMT9kLWU.js";import"./board-guides-C3usUZZk.js";import"./writer-BPbm4_my.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-BRgDdtVk.js";import"./inference-diagnostics-YW0yJkKx.js";import"./debug-registry-B3Cnne3x.js";import"./playtest-BnFenMBW.js";import"./webgl-frame-capture-CRKX73E9.js";import"./active-ingest-DEgq9JiA.js";import"./ingest-source-persistence-DH6ioCOu.js";const n="IngestGame2DLoadError";class s extends Error{constructor(i,t){super(`pixi ingest: game "${i}" failed to load: ${t}`,{cause:t}),this.name=n}}async function b(e,i,t={}){const r=p(e,{...t.acceptCapture?{accept:t.acceptCapture}:{}});try{if(await i.load(),await t.preferStructuralRuntime?.())return r.uninstall(),null}catch(o){throw r.uninstall(),new s(i.id,o)}const a=t.captureTimeoutMs??i.captureTimeoutMs??8e3;try{return{stage:(await r.waitForCapture({timeoutMs:a,...t.onWait?{onWait:t.onWait}:{}})).stage,capture:r,setPaused:m=>r.setPaused(m),dispose:()=>r.uninstall()}}catch(o){throw r.uninstall(),new Error(`pixi ingest: game "${i.id}" rendered no capturable frame within ${a}ms: ${o}`)}}export{n as INGEST_GAME_2D_LOAD_ERROR_NAME,s as IngestGame2DLoadError,b as mountIngestGame2D};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{X as s,E as d,dz as a,dA as c,dB as p,dC as m,aO as l}from"./index-Ckxb31Yz.js";import{h as u,f,a as I}from"./active-ingest-DEgq9JiA.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./three.module-IFn-4i31.js";import"./game-contract-seams-TCpIMmHP.js";import"./capability-coverage-CfUeULDN.js";import"./ingest-source-persistence-DH6ioCOu.js";import"./playtest-BnFenMBW.js";function b(){const o=I();if(o){if(!u())throw new Error(`Ingest "${o.worldId}" mounted without the required pause capability; refusing to expose a running game in Edit — ${f()??"no lifecycle control was bound"}.`);s.log(`Ingest "${o.worldId}" is HELD — content time does not advance in Edit until ▶`,"ingest")}const e=l(),i=d()?.scenes.default,n=i?m(i):void 0,r=(n?e.find(t=>t.descriptor.id===n):void 0)??e.find(t=>t.descriptor.id===a)??e.find(t=>t.descriptor.id===c);r&&p(r.descriptor.id)}export{b as landIngestBootInEdit};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ak as v,X as g,cl as b,cm as R,dX as S,dY as E,cs as f}from"./index-Ckxb31Yz.js";import{w as k}from"./mounted-authoring-TIN5EnCb.js";import{PixiAuthoringAdapter as w}from"./pixi-authoring-adapter-C5Ikqj5-.js";import{createLiveCanvasWriteTarget as A}from"./pixi-live-write-target-OWBk79dp.js";import{resolveCanvasPixiForEditor as x}from"./canvas-entry-runtime-E5YjSgre.js";import{C as $}from"./crash-null-boundary-v3a0uEgw.js";import{a as l}from"./json-history-resource-r-9q_hxP.js";import{a as C}from"./realm-services-D25JHoqD.js";import{r as I}from"./react-root-DGLRLr-F.js";import{D as P}from"./dom-authoring-adapter-CEeFyatF.js";import{w as D,R as M}from"./react-world-authoring-adapter-BMT9kLWU.js";import{createPhysics2DRegistry as j}from"./physics-registry-B2Jkp8e6.js";import{createPhysicsAdapter2D as W}from"./system-adapters-rIC8FSGP.js";import{s as z}from"./three-authoring-adapter-Yqsank46.js";import{r as h}from"./index-nmcBqr7Y.js";import{r as B}from"./index-CtzuWnCS.js";import{a as F}from"./client-DNXj_opT.js";import{mountModuleRootRuntime as O}from"./module-mode-CRfHyIMS.js";import"./jsx-runtime-DPjLkJKQ.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-FUuS4qwW.js";import"./three.module-IFn-4i31.js";import"./authoring-CgcOFhGS.js";import"./index-BLo2LE8C.js";import"./source-persistence-backend-_-JMEXxE.js";import"./ingest-source-persistence-DH6ioCOu.js";import"./pixi-transform-channels-VjdohT11.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./world-state-ZGDGY_Xl.js";import"./debug-registry-B3Cnne3x.js";import"./frame-selector-cache-cCeUbcjG.js";import"./three-ingest-runtime-DWijtqQ8.js";import"./EffectComposer-BHDH-NLz.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-qtkA7CQ8.js";import"./CSS3DRenderer-CAS2WZZy.js";import"./inspect-BRgDdtVk.js";import"./inference-diagnostics-YW0yJkKx.js";import"./board-guides-C3usUZZk.js";import"./writer-BPbm4_my.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./three-projection-core-kubBTx0s.js";import"./three-DSsr_Lvp.js";import"./viewport-pick-context-DkawXbEi.js";import"./body-marks-D8iaje6y.js";import"./user-data-CZqsJDk-.js";import"./object-marks-DwvIEBOK.js";import"./structural-ids-CblajJQK.js";import"./object3d-authoring-subject-CyE4rQ2A.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./r3f-physics-binding-C8OqNRG2.js";import"./capability-coverage-CfUeULDN.js";import"./game-contract-seams-TCpIMmHP.js";import"./binding-resolver-BWwG10zJ.js";import"./native-debug-module-j-MekcLS.js";import"./native-entry-surface-BE8LJNdu.js";import"./playtest-BnFenMBW.js";import"./adapter-surface-Y37Nzcyw.js";import"./entry-adjudication-BYy7TXOB.js";import"./r3f-root-factory-DjGnbU4n.js";import"./register-render-vitals-BO7x64kR.js";import"./render-census-BrQX_CXv.js";import"./structural-signature-0w-i_ats.js";import"./render-vitals-BZ5HtvMi.js";import"./static-batch-advisor-DqfXWRUq.js";import"./webgl-frame-capture-CRKX73E9.js";import"./dev-build-gDYrq68M.js";import"./game-input-seams-BC6xhZy3.js";import"./seeded-random-CN0scLZj.js";import"./render-seed-DF4JHy7P.js";import"./frame-delta-D2nsw_Ht.js";import"./events-156d8d12.esm-C734MYnx.js";import"./index-bQE2NA0D.js";import"./relative-path-guard-GiM7Lsz8.js";function y(t,i,n){t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.width="100%",t.style.height="100%",t.style.zIndex=String(i.zOrder??0),t.style.pointerEvents=n}async function T(t,i,n,m){const r=await C(n,S()),a=await I(t,r),e=document.createElement("div");e.dataset.vgaiRootSurface="true",y(e,t,"none"),i.appendChild(e),g.log(`react sibling "${t.id}": no native Game beside an ingest world — useWorldState unavailable`,"ingest");const u=F.createRoot(e);let s=null;if(B.flushSync(()=>{u.render(h.createElement($,{onCaught:c=>{s=c}},h.createElement(a)))}),s!==null)throw u.unmount(),e.remove(),s instanceof Error?s:new Error(String(s));let o;if(m)if(D(e).nodes.size>0){const p=E("An ingest sibling’s react layer");o=new M(e,m,{...p?{writeBackend:p}:{}})}else o=new P(e,m,{journal:l(t.id)});return{worldId:t.id,...o?{authoring:o}:{},dispose(){u.unmount(),e.remove()}}}async function L(t,i,n,m,r){const a=document.createElement("div");y(a,i,"auto"),n.appendChild(a);try{const e=n.clientWidth||800,u=n.clientHeight||600,{session:s}=await O(t,i,m,a,e,u),o=s.game.roots[0],c=o.mounted.authoring;let p;if(r)if(c)p=k(c,r);else if(o.kind==="three")p=z(r,o.threeScene(),{frameControl:"host",journal:l(i.id)});else if(o.kind==="canvas")if(o.mounted.kind!=="canvas"||o.mounted.substrate.name!=="pixi")p=o.mounted.authoring??f(r,`${i.id} (${o.mounted.kind==="canvas"?o.mounted.substrate.name:"unknown"} authoring unavailable)`);else{const d=W(o.physics2d??j());p=new w(o.canvasRoot(),r,{pixi:await x(),target:A({physics:d}),journal:l(i.id),surface:()=>a})}else p=f(r,`${i.id} (no authoring surface)`);return{worldId:i.id,...p?{authoring:p}:{},setPaused(d){d?s.pause():s.resume()},dispose(){s.stop(),a.remove()}}}catch(e){throw a.remove(),e}}function N(t){throw new Error(`sibling world "${t.id}" (kind: ${t.surface}, adapter identity: "${t.adapter.identity}") has no known composite-sibling mount path — every currently-resolvable identity (three/canvas/dom/module) is routed above; this is reached only for a genuinely unroutable shape.`)}function X(t){return t.adapter.type==="module"||t.adapter.identity==="three"||t.adapter.identity==="canvas"?"scoped-runtime":t.adapter.identity==="dom"?"react-layer":null}async function G(t,i,n,m,r){switch(X(i)){case"scoped-runtime":return L(t,i,n,m,r);case"react-layer":return T(i,n,m,r);default:N(i)}}async function ce(t,i,n,m,r){const a=[];for(const e of v(t))if(e.id!==i)try{a.push(await G(t,e,n,m,r))}catch(u){g.error(`Composite sibling "${e.id}" failed to mount: ${u}`,"ingest"),b({worldId:e.id,kind:e.surface,identity:e.adapter.identity,message:R(u)})}return a}export{ce as mountIngestSiblings,X as siblingMountRoute};
|
package/dist/assets/{ingest-source-persistence-C_6Hiyra.js → ingest-source-persistence-DH6ioCOu.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{V as m,dA as f,dB as g,bb as S,dC as b,dD as w}from"./index-GIL7oGEO.js";const $="vgaiRecordIndex";function O(i){const e=i?.userData;if(e===null||typeof e!="object")return null;const t=e[$];return typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}let d={state:"absent"},h=0;function j(i,e){const t=i;if(t===null||typeof t!="object")throw new Error(`the data writer "${e}" did not export a module object`);if(typeof t.dataFile!="string"||t.dataFile.length===0)throw new Error(`the data writer "${e}" exports no \`dataFile\` string — a writer must name the one project-relative file it edits`);if(typeof t.planDataEdit!="function")throw new Error(`the data writer "${e}" exports no \`planDataEdit\` function — that is the whole contract: (bytes, request) => {changed, bytes} | {changed, reason}`);return{dataFile:t.dataFile,...typeof t.canPlace=="function"?{canPlace:t.canPlace.bind(t)}:{},planDataEdit:t.planDataEdit.bind(t)}}function R(i){const e=++h;if(i===null){d={state:"absent"};return}d={state:"loading"},i.load().then(t=>{h===e&&(d={state:"ready",writer:j(t,i.specifier)})}).catch(t=>{h===e&&(d={state:"failed",reason:`this game's declared data writer (${i.specifier}) could not be loaded: ${t instanceof Error?t.message:String(t)}`})})}function k(){return d}function I(i){const e=d;if(e.state!=="ready"||!e.writer.canPlace)return null;const t=e.writer.canPlace(i);return t===!0?null:t}function _(i){const e=d;switch(e.state){case"ready":return{anchored:!0,kind:"data",file:e.writer.dataFile,record:i,display:`${e.writer.dataFile} record ${i}`};case"loading":return{anchored:!1,reason:`this object is record ${i} of its game's own level data; the game's data writer is still loading`};case"failed":return{anchored:!1,reason:`this object is record ${i}, but ${e.reason}`};default:return{anchored:!1,reason:`this object is record ${i} of its game's own level data, and this game declares no data writer (\`ingest.dataWriter\`) that could write that record back`}}}const u=new TextEncoder,E=new TextDecoder;let l=null,p=null;function x(){return l}async function y(i=fetch){return l||p||(p=(async()=>{try{const e=await i("/__ingest-source/ownership");if(!e.ok)throw new Error(`HTTP ${e.status}`);l=await e.json()}catch(e){l={writable:!1,reason:`the editor could not reach its dev server to check who owns this game's source (${e instanceof Error?e.message:String(e)})`,projectRoot:null}}return l})(),p)}function T(i){const e=async(r,s)=>{const n=await i(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}),o=await n.json();if(!n.ok&&r.endsWith("/read"))throw new Error(`Reading ingested game source failed with HTTP ${n.status}: ${JSON.stringify(o)}`);return o},t=new Map,a=r=>{throw new Error(`The creation-site source backend has no "${r}" — an ingested game has no JSX oids; ingest edits are anchored by creation site.`)};return{historyIdentity:P,readSource:async r=>{const s=await e("/__ingest-source/read",{file:r}),n=s.encoding==="base64";return t.set(r,n?"base64":"utf8"),n?{...s,bytes:w(s.source)}:s},applySource:(r,s,n)=>e("/__ingest-source/apply",{file:r,source:typeof s=="string"?s:b(s),ifMatchSha:n,encoding:typeof s=="string"?t.get(r)??"utf8":"base64"}),writeStyle:()=>a("writeStyle"),removeStyle:()=>a("removeStyle"),writeStruct:()=>a("writeStruct")}}const P={};class N{backend;fetchImpl;history;live;liveResourceKey=null;unregisterLive=null;constructor(e){this.history=e.history,this.live=e.live,this.fetchImpl=e.fetchImpl??fetch.bind(globalThis),this.backend=T(this.fetchImpl),y(this.fetchImpl)}dispose(){this.unregisterLive?.(),this.unregisterLive=null}gate(e,t,a,r="instance"){if(!e.anchored)return{ok:!1,reason:e.reason};const s=e.kind==="data"?`held at ${e.display}`:`created at ${e.display}`;if(e.kind==="data"){const o=I(a);if(o)return{ok:!1,reason:`${s}, but ${o}`}}const n=l;return n?n.writable?e.kind==="source"&&t!==1&&r!=="creation-site"?{ok:!1,reason:t===0?`${s}, but nothing was recorded as constructed there — the editor cannot tell whether that line builds this object alone`:`${s}, but that creation site constructs ${t} objects; a per-object edit cannot be written there`}:f()?{ok:!0}:{ok:!1,reason:`${s}, but this game is playing — hold it to author, or the edit stays live-only`}:{ok:!1,reason:`${s}; ${n.reason??"this game’s source is not writable"}`}:{ok:!1,reason:`${s}; still checking who owns this game's source`}}canAttempt(e,t,a){return this.gate(e,t,a).ok}describe(e,t,a,r="instance"){const s=this.gate(e,t,a,r);return s.ok?`Persisting to ${e.display}.`:`Live-only edit — ${s.reason}.`}async inspect(e){const t=e.anchor;if(!t.anchored||t.kind!=="source")return{};if(e.properties.length===0)return{};try{return(await this.post("/__ingest-source/inspect",{site:{file:t.file,line:t.line,col:t.col},instances:e.instances,...e.writeScope?{writeScope:e.writeScope}:{},...e.surface?{surface:e.surface}:{},properties:e.properties})).properties??{}}catch{return{}}}async persist(e){if(!f())return{persisted:!1,reason:"this game is playing — a play-time edit lives on the running object only"};const t=e.anchor;if(!t.anchored)return{persisted:!1,reason:t.reason};const a=await y(this.fetchImpl);if(!a.writable)return{persisted:!1,reason:a.reason??"this game’s source is not writable"};if(!this.history)return{persisted:!1,reason:"this session has no project history to record into"};if(t.kind==="data")return this.persistData(e,t);const r=await this.post("/__ingest-source/prepare",{site:{file:t.file,line:t.line,col:t.col},instances:e.instances,...e.writeScope?{writeScope:e.writeScope}:{},property:e.property,...e.surface?{surface:e.surface}:{},baseline:e.baseline,next:e.next});if(!r.changed||!r.file||!r.resourcePath||r.prevSource===void 0||r.newSource===void 0||!r.prevSha)return{persisted:!1,reason:r.reason??"the edit was refused"};const s=await this.post("/__ingest-source/apply",{file:r.file,source:r.newSource,ifMatchSha:r.prevSha,note:`${e.property} at ${t.display}`});return s.applied?(await this.recordEdit(e,{file:r.file,resourcePath:r.resourcePath,before:r.prevSource,after:r.newSource}),{persisted:!0,file:r.file,detail:`${e.property} → ${r.file}:${t.line}`}):{persisted:!1,reason:s.error??"the write was refused"}}async remove(e){if(!f())return{persisted:!1,reason:"this game is playing — a play-time edit lives on the running object only"};const t=e.anchor;if(!t.anchored)return{persisted:!1,reason:t.reason};const a=await y(this.fetchImpl);if(!a.writable)return{persisted:!1,reason:a.reason??"this game’s source is not writable"};if(!this.history)return{persisted:!1,reason:"this session has no project history to record into"};if(t.kind==="data")return{persisted:!1,reason:"a level-data record has no removable source statement — its property is the record's own field, not an authored override"};const r=await this.post("/__ingest-source/prepare",{site:{file:t.file,line:t.line,col:t.col},instances:e.instances,...e.writeScope?{writeScope:e.writeScope}:{},property:e.property,...e.surface?{surface:e.surface}:{},remove:!0});if(!r.changed||!r.file||!r.resourcePath||r.prevSource===void 0||r.newSource===void 0||!r.prevSha)return{persisted:!1,reason:r.reason??"the removal was refused"};const s=await this.post("/__ingest-source/apply",{file:r.file,source:r.newSource,ifMatchSha:r.prevSha,note:`${e.property} removed at ${t.display}`});if(!s.applied)return{persisted:!1,reason:s.error??"the removal was refused"};const n=g(this.backend,this.history,{file:r.file,resourcePath:r.resourcePath,before:r.prevSource,after:r.newSource});return await this.history.recordAppliedTransaction({label:e.label,resources:[n.resource],scope:"project"},[n]),{persisted:!0,file:r.file,detail:`${e.property} dropped from ${r.file}:${t.line}`}}async persistData(e,t){const a=k();if(a.state!=="ready"){const c=_(t.record);return{persisted:!1,reason:c.anchored?"this game's data writer changed mid-gesture":c.reason}}const r=await this.post("/__ingest-source/read",{file:t.file});if(typeof r.source!="string"||!r.sha||!r.resourcePath)return{persisted:!1,reason:r.error??`this game's data file ${t.file} could not be read`};if(r.encoding!=="base64")return{persisted:!1,reason:`${t.file} came back as ${r.encoding??"utf8"} text, not bytes — a data writer edits binary game data, and writing text back through it would change the file`};let s;try{s=await a.writer.planDataEdit(w(r.source),{record:t.record,property:e.property,baseline:e.baseline,next:e.next})}catch(c){return{persisted:!1,reason:`this game's data writer refused: ${c instanceof Error?c.message:String(c)}`}}if(!s.changed)return{persisted:!1,reason:s.reason};const n=b(s.bytes),o=await this.post("/__ingest-source/apply",{file:t.file,source:n,encoding:"base64",ifMatchSha:r.sha,note:`${e.property} at ${t.display}`});return o.applied?(await this.recordEdit(e,{file:t.file,resourcePath:r.resourcePath,before:w(r.source),after:s.bytes}),{persisted:!0,file:t.file,detail:`${e.property} → ${t.display}`}):{persisted:!1,reason:o.error??"the write was refused"}}async recordEdit(e,t){const a=this.history,r=this.ensureLiveResource(),s=g(this.backend,a,t),n={objects:{[e.entityId]:{[e.property]:e.baseline}}},o={objects:{[e.entityId]:{[e.property]:e.next}}};await a.recordAppliedTransaction({label:e.label,resources:[s.resource,r],scope:"project"},[s,{resource:r,beforeBytes:u.encode(JSON.stringify(n)),afterBytes:u.encode(JSON.stringify(o)),contentType:"application/json"}])}async post(e,t){return await(await this.fetchImpl(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).json()}ensureLiveResource(){if(this.liveResourceKey)return this.liveResourceKey;const e=this.history,t=e.registry.registerProject("overlay",".vgai/ingest-live-objects","Ingested game objects"),a={descriptor:t,capture:async()=>{const r=u.encode(JSON.stringify({objects:{}}));return{revision:0,contentType:"application/json",bytes:r,sha256:await S(r)}},preflight:async()=>({ok:!0}),restore:async r=>{const s=JSON.parse(E.decode(e.snapshots.read(r).bytes));for(const[n,o]of Object.entries(s.objects))for(const[c,v]of Object.entries(o))this.live.apply(n,c,v)},estimateBytes:r=>r.byteLength};return this.unregisterLive=e.registerDriver(a),this.liveResourceKey=t.key,t.key}}function A(i,e){m.warn(`[ingest] ${i} stayed live-only — ${e}.`)}export{N as I,_ as a,k as b,O as d,x as i,y as l,A as r,R as s};
|
|
1
|
+
import{X as m,eq as f,er as g,b3 as S,es as b,et as w}from"./index-Ckxb31Yz.js";const $="vgaiRecordIndex";function R(i){const e=i?.userData;if(e===null||typeof e!="object")return null;const t=e[$];return typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}let d={state:"absent"},h=0;function j(i,e){const t=i;if(t===null||typeof t!="object")throw new Error(`the data writer "${e}" did not export a module object`);if(typeof t.dataFile!="string"||t.dataFile.length===0)throw new Error(`the data writer "${e}" exports no \`dataFile\` string — a writer must name the one project-relative file it edits`);if(typeof t.planDataEdit!="function")throw new Error(`the data writer "${e}" exports no \`planDataEdit\` function — that is the whole contract: (bytes, request) => {changed, bytes} | {changed, reason}`);return{dataFile:t.dataFile,...typeof t.canPlace=="function"?{canPlace:t.canPlace.bind(t)}:{},planDataEdit:t.planDataEdit.bind(t)}}function x(i){const e=++h;if(i===null){d={state:"absent"};return}d={state:"loading"},i.load().then(t=>{h===e&&(d={state:"ready",writer:j(t,i.specifier)})}).catch(t=>{h===e&&(d={state:"failed",reason:`this game's declared data writer (${i.specifier}) could not be loaded: ${t instanceof Error?t.message:String(t)}`})})}function k(){return d}function I(i){const e=d;if(e.state!=="ready"||!e.writer.canPlace)return null;const t=e.writer.canPlace(i);return t===!0?null:t}function _(i){const e=d;switch(e.state){case"ready":return{anchored:!0,kind:"data",file:e.writer.dataFile,record:i,display:`${e.writer.dataFile} record ${i}`};case"loading":return{anchored:!1,reason:`this object is record ${i} of its game's own level data; the game's data writer is still loading`};case"failed":return{anchored:!1,reason:`this object is record ${i}, but ${e.reason}`};default:return{anchored:!1,reason:`this object is record ${i} of its game's own level data, and this game declares no data writer (\`ingest.dataWriter\`) that could write that record back`}}}const u=new TextEncoder,E=new TextDecoder;let l=null,p=null;function D(){return l}async function y(i=fetch){return l||p||(p=(async()=>{try{const e=await i("/__ingest-source/ownership");if(!e.ok)throw new Error(`HTTP ${e.status}`);l=await e.json()}catch(e){l={writable:!1,reason:`the editor could not reach its dev server to check who owns this game's source (${e instanceof Error?e.message:String(e)})`,projectRoot:null}}return l})(),p)}function T(i){const e=async(r,s)=>{const n=await i(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}),o=await n.json();if(!n.ok&&r.endsWith("/read"))throw new Error(`Reading ingested game source failed with HTTP ${n.status}: ${JSON.stringify(o)}`);return o},t=new Map,a=r=>{throw new Error(`The creation-site source backend has no "${r}" — an ingested game has no JSX oids; ingest edits are anchored by creation site.`)};return{historyIdentity:P,readSource:async r=>{const s=await e("/__ingest-source/read",{file:r}),n=s.encoding==="base64";return t.set(r,n?"base64":"utf8"),n?{...s,bytes:w(s.source)}:s},applySource:(r,s,n)=>e("/__ingest-source/apply",{file:r,source:typeof s=="string"?s:b(s),ifMatchSha:n,encoding:typeof s=="string"?t.get(r)??"utf8":"base64"}),writeStyle:()=>a("writeStyle"),removeStyle:()=>a("removeStyle"),writeStruct:()=>a("writeStruct")}}const P={};class N{backend;fetchImpl;history;live;liveResourceKey=null;unregisterLive=null;constructor(e){this.history=e.history,this.live=e.live,this.fetchImpl=e.fetchImpl??fetch.bind(globalThis),this.backend=T(this.fetchImpl),y(this.fetchImpl)}dispose(){this.unregisterLive?.(),this.unregisterLive=null}gate(e,t,a,r="instance"){if(!e.anchored)return{ok:!1,reason:e.reason};const s=e.kind==="data"?`held at ${e.display}`:`created at ${e.display}`;if(e.kind==="data"){const o=I(a);if(o)return{ok:!1,reason:`${s}, but ${o}`}}const n=l;return n?n.writable?e.kind==="source"&&t!==1&&r!=="creation-site"?{ok:!1,reason:t===0?`${s}, but nothing was recorded as constructed there — the editor cannot tell whether that line builds this object alone`:`${s}, but that creation site constructs ${t} objects; a per-object edit cannot be written there`}:f()?{ok:!0}:{ok:!1,reason:`${s}, but this game is playing — hold it to author, or the edit stays live-only`}:{ok:!1,reason:`${s}; ${n.reason??"this game’s source is not writable"}`}:{ok:!1,reason:`${s}; still checking who owns this game's source`}}canAttempt(e,t,a){return this.gate(e,t,a).ok}describe(e,t,a,r="instance"){const s=this.gate(e,t,a,r);return s.ok?`Persisting to ${e.display}.`:`Live-only edit — ${s.reason}.`}async inspect(e){const t=e.anchor;if(!t.anchored||t.kind!=="source")return{};if(e.properties.length===0)return{};try{return(await this.post("/__ingest-source/inspect",{site:{file:t.file,line:t.line,col:t.col},instances:e.instances,...e.writeScope?{writeScope:e.writeScope}:{},...e.surface?{surface:e.surface}:{},properties:e.properties})).properties??{}}catch{return{}}}async persist(e){if(!f())return{persisted:!1,reason:"this game is playing — a play-time edit lives on the running object only"};const t=e.anchor;if(!t.anchored)return{persisted:!1,reason:t.reason};const a=await y(this.fetchImpl);if(!a.writable)return{persisted:!1,reason:a.reason??"this game’s source is not writable"};if(!this.history)return{persisted:!1,reason:"this session has no project history to record into"};if(t.kind==="data")return this.persistData(e,t);const r=await this.post("/__ingest-source/prepare",{site:{file:t.file,line:t.line,col:t.col},instances:e.instances,...e.writeScope?{writeScope:e.writeScope}:{},property:e.property,...e.surface?{surface:e.surface}:{},baseline:e.baseline,next:e.next});if(!r.changed||!r.file||!r.resourcePath||r.prevSource===void 0||r.newSource===void 0||!r.prevSha)return{persisted:!1,reason:r.reason??"the edit was refused"};const s=await this.post("/__ingest-source/apply",{file:r.file,source:r.newSource,ifMatchSha:r.prevSha,note:`${e.property} at ${t.display}`});return s.applied?(await this.recordEdit(e,{file:r.file,resourcePath:r.resourcePath,before:r.prevSource,after:r.newSource}),{persisted:!0,file:r.file,detail:`${e.property} → ${r.file}:${t.line}`}):{persisted:!1,reason:s.error??"the write was refused"}}async remove(e){if(!f())return{persisted:!1,reason:"this game is playing — a play-time edit lives on the running object only"};const t=e.anchor;if(!t.anchored)return{persisted:!1,reason:t.reason};const a=await y(this.fetchImpl);if(!a.writable)return{persisted:!1,reason:a.reason??"this game’s source is not writable"};if(!this.history)return{persisted:!1,reason:"this session has no project history to record into"};if(t.kind==="data")return{persisted:!1,reason:"a level-data record has no removable source statement — its property is the record's own field, not an authored override"};const r=await this.post("/__ingest-source/prepare",{site:{file:t.file,line:t.line,col:t.col},instances:e.instances,...e.writeScope?{writeScope:e.writeScope}:{},property:e.property,...e.surface?{surface:e.surface}:{},remove:!0});if(!r.changed||!r.file||!r.resourcePath||r.prevSource===void 0||r.newSource===void 0||!r.prevSha)return{persisted:!1,reason:r.reason??"the removal was refused"};const s=await this.post("/__ingest-source/apply",{file:r.file,source:r.newSource,ifMatchSha:r.prevSha,note:`${e.property} removed at ${t.display}`});if(!s.applied)return{persisted:!1,reason:s.error??"the removal was refused"};const n=g(this.backend,this.history,{file:r.file,resourcePath:r.resourcePath,before:r.prevSource,after:r.newSource});return await this.history.recordAppliedTransaction({label:e.label,resources:[n.resource],scope:"project"},[n]),{persisted:!0,file:r.file,detail:`${e.property} dropped from ${r.file}:${t.line}`}}async persistData(e,t){const a=k();if(a.state!=="ready"){const c=_(t.record);return{persisted:!1,reason:c.anchored?"this game's data writer changed mid-gesture":c.reason}}const r=await this.post("/__ingest-source/read",{file:t.file});if(typeof r.source!="string"||!r.sha||!r.resourcePath)return{persisted:!1,reason:r.error??`this game's data file ${t.file} could not be read`};if(r.encoding!=="base64")return{persisted:!1,reason:`${t.file} came back as ${r.encoding??"utf8"} text, not bytes — a data writer edits binary game data, and writing text back through it would change the file`};let s;try{s=await a.writer.planDataEdit(w(r.source),{record:t.record,property:e.property,baseline:e.baseline,next:e.next})}catch(c){return{persisted:!1,reason:`this game's data writer refused: ${c instanceof Error?c.message:String(c)}`}}if(!s.changed)return{persisted:!1,reason:s.reason};const n=b(s.bytes),o=await this.post("/__ingest-source/apply",{file:t.file,source:n,encoding:"base64",ifMatchSha:r.sha,note:`${e.property} at ${t.display}`});return o.applied?(await this.recordEdit(e,{file:t.file,resourcePath:r.resourcePath,before:w(r.source),after:s.bytes}),{persisted:!0,file:t.file,detail:`${e.property} → ${t.display}`}):{persisted:!1,reason:o.error??"the write was refused"}}async recordEdit(e,t){const a=this.history,r=this.ensureLiveResource(),s=g(this.backend,a,t),n={objects:{[e.entityId]:{[e.property]:e.baseline}}},o={objects:{[e.entityId]:{[e.property]:e.next}}};await a.recordAppliedTransaction({label:e.label,resources:[s.resource,r],scope:"project"},[s,{resource:r,beforeBytes:u.encode(JSON.stringify(n)),afterBytes:u.encode(JSON.stringify(o)),contentType:"application/json"}])}async post(e,t){return await(await this.fetchImpl(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).json()}ensureLiveResource(){if(this.liveResourceKey)return this.liveResourceKey;const e=this.history,t=e.registry.registerProject("overlay",".vgai/ingest-live-objects","Ingested game objects"),a={descriptor:t,capture:async()=>{const r=u.encode(JSON.stringify({objects:{}}));return{revision:0,contentType:"application/json",bytes:r,sha256:await S(r)}},preflight:async()=>({ok:!0}),restore:async r=>{const s=JSON.parse(E.decode(e.snapshots.read(r).bytes));for(const[n,o]of Object.entries(s.objects))for(const[c,v]of Object.entries(o))this.live.apply(n,c,v)},estimateBytes:r=>r.byteLength};return this.unregisterLive=e.registerDriver(a),this.liveResourceKey=t.key,t.key}}function A(i,e){m.warn(`[ingest] ${i} stayed live-only — ${e}.`)}export{N as I,_ as a,k as b,R as d,D as i,y as l,A as r,x as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ah as e,q as i,ai as s,X as a}from"./index-Ckxb31Yz.js";import{i as p,a as n}from"./registry-DlTluc4x.js";import{a as m}from"./mount-ingest-root-B5D-Lmmk.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./three.module-IFn-4i31.js";import"./active-ingest-DEgq9JiA.js";import"./game-contract-seams-TCpIMmHP.js";import"./capability-coverage-CfUeULDN.js";import"./ingest-source-persistence-DH6ioCOu.js";import"./playtest-BnFenMBW.js";const H="workspace.service";function P(){const o=e({id:"in-tree-ingest-registry",owner:"@volter/editor-game/contributions/ingest.service.ts",modulePathFor:t=>n(t),importModule:async t=>await p(t)}),r=i().project.onReady(async()=>{const t=s();if(!t){a.error("Ingest auto-launch skipped: the editor shell store had not arrived at project ready.","ingest");return}await m(t)});return()=>{r(),o()}}export{H as point,P as start};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AssetParseError as m}from"./asset-parse-error-BHMwBRU3.js";import{resolveUrl as w}from"./loader-CaF_I7Yt.js";import{inputBindingsCollide as D}from"./binding-identity-DcTpbvyg.js";import{bindingDeviceFamily as A,gamepadAxisPairLabel as x,gamepadAxisLabel as T,STANDARD_GAMEPAD_BUTTON_LABELS as S,mouseButtonLabel as P,keyLabel as b}from"./prompt-labels-DSMdM2_B.js";import{InputMapFileSchema as k}from"./schema-kl9-2B_J.js";import"./index-GIL7oGEO.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./three.module-D396a9Mn.js";function V(){const h=typeof document<"u"?document.activeElement:null;if(!h)return!1;const t=h.tagName;return t==="INPUT"||t==="TEXTAREA"||t==="SELECT"||h.isContentEditable===!0}class E extends Error{code="INPUT_ACTION_NOT_FOUND";data;constructor(t,e,s){super(`InputManager.${e}: unknown action "${t}". Registered actions: `+(s.length?s.join(", "):"(none)")),this.name="InputActionError",this.data={registered:s}}}class B extends Error{code="TICK_ALREADY_PASSED";data;constructor(t,e){super(`InputManager.scheduleActionAtTick: tick ${t} has already passed (next tick to be serviced: ${e}) — scheduling only applies to the current or a future tick`),this.name="InputTickError",this.data={currentTick:e}}}function M(h,t){return h===void 0||typeof h!=typeof t?!1:typeof h=="object"&&typeof t=="object"?h.x===t.x&&h.y===t.y:h===t}const L=2e3,p=.15,v=0;class l{actions=new Map;actionValueTypes=new Map;defaultBindings=new Map;loadedMapVersion=1;keysDown=new Set;keysJustDown=new Set;keysJustUp=new Set;mouseButtons=new Set;mouseButtonsJustDown=new Set;mouseButtonsJustUp=new Set;mouseDeltaX=0;mouseDeltaY=0;mouseClientX=0;mouseClientY=0;gamepads=[];gamepadButtonsDown=new Set;gamepadButtonsPrev=new Set;gamepadButtonsJustDown=new Set;gamepadButtonsJustUp=new Set;gamepadAxesCurrent=new Map;gamepadAxesPrev=new Map;lookStickX=0;lookStickY=0;testAxisValues=new Map;testVector2Values=new Map;testPointerDeltaAccum=new Map;testPointerPositionValues=new Map;pointerPositionSeq=0;touchButtonsDown=new Set;touchButtonsJustDown=new Set;touchButtonsJustUp=new Set;touchStickValues=new Map;lastActiveDevice=null;declaredDeadzone(t,e){let s;for(const i of this.actions.values())for(const n of i){const o=t(n);o!==void 0&&(s===void 0||o<s)&&(s=o)}return s??e}virtualDigitalHeld=new Set;virtualDigitalStrength=new Map;virtualDigitalTapQueued=new Set;virtualDigitalTapActive=new Set;virtualDigitalJustReleased=new Set;virtualScalarValues=new Map;virtualVector2Values=new Map;smoothedAxisSets=new Set;currentTick=0;lastServicedTick=-1;scheduledActions=new Map;debugEmit=null;inputRecording=!1;inputTrace=[];lastTraceSnapshot=new Map;disposed=!1;enabled=!0;focused=!0;get inputActive(){return this.enabled&&this.focused}get machineInputActive(){return this.enabled}pointerLocked=!1;pointerLockElement=null;reportedPointerLockRefusals=new Set;reportPointerLockRefused(t){this.reportedPointerLockRefusals.has(t)||(this.reportedPointerLockRefusals.add(t),console.error(`Pointer lock was refused, so mouse look and mouse aim cannot engage: ${t}. The browser grants it only to a user gesture on a page it trusts — a page inside a frame needs allow="pointer-lock", and some extensions block it.`))}pointerLockRetry=null;onPointerLockClick=()=>{const t=this.pointerLockElement?.requestPointerLock();t instanceof Promise&&t.catch(e=>{const s=e instanceof Error?e.message:String(e);if(/exited the lock/i.test(s)&&this.pointerLockRetry===null){this.pointerLockRetry=setTimeout(()=>{this.pointerLockRetry=null;const i=typeof document<"u"?document:null,n=typeof navigator<"u"?navigator.userActivation:void 0;!this.pointerLockElement||i?.pointerLockElement===this.pointerLockElement||(n?.isActive?this.onPointerLockClick():this.reportPointerLockRefused(`${s} (the retry found no user activation left)`))},1300);return}this.reportPointerLockRefused(s)})};onPointerLockChange=()=>{const t=typeof document<"u"?document:null,e=this.pointerLocked;this.pointerLocked=!!this.pointerLockElement&&t?.pointerLockElement===this.pointerLockElement,e&&!this.pointerLocked&&(this.mouseButtons.clear(),this.mouseButtonsJustDown.clear(),this.mouseButtonsJustUp.clear())};onKeyDown=t=>{!this.inputActive||V()||(this.lastActiveDevice="keyboard",this.keysDown.has(t.code)||this.keysJustDown.add(t.code),this.keysDown.add(t.code))};onKeyUp=t=>{this.inputActive&&(this.keysDown.delete(t.code),this.keysJustUp.add(t.code))};onMouseDown=t=>{this.inputActive&&(this.lastActiveDevice="mouse",this.mouseButtons.add(t.button),this.mouseButtonsJustDown.add(t.button))};onMouseUp=t=>{this.inputActive&&(this.mouseButtons.delete(t.button),this.mouseButtonsJustUp.add(t.button))};onMouseMove=t=>{this.inputActive&&((t.movementX!==0||t.movementY!==0)&&(this.lastActiveDevice="mouse"),this.mouseDeltaX+=t.movementX,this.mouseDeltaY+=t.movementY,this.mouseClientX=t.clientX,this.mouseClientY=t.clientY)};onWindowBlur=()=>{this.focused=!1,this.flushRealHeldState()};onWindowFocus=()=>{this.focused=!0};flushRealHeldState(){this.keysDown.clear(),this.keysJustDown.clear(),this.keysJustUp.clear(),this.mouseButtons.clear(),this.mouseButtonsJustDown.clear(),this.mouseButtonsJustUp.clear(),this.mouseDeltaX=0,this.mouseDeltaY=0,this.touchButtonsDown.clear(),this.touchButtonsJustDown.clear(),this.touchButtonsJustUp.clear()}flushHeldState(){this.flushRealHeldState(),this.clearVirtualActionState()}clearVirtualActionState(t){if(t?.manufactureReleaseEdge)for(const e of this.virtualDigitalHeld)this.virtualDigitalJustReleased.add(e);this.virtualDigitalHeld.clear(),this.virtualDigitalStrength.clear(),this.virtualDigitalTapQueued.clear(),this.virtualDigitalTapActive.clear(),this.virtualScalarValues.clear(),this.virtualVector2Values.clear()}constructor(){typeof window<"u"&&(window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp),window.addEventListener("mousedown",this.onMouseDown),window.addEventListener("mouseup",this.onMouseUp),window.addEventListener("mousemove",this.onMouseMove),window.addEventListener("blur",this.onWindowBlur),window.addEventListener("focus",this.onWindowFocus)),typeof document<"u"&&typeof document.addEventListener=="function"&&document.addEventListener("pointerlockchange",this.onPointerLockChange)}async loadMap(t){await this.fetchMap(t,!1)}async loadMapIfPresent(t){return this.fetchMap(t,!0)}async fetchMap(t,e){let s;try{const i=await fetch(w(t));if(!i.ok){if(e&&i.status===404)return!1;throw new Error(`HTTP ${i.status} ${i.statusText}`)}const n=await i.json(),o=k.safeParse(n);if(!o.success)throw new m(o.error.issues,t);s=o.data}catch(i){const n=`InputManager.loadMap: failed to load input map "${t}": ${i instanceof Error?i.message:String(i)}`;throw console.error(n),i instanceof m?i:new Error(n)}return this.applyParsedMap(s),!0}loadMapObject(t){const e=k.safeParse(t);if(!e.success)throw new m(e.error.issues);return this.applyParsedMap(e.data),e.data}applyParsedMap(t){this.loadedMapVersion=t.version;for(const[e,s]of Object.entries(t.actions))this.actions.set(e,s.bindings),this.actionValueTypes.set(e,s.valueType??"digital"),this.defaultBindings.set(e,structuredClone(s.bindings))}registerAction(t,e,s="digital"){this.actions.set(t,e),this.actionValueTypes.set(t,s),this.defaultBindings.set(t,structuredClone(e))}getActionValueType(t){return this.actionValueTypes.get(t)??"digital"}assertValueType(t,e,s){const i=this.actionValueTypes.get(t);if(i!==void 0&&i!==e)throw new Error(`InputManager.${s}: action "${t}" is declared valueType '${i}', not '${e}'. Typed reads must match an action's declared valueType (F1, spec §12) — use the getter for '${i}' instead.`)}actionNames(){return[...this.actions.keys()]}createSmoothedAxisSet(t){const e=new Map;for(const a of t){const u={...a};if(u.name.length===0)throw new Error("InputManager.createSmoothedAxisSet: axis names must not be empty");if(e.has(u.name))throw new Error(`InputManager.createSmoothedAxisSet: duplicate axis ${JSON.stringify(u.name)}`);if(u.negativeAction.length===0||u.positiveAction.length===0)throw new Error(`InputManager.createSmoothedAxisSet: axis ${JSON.stringify(u.name)} requires both negative and positive actions`);for(const[c,d]of[["gravity",u.gravity],["dead",u.dead],["sensitivity",u.sensitivity]])if(!Number.isFinite(d)||d<0)throw new Error(`InputManager.createSmoothedAxisSet: ${u.name}.${c} must be a finite non-negative number, received ${String(d)}`);e.set(u.name,Object.freeze(u))}const s={definitions:e,values:new Map,disposed:!1};this.smoothedAxisSets.add(s);const i=()=>{if(s.disposed||this.disposed)throw new Error("InputManager smoothed axis set has been disposed")},n=a=>{i();const u=s.definitions.get(a);if(u===void 0)throw new Error(`InputManager smoothed axis set has no axis ${JSON.stringify(a)}`);return u},o=a=>{const u=this.isPressed(a.negativeAction)?-1:0,c=this.isPressed(a.positiveAction)?1:0;return(u+c)*(a.invert?-1:1)},r=a=>{const u=n(a),c=s.values.get(a)??0;return Math.abs(c)<u.dead?0:c};return{advance:a=>{if(i(),!Number.isFinite(a)||a<0)throw new Error("InputManager smoothed axis deltaTime must be finite and non-negative, received "+String(a));for(const u of s.definitions.values()){const c=o(u),d=s.values.get(u.name)??0;let g;if(c===0){const f=u.gravity*a;g=d>0?Math.max(0,d-f):Math.min(0,d+f)}else{const f=u.snap&&d*c<0?0:d,y=u.sensitivity*a;g=c>0?Math.min(c,f+y):Math.max(c,f-y)}s.values.set(u.name,g)}},getAxis:r,getAxisRaw:a=>o(n(a)),snapshot:()=>{i();const a={};for(const u of s.definitions.keys())a[u]=r(u);return a},dispose:()=>{s.disposed||(s.disposed=!0,s.values.clear(),this.smoothedAxisSets.delete(s))}}}poll(t){const e=t!==void 0?t:this.currentTick;if(this.scheduledActions.size>0){const o=[...this.scheduledActions.keys()].filter(r=>r>this.lastServicedTick&&r<e).sort((r,a)=>r-a);for(const r of o){const a=this.scheduledActions.get(r);this.scheduledActions.delete(r);for(const u of a)this.debugEmit?.("input.schedule.dropped",{tick:r,action:u.action})}}if(this.lastServicedTick=e,this.currentTick=e+1,!this.enabled){const o=this.scheduledActions.get(e);if(o){this.scheduledActions.delete(e);for(const r of o)this.debugEmit?.("input.schedule.dropped",{tick:e,action:r.action})}this.gamepads=[];return}if(this.virtualDigitalTapActive=this.virtualDigitalTapQueued,this.virtualDigitalTapQueued=new Set,this.applyScheduledActionsForTick(e),!this.focused){this.gamepads=[],this.recordPostGateTick(e);return}this.gamepads=typeof navigator<"u"&&navigator.getGamepads?[...navigator.getGamepads()]:[];const s=new Set;for(let o=0;o<this.gamepads.length;o++){const r=this.gamepads[o];if(r)for(let a=0;a<r.buttons.length;a++)r.buttons[a]?.pressed&&s.add(`${o}:${a}`)}for(const o of s)this.gamepadButtonsPrev.has(o)||this.gamepadButtonsJustDown.add(o);for(const o of this.gamepadButtonsPrev)s.has(o)||this.gamepadButtonsJustUp.add(o);this.gamepadButtonsDown=s,s.size>0&&(this.lastActiveDevice="gamepad");const i=new Map,n=new Map;for(let o=0;o<this.gamepads.length;o++){const r=this.gamepads[o];if(r)for(let a=0;a<r.axes.length;a++){const u=r.axes[a]??0;i.set(`${o}:${a}`,u);let c=n.get(a);c===void 0&&(c=this.declaredDeadzone(d=>d.type==="gamepad_axis"&&d.axis===a||d.type==="gamepad_axis_pair"&&(d.xAxis===a||d.yAxis===a)?d.deadzone??p:void 0,p),n.set(a,c)),Math.abs(u)>c&&(this.lastActiveDevice="gamepad")}}this.gamepadAxesCurrent=i,(this.lookStickX!==0||this.lookStickY!==0)&&(this.mouseDeltaX+=this.lookStickX*8,this.mouseDeltaY+=this.lookStickY*8),this.recordPostGateTick(e)}applyScheduledActionsForTick(t){const e=this.scheduledActions.get(t);if(e){this.scheduledActions.delete(t);for(const s of e)typeof s.value=="boolean"?s.value?(this.virtualDigitalHeld.add(s.action),this.virtualDigitalStrength.set(s.action,1),this.virtualDigitalTapActive.add(s.action)):(this.virtualDigitalHeld.delete(s.action),this.virtualDigitalStrength.delete(s.action)):this.applyVirtualActionValue(s.action,s.value)}}recordPostGateTick(t){if(!this.inputRecording)return;const e={};let s=!1;for(const i of this.actionNames()){const n=this.getActionValueType(i);if(n!=="digital"&&n!=="scalar"&&n!=="vector2")continue;const o=this.readAction(i,n),r=this.lastTraceSnapshot.get(i);M(r,o)||(e[i]=o,this.lastTraceSnapshot.set(i,o),s=!0)}s&&(this.inputTrace.push({tick:t,actions:e}),this.inputTrace.length>L&&this.inputTrace.shift())}static axisThresholdMet(t,e,s){return e==="positive"?t>s:t<-s}isPressed(t){if(this.assertValueType(t,"digital","isPressed"),this.virtualDigitalHeld.has(t)||this.virtualDigitalTapActive.has(t))return!0;const e=this.actions.get(t);if(!e)return!1;for(const s of e)switch(s.type){case"key":if(this.keysDown.has(s.code))return!0;break;case"mouse_button":if(this.mouseButtons.has(s.button))return!0;break;case"gamepad_button":for(const i of this.gamepads)if(i?.buttons[s.button]?.pressed)return!0;break;case"gamepad_axis":{const i=s.deadzone??p;for(const n of this.gamepads){if(!n)continue;const o=n.axes[s.axis]??0;if(l.axisThresholdMet(o,s.direction,i))return!0}break}case"touch_button":if(this.touchButtonsDown.has(s.sourceId))return!0;break}return!1}getDigitalStrength(t){if(this.assertValueType(t,"digital","getDigitalStrength"),this.machineInputActive&&(this.virtualDigitalHeld.has(t)||this.virtualDigitalTapActive.has(t)))return this.virtualDigitalStrength.get(t)??1;if(!this.inputActive)return 0;const e=this.actions.get(t);if(!e)return 0;let s=0;for(const i of e)switch(i.type){case"key":if(this.keysDown.has(i.code))return 1;break;case"mouse_button":if(this.mouseButtons.has(i.button))return 1;break;case"gamepad_button":for(const n of this.gamepads)if(n?.buttons[i.button]?.pressed)return 1;break;case"gamepad_axis":{const n=i.deadzone??p;for(const o of this.gamepads){if(!o)continue;const r=o.axes[i.axis]??0,a=i.direction==="positive"?r:-r;a<n||(s=Math.max(s,n===1?1:Math.min(1,Math.max(0,(a-n)/(1-n)))))}break}case"touch_button":if(this.touchButtonsDown.has(i.sourceId))return 1;break}return s}getDigitalRawStrength(t){if(this.assertValueType(t,"digital","getDigitalRawStrength"),this.machineInputActive&&(this.virtualDigitalHeld.has(t)||this.virtualDigitalTapActive.has(t)))return this.virtualDigitalStrength.get(t)??1;if(!this.inputActive)return 0;const e=this.actions.get(t);if(!e)return 0;let s=0;for(const i of e)switch(i.type){case"key":if(this.keysDown.has(i.code))return 1;break;case"mouse_button":if(this.mouseButtons.has(i.button))return 1;break;case"gamepad_button":if(this.gamepads.some(n=>n?.buttons[i.button]?.pressed))return 1;break;case"gamepad_axis":for(const n of this.gamepads){if(!n)continue;const o=n.axes[i.axis]??0;s=Math.max(s,Math.min(1,Math.max(0,i.direction==="positive"?o:-o)))}break;case"touch_button":if(this.touchButtonsDown.has(i.sourceId))return 1;break}return s}isJustPressed(t){if(this.assertValueType(t,"digital","isJustPressed"),this.virtualDigitalTapActive.has(t))return!0;const e=this.actions.get(t);if(!e)return!1;for(const s of e)switch(s.type){case"key":if(this.keysJustDown.has(s.code))return!0;break;case"mouse_button":if(this.mouseButtonsJustDown.has(s.button))return!0;break;case"gamepad_button":for(let i=0;i<this.gamepads.length;i++)if(this.gamepadButtonsJustDown.has(`${i}:${s.button}`))return!0;break;case"gamepad_axis":{const i=s.deadzone??p;for(let n=0;n<this.gamepads.length;n++){const o=`${n}:${s.axis}`,r=this.gamepadAxesCurrent.get(o)??0,a=this.gamepadAxesPrev.get(o)??0,u=l.axisThresholdMet(r,s.direction,i),c=l.axisThresholdMet(a,s.direction,i);if(u&&!c)return!0}break}case"touch_button":if(this.touchButtonsJustDown.has(s.sourceId))return!0;break}return!1}isJustReleased(t){if(this.assertValueType(t,"digital","isJustReleased"),this.virtualDigitalJustReleased.has(t))return!0;const e=this.actions.get(t);if(!e)return!1;for(const s of e)switch(s.type){case"key":if(this.keysJustUp.has(s.code))return!0;break;case"mouse_button":if(this.mouseButtonsJustUp.has(s.button))return!0;break;case"gamepad_button":for(let i=0;i<this.gamepads.length;i++)if(this.gamepadButtonsJustUp.has(`${i}:${s.button}`))return!0;break;case"gamepad_axis":{const i=s.deadzone??p;for(let n=0;n<this.gamepads.length;n++){const o=`${n}:${s.axis}`,r=this.gamepadAxesCurrent.get(o)??0,a=this.gamepadAxesPrev.get(o)??0,u=l.axisThresholdMet(r,s.direction,i),c=l.axisThresholdMet(a,s.direction,i);if(!u&&c)return!0}break}case"touch_button":if(this.touchButtonsJustUp.has(s.sourceId))return!0;break}return!1}getDigitalSource(t){if(this.assertValueType(t,"digital","getDigitalSource"),this.machineInputActive&&(this.virtualDigitalHeld.has(t)||this.virtualDigitalTapActive.has(t)))return{bindingType:"virtual"};if(!this.inputActive)return null;const e=this.actions.get(t);if(!e)return null;for(const s of e)switch(s.type){case"key":if(this.keysDown.has(s.code))return{bindingType:"key"};break;case"mouse_button":if(this.mouseButtons.has(s.button))return{bindingType:"mouse_button"};break;case"gamepad_button":for(let i=0;i<this.gamepads.length;i++){const n=this.gamepads[i];if(n?.buttons[s.button]?.pressed)return{bindingType:"gamepad_button",gamepadIndex:i,gamepadId:n.id}}break;case"gamepad_axis":{const i=s.deadzone??p;for(let n=0;n<this.gamepads.length;n++){const o=this.gamepads[n];if(!o)continue;const r=o.axes[s.axis]??0;if(l.axisThresholdMet(r,s.direction,i))return{bindingType:"gamepad_axis",gamepadIndex:n,gamepadId:o.id}}break}case"touch_button":if(this.touchButtonsDown.has(s.sourceId))return{bindingType:"touch_button",sourceId:s.sourceId};break}return null}static rescaleScalar(t,e){const s=Math.max(-1,Math.min(1,t)),i=Math.abs(s);if(i<e)return 0;const n=e>=1?0:(i-e)/(1-e);return Math.sign(s)*Math.min(1,n)}static rescaleVector2(t,e){const s=Math.hypot(t.x,t.y);if(s===0||s<e)return{x:0,y:0};const n=Math.min(1,e>=1?0:(s-e)/(1-e))/s;return{x:t.x*n,y:t.y*n}}static clampVector2(t){const e=Math.hypot(t.x,t.y);return e<=1||e===0?t:{x:t.x/e,y:t.y/e}}collectScalarContributions(t){const e=[],s=this.virtualScalarValues.get(t);if(s!==void 0&&this.machineInputActive&&e.push({value:s,source:{bindingType:"virtual"}}),!this.inputActive)return e;const i=this.actions.get(t);if(!i)return e;for(const n of i)if(n.type==="gamepad_axis"){const o=n.deadzone??p;for(let r=0;r<this.gamepads.length;r++){const a=this.gamepads[r];if(!a)continue;const u=a.axes[n.axis]??0;e.push({value:l.rescaleScalar(u,o),source:{bindingType:"gamepad_axis",gamepadIndex:r,gamepadId:a.id}})}}else if(n.type==="test_axis"){const o=this.testAxisValues.get(n.sourceId)??0;e.push({value:l.rescaleScalar(o,n.deadzone??0),source:{bindingType:"test_axis",sourceId:n.sourceId}})}return e}computeScalar(t){this.assertValueType(t,"scalar","getScalar");let e=null;for(const s of this.collectScalarContributions(t))(!e||Math.abs(s.value)>Math.abs(e.value))&&(e=s);return!e||e.value===0?{value:0,source:null}:e}getScalar(t){return this.computeScalar(t).value}getScalarSource(t){return this.computeScalar(t).source}contributeGamepadAxisPair(t){const e=t.deadzone??p,s=[];for(let i=0;i<this.gamepads.length;i++){const n=this.gamepads[i];if(!n)continue;const o={x:n.axes[t.xAxis]??0,y:n.axes[t.yAxis]??0};s.push({value:l.rescaleVector2(o,e),source:{bindingType:"gamepad_axis_pair",gamepadIndex:i,gamepadId:n.id}})}return s}collectVector2Contributions(t){const e=[],s=this.virtualVector2Values.get(t);if(s!==void 0&&this.machineInputActive&&e.push({value:s,source:{bindingType:"virtual"}}),!this.inputActive)return e;const i=this.actions.get(t);if(!i)return e;for(const n of i)switch(n.type){case"test_vector2":{const o=this.testVector2Values.get(n.sourceId)??{x:0,y:0};e.push({value:l.rescaleVector2(o,n.deadzone??0),source:{bindingType:"test_vector2",sourceId:n.sourceId}});break}case"gamepad_axis_pair":e.push(...this.contributeGamepadAxisPair(n));break;case"mouse_move":{const o={x:this.mouseDeltaX,y:this.mouseDeltaY};e.push({value:l.rescaleVector2(o,n.deadzone??0),source:{bindingType:"mouse_move"}});break}case"touch_stick":{const o=this.touchStickValues.get(n.sourceId)??{x:0,y:0};e.push({value:l.rescaleVector2(o,n.deadzone??v),source:{bindingType:"touch_stick",sourceId:n.sourceId}});break}}return e}computeVector2(t){this.assertValueType(t,"vector2","getVector2");let e={x:0,y:0},s=null,i=0;for(const o of this.collectVector2Contributions(t)){e={x:e.x+o.value.x,y:e.y+o.value.y};const r=Math.hypot(o.value.x,o.value.y);r>i&&(i=r,s=o.source)}const n=l.clampVector2(e);return n.x===0&&n.y===0?{value:n,source:null}:{value:n,source:s}}getVector2(t){return this.computeVector2(t).value}getVector2Source(t){return this.computeVector2(t).source}collectPointerDeltaContributions(t){if(!this.inputActive)return[];const e=this.actions.get(t);if(!e)return[];const s=[];for(const i of e)if(i.type==="test_pointer_delta"){const n=this.testPointerDeltaAccum.get(i.sourceId)??{x:0,y:0};s.push({value:n,source:{bindingType:"test_pointer_delta",sourceId:i.sourceId}})}else i.type==="mouse_move"&&s.push({value:{x:this.mouseDeltaX,y:this.mouseDeltaY},source:{bindingType:"mouse_move"}});return s}computePointerDelta(t){this.assertValueType(t,"pointerDelta","getPointerDelta");let e={x:0,y:0},s=null,i=0;for(const n of this.collectPointerDeltaContributions(t)){e={x:e.x+n.value.x,y:e.y+n.value.y};const o=Math.hypot(n.value.x,n.value.y);o>i&&(i=o,s=n.source)}return e.x===0&&e.y===0?{value:e,source:null}:{value:e,source:s}}getPointerDelta(t){return this.computePointerDelta(t).value}getPointerDeltaSource(t){return this.computePointerDelta(t).source}collectPointerPositionContributions(t){if(!this.inputActive)return[];const e=this.actions.get(t);if(!e)return[];const s=[];for(const i of e)if(i.type==="test_pointer_position"){const n=this.testPointerPositionValues.get(i.sourceId);n&&s.push({value:n.value,seq:n.seq,source:{bindingType:"test_pointer_position",sourceId:i.sourceId}})}return s}computePointerPosition(t){this.assertValueType(t,"pointerPosition","getPointerPosition");const e=this.collectPointerPositionContributions(t);if(e.length===0)return{value:{x:0,y:0},source:null};let s=e[0];for(const i of e)i.seq>s.seq&&(s=i);return{value:s.value,source:s.source}}getPointerPosition(t){return this.computePointerPosition(t).value}getPointerPositionSource(t){return this.computePointerPosition(t).source}readAction(t,e){switch(e){case"digital":return this.isPressed(t);case"scalar":return this.getScalar(t);case"vector2":return this.getVector2(t);case"pointerDelta":return this.getPointerDelta(t);case"pointerPosition":return this.getPointerPosition(t);default:throw new Error(`InputManager.readAction: unknown value type "${e}"`)}}injectAxis(t,e){this.testAxisValues.set(t,e)}clearAxis(t){this.testAxisValues.delete(t)}injectVector2(t,e){this.testVector2Values.set(t,e)}clearVector2(t){this.testVector2Values.delete(t)}injectPointerDelta(t,e){const s=this.testPointerDeltaAccum.get(t)??{x:0,y:0};this.testPointerDeltaAccum.set(t,{x:s.x+e.x,y:s.y+e.y})}injectPointerPosition(t,e){this.testPointerPositionValues.set(t,{value:e,seq:++this.pointerPositionSeq})}isEnabled(){return this.enabled}setEnabled(t){this.enabled!==t&&(this.enabled=t,t||this.flushHeldState())}isFocused(){return this.focused}isInputActive(){return this.inputActive}isPointerLocked(){return this.pointerLocked}getGamepadInfo(t){const e=this.gamepads[t];return e?{index:t,id:e.id,mapping:e.mapping,connected:e.connected}:null}getMouseDelta(){return{x:this.mouseDeltaX,y:this.mouseDeltaY}}isDeviceKeyPressed(t){return this.inputActive?this.keysDown.has(t):!1}isDeviceKeyJustPressed(t){return this.inputActive?this.keysJustDown.has(t):!1}isDeviceKeyJustReleased(t){return this.inputActive?this.keysJustUp.has(t):!1}isDeviceMouseButtonPressed(t){return this.inputActive?this.mouseButtons.has(t):!1}isDeviceMouseButtonJustPressed(t){return this.inputActive?this.mouseButtonsJustDown.has(t):!1}isDeviceMouseButtonJustReleased(t){return this.inputActive?this.mouseButtonsJustUp.has(t):!1}getDeviceMouseDelta(){return this.inputActive?{x:this.mouseDeltaX,y:this.mouseDeltaY}:{x:0,y:0}}getDeviceMousePosition(){return this.inputActive?{x:this.mouseClientX,y:this.mouseClientY}:{x:0,y:0}}hasDeviceGamepad(){return this.inputActive?this.gamepads.some(t=>t!==null):!1}getConnectedGamepadIndices(){if(!this.inputActive)return[];const t=[];for(let e=0;e<this.gamepads.length;e+=1)this.gamepads[e]!==null&&t.push(e);return t}isDeviceGamepadButtonPressed(t){if(!this.inputActive)return!1;const e=this.firstConnectedGamepadIndex();return e<0?!1:this.gamepadButtonsDown.has(`${e}:${t}`)}isDeviceGamepadButtonPressedAt(t,e){return!this.inputActive||!Number.isSafeInteger(t)||t<0||!Number.isSafeInteger(e)||e<0?!1:this.gamepads[t]?.buttons[e]?.pressed??!1}isDeviceGamepadButtonJustPressed(t){if(!this.inputActive)return!1;const e=this.firstConnectedGamepadIndex();return e<0?!1:this.gamepadButtonsJustDown.has(`${e}:${t}`)}isDeviceGamepadButtonJustReleased(t){if(!this.inputActive)return!1;const e=this.firstConnectedGamepadIndex();return e<0?!1:this.gamepadButtonsJustUp.has(`${e}:${t}`)}getDeviceGamepadAxis(t){if(!this.inputActive)return 0;const e=this.firstConnectedGamepadIndex();return e<0?0:this.gamepads[e]?.axes[t]??0}getDeviceGamepadAxisAt(t,e){return!this.inputActive||!Number.isSafeInteger(t)||t<0||!Number.isSafeInteger(e)||e<0?0:this.gamepads[t]?.axes[e]??0}firstConnectedGamepadIndex(){for(let t=0;t<this.gamepads.length;t++)if(this.gamepads[t]!==null)return t;return-1}getLastActiveDevice(){return this.lastActiveDevice}getBindings(t){const e=this.actions.get(t);return e?structuredClone(e):[]}setBindings(t,e){this.actionValueTypes.has(t)||this.actionValueTypes.set(t,"digital"),this.actions.set(t,structuredClone(e))}addBinding(t,e){const s=this.actions.get(t)??[];this.actions.set(t,[...s,structuredClone(e)]),this.actionValueTypes.has(t)||this.actionValueTypes.set(t,"digital")}removeBinding(t,e){const s=this.actions.get(t);!s||e<0||e>=s.length||this.actions.set(t,[...s.slice(0,e),...s.slice(e+1)])}replaceBinding(t,e,s){const i=this.actions.get(t);if(!i||e<0||e>=i.length)return;const n=i.slice();n[e]=structuredClone(s),this.actions.set(t,n)}resetBindings(t){const e=this.defaultBindings.get(t);e&&this.actions.set(t,structuredClone(e))}resetAllBindings(){for(const t of this.defaultBindings.keys())this.resetBindings(t)}findConflicts(t,e){const s=[];for(const[i,n]of this.actions)i!==e&&n.forEach((o,r)=>{D(t,o)&&s.push({actionName:i,bindingIndex:r,binding:structuredClone(o)})});return s}toInputMapFile(){const t={};for(const[e,s]of this.actions)t[e]={valueType:this.actionValueTypes.get(e)??"digital",bindings:structuredClone(s)};return{version:this.loadedMapVersion,actions:t}}getPrompt(t,e,s=0){const i=e??this.lastActiveDevice??"keyboard",n=this.actions.get(t);if(!n)return null;const o=n.find(r=>A(r.type)===i);if(!o)return null;switch(o.type){case"key":return{device:"keyboard",bindingType:"key",label:b(o.code),icon:b(o.code)};case"mouse_button":return{device:"mouse",bindingType:"mouse_button",label:P(o.button),icon:"mouse"};case"mouse_move":return{device:"mouse",bindingType:"mouse_move",label:"Mouse",icon:"mouse"};case"gamepad_button":{const r=this.getGamepadInfo(s);if(!r?.connected)return{device:"gamepad",bindingType:"gamepad_button",label:"Gamepad Disconnected",icon:"gamepad-off"};const a=r.mapping==="standard"?S[o.button]??`Button ${o.button}`:`Button ${o.button}`;return{device:"gamepad",bindingType:"gamepad_button",label:a,icon:a}}case"gamepad_axis":return this.getGamepadInfo(s)?.connected?{device:"gamepad",bindingType:"gamepad_axis",label:T(o.axis),icon:"gamepad-stick"}:{device:"gamepad",bindingType:"gamepad_axis",label:"Gamepad Disconnected",icon:"gamepad-off"};case"gamepad_axis_pair":return this.getGamepadInfo(s)?.connected?{device:"gamepad",bindingType:"gamepad_axis_pair",label:x(o.xAxis,o.yAxis),icon:"gamepad-stick"}:{device:"gamepad",bindingType:"gamepad_axis_pair",label:"Gamepad Disconnected",icon:"gamepad-off"};case"touch_button":return{device:"touch",bindingType:"touch_button",label:o.sourceId,icon:"touch"};case"touch_stick":return{device:"touch",bindingType:"touch_stick",label:o.sourceId,icon:"touch"};default:return null}}endFrame(){this.keysJustDown.clear(),this.keysJustUp.clear(),this.mouseButtonsJustDown.clear(),this.mouseButtonsJustUp.clear(),this.gamepadButtonsPrev=this.gamepadButtonsDown,this.gamepadButtonsJustDown.clear(),this.gamepadButtonsJustUp.clear(),this.gamepadAxesPrev=this.gamepadAxesCurrent,this.mouseDeltaX=0,this.mouseDeltaY=0,this.testPointerDeltaAccum.clear(),this.touchButtonsJustDown.clear(),this.touchButtonsJustUp.clear(),this.virtualDigitalTapActive.clear(),this.virtualDigitalJustReleased.clear()}setVirtualKey(t,e){e?(this.keysDown.has(t)||this.keysJustDown.add(t),this.keysDown.add(t)):(this.keysDown.has(t)&&this.keysJustUp.add(t),this.keysDown.delete(t))}setLookStick(t,e){this.lookStickX=t,this.lookStickY=e}addMouseDelta(t,e){this.mouseDeltaX+=t,this.mouseDeltaY+=e}setTouchButton(t,e){this.inputActive&&(e?(this.touchButtonsDown.has(t)||this.touchButtonsJustDown.add(t),this.touchButtonsDown.add(t),this.lastActiveDevice="touch"):(this.touchButtonsDown.has(t)&&this.touchButtonsJustUp.add(t),this.touchButtonsDown.delete(t)))}setTouchStick(t,e){this.touchStickValues.set(t,e);const s=this.declaredDeadzone(i=>i.type==="touch_stick"&&i.sourceId===t?i.deadzone??v:void 0,v);Math.hypot(e.x,e.y)>s&&(this.lastActiveDevice="touch")}clearTouchStick(t){this.touchStickValues.delete(t)}assertActionExists(t,e){if(!this.actionValueTypes.has(t))throw new E(t,e,this.actionNames())}static virtualValueCategory(t){return typeof t=="boolean"?"digital":typeof t=="number"?"scalar":"vector2"}setVirtualAction(t,e){this.assertActionExists(t,"setVirtualAction");const s=l.virtualValueCategory(e);return this.assertValueType(t,s,"setVirtualAction"),this.machineInputActive?(this.applyVirtualActionValue(t,e),{delivered:!0}):{delivered:!1,reason:"input-gated (input disabled by the editor)"}}setVirtualDigitalStrength(t,e){if(this.assertActionExists(t,"setVirtualDigitalStrength"),this.assertValueType(t,"digital","setVirtualDigitalStrength"),!Number.isFinite(e))throw new Error("InputManager.setVirtualDigitalStrength: strength must be finite.");if(!this.machineInputActive)return{delivered:!1,reason:"input-gated (input disabled by the editor)"};const s=Math.min(1,Math.max(0,e));return this.applyVirtualActionValue(t,!0),this.virtualDigitalStrength.set(t,s),{delivered:!0}}applyVirtualActionValue(t,e){switch(l.virtualValueCategory(e)){case"digital":e?(this.virtualDigitalHeld.has(t)||this.virtualDigitalTapQueued.add(t),this.virtualDigitalHeld.add(t)):(this.virtualDigitalHeld.has(t)&&this.virtualDigitalJustReleased.add(t),this.virtualDigitalHeld.delete(t),this.virtualDigitalStrength.delete(t));break;case"scalar":this.virtualScalarValues.set(t,e);break;default:this.virtualVector2Values.set(t,e);break}}tapVirtualAction(t){return this.assertActionExists(t,"tapVirtualAction"),this.assertValueType(t,"digital","tapVirtualAction"),this.machineInputActive?(this.virtualDigitalTapQueued.add(t),{delivered:!0}):{delivered:!1,reason:"input-gated (input disabled by the editor)"}}clearVirtualActions(){this.clearVirtualActionState({manufactureReleaseEdge:!0})}scheduleActionAtTick(t,e,s){this.assertActionExists(e,"scheduleActionAtTick");const i=l.virtualValueCategory(s);if(this.assertValueType(e,i,"scheduleActionAtTick"),t<this.currentTick)throw new B(t,this.currentTick);const n=this.scheduledActions.get(t);n?n.push({action:e,value:s}):this.scheduledActions.set(t,[{action:e,value:s}])}setDebugEmit(t){this.debugEmit=t}startInputRecording(){this.inputRecording=!0,this.inputTrace=[],this.lastTraceSnapshot.clear()}stopInputRecording(){this.inputRecording=!1}isInputRecording(){return this.inputRecording}getInputTrace(){return{version:1,ticks:this.inputTrace.slice()}}requestPointerLock(t){this.pointerLockElement!==t&&(this.pointerLockElement&&this.pointerLockElement.removeEventListener("click",this.onPointerLockClick),this.pointerLockElement=t,t.addEventListener("click",this.onPointerLockClick));const e=typeof document<"u"?document:null,s=typeof navigator<"u"?navigator.userActivation:void 0;e&&e.pointerLockElement!==t&&s?.isActive&&this.onPointerLockClick()}exitPointerLock(){this.pointerLockRetry!==null&&(clearTimeout(this.pointerLockRetry),this.pointerLockRetry=null);const t=this.pointerLockElement;t&&(t.removeEventListener("click",this.onPointerLockClick),this.pointerLockElement=null),this.pointerLocked=!1;const e=typeof document<"u"?document:void 0;!e||typeof e.exitPointerLock!="function"||t&&e.pointerLockElement===t&&e.exitPointerLock()}dispose(){if(!this.disposed){this.disposed=!0,this.flushHeldState();for(const t of this.smoothedAxisSets)t.disposed=!0,t.values.clear();this.smoothedAxisSets.clear(),typeof window<"u"&&(window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp),window.removeEventListener("mousedown",this.onMouseDown),window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("blur",this.onWindowBlur),window.removeEventListener("focus",this.onWindowFocus)),typeof document<"u"&&typeof document.removeEventListener=="function"&&document.removeEventListener("pointerlockchange",this.onPointerLockChange),this.pointerLockElement&&(this.pointerLockElement.removeEventListener("click",this.onPointerLockClick),this.pointerLockElement=null)}}}export{E as InputActionError,l as InputManager,B as InputTickError};
|
|
1
|
+
import{AssetParseError as m}from"./asset-parse-error-BHMwBRU3.js";import{resolveUrl as w}from"./loader-BbMsvIxP.js";import{inputBindingsCollide as D}from"./binding-identity-DcTpbvyg.js";import{bindingDeviceFamily as A,gamepadAxisPairLabel as x,gamepadAxisLabel as T,STANDARD_GAMEPAD_BUTTON_LABELS as S,mouseButtonLabel as P,keyLabel as b}from"./prompt-labels-DSMdM2_B.js";import{InputMapFileSchema as k}from"./schema-Iy-mbzll.js";import"./index-Ckxb31Yz.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./three.module-IFn-4i31.js";function V(){const h=typeof document<"u"?document.activeElement:null;if(!h)return!1;const t=h.tagName;return t==="INPUT"||t==="TEXTAREA"||t==="SELECT"||h.isContentEditable===!0}class E extends Error{code="INPUT_ACTION_NOT_FOUND";data;constructor(t,e,s){super(`InputManager.${e}: unknown action "${t}". Registered actions: `+(s.length?s.join(", "):"(none)")),this.name="InputActionError",this.data={registered:s}}}class B extends Error{code="TICK_ALREADY_PASSED";data;constructor(t,e){super(`InputManager.scheduleActionAtTick: tick ${t} has already passed (next tick to be serviced: ${e}) — scheduling only applies to the current or a future tick`),this.name="InputTickError",this.data={currentTick:e}}}function M(h,t){return h===void 0||typeof h!=typeof t?!1:typeof h=="object"&&typeof t=="object"?h.x===t.x&&h.y===t.y:h===t}const L=2e3,p=.15,v=0;class l{actions=new Map;actionValueTypes=new Map;defaultBindings=new Map;loadedMapVersion=1;keysDown=new Set;keysJustDown=new Set;keysJustUp=new Set;mouseButtons=new Set;mouseButtonsJustDown=new Set;mouseButtonsJustUp=new Set;mouseDeltaX=0;mouseDeltaY=0;mouseClientX=0;mouseClientY=0;gamepads=[];gamepadButtonsDown=new Set;gamepadButtonsPrev=new Set;gamepadButtonsJustDown=new Set;gamepadButtonsJustUp=new Set;gamepadAxesCurrent=new Map;gamepadAxesPrev=new Map;lookStickX=0;lookStickY=0;testAxisValues=new Map;testVector2Values=new Map;testPointerDeltaAccum=new Map;testPointerPositionValues=new Map;pointerPositionSeq=0;touchButtonsDown=new Set;touchButtonsJustDown=new Set;touchButtonsJustUp=new Set;touchStickValues=new Map;lastActiveDevice=null;declaredDeadzone(t,e){let s;for(const i of this.actions.values())for(const n of i){const o=t(n);o!==void 0&&(s===void 0||o<s)&&(s=o)}return s??e}virtualDigitalHeld=new Set;virtualDigitalStrength=new Map;virtualDigitalTapQueued=new Set;virtualDigitalTapActive=new Set;virtualDigitalJustReleased=new Set;virtualScalarValues=new Map;virtualVector2Values=new Map;smoothedAxisSets=new Set;currentTick=0;lastServicedTick=-1;scheduledActions=new Map;debugEmit=null;inputRecording=!1;inputTrace=[];lastTraceSnapshot=new Map;disposed=!1;enabled=!0;focused=!0;get inputActive(){return this.enabled&&this.focused}get machineInputActive(){return this.enabled}pointerLocked=!1;pointerLockElement=null;reportedPointerLockRefusals=new Set;reportPointerLockRefused(t){this.reportedPointerLockRefusals.has(t)||(this.reportedPointerLockRefusals.add(t),console.error(`Pointer lock was refused, so mouse look and mouse aim cannot engage: ${t}. The browser grants it only to a user gesture on a page it trusts — a page inside a frame needs allow="pointer-lock", and some extensions block it.`))}pointerLockRetry=null;onPointerLockClick=()=>{const t=this.pointerLockElement?.requestPointerLock();t instanceof Promise&&t.catch(e=>{const s=e instanceof Error?e.message:String(e);if(/exited the lock/i.test(s)&&this.pointerLockRetry===null){this.pointerLockRetry=setTimeout(()=>{this.pointerLockRetry=null;const i=typeof document<"u"?document:null,n=typeof navigator<"u"?navigator.userActivation:void 0;!this.pointerLockElement||i?.pointerLockElement===this.pointerLockElement||(n?.isActive?this.onPointerLockClick():this.reportPointerLockRefused(`${s} (the retry found no user activation left)`))},1300);return}this.reportPointerLockRefused(s)})};onPointerLockChange=()=>{const t=typeof document<"u"?document:null,e=this.pointerLocked;this.pointerLocked=!!this.pointerLockElement&&t?.pointerLockElement===this.pointerLockElement,e&&!this.pointerLocked&&(this.mouseButtons.clear(),this.mouseButtonsJustDown.clear(),this.mouseButtonsJustUp.clear())};onKeyDown=t=>{!this.inputActive||V()||(this.lastActiveDevice="keyboard",this.keysDown.has(t.code)||this.keysJustDown.add(t.code),this.keysDown.add(t.code))};onKeyUp=t=>{this.inputActive&&(this.keysDown.delete(t.code),this.keysJustUp.add(t.code))};onMouseDown=t=>{this.inputActive&&(this.lastActiveDevice="mouse",this.mouseButtons.add(t.button),this.mouseButtonsJustDown.add(t.button))};onMouseUp=t=>{this.inputActive&&(this.mouseButtons.delete(t.button),this.mouseButtonsJustUp.add(t.button))};onMouseMove=t=>{this.inputActive&&((t.movementX!==0||t.movementY!==0)&&(this.lastActiveDevice="mouse"),this.mouseDeltaX+=t.movementX,this.mouseDeltaY+=t.movementY,this.mouseClientX=t.clientX,this.mouseClientY=t.clientY)};onWindowBlur=()=>{this.focused=!1,this.flushRealHeldState()};onWindowFocus=()=>{this.focused=!0};flushRealHeldState(){this.keysDown.clear(),this.keysJustDown.clear(),this.keysJustUp.clear(),this.mouseButtons.clear(),this.mouseButtonsJustDown.clear(),this.mouseButtonsJustUp.clear(),this.mouseDeltaX=0,this.mouseDeltaY=0,this.touchButtonsDown.clear(),this.touchButtonsJustDown.clear(),this.touchButtonsJustUp.clear()}flushHeldState(){this.flushRealHeldState(),this.clearVirtualActionState()}clearVirtualActionState(t){if(t?.manufactureReleaseEdge)for(const e of this.virtualDigitalHeld)this.virtualDigitalJustReleased.add(e);this.virtualDigitalHeld.clear(),this.virtualDigitalStrength.clear(),this.virtualDigitalTapQueued.clear(),this.virtualDigitalTapActive.clear(),this.virtualScalarValues.clear(),this.virtualVector2Values.clear()}constructor(){typeof window<"u"&&(window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp),window.addEventListener("mousedown",this.onMouseDown),window.addEventListener("mouseup",this.onMouseUp),window.addEventListener("mousemove",this.onMouseMove),window.addEventListener("blur",this.onWindowBlur),window.addEventListener("focus",this.onWindowFocus)),typeof document<"u"&&typeof document.addEventListener=="function"&&document.addEventListener("pointerlockchange",this.onPointerLockChange)}async loadMap(t){await this.fetchMap(t,!1)}async loadMapIfPresent(t){return this.fetchMap(t,!0)}async fetchMap(t,e){let s;try{const i=await fetch(w(t));if(!i.ok){if(e&&i.status===404)return!1;throw new Error(`HTTP ${i.status} ${i.statusText}`)}const n=await i.json(),o=k.safeParse(n);if(!o.success)throw new m(o.error.issues,t);s=o.data}catch(i){const n=`InputManager.loadMap: failed to load input map "${t}": ${i instanceof Error?i.message:String(i)}`;throw console.error(n),i instanceof m?i:new Error(n)}return this.applyParsedMap(s),!0}loadMapObject(t){const e=k.safeParse(t);if(!e.success)throw new m(e.error.issues);return this.applyParsedMap(e.data),e.data}applyParsedMap(t){this.loadedMapVersion=t.version;for(const[e,s]of Object.entries(t.actions))this.actions.set(e,s.bindings),this.actionValueTypes.set(e,s.valueType??"digital"),this.defaultBindings.set(e,structuredClone(s.bindings))}registerAction(t,e,s="digital"){this.actions.set(t,e),this.actionValueTypes.set(t,s),this.defaultBindings.set(t,structuredClone(e))}getActionValueType(t){return this.actionValueTypes.get(t)??"digital"}assertValueType(t,e,s){const i=this.actionValueTypes.get(t);if(i!==void 0&&i!==e)throw new Error(`InputManager.${s}: action "${t}" is declared valueType '${i}', not '${e}'. Typed reads must match an action's declared valueType (F1, spec §12) — use the getter for '${i}' instead.`)}actionNames(){return[...this.actions.keys()]}createSmoothedAxisSet(t){const e=new Map;for(const a of t){const u={...a};if(u.name.length===0)throw new Error("InputManager.createSmoothedAxisSet: axis names must not be empty");if(e.has(u.name))throw new Error(`InputManager.createSmoothedAxisSet: duplicate axis ${JSON.stringify(u.name)}`);if(u.negativeAction.length===0||u.positiveAction.length===0)throw new Error(`InputManager.createSmoothedAxisSet: axis ${JSON.stringify(u.name)} requires both negative and positive actions`);for(const[c,d]of[["gravity",u.gravity],["dead",u.dead],["sensitivity",u.sensitivity]])if(!Number.isFinite(d)||d<0)throw new Error(`InputManager.createSmoothedAxisSet: ${u.name}.${c} must be a finite non-negative number, received ${String(d)}`);e.set(u.name,Object.freeze(u))}const s={definitions:e,values:new Map,disposed:!1};this.smoothedAxisSets.add(s);const i=()=>{if(s.disposed||this.disposed)throw new Error("InputManager smoothed axis set has been disposed")},n=a=>{i();const u=s.definitions.get(a);if(u===void 0)throw new Error(`InputManager smoothed axis set has no axis ${JSON.stringify(a)}`);return u},o=a=>{const u=this.isPressed(a.negativeAction)?-1:0,c=this.isPressed(a.positiveAction)?1:0;return(u+c)*(a.invert?-1:1)},r=a=>{const u=n(a),c=s.values.get(a)??0;return Math.abs(c)<u.dead?0:c};return{advance:a=>{if(i(),!Number.isFinite(a)||a<0)throw new Error("InputManager smoothed axis deltaTime must be finite and non-negative, received "+String(a));for(const u of s.definitions.values()){const c=o(u),d=s.values.get(u.name)??0;let g;if(c===0){const f=u.gravity*a;g=d>0?Math.max(0,d-f):Math.min(0,d+f)}else{const f=u.snap&&d*c<0?0:d,y=u.sensitivity*a;g=c>0?Math.min(c,f+y):Math.max(c,f-y)}s.values.set(u.name,g)}},getAxis:r,getAxisRaw:a=>o(n(a)),snapshot:()=>{i();const a={};for(const u of s.definitions.keys())a[u]=r(u);return a},dispose:()=>{s.disposed||(s.disposed=!0,s.values.clear(),this.smoothedAxisSets.delete(s))}}}poll(t){const e=t!==void 0?t:this.currentTick;if(this.scheduledActions.size>0){const o=[...this.scheduledActions.keys()].filter(r=>r>this.lastServicedTick&&r<e).sort((r,a)=>r-a);for(const r of o){const a=this.scheduledActions.get(r);this.scheduledActions.delete(r);for(const u of a)this.debugEmit?.("input.schedule.dropped",{tick:r,action:u.action})}}if(this.lastServicedTick=e,this.currentTick=e+1,!this.enabled){const o=this.scheduledActions.get(e);if(o){this.scheduledActions.delete(e);for(const r of o)this.debugEmit?.("input.schedule.dropped",{tick:e,action:r.action})}this.gamepads=[];return}if(this.virtualDigitalTapActive=this.virtualDigitalTapQueued,this.virtualDigitalTapQueued=new Set,this.applyScheduledActionsForTick(e),!this.focused){this.gamepads=[],this.recordPostGateTick(e);return}this.gamepads=typeof navigator<"u"&&navigator.getGamepads?[...navigator.getGamepads()]:[];const s=new Set;for(let o=0;o<this.gamepads.length;o++){const r=this.gamepads[o];if(r)for(let a=0;a<r.buttons.length;a++)r.buttons[a]?.pressed&&s.add(`${o}:${a}`)}for(const o of s)this.gamepadButtonsPrev.has(o)||this.gamepadButtonsJustDown.add(o);for(const o of this.gamepadButtonsPrev)s.has(o)||this.gamepadButtonsJustUp.add(o);this.gamepadButtonsDown=s,s.size>0&&(this.lastActiveDevice="gamepad");const i=new Map,n=new Map;for(let o=0;o<this.gamepads.length;o++){const r=this.gamepads[o];if(r)for(let a=0;a<r.axes.length;a++){const u=r.axes[a]??0;i.set(`${o}:${a}`,u);let c=n.get(a);c===void 0&&(c=this.declaredDeadzone(d=>d.type==="gamepad_axis"&&d.axis===a||d.type==="gamepad_axis_pair"&&(d.xAxis===a||d.yAxis===a)?d.deadzone??p:void 0,p),n.set(a,c)),Math.abs(u)>c&&(this.lastActiveDevice="gamepad")}}this.gamepadAxesCurrent=i,(this.lookStickX!==0||this.lookStickY!==0)&&(this.mouseDeltaX+=this.lookStickX*8,this.mouseDeltaY+=this.lookStickY*8),this.recordPostGateTick(e)}applyScheduledActionsForTick(t){const e=this.scheduledActions.get(t);if(e){this.scheduledActions.delete(t);for(const s of e)typeof s.value=="boolean"?s.value?(this.virtualDigitalHeld.add(s.action),this.virtualDigitalStrength.set(s.action,1),this.virtualDigitalTapActive.add(s.action)):(this.virtualDigitalHeld.delete(s.action),this.virtualDigitalStrength.delete(s.action)):this.applyVirtualActionValue(s.action,s.value)}}recordPostGateTick(t){if(!this.inputRecording)return;const e={};let s=!1;for(const i of this.actionNames()){const n=this.getActionValueType(i);if(n!=="digital"&&n!=="scalar"&&n!=="vector2")continue;const o=this.readAction(i,n),r=this.lastTraceSnapshot.get(i);M(r,o)||(e[i]=o,this.lastTraceSnapshot.set(i,o),s=!0)}s&&(this.inputTrace.push({tick:t,actions:e}),this.inputTrace.length>L&&this.inputTrace.shift())}static axisThresholdMet(t,e,s){return e==="positive"?t>s:t<-s}isPressed(t){if(this.assertValueType(t,"digital","isPressed"),this.virtualDigitalHeld.has(t)||this.virtualDigitalTapActive.has(t))return!0;const e=this.actions.get(t);if(!e)return!1;for(const s of e)switch(s.type){case"key":if(this.keysDown.has(s.code))return!0;break;case"mouse_button":if(this.mouseButtons.has(s.button))return!0;break;case"gamepad_button":for(const i of this.gamepads)if(i?.buttons[s.button]?.pressed)return!0;break;case"gamepad_axis":{const i=s.deadzone??p;for(const n of this.gamepads){if(!n)continue;const o=n.axes[s.axis]??0;if(l.axisThresholdMet(o,s.direction,i))return!0}break}case"touch_button":if(this.touchButtonsDown.has(s.sourceId))return!0;break}return!1}getDigitalStrength(t){if(this.assertValueType(t,"digital","getDigitalStrength"),this.machineInputActive&&(this.virtualDigitalHeld.has(t)||this.virtualDigitalTapActive.has(t)))return this.virtualDigitalStrength.get(t)??1;if(!this.inputActive)return 0;const e=this.actions.get(t);if(!e)return 0;let s=0;for(const i of e)switch(i.type){case"key":if(this.keysDown.has(i.code))return 1;break;case"mouse_button":if(this.mouseButtons.has(i.button))return 1;break;case"gamepad_button":for(const n of this.gamepads)if(n?.buttons[i.button]?.pressed)return 1;break;case"gamepad_axis":{const n=i.deadzone??p;for(const o of this.gamepads){if(!o)continue;const r=o.axes[i.axis]??0,a=i.direction==="positive"?r:-r;a<n||(s=Math.max(s,n===1?1:Math.min(1,Math.max(0,(a-n)/(1-n)))))}break}case"touch_button":if(this.touchButtonsDown.has(i.sourceId))return 1;break}return s}getDigitalRawStrength(t){if(this.assertValueType(t,"digital","getDigitalRawStrength"),this.machineInputActive&&(this.virtualDigitalHeld.has(t)||this.virtualDigitalTapActive.has(t)))return this.virtualDigitalStrength.get(t)??1;if(!this.inputActive)return 0;const e=this.actions.get(t);if(!e)return 0;let s=0;for(const i of e)switch(i.type){case"key":if(this.keysDown.has(i.code))return 1;break;case"mouse_button":if(this.mouseButtons.has(i.button))return 1;break;case"gamepad_button":if(this.gamepads.some(n=>n?.buttons[i.button]?.pressed))return 1;break;case"gamepad_axis":for(const n of this.gamepads){if(!n)continue;const o=n.axes[i.axis]??0;s=Math.max(s,Math.min(1,Math.max(0,i.direction==="positive"?o:-o)))}break;case"touch_button":if(this.touchButtonsDown.has(i.sourceId))return 1;break}return s}isJustPressed(t){if(this.assertValueType(t,"digital","isJustPressed"),this.virtualDigitalTapActive.has(t))return!0;const e=this.actions.get(t);if(!e)return!1;for(const s of e)switch(s.type){case"key":if(this.keysJustDown.has(s.code))return!0;break;case"mouse_button":if(this.mouseButtonsJustDown.has(s.button))return!0;break;case"gamepad_button":for(let i=0;i<this.gamepads.length;i++)if(this.gamepadButtonsJustDown.has(`${i}:${s.button}`))return!0;break;case"gamepad_axis":{const i=s.deadzone??p;for(let n=0;n<this.gamepads.length;n++){const o=`${n}:${s.axis}`,r=this.gamepadAxesCurrent.get(o)??0,a=this.gamepadAxesPrev.get(o)??0,u=l.axisThresholdMet(r,s.direction,i),c=l.axisThresholdMet(a,s.direction,i);if(u&&!c)return!0}break}case"touch_button":if(this.touchButtonsJustDown.has(s.sourceId))return!0;break}return!1}isJustReleased(t){if(this.assertValueType(t,"digital","isJustReleased"),this.virtualDigitalJustReleased.has(t))return!0;const e=this.actions.get(t);if(!e)return!1;for(const s of e)switch(s.type){case"key":if(this.keysJustUp.has(s.code))return!0;break;case"mouse_button":if(this.mouseButtonsJustUp.has(s.button))return!0;break;case"gamepad_button":for(let i=0;i<this.gamepads.length;i++)if(this.gamepadButtonsJustUp.has(`${i}:${s.button}`))return!0;break;case"gamepad_axis":{const i=s.deadzone??p;for(let n=0;n<this.gamepads.length;n++){const o=`${n}:${s.axis}`,r=this.gamepadAxesCurrent.get(o)??0,a=this.gamepadAxesPrev.get(o)??0,u=l.axisThresholdMet(r,s.direction,i),c=l.axisThresholdMet(a,s.direction,i);if(!u&&c)return!0}break}case"touch_button":if(this.touchButtonsJustUp.has(s.sourceId))return!0;break}return!1}getDigitalSource(t){if(this.assertValueType(t,"digital","getDigitalSource"),this.machineInputActive&&(this.virtualDigitalHeld.has(t)||this.virtualDigitalTapActive.has(t)))return{bindingType:"virtual"};if(!this.inputActive)return null;const e=this.actions.get(t);if(!e)return null;for(const s of e)switch(s.type){case"key":if(this.keysDown.has(s.code))return{bindingType:"key"};break;case"mouse_button":if(this.mouseButtons.has(s.button))return{bindingType:"mouse_button"};break;case"gamepad_button":for(let i=0;i<this.gamepads.length;i++){const n=this.gamepads[i];if(n?.buttons[s.button]?.pressed)return{bindingType:"gamepad_button",gamepadIndex:i,gamepadId:n.id}}break;case"gamepad_axis":{const i=s.deadzone??p;for(let n=0;n<this.gamepads.length;n++){const o=this.gamepads[n];if(!o)continue;const r=o.axes[s.axis]??0;if(l.axisThresholdMet(r,s.direction,i))return{bindingType:"gamepad_axis",gamepadIndex:n,gamepadId:o.id}}break}case"touch_button":if(this.touchButtonsDown.has(s.sourceId))return{bindingType:"touch_button",sourceId:s.sourceId};break}return null}static rescaleScalar(t,e){const s=Math.max(-1,Math.min(1,t)),i=Math.abs(s);if(i<e)return 0;const n=e>=1?0:(i-e)/(1-e);return Math.sign(s)*Math.min(1,n)}static rescaleVector2(t,e){const s=Math.hypot(t.x,t.y);if(s===0||s<e)return{x:0,y:0};const n=Math.min(1,e>=1?0:(s-e)/(1-e))/s;return{x:t.x*n,y:t.y*n}}static clampVector2(t){const e=Math.hypot(t.x,t.y);return e<=1||e===0?t:{x:t.x/e,y:t.y/e}}collectScalarContributions(t){const e=[],s=this.virtualScalarValues.get(t);if(s!==void 0&&this.machineInputActive&&e.push({value:s,source:{bindingType:"virtual"}}),!this.inputActive)return e;const i=this.actions.get(t);if(!i)return e;for(const n of i)if(n.type==="gamepad_axis"){const o=n.deadzone??p;for(let r=0;r<this.gamepads.length;r++){const a=this.gamepads[r];if(!a)continue;const u=a.axes[n.axis]??0;e.push({value:l.rescaleScalar(u,o),source:{bindingType:"gamepad_axis",gamepadIndex:r,gamepadId:a.id}})}}else if(n.type==="test_axis"){const o=this.testAxisValues.get(n.sourceId)??0;e.push({value:l.rescaleScalar(o,n.deadzone??0),source:{bindingType:"test_axis",sourceId:n.sourceId}})}return e}computeScalar(t){this.assertValueType(t,"scalar","getScalar");let e=null;for(const s of this.collectScalarContributions(t))(!e||Math.abs(s.value)>Math.abs(e.value))&&(e=s);return!e||e.value===0?{value:0,source:null}:e}getScalar(t){return this.computeScalar(t).value}getScalarSource(t){return this.computeScalar(t).source}contributeGamepadAxisPair(t){const e=t.deadzone??p,s=[];for(let i=0;i<this.gamepads.length;i++){const n=this.gamepads[i];if(!n)continue;const o={x:n.axes[t.xAxis]??0,y:n.axes[t.yAxis]??0};s.push({value:l.rescaleVector2(o,e),source:{bindingType:"gamepad_axis_pair",gamepadIndex:i,gamepadId:n.id}})}return s}collectVector2Contributions(t){const e=[],s=this.virtualVector2Values.get(t);if(s!==void 0&&this.machineInputActive&&e.push({value:s,source:{bindingType:"virtual"}}),!this.inputActive)return e;const i=this.actions.get(t);if(!i)return e;for(const n of i)switch(n.type){case"test_vector2":{const o=this.testVector2Values.get(n.sourceId)??{x:0,y:0};e.push({value:l.rescaleVector2(o,n.deadzone??0),source:{bindingType:"test_vector2",sourceId:n.sourceId}});break}case"gamepad_axis_pair":e.push(...this.contributeGamepadAxisPair(n));break;case"mouse_move":{const o={x:this.mouseDeltaX,y:this.mouseDeltaY};e.push({value:l.rescaleVector2(o,n.deadzone??0),source:{bindingType:"mouse_move"}});break}case"touch_stick":{const o=this.touchStickValues.get(n.sourceId)??{x:0,y:0};e.push({value:l.rescaleVector2(o,n.deadzone??v),source:{bindingType:"touch_stick",sourceId:n.sourceId}});break}}return e}computeVector2(t){this.assertValueType(t,"vector2","getVector2");let e={x:0,y:0},s=null,i=0;for(const o of this.collectVector2Contributions(t)){e={x:e.x+o.value.x,y:e.y+o.value.y};const r=Math.hypot(o.value.x,o.value.y);r>i&&(i=r,s=o.source)}const n=l.clampVector2(e);return n.x===0&&n.y===0?{value:n,source:null}:{value:n,source:s}}getVector2(t){return this.computeVector2(t).value}getVector2Source(t){return this.computeVector2(t).source}collectPointerDeltaContributions(t){if(!this.inputActive)return[];const e=this.actions.get(t);if(!e)return[];const s=[];for(const i of e)if(i.type==="test_pointer_delta"){const n=this.testPointerDeltaAccum.get(i.sourceId)??{x:0,y:0};s.push({value:n,source:{bindingType:"test_pointer_delta",sourceId:i.sourceId}})}else i.type==="mouse_move"&&s.push({value:{x:this.mouseDeltaX,y:this.mouseDeltaY},source:{bindingType:"mouse_move"}});return s}computePointerDelta(t){this.assertValueType(t,"pointerDelta","getPointerDelta");let e={x:0,y:0},s=null,i=0;for(const n of this.collectPointerDeltaContributions(t)){e={x:e.x+n.value.x,y:e.y+n.value.y};const o=Math.hypot(n.value.x,n.value.y);o>i&&(i=o,s=n.source)}return e.x===0&&e.y===0?{value:e,source:null}:{value:e,source:s}}getPointerDelta(t){return this.computePointerDelta(t).value}getPointerDeltaSource(t){return this.computePointerDelta(t).source}collectPointerPositionContributions(t){if(!this.inputActive)return[];const e=this.actions.get(t);if(!e)return[];const s=[];for(const i of e)if(i.type==="test_pointer_position"){const n=this.testPointerPositionValues.get(i.sourceId);n&&s.push({value:n.value,seq:n.seq,source:{bindingType:"test_pointer_position",sourceId:i.sourceId}})}return s}computePointerPosition(t){this.assertValueType(t,"pointerPosition","getPointerPosition");const e=this.collectPointerPositionContributions(t);if(e.length===0)return{value:{x:0,y:0},source:null};let s=e[0];for(const i of e)i.seq>s.seq&&(s=i);return{value:s.value,source:s.source}}getPointerPosition(t){return this.computePointerPosition(t).value}getPointerPositionSource(t){return this.computePointerPosition(t).source}readAction(t,e){switch(e){case"digital":return this.isPressed(t);case"scalar":return this.getScalar(t);case"vector2":return this.getVector2(t);case"pointerDelta":return this.getPointerDelta(t);case"pointerPosition":return this.getPointerPosition(t);default:throw new Error(`InputManager.readAction: unknown value type "${e}"`)}}injectAxis(t,e){this.testAxisValues.set(t,e)}clearAxis(t){this.testAxisValues.delete(t)}injectVector2(t,e){this.testVector2Values.set(t,e)}clearVector2(t){this.testVector2Values.delete(t)}injectPointerDelta(t,e){const s=this.testPointerDeltaAccum.get(t)??{x:0,y:0};this.testPointerDeltaAccum.set(t,{x:s.x+e.x,y:s.y+e.y})}injectPointerPosition(t,e){this.testPointerPositionValues.set(t,{value:e,seq:++this.pointerPositionSeq})}isEnabled(){return this.enabled}setEnabled(t){this.enabled!==t&&(this.enabled=t,t||this.flushHeldState())}isFocused(){return this.focused}isInputActive(){return this.inputActive}isPointerLocked(){return this.pointerLocked}getGamepadInfo(t){const e=this.gamepads[t];return e?{index:t,id:e.id,mapping:e.mapping,connected:e.connected}:null}getMouseDelta(){return{x:this.mouseDeltaX,y:this.mouseDeltaY}}isDeviceKeyPressed(t){return this.inputActive?this.keysDown.has(t):!1}isDeviceKeyJustPressed(t){return this.inputActive?this.keysJustDown.has(t):!1}isDeviceKeyJustReleased(t){return this.inputActive?this.keysJustUp.has(t):!1}isDeviceMouseButtonPressed(t){return this.inputActive?this.mouseButtons.has(t):!1}isDeviceMouseButtonJustPressed(t){return this.inputActive?this.mouseButtonsJustDown.has(t):!1}isDeviceMouseButtonJustReleased(t){return this.inputActive?this.mouseButtonsJustUp.has(t):!1}getDeviceMouseDelta(){return this.inputActive?{x:this.mouseDeltaX,y:this.mouseDeltaY}:{x:0,y:0}}getDeviceMousePosition(){return this.inputActive?{x:this.mouseClientX,y:this.mouseClientY}:{x:0,y:0}}hasDeviceGamepad(){return this.inputActive?this.gamepads.some(t=>t!==null):!1}getConnectedGamepadIndices(){if(!this.inputActive)return[];const t=[];for(let e=0;e<this.gamepads.length;e+=1)this.gamepads[e]!==null&&t.push(e);return t}isDeviceGamepadButtonPressed(t){if(!this.inputActive)return!1;const e=this.firstConnectedGamepadIndex();return e<0?!1:this.gamepadButtonsDown.has(`${e}:${t}`)}isDeviceGamepadButtonPressedAt(t,e){return!this.inputActive||!Number.isSafeInteger(t)||t<0||!Number.isSafeInteger(e)||e<0?!1:this.gamepads[t]?.buttons[e]?.pressed??!1}isDeviceGamepadButtonJustPressed(t){if(!this.inputActive)return!1;const e=this.firstConnectedGamepadIndex();return e<0?!1:this.gamepadButtonsJustDown.has(`${e}:${t}`)}isDeviceGamepadButtonJustReleased(t){if(!this.inputActive)return!1;const e=this.firstConnectedGamepadIndex();return e<0?!1:this.gamepadButtonsJustUp.has(`${e}:${t}`)}getDeviceGamepadAxis(t){if(!this.inputActive)return 0;const e=this.firstConnectedGamepadIndex();return e<0?0:this.gamepads[e]?.axes[t]??0}getDeviceGamepadAxisAt(t,e){return!this.inputActive||!Number.isSafeInteger(t)||t<0||!Number.isSafeInteger(e)||e<0?0:this.gamepads[t]?.axes[e]??0}firstConnectedGamepadIndex(){for(let t=0;t<this.gamepads.length;t++)if(this.gamepads[t]!==null)return t;return-1}getLastActiveDevice(){return this.lastActiveDevice}getBindings(t){const e=this.actions.get(t);return e?structuredClone(e):[]}setBindings(t,e){this.actionValueTypes.has(t)||this.actionValueTypes.set(t,"digital"),this.actions.set(t,structuredClone(e))}addBinding(t,e){const s=this.actions.get(t)??[];this.actions.set(t,[...s,structuredClone(e)]),this.actionValueTypes.has(t)||this.actionValueTypes.set(t,"digital")}removeBinding(t,e){const s=this.actions.get(t);!s||e<0||e>=s.length||this.actions.set(t,[...s.slice(0,e),...s.slice(e+1)])}replaceBinding(t,e,s){const i=this.actions.get(t);if(!i||e<0||e>=i.length)return;const n=i.slice();n[e]=structuredClone(s),this.actions.set(t,n)}resetBindings(t){const e=this.defaultBindings.get(t);e&&this.actions.set(t,structuredClone(e))}resetAllBindings(){for(const t of this.defaultBindings.keys())this.resetBindings(t)}findConflicts(t,e){const s=[];for(const[i,n]of this.actions)i!==e&&n.forEach((o,r)=>{D(t,o)&&s.push({actionName:i,bindingIndex:r,binding:structuredClone(o)})});return s}toInputMapFile(){const t={};for(const[e,s]of this.actions)t[e]={valueType:this.actionValueTypes.get(e)??"digital",bindings:structuredClone(s)};return{version:this.loadedMapVersion,actions:t}}getPrompt(t,e,s=0){const i=e??this.lastActiveDevice??"keyboard",n=this.actions.get(t);if(!n)return null;const o=n.find(r=>A(r.type)===i);if(!o)return null;switch(o.type){case"key":return{device:"keyboard",bindingType:"key",label:b(o.code),icon:b(o.code)};case"mouse_button":return{device:"mouse",bindingType:"mouse_button",label:P(o.button),icon:"mouse"};case"mouse_move":return{device:"mouse",bindingType:"mouse_move",label:"Mouse",icon:"mouse"};case"gamepad_button":{const r=this.getGamepadInfo(s);if(!r?.connected)return{device:"gamepad",bindingType:"gamepad_button",label:"Gamepad Disconnected",icon:"gamepad-off"};const a=r.mapping==="standard"?S[o.button]??`Button ${o.button}`:`Button ${o.button}`;return{device:"gamepad",bindingType:"gamepad_button",label:a,icon:a}}case"gamepad_axis":return this.getGamepadInfo(s)?.connected?{device:"gamepad",bindingType:"gamepad_axis",label:T(o.axis),icon:"gamepad-stick"}:{device:"gamepad",bindingType:"gamepad_axis",label:"Gamepad Disconnected",icon:"gamepad-off"};case"gamepad_axis_pair":return this.getGamepadInfo(s)?.connected?{device:"gamepad",bindingType:"gamepad_axis_pair",label:x(o.xAxis,o.yAxis),icon:"gamepad-stick"}:{device:"gamepad",bindingType:"gamepad_axis_pair",label:"Gamepad Disconnected",icon:"gamepad-off"};case"touch_button":return{device:"touch",bindingType:"touch_button",label:o.sourceId,icon:"touch"};case"touch_stick":return{device:"touch",bindingType:"touch_stick",label:o.sourceId,icon:"touch"};default:return null}}endFrame(){this.keysJustDown.clear(),this.keysJustUp.clear(),this.mouseButtonsJustDown.clear(),this.mouseButtonsJustUp.clear(),this.gamepadButtonsPrev=this.gamepadButtonsDown,this.gamepadButtonsJustDown.clear(),this.gamepadButtonsJustUp.clear(),this.gamepadAxesPrev=this.gamepadAxesCurrent,this.mouseDeltaX=0,this.mouseDeltaY=0,this.testPointerDeltaAccum.clear(),this.touchButtonsJustDown.clear(),this.touchButtonsJustUp.clear(),this.virtualDigitalTapActive.clear(),this.virtualDigitalJustReleased.clear()}setVirtualKey(t,e){e?(this.keysDown.has(t)||this.keysJustDown.add(t),this.keysDown.add(t)):(this.keysDown.has(t)&&this.keysJustUp.add(t),this.keysDown.delete(t))}setLookStick(t,e){this.lookStickX=t,this.lookStickY=e}addMouseDelta(t,e){this.mouseDeltaX+=t,this.mouseDeltaY+=e}setTouchButton(t,e){this.inputActive&&(e?(this.touchButtonsDown.has(t)||this.touchButtonsJustDown.add(t),this.touchButtonsDown.add(t),this.lastActiveDevice="touch"):(this.touchButtonsDown.has(t)&&this.touchButtonsJustUp.add(t),this.touchButtonsDown.delete(t)))}setTouchStick(t,e){this.touchStickValues.set(t,e);const s=this.declaredDeadzone(i=>i.type==="touch_stick"&&i.sourceId===t?i.deadzone??v:void 0,v);Math.hypot(e.x,e.y)>s&&(this.lastActiveDevice="touch")}clearTouchStick(t){this.touchStickValues.delete(t)}assertActionExists(t,e){if(!this.actionValueTypes.has(t))throw new E(t,e,this.actionNames())}static virtualValueCategory(t){return typeof t=="boolean"?"digital":typeof t=="number"?"scalar":"vector2"}setVirtualAction(t,e){this.assertActionExists(t,"setVirtualAction");const s=l.virtualValueCategory(e);return this.assertValueType(t,s,"setVirtualAction"),this.machineInputActive?(this.applyVirtualActionValue(t,e),{delivered:!0}):{delivered:!1,reason:"input-gated (input disabled by the editor)"}}setVirtualDigitalStrength(t,e){if(this.assertActionExists(t,"setVirtualDigitalStrength"),this.assertValueType(t,"digital","setVirtualDigitalStrength"),!Number.isFinite(e))throw new Error("InputManager.setVirtualDigitalStrength: strength must be finite.");if(!this.machineInputActive)return{delivered:!1,reason:"input-gated (input disabled by the editor)"};const s=Math.min(1,Math.max(0,e));return this.applyVirtualActionValue(t,!0),this.virtualDigitalStrength.set(t,s),{delivered:!0}}applyVirtualActionValue(t,e){switch(l.virtualValueCategory(e)){case"digital":e?(this.virtualDigitalHeld.has(t)||this.virtualDigitalTapQueued.add(t),this.virtualDigitalHeld.add(t)):(this.virtualDigitalHeld.has(t)&&this.virtualDigitalJustReleased.add(t),this.virtualDigitalHeld.delete(t),this.virtualDigitalStrength.delete(t));break;case"scalar":this.virtualScalarValues.set(t,e);break;default:this.virtualVector2Values.set(t,e);break}}tapVirtualAction(t){return this.assertActionExists(t,"tapVirtualAction"),this.assertValueType(t,"digital","tapVirtualAction"),this.machineInputActive?(this.virtualDigitalTapQueued.add(t),{delivered:!0}):{delivered:!1,reason:"input-gated (input disabled by the editor)"}}clearVirtualActions(){this.clearVirtualActionState({manufactureReleaseEdge:!0})}scheduleActionAtTick(t,e,s){this.assertActionExists(e,"scheduleActionAtTick");const i=l.virtualValueCategory(s);if(this.assertValueType(e,i,"scheduleActionAtTick"),t<this.currentTick)throw new B(t,this.currentTick);const n=this.scheduledActions.get(t);n?n.push({action:e,value:s}):this.scheduledActions.set(t,[{action:e,value:s}])}setDebugEmit(t){this.debugEmit=t}startInputRecording(){this.inputRecording=!0,this.inputTrace=[],this.lastTraceSnapshot.clear()}stopInputRecording(){this.inputRecording=!1}isInputRecording(){return this.inputRecording}getInputTrace(){return{version:1,ticks:this.inputTrace.slice()}}requestPointerLock(t){this.pointerLockElement!==t&&(this.pointerLockElement&&this.pointerLockElement.removeEventListener("click",this.onPointerLockClick),this.pointerLockElement=t,t.addEventListener("click",this.onPointerLockClick));const e=typeof document<"u"?document:null,s=typeof navigator<"u"?navigator.userActivation:void 0;e&&e.pointerLockElement!==t&&s?.isActive&&this.onPointerLockClick()}exitPointerLock(){this.pointerLockRetry!==null&&(clearTimeout(this.pointerLockRetry),this.pointerLockRetry=null);const t=this.pointerLockElement;t&&(t.removeEventListener("click",this.onPointerLockClick),this.pointerLockElement=null),this.pointerLocked=!1;const e=typeof document<"u"?document:void 0;!e||typeof e.exitPointerLock!="function"||t&&e.pointerLockElement===t&&e.exitPointerLock()}dispose(){if(!this.disposed){this.disposed=!0,this.flushHeldState();for(const t of this.smoothedAxisSets)t.disposed=!0,t.values.clear();this.smoothedAxisSets.clear(),typeof window<"u"&&(window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp),window.removeEventListener("mousedown",this.onMouseDown),window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("blur",this.onWindowBlur),window.removeEventListener("focus",this.onWindowFocus)),typeof document<"u"&&typeof document.removeEventListener=="function"&&document.removeEventListener("pointerlockchange",this.onPointerLockChange),this.pointerLockElement&&(this.pointerLockElement.removeEventListener("click",this.onPointerLockClick),this.pointerLockElement=null)}}}export{E as InputActionError,l as InputManager,B as InputTickError};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{cu as f,cx as l}from"./index-Ckxb31Yz.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./three.module-IFn-4i31.js";function E(o){f(o).forEach((n,r)=>{n.canvas.style.pointerEvents=r===0?"auto":"none"})}const a=["pointerdown","pointerup","pointermove","click","wheel"];function v(o){const t=o,n=["clientX","clientY","screenX","screenY","offsetX","offsetY","button","buttons","ctrlKey","altKey","shiftKey","metaKey","pointerId","pointerType","pressure","isPrimary","deltaX","deltaY","deltaZ","deltaMode"],r={bubbles:!1,cancelable:!0,composed:!0};for(const c of n)c in t&&(r[c]=t[c]);return r}function h(o,t){const n=globalThis,r=t.type==="wheel"?n.WheelEvent:t.type.startsWith("pointer")?n.PointerEvent:n.MouseEvent??n.PointerEvent;if(!(!r||typeof o.dispatchEvent!="function"))try{o.dispatchEvent(new r(t.type,v(t)))}catch{}}function K(o,t){E(t);const n=new Map(t.map(e=>[e.id,e])),r=f(t)[0]?.id,c=e=>{const s=o.getBoundingClientRect?.()??{left:0,top:0},d=e.clientX??0,u=e.clientY??0,m=d-s.left,y=u-s.top,i=l(t,m,y);if(i&&i!==r){const p=n.get(i);p&&h(p.canvas,e)}};for(const e of a)o.addEventListener?.(e,c,!0);return{resolveClaim:(e,s)=>l(t,e,s),dispose(){for(const e of a)o.removeEventListener?.(e,c,!0)}}}export{E as applyPointerEventsStacking,K as createInputRouter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{w as p}from"./inference-diagnostics-
|
|
1
|
+
import{w as p}from"./inference-diagnostics-YW0yJkKx.js";const y="data-oid";function S(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function w(e){return e.replace(/-([a-z])/g,(n,t)=>t.toUpperCase())}function C(e,n){return e?e[n]:void 0}const R=e=>{const n=globalThis.window;if(n?.getComputedStyle)return n.getComputedStyle(e);const t=e.style;return{getPropertyValue:s=>String(C(t,w(s))??"")}};function L(e,n,t=R){return t(e).getPropertyValue(S(n))}function v(e){if(!e||typeof e!="object")return null;const n=Object.keys(e).find(t=>t.startsWith("__reactFiber$")||t.startsWith("__reactInternalInstance$"));return n?e[n]??null:null}function u(e){const n=v(e);if(!n?.return)return null;const t=n.return;return t.type&&typeof t.type=="function"?t:null}function $(e){const n=u(e);if(!n)return null;const t=n.type;return t.displayName||t.name||null}function _(e){const n=u(e);if(!n)return null;const t=n.memoizedProps?.[y];return typeof t=="string"?t:null}function P(e){const n=u(e);if(!n)return null;const t=n.memoizedProps;if(!t||typeof t!="object")return null;const s=new Set(["children","key","ref",y,"style","className"]),o={};for(const[r,i]of Object.entries(t))s.has(r)||(typeof i=="string"||typeof i=="number"||typeof i=="boolean")&&(o[r]=String(i));return Object.keys(o).length>0?o:null}function j(e){const n=_(e);if(!n)return null;const t=P(e);return t?{callSiteOid:n,props:t}:null}const f="__visual-edit-preview-styles";function m(e){const n=globalThis.CSSStyleRule;if(typeof n=="function")return e instanceof n;const t=e;return!!t&&typeof t.selectorText=="string"&&!!t.style}function W(e){const n={};for(let t=0;t<e.style.length;t++){const s=e.style[t];n[s]=e.style.getPropertyValue(s)}return n}function b(e,n){const t=globalThis.matchMedia,s=(o,r)=>{for(const i of Array.from(o)){if(m(i)){n(i,r);continue}const a=i;if(!a.cssRules)continue;const c=a.media?.mediaText;typeof c=="string"&&t&&!t(c).matches||typeof a.containerQuery=="string"||a.cssText?.trimStart().startsWith("@container")||s(a.cssRules,r)}};for(const o of e){const r=o.ownerNode;if(r?.id===f)continue;const i=r?.getAttribute?.("data-vite-dev-id")??null;if(i)try{s(o.cssRules,i)}catch{}}}function B(e,n=globalThis.document?.styleSheets??[]){let t=null;return b(n,(s,o)=>{s.selectorText.trim()===`.${e}`&&(t={sourceFile:o})}),t}function G(e=globalThis.document?.styleSheets??[]){const n=[];for(const t of e){const s=t.ownerNode;if(s?.id===f)continue;const o=s?.getAttribute?.("data-vite-dev-id")??null;if(!o)continue;(o.split("?")[0]??o).endsWith(".css")&&!n.includes(o)&&n.push(o)}return n}function z(e,n=globalThis.document?.styleSheets??[]){const t=[];return b(n,(s,o)=>{e.matches(s.selectorText)&&t.push({selectorText:s.selectorText,properties:W(s),sourceFile:o})}),t}function A(e=globalThis.document?.styleSheets??[]){const n=new Map,t=(s,o,r)=>{if(m(s)){const c=s.selectorText,d=r&&/(^|,)\s*:scope\s*($|,)/.test(c),T=/(^|,)\s*(:root|html)\s*($|,)/.test(c)&&!c.includes("[data-theme");if(!d&&!T)return;for(let l=0;l<s.style.length;l++){const h=s.style[l];h.startsWith("--")&&n.set(h,{sourceFile:o,selector:d?":root":c})}return}const i=s;if(!i.cssRules)return;const a=r||!!i.cssText?.trimStart().startsWith("@scope");for(const c of Array.from(i.cssRules))t(c,o,a)};for(const s of e){const o=s.ownerNode;if(o?.id===f)continue;const r=o?.getAttribute?.("data-vite-dev-id")??null;if(r)try{for(const i of Array.from(s.cssRules))t(i,r,!1)}catch{}}return n}function D(e=V()){if(!e)return[];const n=[],t=new Set;for(let o=0;o<e.length;o++){const r=e[o];if(!r.startsWith("--")||r.startsWith("--tw-")||r.startsWith("--fa-")||r.startsWith("--vgai-")||r.startsWith("--vscode-")||r==="--chat-input-control-height"||r.startsWith("--dv-")||t.has(r))continue;t.add(r);const i=e.getPropertyValue(r).trim();i&&n.push({name:r,value:i,category:g(r,i)})}const s=A();for(const o of s.keys()){if(t.has(o)||o.startsWith("--tw-")||o.startsWith("--fa-")||o.startsWith("--vgai-")||o.startsWith("--dv-")||o.startsWith("--vscode-")||o==="--chat-input-control-height")continue;t.add(o);const r=e.getPropertyValue(o).trim();r&&n.push({name:o,value:r,category:g(o,r)})}for(const o of n){const r=s.get(o.name);r&&(o.declaredIn=r)}return n}const x=/^(#[0-9a-f]{3,8}|rgba?\(|hsla?\(|oklch\()/i,N=/spacing|gap|margin|padding|radius|size|width|height/i,k=/color/i;function g(e,n){return x.test(n)?"color":k.test(e)?(p(":root",e,"color"),"color"):N.test(e)&&/^\d/.test(n)?(p(":root",e,"spacing"),"spacing"):"other"}function K(e){const n=[];for(const t of e){if(t.hasVisibleChildren||t.hasText||t.rect.width>=8&&t.rect.height>=8)continue;const s=Math.max(t.rect.width,40),o=Math.max(t.rect.height,24);n.push({oid:t.oid,displayName:t.displayName,rect:{x:t.rect.x-(s-t.rect.width)/2,y:t.rect.y-(o-t.rect.height)/2,width:s,height:o}})}return n}const E=new Set(["","transparent","rgba(0, 0, 0, 0)"]);function F(e){return E.has(e)}function U(e){for(const n of e)if(!F(n))return n;return"#fff"}const O=["Arial","Helvetica","Times New Roman","Georgia","Verdana","Courier New","Impact","Trebuchet MS","Palatino Linotype","Lucida Console","monospace","sans-serif","serif"];function I(e=[]){const n=new Set;for(const t of e)n.add(t.replace(/^["']|["']$/g,""));for(const t of O)n.add(t);return[...n].sort((t,s)=>t.localeCompare(s))}function H(){const e=globalThis,n=[],t=e.document?.fonts;if(t)for(const s of t)n.push(s.family);return I(n)}function V(){const e=globalThis,n=e.document?.documentElement;if(!(!n||!e.window?.getComputedStyle))return e.window.getComputedStyle(n)}export{z as a,R as b,D as c,$ as d,j as e,K as f,L as g,B as h,G as i,S as j,H as k,U as l};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{al as m}from"./index-Ckxb31Yz.js";import{a as p,i as e,s as n,b as s}from"./play-mode-DomOvQie.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./three.module-IFn-4i31.js";import"./drei-asset-caches-jJoHXbTj.js";import"./native-debug-module-j-MekcLS.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-B3Cnne3x.js";import"./playtest-BnFenMBW.js";import"./game-contract-seams-TCpIMmHP.js";import"./instruments-IKn-vvNb.js";import"./frame-pacing-D5acoOzO.js";import"./edit-mode-authoring-D_BiHCQj.js";import"./json-history-resource-r-9q_hxP.js";import"./binding-resolver-BWwG10zJ.js";import"./adapter-surface-Y37Nzcyw.js";import"./entry-adjudication-BYy7TXOB.js";import"./r3f-root-factory-DjGnbU4n.js";import"./register-render-vitals-BO7x64kR.js";import"./render-census-BrQX_CXv.js";import"./structural-signature-0w-i_ats.js";import"./render-vitals-BZ5HtvMi.js";import"./static-batch-advisor-DqfXWRUq.js";import"./webgl-frame-capture-CRKX73E9.js";import"./world-state-ZGDGY_Xl.js";import"./frame-selector-cache-cCeUbcjG.js";import"./dev-build-gDYrq68M.js";import"./game-input-seams-BC6xhZy3.js";import"./seeded-random-CN0scLZj.js";import"./render-seed-DF4JHy7P.js";import"./frame-delta-D2nsw_Ht.js";import"./events-156d8d12.esm-C734MYnx.js";import"./index-bQE2NA0D.js";import"./realm-services-D25JHoqD.js";import"./canvas-entry-runtime-E5YjSgre.js";import"./three-ingest-runtime-DWijtqQ8.js";import"./EffectComposer-BHDH-NLz.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-qtkA7CQ8.js";import"./CSS3DRenderer-CAS2WZZy.js";import"./relative-path-guard-GiM7Lsz8.js";import"./capability-coverage-CfUeULDN.js";import"./react-root-DGLRLr-F.js";import"./editor-presentation-activity-C7SNSmTd.js";import"./active-ingest-DEgq9JiA.js";import"./ingest-source-persistence-DH6ioCOu.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-C9M98VNM.js";import"./mounted-authoring-TIN5EnCb.js";import"./three-DSsr_Lvp.js";import"./viewport-pick-context-DkawXbEi.js";import"./logger-Dqis-7W1.js";import"./run-ticks-settled-B0cTtmhQ.js";import"./three-authoring-adapter-Yqsank46.js";import"./source-persistence-backend-_-JMEXxE.js";import"./three-projection-core-kubBTx0s.js";import"./body-marks-D8iaje6y.js";import"./user-data-CZqsJDk-.js";import"./object-marks-DwvIEBOK.js";import"./structural-ids-CblajJQK.js";import"./object3d-authoring-subject-CyE4rQ2A.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./r3f-physics-binding-C8OqNRG2.js";import"./deferred-ingest-play-7V8OrW3e.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-BMT9kLWU.js";import"./board-guides-C3usUZZk.js";import"./writer-BPbm4_my.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-BRgDdtVk.js";import"./inference-diagnostics-YW0yJkKx.js";const jt="workspace.command",a=()=>({ok:!1,error:"not in play mode — start play before using the debug seam"}),zt={"set-instance-count":{derivedRefresh:"always",handle:o=>{if(!e())return a();const r=o.names;if(Array.isArray(r)&&r.every(i=>typeof i=="string"))return r.length<1?{ok:!1,error:'set-instance-count "names" must have at least one entry.'}:(n(r),{ok:!0});const t=o.count;return typeof t!="number"||!Number.isFinite(t)||t<1?{ok:!1,error:`set-instance-count requires a whole "count" >= 1 (or a "names" array), got ${String(t)}.`}:(s(Math.floor(t)-1),{ok:!0})}},"list-instances":{derivedRefresh:"if-content-changed",handle:()=>({ok:!0,data:{instances:m(),named:p()}})}};export{zt as commands,jt as point};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{L as c,O as m,p as h}from"./index-Ckxb31Yz.js";import{TIME_SCALE_RANGE as a,clampTimeScale as f}from"./frame-pacing-D5acoOzO.js";import{g}from"./debug-registry-B3Cnne3x.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./three.module-IFn-4i31.js";const w=60;function b(e){if(e.length===0)return{ms:null,fps:null,worstMs:null,samples:[]};let r=0,t=0;for(const s of e)r+=s,s>t&&(t=s);const i=r/e.length;return{ms:l(i,2),fps:i>0?l(1e3/i,1):null,worstMs:l(t,2),samples:e.map(s=>l(s,2))}}function l(e,r){const t=10**r;return Math.round(e*t)/t}const y="No physics adapter on this game implements setDebugDrawEnabled, so nothing can draw its colliders. A first-party three root with Rapier physics registers one; a game with no physics has no colliders to draw.",d=c([]);function S(e){const r=[];let t=p();const i=e.onRenderStep(()=>{const n=p();r.push(n-t),t=n,r.length>w&&r.shift()});let s=!1;const o=()=>{const n=h(e.systemAdapters.physics);return n?.setDebugDrawEnabled?n:null};return{instruments:[{id:"timescale",label:"Time scale",hint:"Sim speed multiplier. 1 is real time, 0 freezes the simulation while the game keeps drawing.",unit:"x",control:{kind:"scale",action:"set",min:a.min,max:a.max,step:.05},actions:[{id:"set",label:"Set",hint:`Set the sim speed multiplier (${a.min}–${a.max}).`,args:c([m()]),run:n=>(e.loop.timeScale=f(n[0]),e.loop.timeScale)}],read:()=>e.loop.timeScale},{id:"paused",label:"Paused",hint:"Freeze the simulation. The game keeps drawing, so you can look at a frozen frame.",control:{kind:"toggle",action:"toggle"},actions:[{id:"toggle",label:"Toggle",hint:"Pause or resume the simulation.",args:d,run:()=>(e.play.paused?e.play.resume():e.play.pause(),e.play.paused)},{id:"step",label:"Step",hint:"Advance exactly one fixed substep. Pauses first if the game is running.",args:d,run:()=>(e.play.paused||e.play.pause(),e.play.step(),e.play.paused)}],read:()=>e.play.paused},{id:"colliders",label:"Colliders drawn",hint:"Draw the physics colliders over the world, through the game's own physics adapter.",control:{kind:"toggle",action:"toggle"},actions:[{id:"toggle",label:"Toggle",hint:"Turn collider wireframes on or off.",args:d,run:()=>{const n=o();if(!n)throw new Error(y);return s=!s,n.setDebugDrawEnabled?.(s),s}}],read:()=>o()===null?null:s},{id:"frame-time",label:"Frame time",hint:"Wall-clock milliseconds per display frame, newest last. The window is where a hitch shows; the mean hides it.",unit:"ms",control:{kind:"plot"},actions:[{id:"clear",label:"Clear",hint:"Forget the sampled window and start measuring again.",args:d,run:()=>(r.length=0,null)}],read:()=>b(r)}],dispose(){i(),r.length=0}}}function p(){return typeof performance>"u"?Date.now():performance.now()}const D="instruments",E="__instruments__";function T(e){const r={name:`instrument.${e.id}`,id:e.id,label:e.label,hint:e.hint,...e.unit===void 0?{}:{unit:e.unit},control:e.control,actions:e.actions.map(t=>({name:`instrument.${e.id}.${t.id}`,id:t.id,label:t.label,hint:t.hint}))};try{return{...r,value:e.read()}}catch(t){return{...r,value:null,error:t instanceof Error?t.message:String(t)}}}function C(e){const r=g(e);if(!r)throw new Error("Cannot publish dev instruments: mounted Game has no debug registry.");const t=S(e),i=r.forRoot(E);for(const s of t.instruments){i.registerStateProvider(`instrument.${s.id}`,()=>s.read(),{tier:"assisted"});for(const o of s.actions)i.registerCommand(`instrument.${s.id}.${o.id}`,{description:`${s.label}: ${o.label} — ${o.hint}`,locus:"client",args:o.args},(...u)=>o.run(u))}return i.registerStateProvider(D,()=>t.instruments.map(T),{tier:"assisted"}),()=>t.dispose()}export{w as FRAME_TIME_WINDOW,D as INSTRUMENTS_PROVIDER,S as createDevInstruments,C as publishDevInstruments,b as summarizeFrameTimes};
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ej as u,ek as y,b3 as n}from"./index-Ckxb31Yz.js";function g(){return{isDirty:()=>!1,save:async()=>{},destination:u}}const p=new TextEncoder,c=new TextDecoder,l="authoring";function w(t){return{session:l,id:t}}function N(t,e){return{session:`play-${t}`,id:e}}class S{constructor(e){if(this.options=e,e.scope==="project"){if(!e.location)throw new Error("A project JSON history resource needs a location.");this.descriptor=e.history.registry.registerProject(e.kind,e.location,e.displayName)}else{if(!e.subject)throw new Error("A session JSON history resource needs a subject.");this.descriptor=e.history.registry.registerSession(e.kind,e.subject.session,e.subject.id,e.displayName)}const i={descriptor:this.descriptor,capture:async()=>{const s=this.encode(e.capture());return{revision:this.revision,contentType:"application/json",bytes:s,sha256:await n(s)}},preflight:async s=>{const r=this.encode(e.capture()),o=await n(r);if(!this.recorded)return{ok:!0};if(o===s.sha256)return{ok:!0};if(e.conflictIdentity){const a=JSON.parse(c.decode(e.history.snapshots.read(s).bytes)),d=JSON.stringify(e.conflictIdentity(a)),h=JSON.stringify(e.conflictIdentity(e.capture()));if(d===h)return{ok:!0}}return{ok:!1,reason:"content-conflict",actualRevision:this.revision,actualSha256:o}},restore:async s=>{const r=e.history.snapshots.read(s).bytes;await e.restore(JSON.parse(c.decode(r))),this.revision++},estimateBytes:s=>s.byteLength};this.unregister=e.history.registerDriver(i)}descriptor;revision=0;unregister;disposed=!1;recorded=!1;record(e,i,s){return this.disposed?Promise.reject(new Error("JSON history resource is disposed.")):(this.options.history.assertCanRecordAppliedChange(),this.revision++,this.recorded=!0,this.options.history.recordAppliedTransaction({label:e,resources:[this.descriptor.key],scope:this.descriptor.scope,...this.descriptor.sessionId?{sessionId:this.descriptor.sessionId}:{}},[{resource:this.descriptor.key,beforeBytes:this.encode(i),afterBytes:this.encode(s),contentType:"application/json"}]).catch(async r=>{try{await this.options.restore(structuredClone(i)),this.revision++}catch(o){throw this.options.history.blockForCompensationFailure(e,[this.descriptor.key],{operationError:r,compensationError:o})}throw r instanceof y||this.options.history.reportAppliedChangeFailure(e,[this.descriptor.key],r),r}))}assertCanMutate(){if(this.disposed)throw new Error("JSON history resource is disposed.");this.options.history.assertCanRecordAppliedChange()}dispose(){this.disposed||(this.disposed=!0,this.unregister())}encode(e){return p.encode(JSON.stringify(e,null,2))}}export{S as J,w as a,g as c,N as p};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,
|
|
1
|
+
import{r as o,O as e,u as i,cy as a}from"./index-Ckxb31Yz.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./three.module-IFn-4i31.js";const s=o({type:a(["directional","point","spot","hemisphere","area"]).describe("Light type"),color:i().optional().describe("Light color as CSS hex string"),intensity:e().optional().describe("Native Three.js light intensity. Point and spot lights use candela with inverse-square falloff (a value near 1 is candle-scale); area lights use nit; directional and hemisphere lights use Three.js scene-light intensity units."),groundColor:i().optional().describe("Ground color for hemisphere lights"),distance:e().optional().describe("Maximum range of the light. 0 = infinite (point/spot only)"),decay:e().nonnegative().optional().describe("Native Three.js distance-decay exponent for point/spot lights. Default 2 gives physically correct inverse-square falloff."),angle:e().optional().describe("Spotlight cone angle in radians (spot only)"),penumbra:e().optional().describe("Spotlight penumbra softness 0–1 (spot only)"),width:e().optional().describe("Area light width (area only). RectAreaLight has NO shadow support and only affects Standard/Physical materials — degrades loudly, not silently."),height:e().optional().describe("Area light height (area only). RectAreaLight has NO shadow support and only affects Standard/Physical materials — degrades loudly, not silently.")}),u=s.refine(t=>t.type!=="spot"||t.angle===void 0||t.angle>0,{message:"Spot light angle must be positive"}).describe("Light source configuration");export{u as LightDescriptorSchema};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{RectAreaLightUniformsLib as s}from"./RectAreaLightUniformsLib-CwcuoVqt.js";import{DEFAULTS as c}from"./defaults-DKiBJCPN.js";import{an as h,u as g,bA as n,bB as p,bC as u,bD as m,bE as l}from"./three.module-IFn-4i31.js";let o=!1;function b(t){const r=c.light,i=t.color??r.color,e=t.intensity??r.intensity;switch(t.type){case"directional":return new n(i,e);case"point":return new l(i,e,t.distance??r.distance,t.decay??r.decay);case"spot":{const a=new m(i,e,t.distance??r.distance,t.angle??r.angle,t.penumbra??r.penumbra);return a.decay=t.decay??r.decay,a}case"hemisphere":return new u(i,t.groundColor??r.groundColor,e);case"area":return o||(s.init(),o=!0),new p(i,e,t.width??r.width,t.height??r.height);default:return new n(i,e)}}function C(t){const r=c.camera,i=(t.width??r.width)/(t.height??r.height);if(t.type==="orthographic"){const e=t.orthoSize??r.orthoSize;return new h(-e*i,e*i,e,-e,t.near??r.near,t.far??r.far)}return new g(t.fov??r.fov,i,t.near??r.near,t.far??r.far)}export{C as createCamera,b as createLight};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const n=Symbol.for("volter.three.animation.live");function i(){const e=globalThis;return e[n]??={mixers:new Map,listeners:new Set,version:0}}function o(e){for(const r of i().mixers.values())if(r.clips.size!==0&&(r.mixer.getRoot()===e||r.roots.has(e)))return r;return null}function t(){return[...i().mixers.values()]}export{o as a,t as l};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{G as d,K as p,w as f,M as u}from"./index-
|
|
1
|
+
import{G as d,K as p,w as f,M as u}from"./index-Ckxb31Yz.js";import{L as m,e as L}from"./three.module-IFn-4i31.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";let a="/";function i(t){return t.startsWith("/")||t.startsWith("http")||t.startsWith("data:")||t.startsWith("blob:")?t:a+t}const o=new m;o.setURLModifier(i);const K=new L(o),c=new f(o);c.setDecoderPath("/jsm/libs/draco/gltf/");const r=new p(o);r.setTranscoderPath("/jsm/libs/basis/");let n=!1;function P(t){if(n)return;const e=t;e!=null&&(e.isWebGPURenderer===!0?typeof e.hasFeature=="function":typeof e.extensions?.has=="function"&&typeof e.extensions?.get=="function")&&(r.detectSupport(t),n=!0)}const s=new d(o);s.setDRACOLoader(c);s.setKTX2Loader(r);s.setMeshoptDecoder(u);function R(t){a=t.endsWith("/")?t:t?`${t}/`:"/"}function U(t){return i(t)}export{P as detectKtx2Support,c as dracoLoader,s as gltfLoader,r as ktx2Loader,o as loadingManager,U as resolveUrl,R as setAssetPrefix,K as textureLoader};
|