@volter/game-editor 0.5.67 → 0.5.68
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 +20 -20
- package/catalog/entries/blender.json +1 -1
- package/catalog/entries/music.json +3 -3
- package/catalog/project-source/src/lib/music/music-player.ts +18 -12
- package/dist/.vite/manifest.json +2307 -2166
- package/dist/assets/{AssetBudgetPanel-x_FNJbfZ.js → AssetBudgetPanel-P2PeL_X5.js} +9 -9
- package/dist/assets/{AudioViewer-BDPqHDfU.js → AudioViewer-xFb5Wv7A.js} +1 -1
- package/dist/assets/CanvasBoardDocument-BFJdTVGp.js +1 -0
- package/dist/assets/CanvasSceneViewport-vqBlOz8P.js +1 -0
- package/dist/assets/{ColorInput-QUPS1pEB.js → ColorInput-CX1UZjYO.js} +1 -1
- package/dist/assets/{EntityModelDocument-CzUHsH9E.js → EntityModelDocument-Du8wIbyK.js} +1 -1
- package/dist/assets/{EnvironmentAssetDocument-ByEB7_4A.js → EnvironmentAssetDocument-_SttfMY_.js} +1 -1
- package/dist/assets/{GameplaySessionTimeline-dhG-oiqd.js → GameplaySessionTimeline-CWudWnfd.js} +1 -1
- package/dist/assets/{ImageViewer-tlVvkdM4.js → ImageViewer-shZzMd91.js} +1 -1
- package/dist/assets/InspectorObjectPreview-BMOvJaOw.js +1 -0
- package/dist/assets/{JsonAssetDocument-CPmcWFPW.js → JsonAssetDocument-D_HXneWE.js} +1 -1
- package/dist/assets/{LiveModuleDocument-DL8QHSlk.js → LiveModuleDocument-BWjOzO_6.js} +1 -1
- package/dist/assets/{LutAssetDocument-BImiug2M.js → LutAssetDocument-DIc6nsht.js} +1 -1
- package/dist/assets/ModelAssetDocument-_CqTsX_A.js +1 -0
- package/dist/assets/{NonThreeAuthoringBootstrap-B40qmGGS.js → NonThreeAuthoringBootstrap-C-V23E1e.js} +1 -1
- package/dist/assets/Object3DDocumentToolbar-BfPH9jz5.js +1 -0
- package/dist/assets/Object3DDocumentViewport-BaXWtATg.js +2 -0
- package/dist/assets/{Object3DPreview-ClYDoH2L.js → Object3DPreview-BPHEr3vI.js} +1 -1
- package/dist/assets/OnlineAssetDetail-BxibUH6K.js +1 -0
- package/dist/assets/PlayBar-DRANyO01.js +1 -0
- package/dist/assets/{QuarksAssetDocument-B-VOj-n4.js → QuarksAssetDocument-4Dne3EHx.js} +1 -1
- package/dist/assets/ReactCanvasControls-K98jOX9b.js +1 -0
- package/dist/assets/RootSelectionOverlay-BQC12Gdd.js +1 -0
- package/dist/assets/{ShaderAssetDocument-Kn8IvRGV.js → ShaderAssetDocument-W3ZjLCkt.js} +4 -4
- package/dist/assets/ShadowEditor-DP1LWynl.js +1 -0
- package/dist/assets/{SourceAssetViewer-CLQ95VSD.js → SourceAssetViewer-BGUeDAEv.js} +1 -1
- package/dist/assets/StageHost-V_0opXFt.js +2 -0
- package/dist/assets/{StoryPreviewMount-D2lg37et.js → StoryPreviewMount-Di8uMovM.js} +1 -1
- package/dist/assets/{ThreeBoardDocument-BAgHrbtu.js → ThreeBoardDocument-tgcaZDqQ.js} +2 -2
- package/dist/assets/{ThreeIsolationSceneContent-DbYIylZQ.js → ThreeIsolationSceneContent-BAKurKW5.js} +1 -1
- package/dist/assets/{ToolObject3DPreview-WEi6C9uU.js → ToolObject3DPreview-CffvGJ1h.js} +1 -1
- package/dist/assets/Toolbar-uLgsrB2z.js +1 -0
- package/dist/assets/{TransientHint-BpDLhRLd.js → TransientHint-CgmkrmKF.js} +1 -1
- package/dist/assets/{VideoViewer-DMV8lf4P.js → VideoViewer-ClUJ6_uy.js} +1 -1
- package/dist/assets/ViewportShadingMenu-Bdkc6jcd.js +1 -0
- package/dist/assets/{active-ingest-DA426a81.js → active-ingest-CnAeQcuQ.js} +3 -3
- package/dist/assets/{animation-clock-Bm80XdqP.js → animation-clock-fLmY_3--.js} +1 -1
- package/dist/assets/{animation-mixers.service-DK64IuYq.js → animation-mixers.service-DiecMX_A.js} +1 -1
- package/dist/assets/{animation-timeline.utility-D-g0zrOl.js → animation-timeline.utility-C71vPJgs.js} +1 -1
- package/dist/assets/{asset-budget-asset.menu-CEgP0Kiw.js → asset-budget-asset.menu-BDRDWrvx.js} +1 -1
- package/dist/assets/{asset-budget.action-D4R1c3wi.js → asset-budget.action-tQmNGQHC.js} +1 -1
- package/dist/assets/{asset-budget.document-Syzjn1U1.js → asset-budget.document-BthgX37Z.js} +1 -1
- package/dist/assets/{asset-budget.menu-BbRiqXeM.js → asset-budget.menu-DfyWVH6p.js} +1 -1
- package/dist/assets/{asset-editor-persistence-BGWIqZdk.js → asset-editor-persistence-BQgjOCrm.js} +1 -1
- package/dist/assets/{asset-loaders-C0KQI5eY.js → asset-loaders-5PIUVvmH.js} +1 -1
- package/dist/assets/{asset-preview-B1tDziF1.js → asset-preview-Cv7tfD98.js} +1 -1
- package/dist/assets/{audio-unlock.service-ucMfCVBw.js → audio-unlock.service-BvHvZjzx.js} +1 -1
- package/dist/assets/{audio.utility-BmE9WMUg.js → audio.utility-D9Vk_WYS.js} +1 -1
- package/dist/assets/autoplay.service-CFJoLPLw.js +1 -0
- package/dist/assets/{babylon-authoring-adapter-C8mFMXSr.js → babylon-authoring-adapter-Cg5ALSpr.js} +1 -1
- package/dist/assets/binding-resolver-C_9MBSMa.js +2 -0
- package/dist/assets/{blender-node-editor.document-C1YmwWls.js → blender-node-editor.document-B92MO51u.js} +1 -1
- package/dist/assets/{blender-properties-tab-B8lyjgj3.js → blender-properties-tab-CDVyDAbf.js} +1 -1
- package/dist/assets/{blender-runtime-host-CyQlImSR.js → blender-runtime-host-CuniE0sy.js} +1 -1
- package/dist/assets/{blender-runtime-skin-BK7ShZ6z.js → blender-runtime-skin-B_tOz5j5.js} +1 -1
- package/dist/assets/{blender-runtime.document-B0nVQs0P.js → blender-runtime.document-DxUwLiEW.js} +1 -1
- package/dist/assets/{blender-timeline.document-CMcdE2CK.js → blender-timeline.document-BdEEoQbK.js} +1 -1
- package/dist/assets/{blender-uv-editor.document-CjqNo4sZ.js → blender-uv-editor.document-EMSUlRh4.js} +1 -1
- package/dist/assets/{blender-version.status-OsFoc9SA.js → blender-version.status-DtfwUahB.js} +1 -1
- package/dist/assets/{blender.command-C6NmRBo5.js → blender.command-BkBML2SY.js} +1 -1
- package/dist/assets/blender.keymap-BmOBRY7p.js +1 -0
- package/dist/assets/{board-guides-BEKPgD9M.js → board-guides-_3R1t_-2.js} +1 -1
- package/dist/assets/bridge.command-VnplZ81v.js +3 -0
- package/dist/assets/{browserAll-lF_dLQVz.js → browserAll-BCmkqg8n.js} +1 -1
- package/dist/assets/build-player.document-DV7YcJQt.js +1 -0
- package/dist/assets/build-profiles.document-CZxDuhzz.js +2 -0
- package/dist/assets/{build-progress.status-Bo1ZgJcb.js → build-progress.status-Dk5u3C67.js} +1 -1
- package/dist/assets/build-session-BGe0eGrQ.js +9 -0
- package/dist/assets/{build.action-DRX2IcYt.js → build.action-Bdj4ZEL_.js} +1 -1
- package/dist/assets/{build.command-BGvLaLG0.js → build.command-DAWiYvPa.js} +1 -1
- package/dist/assets/build.header--xqH6uTP.js +1 -0
- package/dist/assets/{build.menu-UenrjPWS.js → build.menu-BiRNC_xc.js} +1 -1
- package/dist/assets/{build.service-BIUoTY6l.js → build.service-Dw9K6VSF.js} +1 -1
- package/dist/assets/{camera-DrvaM47S.js → camera-C-qXzXFf.js} +1 -1
- package/dist/assets/{camera-runtime.inspector-CjJALNO8.js → camera-runtime.inspector-BDrwWRlU.js} +1 -1
- package/dist/assets/canvas-design-mount-DLn49Zle.js +6 -0
- package/dist/assets/canvas-entry-runtime-DVeh71nC.js +2 -0
- package/dist/assets/{canvas-preview-frames-C0QTagA3.js → canvas-preview-frames-B5xFRjhQ.js} +1 -1
- package/dist/assets/{canvas-story-capture.service-Dgjr-rT1.js → canvas-story-capture.service-DQ_leYyi.js} +2 -2
- package/dist/assets/{capability-coverage-DZ-onC5j.js → capability-coverage-DQgg6UJe.js} +3 -3
- package/dist/assets/{collaboration-presence-BVIQuN1l.js → collaboration-presence-BOS1t8wI.js} +1 -1
- package/dist/assets/{collider-C7SbIYKY.js → collider-Bf4Uk6LW.js} +1 -1
- package/dist/assets/{component-board.service-CWFaGMCO.js → component-board.service-CpVXGhz5.js} +2 -2
- package/dist/assets/{component-board.service-BEsFAw4_.js → component-board.service-DFSSCaCf.js} +2 -2
- package/dist/assets/{component-board.service-q_TM9BCw.js → component-board.service-DgujG90T.js} +2 -2
- package/dist/assets/{component-contracts.service-CPbfXE1h.js → component-contracts.service-Bc_2Xxh_.js} +1 -1
- package/dist/assets/{component-instance-root-B0C5oNEm.js → component-instance-root-df4ofoOR.js} +1 -1
- package/dist/assets/{component-verbs.command-oNtGgzQL.js → component-verbs.command-DGzZAV_Z.js} +1 -1
- package/dist/assets/component-verbs.service-D1rVRogp.js +1 -0
- package/dist/assets/{config-_wCzzlM_.js → config-D-EAAhqP.js} +4 -4
- package/dist/assets/{configurations-BXU4GGbV.js → configurations-_HZOWZPy.js} +1 -1
- package/dist/assets/{connection.status-Yvt0bX0r.js → connection.status-CCX-mgmr.js} +1 -1
- package/dist/assets/{constraints.inspector-4r8jWq5a.js → constraints.inspector-CwEEREsf.js} +1 -1
- package/dist/assets/{content-bounds-BeuIXKYu.js → content-bounds-DKBD7nsv.js} +1 -1
- package/dist/assets/{contract-system-adapters-Bic_7sev.js → contract-system-adapters-h6OUBRYA.js} +1 -1
- package/dist/assets/{coverage.service-DcpEoBuf.js → coverage.service-CV7b5Sqn.js} +2 -2
- package/dist/assets/create-runtime-Bg2uYMfh.js +3 -0
- package/dist/assets/{curve-DVd18iAX.js → curve-BKuiAPpj.js} +1 -1
- package/dist/assets/{data-asset-DfQ2Pjse.js → data-asset-7Nfmx-28.js} +1 -1
- package/dist/assets/{data-ref-CWnkj-HX.js → data-ref-DyFQqqX6.js} +1 -1
- package/dist/assets/debug-bridge-CESAxmlz.js +1 -0
- package/dist/assets/{debug-registry-P0_YQGWd.js → debug-registry-l7k5Hjc8.js} +1 -1
- package/dist/assets/{deferred-ingest-play-BdR4qGk6.js → deferred-ingest-play-Bej67_y9.js} +2 -2
- package/dist/assets/{design-time-canvas-mount-DPQeHSN2.js → design-time-canvas-mount-CFW9ZWuk.js} +2 -2
- package/dist/assets/{design-time-layers-ChswRUJt.js → design-time-layers-CQgnmqc8.js} +1 -1
- package/dist/assets/{design-time-mount.service-Ks-5Wkcs.js → design-time-mount.service-DJeAPUB_.js} +2 -2
- package/dist/assets/{design-time-mount.service-Ca-DZGFV.js → design-time-mount.service-_R1UDCw3.js} +2 -2
- package/dist/assets/{design-time-react-mount-C85KfXOd.js → design-time-react-mount-CFvIk_rV.js} +1 -1
- package/dist/assets/{document-preview-three-DThkjI1S.js → document-preview-three-5cbuuJMH.js} +1 -1
- package/dist/assets/{dom-authoring-adapter-BrLU8IJ_.js → dom-authoring-adapter-CoESNvrM.js} +1 -1
- package/dist/assets/{draco3d-B2cwv46o.js → draco3d-Sk9K4AUT.js} +1 -1
- package/dist/assets/{edit-mode-audio.service-D4ITNbsm.js → edit-mode-audio.service-CH6J-8N7.js} +1 -1
- package/dist/assets/{edit-mode-authoring-DeCxPcHM.js → edit-mode-authoring-DBjaBTxM.js} +1 -1
- package/dist/assets/{edit-mode-networking.service-BNv-FTRh.js → edit-mode-networking.service-C4o2pGHX.js} +1 -1
- package/dist/assets/editor-api-D2azVray.js +1 -0
- package/dist/assets/{editor-layers-BDJnAAzj.js → editor-layers-B4oYfpj8.js} +1 -1
- package/dist/assets/{editor-shell-store-ChLcVeNB.js → editor-shell-store-Bh1S7M54.js} +1 -1
- package/dist/assets/{entity-object-JmYMfLsx.js → entity-object-B_5Gc0Ky.js} +1 -1
- package/dist/assets/{extend-Cc-nEa_A.js → extend-DcEyE5jI.js} +1 -1
- package/dist/assets/fork-menu-CKjNh3MO.js +1 -0
- package/dist/assets/{frame-debugger-store-DaCbAYSW.js → frame-debugger-store-D5YViF_8.js} +1 -1
- package/dist/assets/{game-contract-seams-BnPFGLll.js → game-contract-seams-C0AVYwvO.js} +1 -1
- package/dist/assets/{game-css-scope-transform-D_p7cVgW.js → game-css-scope-transform-8GOvVu1s.js} +1 -1
- package/dist/assets/game-document.service-FdG_gFPU.js +1 -0
- package/dist/assets/game-eval.command-4wa9vqWE.js +2 -0
- package/dist/assets/{game-module-access-o3iXZpCA.js → game-module-access-DulnT3NH.js} +1 -1
- package/dist/assets/game-network-Bo_nlDR5.js +22 -0
- package/dist/assets/{gameplay-export-BzYzLZPi.js → gameplay-export-K5AcStVC.js} +1 -1
- package/dist/assets/{gameplay-replay-BwdxV4oF.js → gameplay-replay-CnWnlogY.js} +1 -1
- package/dist/assets/gameplay.command-DoWqBWhH.js +1 -0
- package/dist/assets/{generation-jobs-BZhOMrp-.js → generation-jobs-CiabIfR0.js} +1 -1
- package/dist/assets/generation.service-D2yeZaJu.js +1 -0
- package/dist/assets/{generations-DVDht_31.js → generations-DU9rCeQR.js} +1 -1
- package/dist/assets/{generations.status-BvzgHlyk.js → generations.status-3CrPw_n5.js} +1 -1
- package/dist/assets/{hierarchy-marks-Cc_3lxw6.js → hierarchy-marks-C25dY2fR.js} +1 -1
- package/dist/assets/{hosted-asset-materialization-BpbnhJac.js → hosted-asset-materialization-DYdcFlDf.js} +1 -1
- package/dist/assets/{index-0Lm0Nf1M.css → index-B5WjeCHm.css} +1 -1
- package/dist/assets/{index-C1c3eOmm.js → index-BcH5GC3b.js} +1 -1
- package/dist/assets/{index-cNc-iFbq.js → index-BsYc2Oyj.js} +1 -1
- package/dist/assets/{index-SS9EugVg.js → index-C20Flc1s.js} +2 -2
- package/dist/assets/{index-Ck3JFh48.js → index-C4AUQbmq.js} +1 -1
- package/dist/assets/{index-DUZeuA7g.js → index-CC1puVjo.js} +1 -1
- package/dist/assets/{index-BRJMIUK0.js → index-CaG87ZF-.js} +321 -321
- package/dist/assets/index-CwCDkEl1.js +1 -0
- package/dist/assets/{index-C3Pw-9So.js → index-Kb9_s5aP.js} +1 -1
- package/dist/assets/{index-BeK4RPgj.js → index-n3QdTv-T.js} +1 -1
- package/dist/assets/{inference-diagnostics-xecGdohW.js → inference-diagnostics-MGcIHEX6.js} +1 -1
- package/dist/assets/{ingest-boot-viewport-DAt8WFSy.js → ingest-boot-viewport-D2okO6JI.js} +1 -1
- package/dist/assets/ingest-siblings-CkxW__go.js +1 -0
- package/dist/assets/{ingest-source-persistence-Dmdo-UBp.js → ingest-source-persistence-6peGfPAS.js} +1 -1
- package/dist/assets/{ingest.service-vbCucMz7.js → ingest.service-Cc73WMIW.js} +1 -1
- package/dist/assets/{inspect-Dr4qvDpJ.js → inspect-C8RP8G5F.js} +1 -1
- package/dist/assets/instances.command-CxKGnrNl.js +1 -0
- package/dist/assets/{json-history-resource-DwS10tqD.js → json-history-resource-CTXRV4GD.js} +1 -1
- package/dist/assets/layered-pick-B_-BRrRD.js +1 -0
- package/dist/assets/{light-DcFqVCmv.js → light-CskDQ8gF.js} +1 -1
- package/dist/assets/{live-project-verbs-C3LzprCe.js → live-project-verbs-BOAQN3ME.js} +1 -1
- package/dist/assets/{machine.document-BzZxubYQ.js → machine.document-BxOoCOo9.js} +1 -1
- package/dist/assets/{machines.finder-BR02bfVG.js → machines.finder-CqEceWzS.js} +1 -1
- package/dist/assets/{material-B_V78pTt.js → material-BwFzKPi0.js} +1 -1
- package/dist/assets/{material-factory-COz7qZhC.js → material-factory-qB9pzcQf.js} +1 -1
- package/dist/assets/{mesh-DcmO-mWI.js → mesh-5--4qA-C.js} +1 -1
- package/dist/assets/model-asset-sections.service-TZ2SaBmH.js +1 -0
- package/dist/assets/{model-inspection-CXHxrafK.js → model-inspection-MrJY0U_-.js} +1 -1
- package/dist/assets/{model-thumbnail-BEKPWg4l.js → model-thumbnail-uk-2sblh.js} +1 -1
- package/dist/assets/{models.finder-c1I0tp2M.js → models.finder-rk8dhgO8.js} +1 -1
- package/dist/assets/module-mode-B79jV5tQ.js +2 -0
- package/dist/assets/mount-canvas-ingest-root-BhaYNuhY.js +2 -0
- package/dist/assets/mount-dom-ingest-root-BQb1u0LX.js +2 -0
- package/dist/assets/mount-ingest-root-BC3-1Cw1.js +2 -0
- package/dist/assets/mount-manifest-QJOB11Kv.js +1 -0
- package/dist/assets/{mount-three-ingest-root-DVbACDUy.js → mount-three-ingest-root-DIDBfvIH.js} +1 -1
- package/dist/assets/{mounted-authoring-Clftxx0x.js → mounted-authoring-B7RL_V28.js} +1 -1
- package/dist/assets/{mounted-story-viewport-source-B4-eAYGI.js → mounted-story-viewport-source-CnYhX3vW.js} +1 -1
- package/dist/assets/{native-debug-module-2_HVupdg.js → native-debug-module-B-rWJfWE.js} +1 -1
- package/dist/assets/{navigation-CH3-zr1n.js → navigation-BVu-aVmF.js} +1 -1
- package/dist/assets/{navmesh.menu-Dfi-Pk-8.js → navmesh.menu-C3M63eR4.js} +1 -1
- package/dist/assets/{navmesh.service-Cz7QFY-M.js → navmesh.service-B0H1fUfn.js} +1 -1
- package/dist/assets/network-observer.service-CiR4Q9Q0.js +1 -0
- package/dist/assets/network.utility-CNG3eJ0E.js +1 -0
- package/dist/assets/{object3d-document-session-registry-DJDEDM0p.js → object3d-document-session-registry-OjqzJ86S.js} +2 -2
- package/dist/assets/{oid-transform-D5Kxt6ij.js → oid-transform-Bzc2ZJSH.js} +1 -1
- package/dist/assets/{particles-vRp0Lf3o.js → particles-Be7AvO4c.js} +1 -1
- package/dist/assets/pixi-authoring-adapter-B42K4md-.js +1 -0
- package/dist/assets/{pixi-live-write-target-BjDsBQbp.js → pixi-live-write-target-D56tQEe_.js} +1 -1
- package/dist/assets/play.command-CIGRq8ow.js +2 -0
- package/dist/assets/presentation-DGBuGP6i.js +1 -0
- package/dist/assets/{product-CxmUIxmr.js → product-BN31wSnB.js} +1 -1
- package/dist/assets/{profiler.action-Dzy9DuAc.js → profiler.action-D57Kj9ym.js} +1 -1
- package/dist/assets/{profiler.menu-jLDO3U6N.js → profiler.menu-Dh9Q5DDx.js} +1 -1
- package/dist/assets/{profiler.utility-Do2Bw7MY.js → profiler.utility-DLNySW3w.js} +1 -1
- package/dist/assets/{project-authoring-session-C3eusefK.js → project-authoring-session-LCJAwGrD.js} +2 -2
- package/dist/assets/{properties-bone-constraints.inspector-B_PbSMV7.js → properties-bone-constraints.inspector-CaIDq5nN.js} +1 -1
- package/dist/assets/{properties-bone.inspector-CMDEQuBd.js → properties-bone.inspector-D2fcQGMF.js} +1 -1
- package/dist/assets/{properties-collection.inspector-D7Ay8yRj.js → properties-collection.inspector-CF5AtTAd.js} +1 -1
- package/dist/assets/{properties-constraints.inspector-DS1fZgXK.js → properties-constraints.inspector-Bj2itDrS.js} +1 -1
- package/dist/assets/{properties-data.inspector-k2pGN2Mp.js → properties-data.inspector-BfRqk0Xo.js} +1 -1
- package/dist/assets/{properties-material.inspector-Bb3yAGUx.js → properties-material.inspector-Bf8H0mvu.js} +1 -1
- package/dist/assets/{properties-modifiers.inspector-BcJfe-Wy.js → properties-modifiers.inspector-BKShc1TH.js} +1 -1
- package/dist/assets/{properties-object.inspector-CUSfXJuq.js → properties-object.inspector-YBh8ABnN.js} +1 -1
- package/dist/assets/{properties-output.inspector-BTVW2kn1.js → properties-output.inspector-CVkzfs-l.js} +1 -1
- package/dist/assets/{properties-particles.inspector-Cw0fxx3B.js → properties-particles.inspector-ChDpAq-2.js} +1 -1
- package/dist/assets/{properties-physics.inspector-C-0bD2bu.js → properties-physics.inspector-BLEM7aMj.js} +1 -1
- package/dist/assets/{properties-render.inspector-C8D5UpjX.js → properties-render.inspector-vU4D9xLL.js} +1 -1
- package/dist/assets/{properties-scene.inspector-HjK6QHGg.js → properties-scene.inspector-C-DoN-kL.js} +1 -1
- package/dist/assets/{properties-texture.inspector-CckZgUaI.js → properties-texture.inspector-DySxy1oU.js} +1 -1
- package/dist/assets/{properties-view-layer.inspector-C1ajtVSk.js → properties-view-layer.inspector-DEKxMahJ.js} +1 -1
- package/dist/assets/{properties-world.inspector-BiT_EdT-.js → properties-world.inspector-m5qL_TQV.js} +1 -1
- package/dist/assets/r3f-design-session-C0DPEChS.js +2 -0
- package/dist/assets/{r3f-physics-binding-DzrbpqjM.js → r3f-physics-binding-Bgzzd4ol.js} +1 -1
- package/dist/assets/{r3f-source-authoring-adapter-DbbeRcvt.js → r3f-source-authoring-adapter-C8oMjdTL.js} +2 -2
- package/dist/assets/{react-canvas-navigation-Cp3cOHJa.js → react-canvas-navigation-Jowa_lJq.js} +1 -1
- package/dist/assets/react-inspector.service-TfTdj_Qk.js +1 -0
- package/dist/assets/{react-story-board-GaXqr03H.js → react-story-board-Bx7qYytV.js} +1 -1
- package/dist/assets/{react-three-rapier.esm-U8J7g6tH.js → react-three-rapier.esm-BR2ttgLS.js} +1 -1
- package/dist/assets/{react-world-authoring-adapter-DOjv2pYm.js → react-world-authoring-adapter-C1jPW_cN.js} +1 -1
- package/dist/assets/{realm-services-CnY105XU.js → realm-services-DefTrXnY.js} +1 -1
- package/dist/assets/{reflection-probe-capture.inspector-DqSW9p1v.js → reflection-probe-capture.inspector-C-6zrzZb.js} +1 -1
- package/dist/assets/{registry-CaCdF63N.js → registry-Z28XSZHF.js} +1 -1
- package/dist/assets/{relative-import-specifier-BFKIWEWs.js → relative-import-specifier-DQzkawgj.js} +1 -1
- package/dist/assets/{render-env-BkKZ4uMA.js → render-env-BZ7LsGfk.js} +1 -1
- package/dist/assets/{render-features-rxbawsRb.js → render-features-C7QwmhCo.js} +1 -1
- package/dist/assets/{render-settings-DS5leCed.js → render-settings-BBvkacR3.js} +1 -1
- package/dist/assets/{resolve-three-CVnMRHxw.js → resolve-three-C7zDbK29.js} +9 -9
- package/dist/assets/{root-seam-contract-CxLZaRio.js → root-seam-contract-rGNbiX6q.js} +1 -1
- package/dist/assets/run-selection-BUeubtHj.js +2 -0
- package/dist/assets/{scene-capture-0a-bTjT8.js → scene-capture-BTWgUzhI.js} +1 -1
- package/dist/assets/{scene-document.service-CeDwVA7t.js → scene-document.service-DJJp-la1.js} +2 -2
- package/dist/assets/{scene-framing-BQt72ZCw.js → scene-framing-PVMqGU8h.js} +1 -1
- package/dist/assets/{seeded-random-BgCwIAAU.js → seeded-random-38To73fI.js} +1 -1
- package/dist/assets/{setup-renderer-Cwkl1Ar6.js → setup-renderer-OOw1SykJ.js} +1 -1
- package/dist/assets/{source-object3d-authoring-adapter-DF679Ncb.js → source-object3d-authoring-adapter-RmutT5Dt.js} +1 -1
- package/dist/assets/{source-persistence-backend-CwLYVPXj.js → source-persistence-backend-HviqjKZ2.js} +1 -1
- package/dist/assets/{stage-keyboard-B8BEW592.js → stage-keyboard-DDi7S27C.js} +1 -1
- package/dist/assets/stage-overlay-set-olkNSZmq.js +1 -0
- package/dist/assets/{stage-presence-markers-DIP7YMcO.js → stage-presence-markers-cznMN_qq.js} +1 -1
- package/dist/assets/stage-transform-tools-BDUZqRIR.js +1 -0
- package/dist/assets/{standard-viewport-dressing-BCA51Tum.js → standard-viewport-dressing-BZyuxyVl.js} +1 -1
- package/dist/assets/{state-watch.action-DnR5Zjr-.js → state-watch.action-DEdb1mNa.js} +1 -1
- package/dist/assets/{state-watch.menu-wYLCLsAw.js → state-watch.menu-jWbUM3kw.js} +1 -1
- package/dist/assets/{state-watch.utility-CFG1Tu1m.js → state-watch.utility-DDmn3G25.js} +1 -1
- package/dist/assets/{story-capture-BmnwHGDV.js → story-capture-Dj1xkeKH.js} +1 -1
- package/dist/assets/{story-documents-BTo90DiA.js → story-documents-8ehMyYHo.js} +2 -2
- package/dist/assets/{story-documents.service-yagl1wGp.js → story-documents.service-BzQCuNBu.js} +1 -1
- package/dist/assets/{story-documents.service-B6v7Z-WE.js → story-documents.service-iNP-ORNr.js} +1 -1
- package/dist/assets/{story-media-presence-BqRMu572.js → story-media-presence-zTPlU9HR.js} +1 -1
- package/dist/assets/{story-pixi-preview-Da6afqLg.js → story-pixi-preview-B7THvSl7.js} +1 -1
- package/dist/assets/{story-presentation-DMSYRWaz.js → story-presentation-BLXYPadR.js} +1 -1
- package/dist/assets/{story-three-preview-R1JvrggS.js → story-three-preview-B1nNiPwP.js} +2 -2
- package/dist/assets/{studio-environment-DRxxq_QX.js → studio-environment-yaKaHPxH.js} +1 -1
- package/dist/assets/{surface-state-1lTOi8FD.js → surface-state-D9j6qNu8.js} +1 -1
- package/dist/assets/{syntactic-prop-specs-eiQXwMIc.js → syntactic-prop-specs-BTnsMOvH.js} +1 -1
- package/dist/assets/team-playtest.service-Ds9tkO4q.js +1 -0
- package/dist/assets/{three-authoring-adapter-htbnVej2.js → three-authoring-adapter-BrkGH4cd.js} +1 -1
- package/dist/assets/three-authoring.service-DoamZDMx.js +2 -0
- package/dist/assets/{three-ingest-runtime-B7rtg3QE.js → three-ingest-runtime-CXKjNysA.js} +1 -1
- package/dist/assets/{three-integration-BdN5Nhsg.js → three-integration-CuAnYaTW.js} +2 -2
- package/dist/assets/three-integration.service-Db-VabIm.js +1 -0
- package/dist/assets/{three-TCuY32m_.js → three-oYrcK5SQ.js} +1 -1
- package/dist/assets/{three-projection-core-CG01r5Ta.js → three-projection-core-jBJVt6O0.js} +1 -1
- package/dist/assets/{three-state-DwFE3ay2.js → three-state-wXRU3rLr.js} +1 -1
- package/dist/assets/{three-story-capture.service-CvpV3v5a.js → three-story-capture.service-DMJRcqjr.js} +2 -2
- package/dist/assets/{three-story-model-C2r2BuiA.js → three-story-model-DgiAP-oQ.js} +1 -1
- package/dist/assets/{three-viewport-presentation-B0z_cECu.js → three-viewport-presentation-CgO3eWJ-.js} +1 -1
- package/dist/assets/transform-mode-request-BnKpgRUW.js +1 -0
- package/dist/assets/transport-strip-a9yLoPsI.js +1 -0
- package/dist/assets/transport.header-CpfoppXc.js +1 -0
- package/dist/assets/{tuples-DfWSY2tr.js → tuples-CKsHOV9T.js} +1 -1
- package/dist/assets/ui-board-document-DtTR_mBr.js +2 -0
- package/dist/assets/{user-data-Bpj7diUS.js → user-data-CqOoAowZ.js} +1 -1
- package/dist/assets/{utility-view-state-CAfbFbKQ.js → utility-view-state-Db97zwDz.js} +1 -1
- package/dist/assets/{viewport-door-Bj_ZIP85.js → viewport-door-DVkMQazS.js} +1 -1
- package/dist/assets/{viewport-root-presentation-vgxsTyj4.js → viewport-root-presentation-B35t51xX.js} +1 -1
- package/dist/assets/{viewport-surface-status-cwCiBGa7.js → viewport-surface-status-D5kZtFW5.js} +1 -1
- package/dist/assets/{webworkerAll-Cm3gTjWi.js → webworkerAll-CfKEb4Ao.js} +1 -1
- package/dist/assets/{workspace-arrangement-BdAlBwvd.js → workspace-arrangement-DIMM7ska.js} +1 -1
- package/dist/assets/world-documents-C4t3iOD-.js +1 -0
- package/dist/assets/world-root-stage-binding-ydl3JN1a.js +1 -0
- package/dist/assets/{xstate-animation-binding-BGLxcZT_.js → xstate-animation-binding-aQEmNSpm.js} +1 -1
- package/dist/assets/{xstate-animation-meta-D_T441Ru.js → xstate-animation-meta-CnMX1Sc1.js} +1 -1
- package/dist-node/cli.js +29 -24
- package/dist-node/create.js +14 -9
- package/package.json +18 -16
- package/template/.agents/skills/vgai-music/SKILL.md +28 -4
- package/template/package.json +13 -11
- package/template/src/input.ts +1 -1
- package/template/src/main.ts +74 -3
- package/dist/assets/CanvasBoardDocument-mxL0oJ3N.js +0 -1
- package/dist/assets/CanvasSceneViewport-C_mapCwC.js +0 -1
- package/dist/assets/InspectorObjectPreview-W-y079DS.js +0 -1
- package/dist/assets/ModelAssetDocument-De1HKuxG.js +0 -1
- package/dist/assets/Object3DDocumentToolbar-Cks81kCS.js +0 -1
- package/dist/assets/Object3DDocumentViewport-DCwiSY3O.js +0 -2
- package/dist/assets/OnlineAssetDetail-CNuwSQRQ.js +0 -1
- package/dist/assets/PlayBar-bT8Xdrap.js +0 -1
- package/dist/assets/ReactCanvasControls-CnJrPj-B.js +0 -1
- package/dist/assets/RootSelectionOverlay-CpaGluQu.js +0 -1
- package/dist/assets/ShadowEditor-CVtMlALn.js +0 -1
- package/dist/assets/StageHost-B89HKcvd.js +0 -2
- package/dist/assets/Toolbar-DkTHnQto.js +0 -1
- package/dist/assets/ViewportShadingMenu-CXPi6fl8.js +0 -1
- package/dist/assets/adapter-runtime-bindings-4cmsRvRh.js +0 -2
- package/dist/assets/autoplay.service-CjPnv3QW.js +0 -1
- package/dist/assets/binding-resolver-dE0GnZT5.js +0 -2
- package/dist/assets/blender.keymap-_rF_vRX8.js +0 -1
- package/dist/assets/bridge.command-BF00Iefm.js +0 -3
- package/dist/assets/build-profiles.document-CqNrDdh9.js +0 -2
- package/dist/assets/build-session-GZcSAfPN.js +0 -9
- package/dist/assets/build.header-Bt1kwHWl.js +0 -1
- package/dist/assets/canvas-design-mount-BbLW_Nci.js +0 -6
- package/dist/assets/canvas-entry-runtime-UNYuSfG0.js +0 -2
- package/dist/assets/component-verbs.service-CnA11bJq.js +0 -1
- package/dist/assets/create-runtime-DBfUy0SO.js +0 -3
- package/dist/assets/debug-bridge-D3_-EgRE.js +0 -1
- package/dist/assets/editor-api-BFTIRlWa.js +0 -1
- package/dist/assets/entry-adjudication-Dc18TIqT.js +0 -1
- package/dist/assets/fork-menu-DpKqRhF5.js +0 -1
- package/dist/assets/game-document.service-Chmt4065.js +0 -1
- package/dist/assets/game-eval.command-DRSvOJ_1.js +0 -2
- package/dist/assets/game-network-Ct2FQYmu.js +0 -1
- package/dist/assets/gameplay.command-Boqv1hnc.js +0 -1
- package/dist/assets/generation.service-o9aXlsx4.js +0 -1
- package/dist/assets/index-BHoAKyAC.js +0 -1
- package/dist/assets/ingest-siblings-BtiEXLnh.js +0 -1
- package/dist/assets/instances.command-BwayrqNm.js +0 -1
- package/dist/assets/layered-pick-kiQf53t5.js +0 -1
- package/dist/assets/model-asset-sections.service-CqSclZGY.js +0 -1
- package/dist/assets/module-mode-BH2R93XP.js +0 -2
- package/dist/assets/mount-canvas-ingest-root-D1z9i5B3.js +0 -2
- package/dist/assets/mount-dom-ingest-root-BAmmNxlm.js +0 -2
- package/dist/assets/mount-ingest-root-DYR0TMIt.js +0 -2
- package/dist/assets/mount-manifest-DdkFYdVA.js +0 -1
- package/dist/assets/network-observer.service-Ce83TdsU.js +0 -1
- package/dist/assets/network.utility-DFDul2Xb.js +0 -1
- package/dist/assets/pixi-authoring-adapter-BChknIdC.js +0 -1
- package/dist/assets/play-mode-DICV4cKP.js +0 -22
- package/dist/assets/play.command-NHyi5rzF.js +0 -2
- package/dist/assets/presentation-BeNFBfKg.js +0 -1
- package/dist/assets/r3f-design-session-B5GsZI5M.js +0 -2
- package/dist/assets/react-inspector.service-Bm0OnanU.js +0 -1
- package/dist/assets/run-selection-DzEkGesJ.js +0 -2
- package/dist/assets/stage-overlay-set-BGE03mqb.js +0 -1
- package/dist/assets/stage-transform-tools-BQB7EY4l.js +0 -1
- package/dist/assets/team-playtest.service-hLfjgScx.js +0 -1
- package/dist/assets/three-authoring.service-BIQAtVdX.js +0 -2
- package/dist/assets/three-integration.service-CS8Nvbd2.js +0 -1
- package/dist/assets/transform-mode-request-DzD9aUNA.js +0 -1
- package/dist/assets/transport-strip-CUjNltnb.js +0 -1
- package/dist/assets/transport.header-Bb4FpQ8J.js +0 -1
- package/dist/assets/ui-board-document-CCiiXjX9.js +0 -2
- package/dist/assets/world-documents-DBybpBq8.js +0 -1
- package/dist/assets/world-root-stage-binding-ZVYIgr74.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mount-canvas-ingest-root-D1z9i5B3.js","assets/index-BRJMIUK0.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-0Lm0Nf1M.css","assets/capability-coverage-DZ-onC5j.js","assets/game-contract-seams-BnPFGLll.js","assets/after-paint-CB4bz1-e.js","assets/babylon-authoring-adapter-C8mFMXSr.js","assets/json-history-resource-DwS10tqD.js","assets/source-persistence-backend-CwLYVPXj.js","assets/ingest-source-persistence-Dmdo-UBp.js","assets/active-ingest-DA426a81.js","assets/contract-system-adapters-Bic_7sev.js","assets/pixi-authoring-adapter-BChknIdC.js","assets/index-SS9EugVg.js","assets/component-instance-root-B0C5oNEm.js","assets/user-data-Bpj7diUS.js","assets/workspace-arrangement-BdAlBwvd.js","assets/pixi-transform-channels-P4rvmusc.js","assets/pixi-live-write-target-BjDsBQbp.js","assets/canvas-entry-runtime-UNYuSfG0.js","assets/debug-registry-P0_YQGWd.js","assets/canvas-preview-frames-C0QTagA3.js","assets/resolve-three-CVnMRHxw.js","assets/dom-authoring-adapter-BrLU8IJ_.js","assets/react-world-authoring-adapter-DOjv2pYm.js","assets/board-guides-BEKPgD9M.js","assets/relative-import-specifier-BFKIWEWs.js","assets/story-arg-descriptors-Ek86ExX7.js","assets/inspect-Dr4qvDpJ.js","assets/inference-diagnostics-xecGdohW.js","assets/writer-tw6EcuVO.js","assets/webgl-frame-capture-DdJkM2mi.js","assets/three.core-3arARmh6.js","assets/physics-registry-B2Jkp8e6.js","assets/system-adapters-rIC8FSGP.js","assets/ingest-boot-viewport-DAt8WFSy.js","assets/react-canvas-navigation-Cp3cOHJa.js","assets/CanvasSceneViewport-C_mapCwC.js","assets/RootSelectionOverlay-CpaGluQu.js","assets/eyedropper-session-bjPXnfeX.js","assets/layered-pick-kiQf53t5.js","assets/root-stacking-BEd9ZvxC.js","assets/react-story-board-GaXqr03H.js","assets/viewport-editor-controls-BYaAZ_Ku.js","assets/Toolbar-DkTHnQto.js","assets/transform-mode-request-DzD9aUNA.js","assets/TransientHint-BpDLhRLd.js","assets/surface-state-1lTOi8FD.js","assets/registry-CaCdF63N.js","assets/three-state-DwFE3ay2.js","assets/editor-shell-store-ChLcVeNB.js","assets/output-pass-HurwNl0G.js","assets/three.module-BLhyNg0e.js","assets/Pass-D1MRT672.js","assets/editor-layers-BDJnAAzj.js","assets/entity-object-JmYMfLsx.js","assets/three-contract-Dkt6PmWY.js","assets/mount-dom-ingest-root-BAmmNxlm.js","assets/binding-resolver-dE0GnZT5.js","assets/native-debug-module-2_HVupdg.js","assets/native-entry-surface-BE8LJNdu.js","assets/adapter-surface-Y37Nzcyw.js","assets/entry-adjudication-Dc18TIqT.js","assets/structural-signature-Dc7skRiy.js","assets/events-156d8d12.esm-CYeuVCYr.js","assets/index-bQE2NA0D.js","assets/realm-services-CnY105XU.js","assets/three-ingest-runtime-B7rtg3QE.js","assets/EffectComposer-BEAt0PtQ.js","assets/CopyShader-BzTUYzf6.js","assets/ShaderPass-DTnDQXm0.js","assets/CSS3DRenderer-BsAqfavI.js","assets/relative-path-guard-GiM7Lsz8.js","assets/react-root-BHA-cdrW.js","assets/mount-three-ingest-root-DVbACDUy.js","assets/scene-framing-BQt72ZCw.js","assets/mount-readiness-Ds0HvvLH.js","assets/loop-gate-report-N52EWFGD.js","assets/three-authoring-adapter-htbnVej2.js","assets/three-projection-core-CG01r5Ta.js","assets/three-TCuY32m_.js","assets/body-marks-RKb_LTwL.js","assets/user-data-dHvLdpwM.js","assets/object-marks-DwvIEBOK.js","assets/structural-ids-Br2zjINh.js","assets/object3d-authoring-subject-BDrxd1GA.js","assets/rapier-physics-adapter-CaZqWLu0.js","assets/r3f-physics-binding-DzrbpqjM.js","assets/renderer-ownership-BovSEcLv.js","assets/scene-capture-0a-bTjT8.js","assets/ingest-siblings-BtiEXLnh.js","assets/mounted-authoring-Clftxx0x.js","assets/crash-null-boundary-v3a0uEgw.js","assets/module-mode-BH2R93XP.js","assets/deferred-ingest-play-BdR4qGk6.js","assets/edit-mode-authoring-DeCxPcHM.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{gJ as k,au as d,_ as s,y as C,gK as S,M as u,gL as L,bo as c,bu as g,z as T,bn as y,ay as I,gM as F,br as D,go as O,bt as j,gN as V}from"./index-BRJMIUK0.js";import{q as $,t as x,g as _,u as W,a as z,v as N,c as B,w as K,x as q,i as G,y as H}from"./active-ingest-DA426a81.js";import{o as J}from"./three-state-DwFE3ay2.js";let M=null;const Q=new Set;function U(){for(const t of Q)t()}function gt(t,n){M=n?{worldId:t,window:n}:null,U(),k()}function X(){const t=M;if(!t)return null;const n=t.window.isHidden(),o=t.window.isSuspended(),e=t.window.suspensionReason();return{worldId:t.worldId,budgetMs:t.window.budgetMs,elapsedVisibleMs:Math.round(t.window.elapsedVisibleMs()),hidden:n,suspended:o,suspensionReason:e,reason:e==="hidden"?"waiting for first visible frame — tab is hidden (a hidden tab cannot render, so the capture window is parked, not counting down; bring the tab to the foreground)":e==="unfocused"?"waiting for the browser to resume frame presentation — the editor window is unfocused (WebKit can suspend requestAnimationFrame in this state, so the capture window is parked; focus the editor window)":e==="page-suspended"?"waiting for the browser to restore the suspended editor page — the capture window is parked, not counting down":o?"waiting for the browser to resume frame presentation — the capture window is parked":"waiting for the game's first rendered frame"}}function R(){const t=z();if(!t)return null;const n=t.kind==="three"?t.session.mount:void 0,o=t.kind==="canvas"?t.session.loop?.():void 0,e=$(n?.realmLoopVerdict?.())??o?.loop??null,r=n?.realmLoopVerdict?.()?.reason??o?.reason??null;return{worldId:t.worldId,kind:t.kind,playing:W(),loop:e,loopReason:r,canStep:_()?.canStep??!1,coverage:x()}}const Y=()=>s(()=>import("./mount-canvas-ingest-root-D1z9i5B3.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64])),Z=()=>s(()=>import("./mount-dom-ingest-root-BAmmNxlm.js"),__vite__mapDeps([65,1,2,3,4,5,6,7,8,9,10,11,12,66,67,68,28,19,69,70,71,40,39,72,60,73,74,27,75,76,77,78,61,79,80,81,18,17,15,31,32,33,34,35,36,37,38,43,56])),tt=()=>s(()=>import("./mount-three-ingest-root-DVbACDUy.js"),__vite__mapDeps([82,11,1,2,3,4,5,6,7,8,9,10,12,18,17,19,83,62,24,40,30,15,31,32,33,34,35,36,37,38,28,39,22,23,75,60,76,77,78,61,79,84,85,86,16,87,88,63,64,51,89,90,91,92,93,94,95,96,97,43,56,57,58,59]));function b(...t){return Y().then(n=>n.mountCanvasIngestRootFromManifest(...t))}function v(...t){return Z().then(n=>n.mountDomIngestRootFromManifest(...t))}function P(...t){return tt().then(n=>n.mountThreeIngestRootFromManifest(...t))}J(t=>{j()});V(()=>({ingest:R(),ingestCaptureWait:X()}));function l(t,n){u.error(`Ingest mount failed for "${n.worldId}" (${n.identity}): ${n.message}`,"ingest"),B(),N(),t.shell.setPlayState("stopped"),y(n),t.shell.notifyIngestEdit()}async function et(){try{return await C()}catch(t){return S(t)||u.error(`Ingest routing: this project's ${L} could not be read, so no root was mounted from it — ${c(t)}`,"ingest"),null}}function f(t){return T(t)}function p(t){const n=t.map(e=>`"${e.id}"`).join(", "),o=`a composite manifest declares exactly ONE ingest world in this slice — found ${t.length}: ${n}.`;u.error(`Manifest composite ingest route: ${o}`,"ingest");for(const e of t)y({worldId:e.id,kind:e.surface,identity:e.adapter.identity,message:o})}async function w(t,n,o,e,r){const{mountIngestSiblings:a}=await s(async()=>{const{mountIngestSiblings:E}=await import("./ingest-siblings-BtiEXLnh.js");return{mountIngestSiblings:E}},__vite__mapDeps([98,1,2,3,4,5,6,7,8,9,10,99,63,23,24,64,20,21,16,17,22,15,25,26,27,28,100,74,75,60,40,76,77,78,61,79,81,31,32,33,34,35,36,37,38,41,42,86,87,62,88,51,89,90,91,92,93,94,95,101,11,12,66,67,68,19,69,70,71,39,72,73,80])),i=await a(t,n,o,e,r);return K(i),i}function m(t,n,o){if(o.length===0)return;const e=O();if(!e)return;const a=[...e instanceof I?e.childAdapters().map(i=>({worldId:i.worldId,kind:i.kind,adapter:i.adapter,role:i.role,zOrder:i.zOrder,...i.label!==void 0?{label:i.label}:{},...i.parentRootId!==void 0?{parentRootId:i.parentRootId}:{}})):[{worldId:n.id,kind:n.surface,adapter:e}],...o.map(i=>({worldId:i.worldId,kind:F(t,i.worldId)?.surface??"unknown",adapter:i.authoring}))];D(new I(a))}async function nt(t,n){if(!n)return!1;const o=f(n);if(o.length===0)return!1;if(o.length>1)return p(o),!0;const e=o[0];if(e.adapter.identity!=="ingest-three")return!1;const r=d();if(!r)return u.error("Manifest declares an ingest-three world but no project is open — cannot auto-ingest","ingest"),!0;try{await P(t,e,r.rootPath);const a=g();if(a){const i=await w(n,e.id,a,r.rootPath,t);m(n,e,i)}}catch(a){l(t,{worldId:e.id,kind:e.surface,identity:e.adapter.identity,message:c(a)})}return!0}async function ot(t,n){if(!n)return!1;const o=f(n);if(o.length===0)return!1;if(o.length>1)return p(o),!0;const e=o[0];if(e.adapter.identity!=="ingest-pixi")return!1;const r=d();if(!r)return u.error("Manifest declares an ingest-pixi world but no project is open — cannot auto-ingest","ingest"),!0;try{await b(t,e,r.rootPath);const a=g();if(a){const i=await w(n,e.id,a,r.rootPath,t);m(n,e,i)}}catch(a){l(t,{worldId:e.id,kind:e.surface,identity:e.adapter.identity,message:c(a)})}return!0}async function rt(t,n){if(!n)return!1;const o=f(n);if(o.length===0)return!1;if(o.length>1)return p(o),!0;const e=o[0];if(e.adapter.identity!=="ingest-react")return!1;const r=d();if(!r)return u.error("Manifest declares an ingest-react world but no project is open — cannot auto-ingest","ingest"),!0;try{await v(t,n,e,r.rootPath);const a=g();if(a){const i=await w(n,e.id,a,r.rootPath,t);m(n,e,i)}}catch(a){l(t,{worldId:e.id,kind:e.surface,identity:e.adapter.identity,message:c(a)})}return!0}function it(t){return at(t,()=>st(t))}const h=new WeakMap;function at(t,n){let o=h.get(t);o||(o=new Map,h.set(t,o));const e=d()?.rootPath??"",r=o.get(e);if(r)return r;const a=n();return o.set(e,a),a}async function A(t){const{tryManifestModuleRoute:n}=await s(async()=>{const{tryManifestModuleRoute:e}=await import("./module-mode-BH2R93XP.js");return{tryManifestModuleRoute:e}},__vite__mapDeps([101,1,2,3,4,5,6,7,8,9,10,11,12,66,67,68,28,19,69,70,71,40,39,72,60,73,74,27,75,76,77,78,61,79,80,81]));if(await n(t))return;const o=await et();await nt(t,o)||await ot(t,o)||await rt(t,o)}async function st(t){const{deferredIngestPlayActive:n,ingestMountIsDeferredToPlay:o}=await s(async()=>{const{deferredIngestPlayActive:e,ingestMountIsDeferredToPlay:r}=await import("./deferred-ingest-play-BdR4qGk6.js");return{deferredIngestPlayActive:e,ingestMountIsDeferredToPlay:r}},__vite__mapDeps([102,1,2,3,4,5,6,7,8,9,10,103,18,12,11,17,19]));if(await o()){if(n())return;const{landIngestBootInEdit:e}=await s(async()=>{const{landIngestBootInEdit:r}=await import("./ingest-boot-viewport-DAt8WFSy.js");return{landIngestBootInEdit:r}},__vite__mapDeps([43,1,2,3,4,5,6,7,8,9,10,18,12,11,17,19]));e();return}await A(t)}const lt=Object.freeze(Object.defineProperty({__proto__:null,activeIngestKind:q,autoLaunchIngest:it,getIngestPlayControl:_,ingestStatusFacet:R,isIngestActive:G,launchIngestRoutes:A,mountCanvasIngestRootFromManifest:b,mountDomIngestRootFromManifest:v,mountThreeIngestRootFromManifest:P,unmountThreeIngestRoot:H},Symbol.toStringTag,{value:"Module"}));export{it as a,lt as m,gt as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{assertNever as u}from"./adapter-surface-Y37Nzcyw.js";import{a8 as c,a7 as f}from"./index-BRJMIUK0.js";import{c as l}from"./create-runtime-DBfUy0SO.js";import{m as h}from"./debug-bridge-D3_-EgRE.js";import{g}from"./debug-registry-P0_YQGWd.js";import{R as y}from"./seeded-random-BgCwIAAU.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"./binding-Bmxqznjk.js";import"./root-stacking-BEd9ZvxC.js";import"./assets-BcrMQHRv.js";import"./loader-BTUKnX5Q.js";import"./KTX2Loader-CaqVE6nY.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./setup-renderer-Cwkl1Ar6.js";import"./index-DHhMOs_s.js";import"./defaults-DKiBJCPN.js";import"./render-settings-DS5leCed.js";import"./render-features-rxbawsRb.js";import"./loop-gate-report-N52EWFGD.js";import"./system-slot-E2mEdiih.js";import"./user-data-dHvLdpwM.js";import"./object-marks-DwvIEBOK.js";import"./performance-profiler-OwnXQX0M.js";import"./play-mode-DICV4cKP.js";import"./adapter-runtime-bindings-4cmsRvRh.js";import"./native-debug-module-2_HVupdg.js";import"./native-entry-surface-BE8LJNdu.js";import"./contract-system-adapters-Bic_7sev.js";import"./game-contract-seams-BnPFGLll.js";import"./game-audio-CaGKzia4.js";import"./game-network-Ct2FQYmu.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-C3LzprCe.js";import"./capability-coverage-DZ-onC5j.js";import"./edit-mode-authoring-DeCxPcHM.js";import"./json-history-resource-DwS10tqD.js";import"./binding-resolver-dE0GnZT5.js";import"./entry-adjudication-Dc18TIqT.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-CnY105XU.js";import"./canvas-entry-runtime-UNYuSfG0.js";import"./three-ingest-runtime-B7rtg3QE.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./editor-presentation-activity-C7SNSmTd.js";import"./active-ingest-DA426a81.js";import"./ingest-source-persistence-Dmdo-UBp.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-vgxsTyj4.js";import"./mounted-authoring-Clftxx0x.js";import"./entity-object-JmYMfLsx.js";import"./user-data-Bpj7diUS.js";import"./workspace-arrangement-BdAlBwvd.js";import"./three-contract-Dkt6PmWY.js";import"./three-TCuY32m_.js";import"./editor-layers-BDJnAAzj.js";import"./component-instance-root-B0C5oNEm.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-htbnVej2.js";import"./source-persistence-backend-CwLYVPXj.js";import"./three-projection-core-CG01r5Ta.js";import"./body-marks-RKb_LTwL.js";import"./structural-ids-Br2zjINh.js";import"./object3d-authoring-subject-BDrxd1GA.js";import"./r3f-physics-binding-DzrbpqjM.js";import"./deferred-ingest-play-BdR4qGk6.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-DOjv2pYm.js";import"./board-guides-BEKPgD9M.js";import"./relative-import-specifier-BFKIWEWs.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-Dr4qvDpJ.js";import"./inference-diagnostics-xecGdohW.js";import"./writer-tw6EcuVO.js";import"./three-state-DwFE3ay2.js";import"./editor-shell-store-ChLcVeNB.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-Bj_ZIP85.js";function R(e){if(e.determinism?.seededRandom!==!0)return;const t=e.url?v(e.url):void 0;return e.explicitSeed??t??e.determinism.defaultSeed}function v(e){const t=new URLSearchParams(e.search).get(y);if(t===null||t==="")return;const r=Number(t);return Number.isFinite(r)?r:void 0}function b(){return typeof window<"u"}function E(e){if(typeof e!="object"||e===null)return!1;if(Array.isArray(e.deferredConfigurationKinds))return!0;const t=e.roots;return!Array.isArray(t)||t.length===0?!1:t.every(r=>{if(typeof r!="object"||r===null)return!1;const i=r.adapter;if(typeof i!="object"||i===null)return!1;const o=i.type;return o==="builtin"||o==="module"||o==="ingest"})}function M(e){return E(e)?e:f(e,{configurationKinds:"defer"})}function $(e,t){if(t?.adapter)return t.adapter;throw e.adapter.type==="module"?new Error(`mountManifestRoots: world "${e.id}" (three) declares a { module } adapter ("${e.adapter.module}") — mountManifestRoots never imports an arbitrary module path itself (no \`/@fs/\`, no dev server). Import the module yourself and supply the constructed adapter via entries["${e.id}"] = { kind: 'three', adapter }.`):e.adapter.type==="ingest"?new Error(`mountManifestRoots: world "${e.id}" (three) declares an { ingest } adapter — captured ingest roots require the editor's dev-server-backed mount machinery (an EditorStore plus in-realm scene capture, see resolveIngestDescriptor + mountThreeIngestRootFromManifest) and are not supported by mountManifestRoots (no porting aids, no hosted ingest routes).`):e.entry!==void 0?new Error(`mountManifestRoots: world "${e.id}" (three) declares \`entry\` "${e.entry}" — supply entries["${e.id}"] = { kind: 'three', adapter } (for a default-exported world, the editor builds it from the entry module with \`resolveR3FEntryAdapterForEditor\`). Got ${t===void 0?"no entry at all":"an entry with no `adapter`"}.`):new Error(`mountManifestRoots: world "${e.id}" is default-three with no \`entry\` — this should have been rejected by manifest validation.`)}function w(e,t){if(t?.adapter)return t.adapter;throw new Error(`mountManifestRoots: world "${e.id}" (canvas) has no entries["${e.id}"] — a canvas world always needs a caller-supplied, already-constructed adapter (entries["${e.id}"] = { kind: 'canvas', adapter }, constructed from your own already-imported pixi module graph) — mountManifestRoots never value-imports pixi.js (mirrors create-runtime.ts's own pixi-free-core discipline).`)}function k(e,t){if(t?.adapter)return t.adapter;throw new Error(`mountManifestRoots: world "${e.id}" (react) has no entries["${e.id}"] — a react world always needs a caller-supplied, already-constructed \`RootAdapter<'dom'>\` (entries["${e.id}"] = { kind: 'dom', adapter }, mounting via your own already-imported react-dom \`createRoot\`) — mountManifestRoots never value-imports react/react-dom (mirrors create-runtime.ts's own react-free-core discipline).`)}function A(e,t){if(t!==void 0&&t.kind!==e.surface)throw new Error(`mountManifestRoots: entries["${e.id}"] declares kind "${t.kind}" but the manifest's root "${e.id}" uses surface "${e.surface}" — fix the entries key (or the manifest) so the two agree.`);const r={id:e.id,zOrder:e.zOrder,pausable:e.pausable,...t?.declaration===void 0?{}:{declaration:{root:e,...t.declaration}}};return e.surface==="three"?{...r,kind:"three",adapter:$(e,t)}:e.surface==="canvas"?{...r,kind:"canvas",adapter:w(e,t)}:e.surface==="dom"?{...r,kind:"dom",adapter:k(e,t)}:u(e.surface,"mountManifestRoots")}async function vt(e){const t=M(e.manifest),r=c(t);if(r.length===0)throw new Error("mountManifestRoots: manifest declares no roots — nothing to mount.");const i=e.entries??{},o=r.map(n=>A(n,i[n.id])),p=e.seedUrl??(b()?window.location:void 0),d=R({determinism:t.determinism,explicitSeed:e.seed,url:p}),a=await l({container:e.container,roots:o,width:e.width??t.resolution?.width,height:e.height??t.resolution?.height,headless:e.headless,...t.rendering===void 0?{}:{antialias:t.rendering.antialias},seed:d,playtest:e.playtest});t.determinism?.seededRandom;const s=g(a.game);if(s){t.configurations.some(m=>m.kind==="process")&&s.setRoomDeclared(!0);const n=h({registry:s,manifest:t,url:e.debugBridge?.url,window:e.debugBridge?.window});if(n){const m=a.stop;a.stop=()=>{n.uninstall(),m()}}}return a}export{vt as mountManifestRoots,R as resolveDeterminismSeed,M as resolveManifest};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as t}from"./game-network-Ct2FQYmu.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./_commonjsHelpers-D6-XlEtG.js";const e="workspace.service";function m(){t()}export{e as point,m as start};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./jsx-runtime-DPjLkJKQ.js";import{q as P,ey as x,ad as i,ew as u,Z as R,aK as M,dJ as T,eO as q}from"./index-BRJMIUK0.js";import{r as m}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";function W(t){return t?{connectionState:t.getConnectionState?.(),roomInfo:t.getRoomInfo?.(),stats:t.getReplicationStats?.()}:null}function K(t){return t?{stateTree:typeof t.getStateSnapshot=="function",messageLog:typeof t.messageEvents=="function",rates:typeof t.getRates=="function",conditioning:typeof t.getConditioning=="function"&&typeof t.setConditioning=="function",connection:typeof t.getConnectionState=="function",room:typeof t.getRoomInfo=="function",stats:typeof t.getReplicationStats=="function",identity:typeof t.getPlayerIdentity=="function",identitySettable:typeof t.setPlayerIdentity=="function",traffic:typeof t.getTrafficByType=="function",send:typeof t.sendMessage=="function",ping:typeof t.ping=="function",server:typeof t.inspectServer=="function"}:null}class L{constructor(n=500){this.capacity=n}entries=[];lastSeq=0;paused=!1;pull(n){if(this.paused||!n?.messageEvents)return 0;const r=n.messageEvents(this.lastSeq);if(r.length===0)return 0;for(const o of r)this.entries.push(o),o.seq>this.lastSeq&&(this.lastSeq=o.seq);return this.entries.length>this.capacity&&this.entries.splice(0,this.entries.length-this.capacity),r.length}get all(){return this.entries}clear(){this.entries=[]}}function V(t,n){const r=n.trim().toLowerCase();return r?t.filter(o=>o.type.toLowerCase().includes(r)):[...t]}class N{constructor(n=60){this.capacity=n}values=[];push(n){this.values.push(n),this.values.length>this.capacity&&this.values.shift()}get data(){return this.values}get latest(){return this.values.length>0?this.values[this.values.length-1]:null}}class z{msgsIn=new N;msgsOut=new N;bytesIn=new N;bytesOut=new N;sample(n){this.msgsIn.push(n.msgsInPerSec),this.msgsOut.push(n.msgsOutPerSec),n.bytesInPerSec!==void 0&&this.bytesIn.push(n.bytesInPerSec),n.bytesOutPerSec!==void 0&&this.bytesOut.push(n.bytesOutPerSec)}}function _(t,n,r,o=1){if(t.length<2)return"";const a=Math.max(1,...t),d=r-o*2,f=n/(t.length-1);return t.map((j,b)=>{const g=b*f,l=o+d*(1-j/a);return`${g.toFixed(1)},${l.toFixed(1)}`}).join(" ")}const J={disconnected:i.content.muted,connecting:i.semantic.warning,connected:i.semantic.success,error:i.semantic.danger},k={fontFamily:i.typography.mono,fontSize:x.base};function I({children:t,testId:n}){return e.jsx("div",{"data-testid":n,style:{padding:u[4],color:i.content.muted,fontSize:x.base,fontStyle:"italic"},children:t})}function G(t){return t!==null&&typeof t=="object"}function U(t){return typeof t=="string"?`"${t}"`:typeof t=="number"?Number.isInteger(t)?String(t):t.toFixed(3):String(t)}function A({type:t}){return t?e.jsx("span",{"data-testid":"net-tree-type",style:{color:i.content.dim,marginLeft:6},children:t}):null}function B({name:t,value:n,depth:r,path:o=[],edit:a,remove:d,typeOf:f}){const[j,b]=m.useState(r===0),[g,l]=m.useState(null),[h,p]=m.useState(null),S={...k,paddingLeft:8+r*14,lineHeight:"18px",whiteSpace:"nowrap"};if(!G(n)){const s=a&&(typeof n=="number"||typeof n=="string"||typeof n=="boolean"),c=y=>{l(null),a?.(o,y).then(()=>p(null),C=>p(C instanceof Error?C.message:String(C)))},w=y=>{if(typeof n=="number"){const C=Number(y);return Number.isFinite(C)?C:n}return y};return e.jsxs("div",{style:S,"data-testid":"net-tree-leaf","data-path":o.join("."),children:[e.jsx("span",{style:{color:i.content.primary},children:t}),e.jsx("span",{style:{color:i.content.muted},children:": "}),g!==null?e.jsx(M,{"data-testid":"net-tree-edit",autoFocus:!0,value:g,onChange:y=>l(y.target.value),onKeyDown:y=>{y.key==="Enter"&&c(w(g)),y.key==="Escape"&&l(null)},onBlur:()=>l(null),style:{width:120}}):e.jsx("span",{"data-testid":s?"net-tree-value":void 0,title:s?typeof n=="boolean"?"Click to toggle on the server":"Click to edit on the server":void 0,style:{color:i.content.primary,cursor:s?"text":void 0},onClick:s?()=>typeof n=="boolean"?c(!n):l(String(n)):void 0,children:U(n)}),e.jsx(A,{type:o.length>0?f?.(o):null}),d&&o.length>0?e.jsx("button",{type:"button","data-testid":"net-tree-delete",title:"Delete this key on the server","aria-label":`Delete ${o.join(".")} on the server`,onClick:()=>d(o).then(()=>p(null),y=>p(y instanceof Error?y.message:String(y))),style:{marginLeft:8,border:0,background:"transparent",color:i.content.muted,cursor:"pointer"},children:"×"}):null,h?e.jsxs("span",{style:{color:i.semantic.danger},children:[" ",h]}):null]})}const v=Object.entries(n);return e.jsxs("div",{children:[e.jsxs("div",{style:{...S,cursor:"pointer",userSelect:"none"},"data-testid":"net-tree-branch","data-expanded":j||void 0,onClick:()=>b(s=>!s),children:[e.jsx("span",{style:{color:i.content.muted,display:"inline-block",width:12},children:e.jsx(q,{direction:j?"down":"right"})}),e.jsx("span",{style:{color:i.content.primary},children:t}),e.jsxs("span",{style:{color:i.content.dim},children:[" ",Array.isArray(n)?`[${v.length}]`:`{${v.length}}`]}),e.jsx(A,{type:o.length>0?f?.(o):null}),h?e.jsxs("span",{style:{color:i.semantic.danger},children:[" ",h]}):null,d&&o.length>0?e.jsx("button",{type:"button","data-testid":"net-tree-delete",title:"Delete this key on the server","aria-label":`Delete ${o.join(".")} on the server`,onClick:s=>{s.stopPropagation(),d(o).then(()=>p(null),c=>p(c instanceof Error?c.message:String(c)))},style:{marginLeft:8,border:0,background:"transparent",color:i.content.muted,cursor:"pointer"},children:"×"}):null]}),j&&v.map(([s,c])=>e.jsx(B,{name:s,value:c,depth:r+1,path:r===0?[s]:[...o,s],edit:a,remove:d,typeOf:f},s))]})}const D=96,H=22,X=m.memo(function({points:n,color:r}){return e.jsx("svg",{width:D,height:H,style:{display:"block",background:i.surface.inset,borderRadius:i.shape.small},role:"img","aria-label":"rate sparkline",children:n&&e.jsx("polyline",{points:n,fill:"none",stroke:r,strokeWidth:1.2})})});function O({label:t,series:n,unit:r,color:o,testId:a}){const d=n.latest;return e.jsxs("div",{"data-testid":a,style:{display:"flex",flexDirection:"column",gap:u[1]},children:[e.jsxs("div",{style:{fontSize:x.sm,color:i.content.muted},children:[t," ",e.jsx("span",{style:{color:i.content.primary,fontFamily:i.typography.mono},children:d===null?"n/a":`${d}${r}`})]}),e.jsx(X,{points:_(n.data,D,H),color:o})]})}function Z({event:t}){const n=t.direction==="in"?i.semantic.success:i.accent.default;return e.jsxs("div",{"data-testid":"net-log-row","data-direction":t.direction,style:{...k,display:"grid",gridTemplateColumns:"64px 24px 1fr 56px",gap:u[2],lineHeight:"17px",padding:`0 ${u[4]}`,opacity:t.dropped?.55:1},children:[e.jsxs("span",{style:{color:i.content.dim},children:[(t.time/1e3).toFixed(2),"s"]}),e.jsx("span",{style:{color:n},children:t.direction==="in"?"↓in":"↑out"}),e.jsxs("span",{style:{color:i.content.primary,textDecoration:t.dropped?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis"},children:[t.type,t.dropped?" (dropped)":""]}),e.jsx("span",{style:{color:i.content.muted,textAlign:"right"},children:t.size!==void 0?`${t.size} B`:"—"})]})}function Q({adapter:t}){const[n,r]=m.useState(()=>t.getConditioning?.()??{latencyMs:0,jitterMs:0,packetLoss:0}),o=t.getConditioningLimits?.()??{},a=d=>{r(d),t.setConditioning?.(d)};return e.jsxs("div",{"data-testid":"net-conditioner",style:{display:"flex",gap:u[4],alignItems:"center",padding:`${u[2]} ${u[4]}`},children:[e.jsx("span",{style:{fontSize:x.sm,color:i.content.muted},children:"Conditioner"}),e.jsx(T,{label:"latency ms",value:n.latencyMs,step:10,testId:"net-cond-latency",onChange:d=>a({...n,latencyMs:Math.max(0,d)})}),e.jsx(T,{label:"jitter ms",value:n.jitterMs,step:5,testId:"net-cond-jitter",onChange:d=>a({...n,jitterMs:Math.max(0,d)})}),o.packetLoss?e.jsx("span",{"data-testid":"net-cond-loss-absent",title:o.packetLoss,style:{fontSize:x.sm,color:i.content.muted},children:"loss: not simulated"}):e.jsx(T,{label:"loss %",value:n.packetLoss*100,step:5,testId:"net-cond-loss",onChange:d=>a({...n,packetLoss:Math.min(1,Math.max(0,d/100))})})]})}function Y({adapter:t,settable:n}){const[r,o]=m.useState(()=>t.getPlayerIdentity?.()?.name??""),a=()=>{const d=r.trim();d&&t.setPlayerIdentity?.({name:d})};return e.jsxs("div",{"data-testid":"net-identity",style:{display:"flex",gap:u[4],alignItems:"center",padding:`${u[2]} ${u[4]}`},children:[e.jsx("span",{style:{fontSize:x.sm,color:i.content.muted},children:"Player name"}),n?e.jsx(M,{"data-testid":"net-identity-name",value:r,onChange:d=>o(d.target.value),onBlur:a,onKeyDown:d=>{d.key==="Enter"&&d.currentTarget.blur()},style:{width:140}}):e.jsx("span",{"data-testid":"net-identity-name",style:{...k,color:i.content.primary},children:r||"—"})]})}function ee({view:t,caps:n,rates:r}){return e.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:u[6],alignItems:"center",padding:`${u[2]} ${u[4]}`,borderBottom:`1px solid ${i.boundary.default}`},children:[t.connectionState!==void 0?e.jsxs("span",{"data-testid":"net-connection-state",style:{color:J[t.connectionState]},children:["● ",t.connectionState]}):e.jsx(I,{testId:"net-connection-state-absent",children:"Connection state not provided by this adapter."}),t.roomInfo===void 0?e.jsx(I,{testId:"net-room-absent",children:"Room info not provided by this adapter."}):t.roomInfo?e.jsxs("span",{style:{...k,color:i.content.primary},children:[t.roomInfo.roomName," · ",t.roomInfo.roomId," · session ",t.roomInfo.sessionId]}):e.jsx("span",{style:{color:i.content.muted},children:"no room"}),t.stats?e.jsxs("span",{style:{color:i.content.muted},children:["entities ",e.jsx("span",{style:{color:i.content.primary},children:t.stats.entities})]}):e.jsx(I,{testId:"net-stats-absent",children:"Replication stats not provided by this adapter."}),n.rates?e.jsxs("div",{"data-testid":"net-sparklines",style:{display:"flex",gap:u[5]},children:[e.jsx(O,{label:"msgs in",unit:"/s",series:r.msgsIn,color:i.semantic.success,testId:"net-rate-msgs-in"}),e.jsx(O,{label:"msgs out",unit:"/s",series:r.msgsOut,color:i.accent.default,testId:"net-rate-msgs-out"}),e.jsx(O,{label:"bytes in",unit:" B/s",series:r.bytesIn,color:i.semantic.success,testId:"net-rate-bytes-in"}),e.jsx(O,{label:"bytes out",unit:" B/s",series:r.bytesOut,color:i.accent.default,testId:"net-rate-bytes-out"})]}):e.jsx(I,{testId:"net-rates-absent",children:"Rates not provided by this adapter."})]})}function te(){const[,t]=m.useReducer(s=>s+1,0),n=m.useRef(new L),r=m.useRef(new z),o=m.useRef(null),[a,d]=m.useState(!1),[f,j]=m.useState(""),[b,g]=m.useState({type:"",payload:""});m.useEffect(()=>{const s=()=>{const $=P().systems.inspectedNetworking()??null;return $!==o.current&&(o.current=$,n.current=new L,n.current.paused=a,r.current=new z),$},c=()=>{const $=s();n.current.pull($),t()};c();const w=setInterval(c,250),y=setInterval(()=>{const F=s()?.getRates?.();F&&r.current.sample(F)},1e3),C=P().systems.inspectedNetworking()?.subscribe(()=>t());return()=>{clearInterval(w),clearInterval(y),C?.()}},[a]);const l=o.current??P().systems.inspectedNetworking()??null,h=K(l);if(!l||!h)return e.jsxs("div",{"data-testid":"network-inspector-empty",style:{padding:u[8],color:i.content.muted,fontSize:x.md,lineHeight:"18px"},children:[e.jsx("div",{style:{color:i.content.primary,marginBottom:u[2]},children:"No networking adapter is registered."}),"Games expose replication state to this inspector by registering a"," ",e.jsx("code",{style:k,children:"NetworkingAdapter"})," during setup:"," ",e.jsx("code",{style:k,children:"ctx.registerSystemAdapter?.('networking', adapter)"})," — see the third-person-arena example. Single-player games register none; there is nothing to inspect."]});const p=W(l),S=h.stateTree?l.getStateSnapshot?.():void 0,v=V(n.current.all,f);return e.jsxs("div",{"data-testid":"network-inspector",className:"vgai-content-frost",style:{flex:1,minHeight:0,display:"flex",flexDirection:"column",fontSize:x.md},children:[e.jsx(ee,{view:p,caps:h,rates:r.current}),h.identity?e.jsx(Y,{adapter:l,settable:h.identitySettable},l.getPlayerIdentity?.()?.name??""):null,h.conditioning?e.jsx(Q,{adapter:l}):e.jsx(I,{testId:"net-conditioner-absent",children:"Link conditioning not provided by this adapter."}),h.server?e.jsx(oe,{adapter:l,ownSession:p.roomInfo?.sessionId??null,ownRoom:p.roomInfo?.roomId??null,draft:b}):null,h.traffic?e.jsx(ne,{rows:l.getTrafficByType?.()??[]}):null,h.send?e.jsx(se,{adapter:l,ping:h.ping,draft:b,setDraft:g}):null,e.jsxs("div",{style:{flex:1,minHeight:0,display:"flex"},children:[e.jsx("div",{"data-testid":"net-state-tree",style:{flex:1,minWidth:0,overflow:"auto",borderRight:`1px solid ${i.boundary.default}`,padding:`${u[2]} 0`},children:h.stateTree?S!=null?e.jsx(B,{name:"state",value:S,depth:0,edit:l.editServerState?(s,c)=>l.editServerState(s,c):void 0,remove:l.deleteServerState?s=>l.deleteServerState(s):void 0,typeOf:l.stateFieldType?s=>l.stateFieldType(s):void 0}):e.jsx(I,{children:"Not connected — no replicated state to show."}):e.jsx(I,{testId:"net-tree-absent",children:"Replicated-state snapshot not provided by this adapter."})}),e.jsx("div",{"data-testid":"net-message-log",style:{flex:1,minWidth:0,display:"flex",flexDirection:"column"},children:h.messageLog?e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",gap:u[3],alignItems:"center",padding:u[2]},children:[e.jsx(R,{type:"button",variant:"ghost","data-testid":"net-log-pause",onClick:()=>{const s=!a;n.current.paused=s,d(s)},children:a?"Resume":"Pause"}),e.jsx(R,{type:"button",variant:"ghost","data-testid":"net-log-clear",onClick:()=>{n.current.clear(),l.clearTraffic?.(),t()},children:"Clear"}),e.jsx(M,{"data-testid":"net-log-filter",placeholder:"Filter by type",value:f,onChange:s=>j(s.target.value),style:{flex:1,minWidth:60}}),e.jsxs("span",{style:{fontSize:x.sm,color:i.content.muted},children:[v.length,"/",n.current.all.length]})]}),e.jsx("div",{style:{flex:1,minHeight:0,overflow:"auto"},children:v.length===0?e.jsx(I,{children:"No messages captured yet."}):v.map(s=>e.jsx(Z,{event:s},s.seq))})]}):e.jsx(I,{testId:"net-log-absent",children:"Message log not provided by this adapter."})})]})]})}function ne({rows:t}){const n={padding:`0 ${u[3]}`,textAlign:"right",whiteSpace:"nowrap"},r=o=>o>=1024?`${(o/1024).toFixed(1)} KiB`:`${o} B`;return e.jsx("div",{"data-testid":"net-traffic",style:{maxHeight:132,overflow:"auto",borderBottom:`1px solid ${i.boundary.default}`},children:t.length===0?e.jsx(I,{children:"No traffic yet."}):e.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:x.sm,...k},children:[e.jsx("thead",{children:e.jsxs("tr",{style:{color:i.content.muted},children:[e.jsx("th",{style:{...n,textAlign:"left"},children:"Type"}),e.jsx("th",{style:n,children:"In"}),e.jsx("th",{style:n,children:"Bytes in"}),e.jsx("th",{style:n,children:"Out"}),e.jsx("th",{style:n,children:"Bytes out"})]})}),e.jsx("tbody",{children:t.map(o=>e.jsxs("tr",{"data-testid":"net-traffic-row",children:[e.jsx("td",{style:{...n,textAlign:"left"},children:o.type}),e.jsx("td",{style:n,children:o.countIn||"-"}),e.jsx("td",{style:n,children:o.countIn?r(o.bytesIn):"-"}),e.jsx("td",{style:n,children:o.countOut||"-"}),e.jsx("td",{style:n,children:o.countOut?r(o.bytesOut):"-"})]},o.type))})]})})}function E(t){if(t.type.trim()==="")throw new Error("Name the message type first.");return{type:t.type,payload:t.payload.trim()===""?void 0:JSON.parse(t.payload)}}function se({adapter:t,ping:n,draft:r,setDraft:o}){const[a,d]=m.useState(null),f=()=>{d("…"),t.ping?.().then(l=>d(`${l} ms`),l=>d(l instanceof Error?l.message:String(l)))},[j,b]=m.useState(null),g=()=>{try{const l=E(r);t.sendMessage?.(l.type,l.payload),b(null)}catch(l){b(l instanceof Error?l.message:String(l))}};return e.jsxs("div",{"data-testid":"net-send",style:{display:"flex",gap:u[2],alignItems:"center",padding:u[2]},children:[e.jsx(M,{"data-testid":"net-send-type",placeholder:"Message type",value:r.type,onChange:l=>o({...r,type:l.target.value}),style:{width:140}}),e.jsx(M,{"data-testid":"net-send-payload",placeholder:'Payload (JSON), e.g. {"x": 1}',value:r.payload,onChange:l=>o({...r,payload:l.target.value}),style:{flex:1,minWidth:80}}),e.jsx(R,{type:"button",variant:"ghost","data-testid":"net-send-button",disabled:r.type.trim()==="",onClick:g,children:"Send as this client"}),n?e.jsxs(e.Fragment,{children:[e.jsx(R,{type:"button",variant:"ghost","data-testid":"net-ping",onClick:f,children:"Ping"}),a?e.jsx("span",{"data-testid":"net-rtt",style:{fontSize:x.sm,...k},children:a}):null]}):null,j?e.jsx("span",{"data-testid":"net-send-error",style:{color:i.semantic.danger,fontSize:x.sm},children:j}):null]})}function oe({adapter:t,ownSession:n,ownRoom:r,draft:o}){const[a,d]=m.useState(void 0),[f,j]=m.useState(void 0),[b,g]=m.useState(null);m.useEffect(()=>{let s=!0;const c=()=>{t.inspectServer?.(f).then(y=>{s&&d(y)},y=>{s&&g(y instanceof Error?y.message:String(y))})};c();const w=setInterval(c,2e3);return()=>{s=!1,clearInterval(w)}},[t,f]);const l=s=>{try{s()?.then(()=>g(null),c=>g(c instanceof Error?c.message:String(c)))}catch(c){g(c instanceof Error?c.message:String(c))}},h=s=>`${Math.round(s/1e3)} s`,p={padding:`0 ${u[3]}`,whiteSpace:"nowrap"};if(a===void 0)return null;if(a===null)return e.jsx(I,{testId:"net-server-absent",children:"The room server serves no Monitor view (its `server` configuration sets VGAI_ROOM_MONITOR=1)."});const S=a.room?.roomId,v=(s,c,w)=>e.jsx(R,{type:"button",variant:"ghost","data-testid":s,onClick:()=>l(w),children:c});return e.jsxs("div",{"data-testid":"net-server",style:{padding:`${u[2]} 0`,borderBottom:`1px solid ${i.boundary.default}`,fontSize:x.sm},children:[e.jsxs("div",{"data-testid":"net-server-summary",style:{padding:`0 ${u[3]}`,color:i.content.muted},children:["Server · ",a.rooms.length," room",a.rooms.length===1?"":"s"," · ",a.connections," ","connection",a.connections===1?"":"s",a.cpuPercent!==null?` · CPU ${a.cpuPercent.toFixed(0)}%`:"",a.memory?` · memory ${Math.round(a.memory.usedMb)} / ${Math.round(a.memory.totalMb)} MB`:"",a.room?` · state ${a.room.stateBytes} B`:""]}),e.jsx("table",{style:{borderCollapse:"collapse",...k},children:e.jsxs("tbody",{children:[a.rooms.map(s=>e.jsxs("tr",{"data-testid":"net-server-room","data-inspected":s.roomId===S||void 0,children:[e.jsx("td",{style:p,children:s.name}),e.jsx("td",{style:p,children:s.roomId}),e.jsxs("td",{style:p,children:[s.clients,s.maxClients!==null?` / ${s.maxClients}`:""," clients"]}),e.jsx("td",{style:p,children:s.locked?"locked":"open"}),e.jsx("td",{style:p,children:h(s.elapsedMs)}),e.jsx("td",{style:p,children:s.roomId===S?e.jsxs(e.Fragment,{children:[v("net-server-broadcast","Broadcast",()=>{const c=E(o);return t.broadcast?.(c.type,c.payload,s.roomId)}),v("net-server-dispose","Dispose",()=>t.disposeRoom?.(s.roomId))]}):e.jsx(R,{type:"button",variant:"ghost","data-testid":"net-server-inspect",onClick:()=>j(s.roomId),children:"Inspect"})})]},s.roomId)),a.room?.clients.map(s=>e.jsxs("tr",{"data-testid":"net-server-client",children:[e.jsx("td",{style:p,children:"client"}),e.jsxs("td",{style:p,children:[s.sessionId,s.sessionId===n?" (this client)":""]}),e.jsx("td",{style:p,children:h(s.elapsedMs)}),e.jsxs("td",{style:p,colSpan:3,children:[v("net-server-send","Send",()=>{const c=E(o);return t.sendToClient?.(s.sessionId,c.type,c.payload,S)}),v("net-server-disconnect","Disconnect",()=>t.disconnectClient?.(s.sessionId,S))]})]},s.sessionId))]})}),a.room&&a.room.roomId!==r&&a.room.state!==void 0?e.jsx("div",{"data-testid":"net-server-room-state",style:{padding:`${u[2]} 0`},children:e.jsx(B,{name:`room ${a.room.roomId}`,value:a.room.state,depth:0,edit:t.editServerState?(s,c)=>t.editServerState(s,c,S):void 0,remove:t.deleteServerState?s=>t.deleteServerState(s,S):void 0})}):null,b?e.jsx(I,{children:b}):null]})}const he="workspace.utility",me="Network",ge=25,fe=()=>P().systems.inspectedNetworking()!==null;function xe(){return e.jsx(te,{})}export{fe as available,xe as default,ge as order,he as point,me as title};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as B}from"./index-SS9EugVg.js";import{M as m,gq as U,bk as C,bl as j}from"./index-BRJMIUK0.js";import{c as W}from"./source-persistence-backend-CwLYVPXj.js";import{c as G}from"./component-instance-root-B0C5oNEm.js";import{J as X}from"./json-history-resource-DwS10tqD.js";import{a as Y,b as z}from"./pixi-transform-channels-P4rvmusc.js";function g(i){const t=i.constructor?.name?.toLowerCase()??"container";return t.includes("animatedsprite")?"animatedsprite":t.includes("nineslice")?"nineslicesprite":t.includes("tiling")?"tilingsprite":t.includes("sprite")?"sprite":t.includes("text")?"text":t.includes("graphics")?"graphics":"container"}function K(i){const t=V(i);if(t)return t;const e=Q(i);if(e)return e;const r=q(i);if(r)return r;const n=h(i);if(n)return n;const o=g(i),s=i.children?.length??0;return s>0?`${o} (${s})`:o}function V(i){const t=i.label?.trim();if(t){if(A(t)&&t!==i.constructor?.name)return t;if(!L(t))return t}}function A(i){return i.length<=2&&i===i.toLowerCase()}const Z=new Set(["container","displayobject","sprite","animatedsprite","nineslicesprite","tilingsprite","text","bitmaptext","htmltext","graphics","mesh"]);function L(i){return A(i)||i==="Object"||i==="Function"?!0:Z.has(i.replace(/^_+/,"").toLowerCase())}function q(i){const e=i.texture?.label?.trim();return!e||/^(_?texture)?(empty|white)$/i.test(e)?void 0:(e.split("/").pop()??e).replace(/\.[a-z0-9]+$/i,"")||void 0}function h(i){const t=i.constructor?.name;if(!(!t||L(t)))return t.replace(/^_+/,"")||void 0}function b(i){const t=i.replace(/^_+/,"");return t.length>0?t:void 0}function N(i){return"addChild"in i&&typeof i.addChild=="function"&&"children"in i}function Q(i){const t={seen:new WeakSet,budget:J};let e=i.parent;for(let r=0;r<8&&e&&typeof e=="object";r++){if(t.budget<=0)return;const n=S(e,i,t)??$(e,i,2,t);if(n)return n;e=e.parent}}const J=2e3;function x(i){return i.budget<=0?!1:(i.budget-=1,!0)}function w(i){return/^_?[A-Za-z][A-Za-zA-Z0-9]*$/.test(i)?!tt.has(i.replace(/^_+/,"")):!1}const tt=new Set(["parent","children","transform","position","origin","scale","pivot","skew","anchor","worldTransform","localTransform","groupTransform","relativeGroupTransform","renderGroup","parentRenderGroup","parentRenderGroupIndex","parentRenderLayer","relativeRenderGroupDepth","renderPipeId","instructionSet","childrenToUpdate","childrenRenderablesToUpdate","effects","filters","mask","bounds","boundsArea","visualBounds","gpuData","texture","events","eventsCount","updateFlags"]);function S(i,t,e){if(e.seen.has(i))return;e.seen.add(i);const r=k(i,t,void 0,e);if(r)return r;for(const[n,o]of Object.entries(i)){if(!x(e))return;if(!w(n))continue;const s=F(i,n,o,t);if(s)return s;const a=k(o,t,n,e);if(a)return a}}function k(i,t,e,r){const n=st(i);if(n)for(const[o,s]of n){if(!x(r))return;const a=et(i,s,rt(o)??e,t,r);if(a)return a}}function et(i,t,e,r,n){if(e){const o=F(t&&typeof t=="object"?t:i,e,t,r);if(o)return o}else if(t&&typeof t=="object"&&t.view===r){const o=h(t);if(o)return o}if(t&&typeof t=="object"&&!N(t))return S(t,r,n)}function rt(i){if(!(!i||/^\d+$/.test(i)))return w(i)||i.includes("-")?b(i)??i:void 0}function*it(i){for(let t=0;t<i.length;t++)yield[String(t),i[t]]}function*nt(i){for(const[t,e]of i.entries())yield[String(t),e]}function*ot(i){let t=0;for(const e of i)yield[String(t),e],t+=1}function st(i){if(!(!i||typeof i!="object")){if(Array.isArray(i))return it(i);if(i instanceof Map)return nt(i);if(i instanceof Set)return ot(i);if(Object.getPrototypeOf(i)===Object.prototype)return Object.entries(i)}}function F(i,t,e,r){if(e===r){const n=b(t);return n&&n.toLowerCase()!=="view"?h(e)??n:h(e)??h(i)??n}if(e&&typeof e=="object"&&e.view===r)return h(e)??b(t)}function $(i,t,e,r){const n=S(i,t,r);if(n)return n;if(!(e<=0))for(const[o,s]of Object.entries(i)){if(!x(r))return;if(!w(o)||!s||typeof s!="object"||N(s))continue;const a=$(s,t,e-1,r);if(a)return a}}const ct={idFor:(i,t)=>`w2d:${t.join("/")}:${g(i)}:${i.label??""}`};class at{constructor(t,e={}){this.root=t,e.overlay&&(this.overlay=e.overlay),this.identity=e.identity??ct,this.refresh()}byId=new Map;overlay={};dirty=!1;identity;names=new WeakMap;reindex(){this.byId.clear(),this.identity.beginWalk?.();let t=0,e=0;const r=(n,o)=>{const s=this.identity.idFor(n,o);n.__authId=s,this.byId.set(s,n),t++,g(n).includes("sprite")&&e++,n.children.forEach((a,c)=>{r(a,[...o,c])})};return this.root.children.forEach((n,o)=>{r(n,[o])}),{count:t,sprites:e}}refresh(){const t=this.reindex();for(const[e,r]of Object.entries(this.overlay))this.applyOverride(e,r);return t}roots(){return this.root.children.map(t=>this.toNode(t))}node(t){const e=this.byId.get(t);return e?this.toNode(e):null}displayObject(t){return this.byId.get(t)??null}nameOf(t){const e=this.names.get(t),r=t.parent??null,n=t.constructor,o=t.label??null,s=t.texture??null,a=t.children?.length??0;if(e&&e.parent===r&&e.type===n&&e.own===o&&e.texture===s&&e.childCount===a)return e;const c={label:K(t),kind:g(t),parent:r,type:n,own:o,texture:s,childCount:a};return this.names.set(t,c),c}toNode(t){const e=t,{label:r,kind:n}=this.nameOf(t);return{id:e.__authId??"",label:r,kind:n,parentId:t.parent?.__authId??null,childIds:t.children.map(o=>o.__authId??"")}}getTransform(t){const e=this.byId.get(t);return!e||!e.position||!e.scale?null:{position:[e.position.x,e.position.y],rotation:e.rotation,scale:[e.scale.x,e.scale.y]}}setTransform(t,e){const r=this.byId.get(t);if(!r)return;e.position&&r.position.set(e.position[0],e.position[1]),e.rotation!==void 0&&(r.rotation=e.rotation),e.scale&&r.scale.set(e.scale[0],e.scale[1]),this.overlay[t]??={};const n=this.overlay[t];e.position&&(n.position=e.position),e.rotation!==void 0&&(n.rotation=e.rotation),e.scale&&(n.scale=e.scale),this.dirty=!0}properties(t){const e=this.byId.get(t);if(!e)return[];const r=[{path:"label",label:"Name",type:"string",value:e.label??""},{path:"visible",label:"Visible",type:"boolean",value:e.visible},{path:"alpha",label:"Alpha",type:"number",value:e.alpha}];return"tint"in e&&r.push({path:"tint",label:"Tint",type:"color",value:e.tint}),r}set(t,e,r){const n=this.byId.get(t);n&&(n[e]=r,this.overlay[t]??={},e==="label"&&(this.overlay[t].label=r),e==="alpha"&&(this.overlay[t].alpha=r),e==="tint"&&(this.overlay[t].tint=r),e==="visible"&&(this.overlay[t].visible=r),this.dirty=!0)}applyOverride(t,e){const r=this.byId.get(t);r&&(e.label!==void 0&&(r.label=e.label),e.alpha!==void 0&&(r.alpha=e.alpha),e.position&&r.position.set(e.position[0],e.position[1]),e.rotation!==void 0&&(r.rotation=e.rotation),e.scale&&r.scale.set(e.scale[0],e.scale[1]),e.tint!==void 0&&"tint"in r&&(r.tint=e.tint),e.visible!==void 0&&(r.visible=e.visible))}applyOverlay(t){let e=0,r=0;for(const[n,o]of Object.entries(t)){if(!this.byId.has(n)){r++;continue}this.applyOverride(n,o),this.overlay[n]={...this.overlay[n],...o},e++}return{applied:e,orphaned:r}}isDirty(){return this.dirty}serializeOverlay(){return this.overlay}replaceOverlay(t){this.overlay=structuredClone(t);for(const[e,r]of Object.entries(this.overlay))this.applyOverride(e,r);this.dirty=!0}markClean(){this.dirty=!1}}const ut={count:0,sprites:0};class lt{constructor(t,e,r,n=o=>queueMicrotask(o)){this.root=t,this.index=e,this.mapping=r,this.scheduleWindowClose=n,this.refresh()}current={nodes:new Map,rootIds:[],stats:ut};projectionFresh=!1;refresh(){const t=this.index.refresh();return this.current=this.readProjection(t),this.openProjectionWindow(),t}project(){return this.projectionFresh?this.current:this.reproject()}reproject(){const t=this.index.reindex();return this.current=this.readProjection(t),this.openProjectionWindow(),this.current}invalidate(){this.projectionFresh=!1}openProjectionWindow(){this.projectionFresh||(this.projectionFresh=!0,this.scheduleWindowClose(()=>{this.projectionFresh=!1}))}projection(){return this.current}object(t){const e=this.current.nodes.get(t)?.object??null;return e===null||e.destroyed?null:e}node(t){const e=this.current.nodes.get(t);if(!e)return null;const r=this.index.node(t);return r?{...r,parentId:e.parentId,childIds:[...e.childIds]}:null}roots(){return this.current.rootIds.map(t=>this.node(t)).filter(t=>t!==null)}pick(t,e,r){return this.candidates(t,e,r)[0]??null}candidates(t,e,r){const n=this.pointFromClient(t,e);return n?(this.project(),this.hitIds(n,r)):[]}pointFromClient(t,e){const r=this.mapping?.surface()??null;if(!r)return null;const n=r.getBoundingClientRect();if(n.width<=0||n.height<=0)return null;const o=this.mapping?.pointFromClient?.(t,e,n)??null;if(this.mapping?.pointFromClient)return o;const s=Number(r.dataset?.vgaiStageWidth??n.width),a=Number(r.dataset?.vgaiStageHeight??n.height);return!(s>0)||!(a>0)?null:{x:(t-n.left)*(s/n.width),y:(e-n.top)*(a/n.height)}}hitIds(t,e){const r=[],n=[];this.collectHits(this.root,t,"visual",r),this.collectHits(this.root,t,"hitArea",n);const o=[],s=new Set;for(const a of[...r,...n]){const c=a.__authId;c&&!e(c)&&!s.has(c)&&(s.add(c),o.push(c))}return o}rect(t){const e=this.object(t);if(!e||typeof e.getBounds!="function")return null;const r=e.getBounds();return!(r.width>0)||!(r.height>0)?null:{x:r.x,y:r.y,width:r.width,height:r.height}}frame(t){const e=this.object(t);if(!e||typeof e.getLocalBounds!="function")return null;const r=e.getLocalBounds();if(!(r.width>0)||!(r.height>0))return null;const n=(o,s)=>{const a=e.toGlobal({x:o,y:s});return{x:a.x,y:a.y}};return{tl:n(r.x,r.y),tr:n(r.x+r.width,r.y),br:n(r.x+r.width,r.y+r.height),bl:n(r.x,r.y+r.height)}}contextRects(t){const e=this.node(t);if(!e)return{siblings:[]};const r=e.parentId?this.node(e.parentId)?.childIds??[]:this.current.rootIds,n=e.parentId?this.rect(e.parentId):null;return{...n?{parent:n}:{},siblings:r.filter(o=>o!==t).map(o=>this.rect(o)).filter(o=>o!==null)}}readProjection(t){const e=new Map,r=[],n=o=>{const s=this.index.displayObject(o.id);if(!s)return;const a={object:s,id:o.id,parentId:o.parentId,childIds:[...o.childIds]};e.set(o.id,a);for(const c of o.childIds){const u=this.index.node(c);u&&n(u)}};for(const o of this.index.roots())r.push(o.id),n(o);return{nodes:e,rootIds:r,stats:t}}collectHits(t,e,r,n){const o=t.children??[];for(let s=o.length-1;s>=0;s--){const a=o[s];if(!a.visible||!a.renderable)continue;a.updateLocalTransform();const c={x:0,y:0};a.localTransform.applyInverse(e,c),this.collectHits(a,c,r,n),this.contains(a,c,r)&&n.push(a)}}contains(t,e,r){if(!t.__authId)return!1;const n=t;return r==="hitArea"?n.hitArea?n.hitArea.contains(e.x,e.y):!1:typeof n.containsPoint=="function"?n.containsPoint(e):!1}}const I="pixi",dt="data-oid",ht="data-authoring-instance",ft="data-authoring-label",pt="data-authoring-component";function yt(i){if(!i||typeof i!="object")return;const t=i[dt];return typeof t=="string"&&t.length>0?t:void 0}function O(i,t){if(!i||typeof i!="object")return;const e=i[t];return typeof e=="string"&&e.length>0?e:void 0}function v(i){return O(i,ht)}function gt(i){return O(i,ft)}function mt(i){return O(i,pt)}function R(i){const t=v(i);return t?v(i.parent)!==t:!1}function bt(i){return R(i)?v(i):yt(i)}function vt(i,t,e=0){return G(`${I}:${i}:${t}`,e)}function xt(i,t){return`${I}:${i}:@${t.join(".")}`}function Wt(i,t){const e=`${I}:${i}:`;if(!t.startsWith(e))return null;const r=t.slice(e.length);if(r.startsWith("@"))return null;const n=r.indexOf("#"),o=n<0?r:r.slice(0,n);return o.length>0?o:null}function Gt(i){let t=new Map;return{beginWalk:()=>{t=new Map},idFor:(e,r)=>{const n=bt(e);if(n===void 0)return xt(i,r);const o=t.get(n)??0;return t.set(n,o+1),vt(i,n,o)}}}const E="#root";function wt(i){if(!(!i.position||!i.scale||!i.pivot||!i.skew))return{x:i.position.x,y:i.position.y,rotation:i.rotation,scaleX:i.scale.x,scaleY:i.scale.y,pivotX:i.pivot.x,pivotY:i.pivot.y,skewX:i.skew.x,skewY:i.skew.y}}function St(i,t){!i.position||!i.scale||!i.pivot||!i.skew||(i.position.set(t.x,t.y),i.scale.set(t.scaleX,t.scaleY),i.pivot.set(t.pivotX,t.pivotY),i.skew.set(t.skewX,t.skewY),i.rotation=t.rotation)}class It{constructor(t,e,r,n){this.root=t,this.onRestored=n;const o=e.shell.projectHistory;this.resource=o?new X({history:o,kind:"session-state",scope:"session",subject:{...r,id:`${r.id}/world-2d-structure`},displayName:"World 2D structure",capture:()=>this.capture(),conflictIdentity:s=>Object.fromEntries(Object.entries(s.placements).map(([a,c])=>[a,c.parent])),restore:async s=>{this.restore(s)}}):null}byUid=new Map;resource;track(t){return this.uidOf(t)}run(t,e){this.resource?.assertCanMutate();const r=this.capture(),n=e();return this.resource&&this.resource.record(t,r,this.capture()).catch(o=>{m.error(`[canvas] failed to journal "${t}" into project history — the structural edit is applied but has no history entry (it cannot be undone): ${o instanceof Error?o.message:String(o)}`,"authoring")}),n}dispose(){this.resource?.dispose(),this.byUid.clear()}uidOf(t){if(t===this.root)return E;const e=t,r=e.__vgaiStructUid;if(r&&this.byUid.get(r)===t)return r;const n=r??`s${crypto.randomUUID()}`;return e.__vgaiStructUid=n,this.byUid.set(n,t),n}capture(){const t={};for(const[e,r]of this.byUid){const n=r.parent??null,o=wt(r);t[e]={parent:n?this.uidOf(n):null,index:n?n.children?.indexOf(r)??-1:-1,...o?{pose:o}:{}}}return{placements:t}}restore(t){const e=Object.entries(t.placements);for(const[r,n]of e){if(n.parent!==null)continue;const o=this.byUid.get(r);o?.parent?.removeChild(o)}for(const[r,n]of e.filter(([,o])=>o.parent!==null).sort((o,s)=>o[1].index-s[1].index)){const o=this.byUid.get(r);if(!o)continue;const s=n.parent===E?this.root:this.byUid.get(n.parent);if(!s||typeof s.addChildAt!="function")continue;const a=s.children.length-(o.parent===s?1:0);s.addChildAt(o,Math.max(0,Math.min(n.index,a))),n.pose&&St(o,n.pose)}this.onRestored()}}const H=[{kind:"container",label:"Container"},{kind:"sprite",label:"Sprite"},{kind:"text",label:"Text"},{kind:"graphics",label:"Graphics"}],T=/\.(png|jpe?g|webp|gif|svg)(\?.*)?$/i,Ot="a canvas structural edit would have to add, delete or move a construction statement in the world's own source, and this lane plans property writes only — an editor-created node has no construction site there at all",_="origin",Ct="#ff2d92",jt="this world's write target has no origin write, so the pivot/anchor can be seen here but not dragged";function M(i){const t=i,e=t.anchor,r=t.texture;return e&&r?.orig?{anchor:e,texture:r}:null}function kt(i){const t=M(i);if(!t)return null;const e=i.bounds;return typeof e?.width=="number"&&typeof e.height=="number"?{x:e.width,y:e.height}:{x:t.texture.orig.width,y:t.texture.orig.height}}function Et(i){return H.find(e=>e.kind===i)?.label??i}function Tt(i,t){switch(t){case"container":return new i.Container;case"sprite":{const e=new i.Sprite(i.Texture.WHITE);return e.setSize(64,64),e}case"text":return new i.Text({text:"Text",style:{fill:16777215,fontSize:24}});case"graphics":return new i.Graphics().rect(0,0,100,100).fill(16777215);default:return null}}function P(i,t){const e=_t(i,t);At(t,e);for(const r of t.children??[])e.addChild(P(i,r));return e}function _t(i,t){if(t.constructor===i.Container)return new i.Container;if(t.constructor===i.Sprite){const e=t,r=new i.Sprite(e.texture);return r.anchor.set(e.anchor.x,e.anchor.y),r}if(t.constructor===i.Text){const e=t,r=new i.Text({text:e.text,style:e.style.clone()});return r.anchor.set(e.anchor.x,e.anchor.y),r}if(t.constructor===i.Graphics)return t.clone(!0);throw new Error(`"${t.label??t.constructor?.name??"this node"}" cannot be duplicated: a ${t.constructor?.name??"custom"} is constructed by the game's own code, and copying only its display half would put a lookalike with no behaviour into the world.`)}function At(i,t){t.label=i.label,t.position.set(i.position.x,i.position.y),t.scale.set(i.scale.x,i.scale.y),t.pivot.set(i.pivot.x,i.pivot.y),t.skew.set(i.skew.x,i.skew.y),t.rotation=i.rotation,t.alpha=i.alpha,t.visible=i.visible,"tint"in i&&"tint"in t&&(t.tint=i.tint)}function Lt(i){const t=new Set;return(i.x!==void 0||i.y!==void 0||i.originX!==void 0||i.originY!==void 0)&&t.add("position"),(i.width!==void 0||i.height!==void 0||i.scaleXFactor!==void 0||i.scaleYFactor!==void 0)&&(t.add("scale"),(i.width!==void 0||i.height!==void 0)&&t.add("position")),i.rotate!==void 0&&t.add("rotation"),[...t]}function Nt(i,t){const e=t*Math.PI/180/2,r=Math.sin(e),n=Math.cos(e),[o,s,a,c]=i.rotation;return[o*n+s*r,s*n-o*r,a*n+c*r,c*n-a*r]}function Ft(i,t){const e={position:[...i.transform.position],rotation:[...i.transform.rotation],scale:[...i.transform.scale]},r=t.rotate;r!==void 0&&(e.rotation=Nt(i.transform,r));const n=t.width;n!==void 0&&i.rect.width>0&&(e.scale[0]=i.transform.scale[0]*Math.max(1e-4,n/i.rect.width));const o=t.height;o!==void 0&&i.rect.height>0&&(e.scale[1]=i.transform.scale[1]*Math.max(1e-4,o/i.rect.height));const s=t.scaleStep,a=d=>s!==void 0&&s>0?Math.round(d/s)*s:d,c=d=>Math.abs(d)>=1e-4?d:d<0?-1e-4:1e-4,u=t.scaleXFactor;u!==void 0&&(e.scale[0]=c(a(i.transform.scale[0]*u)));const l=t.scaleYFactor;return l!==void 0&&(e.scale[1]=c(a(i.transform.scale[1]*l))),e}function $t(i,t,e,r){return r.originX!==void 0||r.originY!==void 0?{dx:r.originX!==void 0&&i?r.originX-i.x:0,dy:r.originY!==void 0&&i?r.originY-i.y:0}:{dx:t?(r.x??e.x)-t.x:0,dy:t?(r.y??e.y)-t.y:0}}class Rt{constructor(t,e,r){this.root=t,this.store=e,this.target=r.target,this.pixi=r.pixi??B,this.transforms={dimensions:()=>"2d",get:c=>{const u=this.a2d.getTransform(c);return u?z(u):{position:[0,0,0],rotation:[0,0,0,1],scale:[1,1,1]}},editability:(c,u)=>this.target.transformEditability(c,u),beginEdit:c=>this.target.beginTransformEdit(c),apply:(c,u)=>{this.target.writeTransform(c,Y(u)),this.notify()},endEdit:c=>this.target.endTransformEdit(c),...this.target.removeTransform?{remove:(c,u)=>this.target.removeTransform?.(c,u)}:{}},this.loadTexture=r.loadTexture??(c=>this.pixi.Assets.load(c)),this.capturePreview=r.capturePreview,this.structureHistory=new It(t,e,r.journal,()=>this.afterStructuralChange()),this.a2d=new at(t,{...r.identity?{identity:r.identity}:{}}),this.projector=new lt(t,this.a2d,{surface:r.surface??(()=>null),...r.pointFromClient?{pointFromClient:r.pointFromClient}:{}}),this.provenance=this.target.provenance,r.surface&&(this.pickable={pick:(c,u)=>{const l=this.projector.pick(c,u,d=>this.isPickLocked(d));return l&&this.groupOf(l)},candidates:(c,u)=>this.projector.candidates(c,u,l=>this.isPickLocked(l))},this.rects={rect:c=>this.projector.rect(c),frame:c=>this.projector.frame(c),contextRects:c=>this.projector.contextRects(c)}),r.stories&&(this.stories=r.stories),this.watchStructure(t),this.capabilities={transform:!0,inspectorFields:!0,persist:this.target.provenance.source==="source-code"&&this.target.persistence!==void 0},this.target.bind({a2d:this.a2d,store:e,journal:r.journal,notify:()=>this.notify()}),this.structure=this.target.structure??this.liveStructure,this.assetDrop=this.target.assetDrop??{accepts:(c,u)=>T.test(u)&&this.containerFor(c||null)!==null,drop:(c,u,l)=>this.dropAsset(c,u,l)};const o=this.target.persistence;o&&(this.persistence=o);const s=this.target.truth?.bind(this.target);s&&(this.truth={resolve:(c,u)=>s(c,u)},this.related=W(c=>s(c,"position").site)),!r.stories&&this.target.componentIdentity&&(this.stories=U("canvas",e.shell,c=>this.target.componentIdentity?.(c)??null));const a=this.target.instances?.();a&&(this.instances={describe:c=>a.describe(c),...a.openComponent?{openComponent:c=>a.openComponent?.(c)}:{},revert:(c,u)=>a.revert(c,u),applyToComponent:(c,u)=>a.applyToComponent(c,u)})}capabilities;provenance;pickable;rects;persistence;truth;related;structure;stories;instances;transforms;a2d;projector;target;pixi;structureHistory;loadTexture;capturePreview;listeners=new Set;boxEditSessions=new Map;lockedIds=new Set;groupedIds=new Set;refresh(){return this.projector.refresh()}previewImage(t,e,r){const n=this.projector.object(t);return n&&this.capturePreview?this.capturePreview(n,{width:e,height:r}):Promise.resolve(null)}notify(){for(const t of this.listeners)t()}watchedForStructure=[];structureNotifyQueued=!1;onStructureChanged=()=>{this.projector.invalidate(),!this.structureNotifyQueued&&(this.structureNotifyQueued=!0,queueMicrotask(()=>{this.structureNotifyQueued=!1,this.projector.reproject(),this.watchStructure(this.root),this.target.onReindex(),this.notify(),this.store.shell.notifyIngestEdit()}))};watchStructure(t){for(const r of this.watchedForStructure)r.off("childAdded",this.onStructureChanged),r.off("childRemoved",this.onStructureChanged);this.watchedForStructure=[];const e=r=>{typeof r.on=="function"&&typeof r.off=="function"&&(r.on("childAdded",this.onStructureChanged),r.on("childRemoved",this.onStructureChanged),this.watchedForStructure.push(r));for(const n of r.children??[])e(n)};e(t)}hierarchy={roots:()=>(this.projector.project(),this.projector.roots().map(t=>this.toEditorNode(t.id)).filter(t=>t!==null)),node:t=>this.toEditorNode(t)};toEditorNode(t){const e=this.projector.node(t);if(!e)return null;const r=this.projector.object(t),n=r?R(r):!1,o=n?mt(r):void 0;return{id:e.id,label:(n&&r?gt(r):void 0)??e.label,role:n?"component":"entity",kind:e.kind,...o?{typeLabel:o}:{},parentId:e.parentId,childIds:e.childIds}}selection={get:()=>[...this.store.shell.selectedEntityIds],set:t=>{this.store.shell.selectMultiple(t),this.notify()}};liveStructure={create:(t,e)=>this.createStructuralNode(t,e??null),remove:t=>this.removeStructuralNodes([t]),removeMany:t=>this.removeStructuralNodes(t),duplicate:t=>this.duplicateStructuralNode(t),reparent:(t,e)=>this.reparentStructuralNode(t,e),reorder:(t,e)=>this.reorderStructuralNode(t,e),creatableKinds:()=>H.map(t=>({...t}))};containerFor(t){if(!t)return this.root;const e=this.projector.object(t);return!e||typeof e.addChild!="function"?null:e}refuseStructure(t){return C({resolve:()=>j(t),record:()=>{},report:e=>m.warn(`[canvas] structural edit refused — ${e}`,"authoring")})}reportStructureLiveOnly(t){return C({resolve:()=>j(Ot),record:()=>{},report:e=>{if(this.target.reportStructureLiveOnly){this.target.reportStructureLiveOnly(t,e);return}m.log(`[canvas] ${t} is live-only — ${e}.`,"authoring")}})}afterStructuralChange(){this.projector.reproject(),this.watchStructure(this.root),this.target.onReindex(),this.notify(),this.store.shell.notifyIngestEdit()}idOf(t){return t.__authId??""}createStructuralNode(t,e){const r=this.containerFor(e);if(!r)return{id:"",ack:this.refuseStructure(`no node with id "${e}" can hold children.`)};const n=Tt(this.pixi,t);if(!n)return{id:"",ack:this.refuseStructure(`"${t}" is not a kind this canvas surface can construct.`)};n.label=Et(t);const o=`Create ${n.label}`;return this.structureHistory.track(r),this.structureHistory.track(n),this.structureHistory.run(o,()=>{r.addChild(n)}),this.afterStructuralChange(),{id:this.idOf(n),ack:this.reportStructureLiveOnly(o)}}removeStructuralNodes(t){const e=[];let r=null;for(const o of t){const s=this.projector.object(o);if(!s?.parent){r=this.refuseStructure(`"${o}" is not a removable node in this tree.`);continue}e.push(s)}if(e.length===0)return r??this.refuseStructure("the selection held no removable node.");const n=e.length===1?`Delete ${e[0].label??"node"}`:`Delete ${e.length} nodes`;for(const o of e)this.structureHistory.track(o),o.parent&&this.structureHistory.track(o.parent);return this.structureHistory.run(n,()=>{for(const o of e)o.parent?.removeChild(o)}),this.afterStructuralChange(),this.reportStructureLiveOnly(n)}duplicateStructuralNode(t){const e=this.projector.object(t),r=e?.parent??null;if(!e||!r)throw new Error(`"${t}" is not a duplicable node in this tree.`);const n=P(this.pixi,e);n.label=`${e.label||"node"} copy`;const o=`Duplicate ${e.label??"node"}`,s=r.children.indexOf(e);return this.structureHistory.track(r),this.structureHistory.track(n),this.structureHistory.run(o,()=>{r.addChildAt(n,s+1)}),this.afterStructuralChange(),{id:this.idOf(n),ack:this.reportStructureLiveOnly(o)}}reparentStructuralNode(t,e){const r=this.projector.object(t);if(!r)return this.refuseStructure(`"${t}" is not a node in this tree.`);const n=this.containerFor(e);if(!n)return this.refuseStructure(`no node with id "${e}" can hold children.`);if(n===r||this.isAncestorOf(r,n))return this.refuseStructure("a node cannot be reparented into itself or its own descendant.");const o=this.localToRootMatrix(r),s=this.localToRootMatrix(n),a=`Move ${r.label??"node"}`;return this.structureHistory.track(r),r.parent&&this.structureHistory.track(r.parent),this.structureHistory.track(n),this.structureHistory.run(a,()=>{n.addChild(r),r.setFromMatrix(s.clone().invert().append(o))}),this.afterStructuralChange(),this.reportStructureLiveOnly(a)}reorderStructuralNode(t,e){const r=this.projector.object(t),n=r?.parent??null;if(!r||!n)return this.refuseStructure(`"${t}" is not a reorderable node in this tree.`);const o=e?this.projector.object(e):null;if(e&&(!o||o.parent!==n))return this.refuseStructure(`"${e}" is not a sibling of "${t}".`);const s=`Reorder ${r.label??"node"}`;return this.structureHistory.track(n),this.structureHistory.track(r),this.structureHistory.run(s,()=>{const a=n.children.indexOf(r),c=o?n.children.indexOf(o):n.children.length;n.addChildAt(r,Math.max(0,a<c?c-1:c))}),this.afterStructuralChange(),this.reportStructureLiveOnly(s)}isAncestorOf(t,e){let r=e.parent;for(;r;){if(r===t)return!0;r=r.parent}return!1}localToRootMatrix(t){const e=[];let r=t;for(;r&&r!==this.root;)e.push(r),r=r.parent;const n=new this.pixi.Matrix;for(let o=e.length-1;o>=0;o--){const s=e[o];s.updateLocalTransform(),n.append(s.localTransform)}return n}assetDrop;async dropAsset(t,e,r){if(!T.test(e))return this.refuseStructure(`${e} is not an image. A canvas world mounts an image as a Sprite; a model or an audio file has no display object to become here.`);const n=this.containerFor(t||null);if(!n)return this.refuseStructure(`no node with id "${t}" can hold a dropped asset.`);let o;try{o=await this.loadTexture(e)}catch(u){return this.refuseStructure(`${e} could not be loaded as a texture: ${u instanceof Error?u.message:String(u)}`)}const s=new this.pixi.Sprite(o);s.anchor.set(.5,.5),s.label=e.split("/").pop()??"Sprite";const a=r?.position;if(a){const u=this.localToRootMatrix(n).clone().invert().apply({x:a[0],y:a[1]});s.position.set(u.x,u.y)}const c=`Add ${s.label}`;return this.structureHistory.track(n),this.structureHistory.track(s),this.structureHistory.run(c,()=>{n.addChild(s)}),this.afterStructuralChange(),this.reportStructureLiveOnly(c)}boxEdit={begin:t=>{const e=this.projector.rect(t);if(!e){this.boxEditSessions.delete(t);return}this.boxEditSessions.set(t,{id:t,rect:e,transform:this.transforms.get(t)}),this.transforms.beginEdit?.(t)},apply:(t,e)=>this.applyBoxEdit(t,e),end:t=>{const e=this.boxEditSessions.get(t);this.boxEditSessions.delete(t),e&&this.transforms.endEdit?.(t)},gizmoOrigin:t=>this.gizmoOriginOf(t)};gizmoOriginOf(t){const e=this.projector.object(t);if(!e||typeof e.getGlobalPosition!="function")return null;const r=e.getGlobalPosition();return{x:r.x,y:r.y}}applyBoxEdit(t,e){const r=this.boxEditSessions.get(t);if(!r||Lt(e).some(o=>this.transforms.editability?.(t,o).writable===!1))return;const n=Ft(r,e);this.transforms.apply(t,n),!(e.x===void 0&&e.y===void 0&&e.originX===void 0&&e.originY===void 0&&e.width===void 0&&e.height===void 0)&&this.repositionBoxEditBounds(t,r,e,n)}repositionBoxEditBounds(t,e,r,n){const o=this.projector.object(t);if(!o)return;const s=this.gizmoOriginOf(t),a=this.projector.rect(t),{dx:c,dy:u}=$t(s,a,e.rect,r),l=o.parent;if(l&&typeof l.toLocal=="function"){const d=l.toLocal({x:0,y:0}),f=l.toLocal({x:c,y:u});n.position[0]+=f.x-d.x,n.position[1]+=f.y-d.y}else n.position[0]+=c,n.position[1]+=u;this.transforms.apply(t,n)}spatialHandles={layers:t=>{const e=this.originOf(t);if(!e)return[];const r=this.target.transformEditability(t,"position"),n=!!this.target.writeOrigin&&r.writable;return[{id:`origin:${t}`,category:"origin",guides:[],handles:[{id:_,label:e.kind==="anchor"?"Sprite anchor":"Pivot",position:[e.world.x,e.world.y,0],color:Ct,writable:n,...n?{}:{reason:this.target.writeOrigin&&r.reason?r.reason:jt}}]}]},preview:(t,e,r)=>{this.moveOrigin(t,e,r,"preview")},commit:(t,e,r)=>this.moveOrigin(t,e,r,"commit")};originEditId=null;originOf(t){const e=this.projector.object(t);if(!e||typeof e.updateLocalTransform!="function")return null;const r=M(e),n=r?"anchor":"pivot",o=r?{x:r.anchor.x,y:r.anchor.y}:{x:e.pivot.x,y:e.pivot.y},s=r?{x:0,y:0}:o,a=this.localToRootMatrix(e).apply({x:s.x,y:s.y});return{kind:n,value:o,world:{x:a.x,y:a.y}}}moveOrigin(t,e,r,n){if(e!==_)return;const o=this.originOf(t),s=this.projector.object(t),a=this.target.writeOrigin;if(!o||!s||!a||!this.target.transformEditability(t,"position").writable)return;this.originEditId!==t&&(this.target.beginTransformEdit(t),this.originEditId=t),s.updateLocalTransform();const c=this.localToRootMatrix(s).clone().invert().apply({x:r[0],y:r[1]}),u=o.kind==="anchor"?{x:0,y:0}:o.value,l={x:c.x-u.x,y:c.y-u.y},d=o.kind==="anchor"?kt(s):null;if(o.kind==="anchor"&&(!d||d.x===0||d.y===0))return;const f=d?[o.value.x+l.x/d.x,o.value.y+l.y/d.y]:[c.x,c.y],p=s.localTransform,y=this.a2d.getTransform(t);if(a(t,o.kind,f),y&&this.target.writeTransform(t,{...y,position:[y.position[0]+p.a*l.x+p.c*l.y,y.position[1]+p.b*l.x+p.d*l.y]}),this.notify(),n==="commit"){const D=this.target.endTransformEdit(t);return this.originEditId=null,D}}inspector={properties:t=>[...this.target.properties(t),{path:"locked",label:"Locked",type:"boolean",group:"Visibility"},{path:"grouped",label:"Grouped",type:"boolean",group:"Visibility"}],get:(t,e)=>e==="locked"?this.lockedIds.has(t):e==="grouped"?this.groupedIds.has(t):this.target.get(t,e),set:(t,e,r)=>{if(e==="locked"||e==="grouped"){const n=e==="locked"?this.lockedIds:this.groupedIds;r===!0?n.add(t):n.delete(t),this.notify();return}return this.target.set(t,e,r)},remove:(t,e)=>this.target.remove?.(t,e)};groupOf(t){let e=t,r=t;for(;r;)this.groupedIds.has(r)&&(e=r),r=this.projector.node(r)?.parentId??null;return e}isPickLocked(t){let e=t;for(;e;){if(this.lockedIds.has(e))return!0;e=this.projector.node(e)?.parentId??null}return!1}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}dispose(){this.boxEditSessions.clear(),this.lockedIds.clear(),this.groupedIds.clear();for(const t of this.watchedForStructure)t.off("childAdded",this.onStructureChanged),t.off("childRemoved",this.onStructureChanged);this.watchedForStructure=[],this.structureHistory.dispose(),this.target.dispose(),this.listeners.clear()}}const Xt=Object.freeze(Object.defineProperty({__proto__:null,PixiAuthoringAdapter:Rt},Symbol.toStringTag,{value:"Module"}));export{Rt as P,bt as a,Gt as c,R as i,Wt as o,Xt as p,yt as r};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/babylon-authoring-adapter-C8mFMXSr.js","assets/index-BRJMIUK0.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-0Lm0Nf1M.css","assets/json-history-resource-DwS10tqD.js","assets/source-persistence-backend-CwLYVPXj.js","assets/ingest-source-persistence-Dmdo-UBp.js","assets/pixi-authoring-adapter-BChknIdC.js","assets/index-SS9EugVg.js","assets/component-instance-root-B0C5oNEm.js","assets/user-data-Bpj7diUS.js","assets/workspace-arrangement-BdAlBwvd.js","assets/pixi-transform-channels-P4rvmusc.js","assets/pixi-live-write-target-BjDsBQbp.js","assets/canvas-entry-runtime-UNYuSfG0.js","assets/debug-registry-P0_YQGWd.js","assets/mount-ingest-root-DYR0TMIt.js","assets/active-ingest-DA426a81.js","assets/game-contract-seams-BnPFGLll.js","assets/capability-coverage-DZ-onC5j.js","assets/contract-system-adapters-Bic_7sev.js","assets/three-state-DwFE3ay2.js","assets/editor-shell-store-ChLcVeNB.js","assets/output-pass-HurwNl0G.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/Pass-D1MRT672.js","assets/editor-layers-BDJnAAzj.js","assets/entity-object-JmYMfLsx.js","assets/three-contract-Dkt6PmWY.js","assets/module-mode-BH2R93XP.js","assets/binding-resolver-dE0GnZT5.js","assets/native-debug-module-2_HVupdg.js","assets/native-entry-surface-BE8LJNdu.js","assets/adapter-surface-Y37Nzcyw.js","assets/entry-adjudication-Dc18TIqT.js","assets/structural-signature-Dc7skRiy.js","assets/webgl-frame-capture-DdJkM2mi.js","assets/events-156d8d12.esm-CYeuVCYr.js","assets/index-bQE2NA0D.js","assets/realm-services-CnY105XU.js","assets/three-ingest-runtime-B7rtg3QE.js","assets/EffectComposer-BEAt0PtQ.js","assets/CopyShader-BzTUYzf6.js","assets/ShaderPass-DTnDQXm0.js","assets/CSS3DRenderer-BsAqfavI.js","assets/relative-path-guard-GiM7Lsz8.js","assets/react-root-BHA-cdrW.js","assets/mount-manifest-DdkFYdVA.js","assets/create-runtime-DBfUy0SO.js","assets/binding-Bmxqznjk.js","assets/root-stacking-BEd9ZvxC.js","assets/assets-BcrMQHRv.js","assets/loader-BTUKnX5Q.js","assets/KTX2Loader-CaqVE6nY.js","assets/GLTFLoader-KeoruJgS.js","assets/BufferGeometryUtils-B22h7jo4.js","assets/setup-renderer-Cwkl1Ar6.js","assets/index-DHhMOs_s.js","assets/defaults-DKiBJCPN.js","assets/render-settings-DS5leCed.js","assets/render-features-rxbawsRb.js","assets/seeded-random-BgCwIAAU.js","assets/loop-gate-report-N52EWFGD.js","assets/system-slot-E2mEdiih.js","assets/user-data-dHvLdpwM.js","assets/object-marks-DwvIEBOK.js","assets/performance-profiler-OwnXQX0M.js","assets/debug-bridge-D3_-EgRE.js","assets/adapter-runtime-bindings-4cmsRvRh.js","assets/game-audio-CaGKzia4.js","assets/game-network-Ct2FQYmu.js","assets/index-OZVqp6xS.js","assets/index-Da9JhEvW.js","assets/rapier-physics-adapter-CaZqWLu0.js","assets/live-project-verbs-C3LzprCe.js","assets/edit-mode-authoring-DeCxPcHM.js","assets/editor-presentation-activity-C7SNSmTd.js","assets/pixi-story-model-DNkfnWUV.js","assets/surface-content-Dg9Kkazf.js","assets/viewport-root-presentation-vgxsTyj4.js","assets/mounted-authoring-Clftxx0x.js","assets/three-TCuY32m_.js","assets/viewport-editor-controls-BYaAZ_Ku.js","assets/three-authoring-adapter-htbnVej2.js","assets/three-projection-core-CG01r5Ta.js","assets/body-marks-RKb_LTwL.js","assets/structural-ids-Br2zjINh.js","assets/object3d-authoring-subject-BDrxd1GA.js","assets/r3f-physics-binding-DzrbpqjM.js","assets/deferred-ingest-play-BdR4qGk6.js","assets/rrweb-Cd2ifIRP.js","assets/react-world-authoring-adapter-DOjv2pYm.js","assets/board-guides-BEKPgD9M.js","assets/relative-import-specifier-BFKIWEWs.js","assets/story-arg-descriptors-Ek86ExX7.js","assets/inspect-Dr4qvDpJ.js","assets/inference-diagnostics-xecGdohW.js","assets/writer-tw6EcuVO.js","assets/viewport-door-Bj_ZIP85.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{O as et,Y as Bt,X as Cn,lZ as An,l_ as xn,bF as Rn,bG as In,V as jt,l$ as zt,bz as kn,bA as On,bC as Nt,m0 as Dn,U as Fn,m1 as Gn,bB as Bn,M as S,q as C,jN as $t,m2 as jn,m3 as zn,m4 as Nn,m5 as W,ah as $n,l5 as Ut,af as Un,bs as ue,k7 as Vn,m6 as Wn,ar as Vt,m7 as qn,au as Ce,y as Wt,a8 as ge,km as vt,m8 as qt,_ as z,m9 as Ht,ma as Kt,kD as Yt,h3 as Xt,p as Hn,ks as Kn,mb as Yn,mc as Xn,md as Jn,me as Zn,mf as Qn,gM as er,gf as tr,ay as nr,br as Jt,mg as rr,mh as Zt,mi as sr,fX as or,bk as ar,bl as ir,eb as lr,gH as cr,mj as ur,go as dr,fC as fr}from"./index-BRJMIUK0.js";import{e as gr,i as Qt}from"./adapter-runtime-bindings-4cmsRvRh.js";import{B as wt}from"./edit-mode-authoring-DeCxPcHM.js";import{p as en,c as hr}from"./json-history-resource-DwS10tqD.js";import{a as tn}from"./binding-resolver-dE0GnZT5.js";import{i as pr,s as mr}from"./editor-presentation-activity-C7SNSmTd.js";import{E as nn,V as yr,W as vr,G as rn,B as Ve,l as _e,X as wr,g as br}from"./active-ingest-DA426a81.js";import{m as Lr}from"./pixi-story-model-DNkfnWUV.js";import{t as Er,d as _r}from"./surface-content-Dg9Kkazf.js";import{p as Mr,l as Sr}from"./viewport-root-presentation-vgxsTyj4.js";import{g as Pr}from"./seeded-random-BgCwIAAU.js";import{D as bt,g as sn}from"./debug-registry-P0_YQGWd.js";import{assertNever as Tr}from"./adapter-surface-Y37Nzcyw.js";import{r as Cr,o as Ar,s as xr}from"./three-authoring-adapter-htbnVej2.js";import{t as tt}from"./three-contract-Dkt6PmWY.js";import{mountDeferredIngestForPlay as Rr,exitDeferredIngestPlay as Ir}from"./deferred-ingest-play-BdR4qGk6.js";import{r as X}from"./rrweb-Cd2ifIRP.js";import{R as kr,w as Or}from"./react-world-authoring-adapter-DOjv2pYm.js";import{o as Dr}from"./three-state-DwFE3ay2.js";import{p as Fr}from"./viewport-door-Bj_ZIP85.js";async function Gr(t){try{const e=await fetch(`${et}/log-session`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"start",...t?{name:t}:{}})});return(await Cn(e,"Could not start a play log session")).file}catch{return null}}async function Br(){try{const t=await fetch(`${et}/log-session`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"end"})});Bt(t,"Could not end the play log session")}catch{}}async function on(t){if(t.length===0)return!0;try{const e=await fetch(`${et}/log-entries`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entries:t})});return Bt(e,"Could not flush play log entries"),!0}catch{return!1}}let m=(function(t){return t.info="info",t.warn="warn",t.error="error",t.debug="debug",t.trace="trace",t.fatal="fatal",t})({});const ee={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},an=Symbol.for("loglayer.lazy"),nt="[LazyEvalError]";function Z(t){return t!=null&&typeof t=="object"&&an in t}function Lt(t){let e=0;for(const n of Object.keys(t))Z(t[n])&&e++;return e}function De(t){let e=!1;for(const s of Object.keys(t))if(Z(t[s])){e=!0;break}if(!e)return{resolved:t,errors:null};const n={};let r=null;for(const s of Object.keys(t)){const o=t[s];if(Z(o))try{n[s]=o[an]()}catch(a){n[s]=nt,r||(r=[]),r.push({key:s,error:a})}else n[s]=o}return{resolved:n,errors:r}}function jr(t){for(const e of Object.keys(t))if(t[e]instanceof Promise)return!0;return!1}function Et(t){let e=null;const n={};for(const r of Object.keys(t))t[r]instanceof Promise?(n[r]=nt,e||(e=[]),e.push(r)):n[r]=t[r];return e?{resolved:n,asyncKeys:e}:{resolved:t,asyncKeys:null}}async function zr(t){const e=Object.keys(t),n=await Promise.allSettled(e.map(o=>Promise.resolve(t[o]))),r={};let s=null;for(let o=0;o<e.length;o++){const a=n[o];a.status==="fulfilled"?r[e[o]]=a.value:(r[e[o]]=nt,s||(s=[]),s.push({key:e[o],error:a.reason}))}return{resolved:r,errors:s}}function G(t){const e=t[0];if(Array.isArray(e)&&typeof e.raw<"u"){const n=e,r=t.slice(1);let s="";for(let o=0;o<n.length;o++)s+=n[o],o<r.length&&(s+=String(r[o]));return[s]}return t}let I=(function(t){return t.transformLogLevel="transformLogLevel",t.onBeforeDataOut="onBeforeDataOut",t.shouldSendToLogger="shouldSendToLogger",t.onMetadataCalled="onMetadataCalled",t.onBeforeMessageOut="onBeforeMessageOut",t.onContextCalled="onContextCalled",t})({});var Nr=class ln{context={};hasContext=!1;setContext(e){if(!e){this.context={},this.hasContext=!1;return}this.context=e,this.hasContext=!0}appendContext(e){this.context={...this.context,...e},this.hasContext=!0}getContext(){return this.context}hasContextData(){return this.hasContext}clearContext(e){if(e===void 0){this.context={},this.hasContext=!1;return}const n=Array.isArray(e)?e:[e];for(const r of n)delete this.context[r];this.hasContext=Object.keys(this.context).length>0}onChildLoggerCreated({parentContextManager:e,childContextManager:n}){if(e.hasContextData()){const r=e.getContext();n.setContext({...r})}}clone(){const e=new ln;return e.setContext({...this.context}),e.hasContext=this.hasContext,e}},$r=class We{logLevelEnabledStatus={info:!0,warn:!0,error:!0,debug:!0,trace:!0,fatal:!0};setLevel(e){const n=ee[e];for(const r of Object.values(m)){const s=r,o=ee[r];this.logLevelEnabledStatus[s]=o>=n}}enableIndividualLevel(e){const n=e;n in this.logLevelEnabledStatus&&(this.logLevelEnabledStatus[n]=!0)}disableIndividualLevel(e){const n=e;n in this.logLevelEnabledStatus&&(this.logLevelEnabledStatus[n]=!1)}isLevelEnabled(e){const n=e;return this.logLevelEnabledStatus[n]}enableLogging(){for(const e of Object.keys(this.logLevelEnabledStatus))this.logLevelEnabledStatus[e]=!0}disableLogging(){for(const e of Object.keys(this.logLevelEnabledStatus))this.logLevelEnabledStatus[e]=!1}onChildLoggerCreated({parentLogLevelManager:e,childLogLevelManager:n}){const r=e.logLevelEnabledStatus;n instanceof We&&(n.logLevelEnabledStatus={...r})}clone(){const e=new We;return e.logLevelEnabledStatus={...this.logLevelEnabledStatus},e}},Ur=class{id;enabled;level;consoleDebug;constructor(t){this.id=t.id??Date.now().toString()+Math.random().toString(),this.enabled=t.enabled??!0,this.consoleDebug=t.consoleDebug??!1,this.level=t.level??"trace"}_sendToLogger(t){if(!this.enabled||ee[t.logLevel]<ee[this.level])return;const e=this.shipToLogger(t);if(this.consoleDebug)switch(t.logLevel){case m.info:console.info(...e);break;case m.warn:console.warn(...e);break;case m.error:console.error(...e);break;case m.trace:console.debug(...e);break;case m.debug:console.debug(...e);break;case m.fatal:console.debug(...e);break;default:console.log(...e)}}getLoggerInstance(){throw new Error("This transport does not have a logger instance")}},Vr={};const Wr=[I.onBeforeDataOut,I.onMetadataCalled,I.onBeforeMessageOut,I.transformLogLevel,I.shouldSendToLogger,I.onContextCalled];var _t=class{idToPlugin;transformLogLevel=[];onBeforeDataOut=[];shouldSendToLogger=[];onMetadataCalled=[];onBeforeMessageOut=[];onContextCalled=[];constructor(t){this.idToPlugin={},this.mapPlugins(t),this.indexPlugins()}mapPlugins(t){for(const e of t){if(e.id||(e.id=Date.now().toString()+Math.random().toString()),this.idToPlugin[e.id])throw new Error(`[LogLayer] Plugin with id ${e.id} already exists.`);e.registeredAt=Date.now(),this.idToPlugin[e.id]=e}}indexPlugins(){this.transformLogLevel=[],this.onBeforeDataOut=[],this.shouldSendToLogger=[],this.onMetadataCalled=[],this.onBeforeMessageOut=[],this.onContextCalled=[];const t=Object.values(this.idToPlugin).sort((e,n)=>e.registeredAt-n.registeredAt);for(const e of t){if(e.disabled)return;for(const n of Wr)e[n]&&e.id&&this[n].push(e.id)}}hasPlugins(t){return this[t].length>0}countPlugins(t){return t?this[t].length:Object.keys(this.idToPlugin).length}addPlugins(t){this.mapPlugins(t),this.indexPlugins()}enablePlugin(t){const e=this.idToPlugin[t];e&&(e.disabled=!1),this.indexPlugins()}disablePlugin(t){const e=this.idToPlugin[t];e&&(e.disabled=!0),this.indexPlugins()}removePlugin(t){delete this.idToPlugin[t],this.indexPlugins()}runTransformLogLevel(t,e){let n=null;for(const r of this.transformLogLevel){const s=this.idToPlugin[r];if(s.transformLogLevel){const o=s.transformLogLevel({data:t.data,logLevel:t.logLevel,messages:t.messages,error:t.error,metadata:t.metadata,context:t.context,groups:t.groups,schema:t.schema,prefix:t.prefix},e);o!=null&&o!==!1&&(n=o)}}return n!=null&&n!==!1?n:t.logLevel}runOnBeforeDataOut(t,e){const n={...t},r=n.data;for(const s of this.onBeforeDataOut){const o=this.idToPlugin[s];if(o.onBeforeDataOut){const a=o.onBeforeDataOut({data:n.data,logLevel:n.logLevel,error:n.error,metadata:n.metadata,context:n.context,groups:n.groups,schema:n.schema,prefix:n.prefix},e);a&&(n.data||(n.data={}),a!==r&&Object.assign(n.data,a))}}return n.data}runShouldSendToLogger(t,e){return!this.shouldSendToLogger.some(n=>!this.idToPlugin[n].shouldSendToLogger?.(t,e))}runOnMetadataCalled(t,e){let n={...t};for(const r of this.onMetadataCalled){const s=this.idToPlugin[r].onMetadataCalled?.(n,e);if(s)n=s;else return null}return n}runOnBeforeMessageOut(t,e){let n=[...t.messages];for(const r of this.onBeforeMessageOut){const s=this.idToPlugin[r].onBeforeMessageOut?.({messages:n,logLevel:t.logLevel,groups:t.groups,schema:t.schema,prefix:t.prefix},e);s&&(n=s)}return n}runOnContextCalled(t,e){let n={...t};for(const r of this.onContextCalled){const s=this.idToPlugin[r].onContextCalled?.(n,e);if(s)n=s;else return null}return n}},qr=class cn{pluginManager;idToTransport;hasMultipleTransports;singleTransport;contextManager;logLevelManager;_isLoggingLazyError=!1;_lazyContextCount=0;_assignedGroups=null;_groupsConfig=null;_activeGroups=null;_ungroupedBehavior="all";_config;constructor(e){this._config={...e,enabled:e.enabled??!0},this.contextManager=new Nr,this.logLevelManager=new $r,this._config.enabled||this.disableLogging();const n=[...e.plugins||[],...re.pluginsToInit];this.pluginManager=new _t(n),this._config.errorFieldName||(this._config.errorFieldName="err"),this._config.copyMsgOnOnlyError||(this._config.copyMsgOnOnlyError=!1),this._initializeTransports(this._config.transport),this._groupsConfig=e.groups?{...e.groups}:null,this._ungroupedBehavior=e.ungroupedBehavior??"all",this._activeGroups=e.activeGroups?new Set(e.activeGroups):null,this._parseEnvGroups(),re.logLayerHandlers.length>0&&re.logLayerHandlers.forEach(r=>{r.onConstruct&&r.onConstruct(this,e)})}withContextManager(e){return this.contextManager&&typeof this.contextManager[Symbol.dispose]=="function"&&this.contextManager[Symbol.dispose](),this.contextManager=e,this._lazyContextCount=e.hasContextData()?Lt(e.getContext()):0,this}getContextManager(){return this.contextManager}withLogLevelManager(e){return this.logLevelManager&&typeof this.logLevelManager[Symbol.dispose]=="function"&&this.logLevelManager[Symbol.dispose](),this.logLevelManager=e,this}getLogLevelManager(){return this.logLevelManager}getConfig(){return this._config}_initializeTransports(e){if(this.idToTransport)for(const n in this.idToTransport)this.idToTransport[n]&&typeof this.idToTransport[n][Symbol.dispose]=="function"&&this.idToTransport[n][Symbol.dispose]();this.hasMultipleTransports=Array.isArray(e)&&e.length>1,this.singleTransport=this.hasMultipleTransports?null:Array.isArray(e)?e[0]:e,Array.isArray(e)?this.idToTransport=e.reduce((n,r)=>(n[r.id]=r,n),{}):this.idToTransport={[e.id]:e}}withPrefix(e){const n=this.child();return n._config.prefix=e,n}withGroup(e){const n=this.child(),r=Array.isArray(e)?e:[e];if(n._assignedGroups){const s=new Set([...n._assignedGroups,...r]);n._assignedGroups=Array.from(s)}else n._assignedGroups=[...r];return n}addGroup(e,n){return this._groupsConfig||(this._groupsConfig={}),this._groupsConfig[e]={...n},this}removeGroup(e){return this._groupsConfig&&(delete this._groupsConfig[e],Object.keys(this._groupsConfig).length===0&&(this._groupsConfig=null)),this}enableGroup(e){return this._groupsConfig?.[e]&&(this._groupsConfig[e]={...this._groupsConfig[e],enabled:!0}),this}disableGroup(e){return this._groupsConfig?.[e]&&(this._groupsConfig[e]={...this._groupsConfig[e],enabled:!1}),this}setGroupLevel(e,n){return this._groupsConfig?.[e]&&(this._groupsConfig[e]={...this._groupsConfig[e],level:n}),this}setActiveGroups(e){return this._activeGroups=e?new Set(e):null,this}getGroups(){return this._groupsConfig?{...this._groupsConfig}:{}}withContext(e){let n=e;if(!e)return this._config.consoleDebug&&console.debug("[LogLayer] withContext was called with no context; dropping."),this;if(this.pluginManager.hasPlugins(I.onContextCalled)&&(n=this.pluginManager.runOnContextCalled(e,this),!n))return this._config.consoleDebug&&console.debug("[LogLayer] Context was dropped due to plugin returning falsy value."),this;const r=this.contextManager.getContext();for(const s of Object.keys(n)){const o=s in r&&Z(r[s]),a=Z(n[s]);!o&&a?this._lazyContextCount++:o&&!a&&this._lazyContextCount--}return this.contextManager.appendContext(n),this}clearContext(e){if(e!==void 0&&this._lazyContextCount>0){const n=this.contextManager.getContext(),r=Array.isArray(e)?e:[e];for(const s of r)s in n&&Z(n[s])&&this._lazyContextCount--}else e===void 0&&(this._lazyContextCount=0);return this.contextManager.clearContext(e),this}getContext(e){const n=this.contextManager.getContext();if(e?.raw||this._lazyContextCount===0)return n;const{resolved:r,errors:s}=De(n);s&&this._logLazyEvalErrors(s,"context");const{resolved:o,asyncKeys:a}=Et(r);return a&&this._logAsyncLazyContextErrors(a),o}addPlugins(e){this.pluginManager.addPlugins(e)}enablePlugin(e){this.pluginManager.enablePlugin(e)}disablePlugin(e){this.pluginManager.disablePlugin(e)}removePlugin(e){this.pluginManager.removePlugin(e)}withMetadata(e){return new Mt(this).withMetadata(e)}withError(e){return new Mt(this).withError(e)}child(){const e=new cn({...this._config,transport:Array.isArray(this._config.transport)?[...this._config.transport]:this._config.transport}).withPluginManager(this.pluginManager).withContextManager(this.contextManager.clone()).withLogLevelManager(this.logLevelManager.clone());return this.contextManager.onChildLoggerCreated({parentContextManager:this.contextManager,childContextManager:e.contextManager,parentLogger:this,childLogger:e}),this.logLevelManager.onChildLoggerCreated({parentLogLevelManager:this.logLevelManager,childLogLevelManager:e.logLevelManager,parentLogger:this,childLogger:e}),e._lazyContextCount=e.contextManager.hasContextData()?Lt(e.contextManager.getContext()):0,e._groupsConfig=this._groupsConfig,e._activeGroups=this._activeGroups,e._ungroupedBehavior=this._ungroupedBehavior,e._assignedGroups=this._assignedGroups?[...this._assignedGroups]:null,e}withFreshTransports(e){return this._config.transport=e,this._initializeTransports(e),this}addTransport(e){const n=Array.isArray(e)?e:[e],r=Array.isArray(this._config.transport)?this._config.transport:[this._config.transport],s=new Set(n.map(a=>a.id));for(const a of n){const i=this.idToTransport[a.id];i&&typeof i[Symbol.dispose]=="function"&&i[Symbol.dispose]()}const o=[...r.filter(a=>!s.has(a.id)),...n];this._config.transport=o;for(const a of n)this.idToTransport[a.id]=a;return this.hasMultipleTransports=o.length>1,this.singleTransport=this.hasMultipleTransports?null:o[0],this}removeTransport(e){const n=this.idToTransport[e];if(!n)return!1;typeof n[Symbol.dispose]=="function"&&n[Symbol.dispose](),delete this.idToTransport[e];const r=(Array.isArray(this._config.transport)?this._config.transport:[this._config.transport]).filter(s=>s.id!==e);return this._config.transport=r.length===1?r[0]:r,this.hasMultipleTransports=r.length>1,this.singleTransport=this.hasMultipleTransports?null:r[0]||null,!0}withFreshPlugins(e){return this._config.plugins=e,this.pluginManager=new _t(e),this}withPluginManager(e){return this.pluginManager=e,this}errorOnly(e,n){const r=n?.logLevel||m.error;if(!this.isLevelEnabled(r))return;const{copyMsgOnOnlyError:s}=this._config,o={logLevel:r,err:e};(s&&n?.copyMsg!==!1||n?.copyMsg===!0)&&e?.message&&(o.params=[e.message]),this._formatLog(o)}metadataOnly(e,n=m.info){if(!this.isLevelEnabled(n))return;const{muteMetadata:r,consoleDebug:s}=this._config;if(r)return;if(!e){s&&console.debug("[LogLayer] metadataOnly was called with no metadata; dropping.");return}let o=e;if(this.pluginManager.hasPlugins(I.onMetadataCalled)&&(o=this.pluginManager.runOnMetadataCalled(e,this),!o)){s&&console.debug("[LogLayer] Metadata was dropped due to plugin returning falsy value.");return}const a={logLevel:n,metadata:o};return this._formatLog(a)}info(...e){if(!this.isLevelEnabled(m.info))return;const n=G(e);this._formatMessage(n),this._formatLog({logLevel:m.info,params:n})}warn(...e){if(!this.isLevelEnabled(m.warn))return;const n=G(e);this._formatMessage(n),this._formatLog({logLevel:m.warn,params:n})}error(...e){if(!this.isLevelEnabled(m.error))return;const n=G(e);this._formatMessage(n),this._formatLog({logLevel:m.error,params:n})}debug(...e){if(!this.isLevelEnabled(m.debug))return;const n=G(e);this._formatMessage(n),this._formatLog({logLevel:m.debug,params:n})}trace(...e){if(!this.isLevelEnabled(m.trace))return;const n=G(e);this._formatMessage(n),this._formatLog({logLevel:m.trace,params:n})}fatal(...e){if(!this.isLevelEnabled(m.fatal))return;const n=G(e);this._formatMessage(n),this._formatLog({logLevel:m.fatal,params:n})}raw(e){if(!this.isLevelEnabled(e.logLevel))return;const n={logLevel:e.logLevel,params:e.messages,metadata:e.metadata,rootData:e.rootData,err:e.error,context:e.context};return this._formatMessage(e.messages),this._formatLog(n)}disableLogging(){return this.logLevelManager.disableLogging(),this}enableLogging(){return this.logLevelManager.enableLogging(),this}muteContext(){return this._config.muteContext=!0,this}unMuteContext(){return this._config.muteContext=!1,this}muteMetadata(){return this._config.muteMetadata=!0,this}unMuteMetadata(){return this._config.muteMetadata=!1,this}enableIndividualLevel(e){return this.logLevelManager.enableIndividualLevel(e),this}disableIndividualLevel(e){return this.logLevelManager.disableIndividualLevel(e),this}setLevel(e){return this.logLevelManager.setLevel(e),this}isLevelEnabled(e){return this.logLevelManager.isLevelEnabled(e)}formatContext(e){const{contextFieldName:n,muteContext:r}=this._config;return e&&Object.keys(e).length>0&&!r?n?{[n]:{...e}}:{...e}:{}}formatMetadata(e=null){const{metadataFieldName:n,muteMetadata:r}=this._config;return e&&!r?n?{[n]:{...e}}:{...e}:{}}getLoggerInstance(e){const n=this.idToTransport[e];if(n)return n.getLoggerInstance()}_parseEnvGroups(){const e=typeof process<"u"?Vr?.LOGLAYER_GROUPS:void 0;if(!e)return;const n=e.split(",").map(s=>s.trim()).filter(Boolean),r=[];for(const s of n){const o=s.indexOf(":");if(o>0){const a=s.slice(0,o),i=s.slice(o+1);r.push(a),this._groupsConfig?.[a]&&(this._groupsConfig[a]={...this._groupsConfig[a],level:i})}else r.push(s)}this._activeGroups=new Set(r)}_mergeGroups(e){if(this._assignedGroups&&e){const n=new Set([...this._assignedGroups,...e]);return Array.from(n)}return e||this._assignedGroups}_applyUngroupedRules(e){return this._ungroupedBehavior==="all"?!0:this._ungroupedBehavior==="none"?!1:this._ungroupedBehavior.includes(e)}_shouldTransportReceiveLog(e,n,r){if(!this._groupsConfig)return!0;const s=this._mergeGroups(r);if(!s||s.length===0)return this._applyUngroupedRules(e);let o=!1;for(const a of s){const i=this._groupsConfig[a];if(i&&(o=!0,i.enabled!==!1&&!(this._activeGroups&&!this._activeGroups.has(a)))){if(i.level){const c=ee[i.level];if(ee[n]<c)continue}if(i.transports.includes(e))return!0}}return o?!1:this._applyUngroupedRules(e)}_formatMessage(e=[]){const{prefix:n}=this._config;n&&typeof e[0]=="string"&&(e[0]=`${n} ${e[0]}`)}_formatLog({logLevel:e,params:n=[],metadata:r=null,rootData:s=null,err:o,context:a=null,groups:i=null}){const c=a!==null?a:this.contextManager.getContext();let g;if(this._lazyContextCount>0||a!==null){const p=De(c);p.errors&&this._logLazyEvalErrors(p.errors,"context");const{resolved:f,asyncKeys:u}=Et(p.resolved);u&&this._logAsyncLazyContextErrors(u),g=f}else g=c;let l=null;if(r){const p=De(r);r=p.resolved,l=p.errors}if(l&&this._logLazyEvalErrors(l,"metadata"),r&&jr(r))return this._resolveAsyncAndProcess(e,n,g,r,s,o,a,i);this._processLog(e,n,g,r,s,o,a,i)}async _resolveAsyncAndProcess(e,n,r,s,o,a,i,c){let g=null;if(s){const l=await zr(s);g=l.resolved,l.errors&&this._logLazyEvalErrors(l.errors,"metadata")}this._processLog(e,n,r,g,o,a,i,c)}_logLazyEvalErrors(e,n){if(this._isLoggingLazyError){for(const r of e)console.error(`[LogLayer] Lazy evaluation error in ${n} key "${r.key}":`,r.error);return}this._isLoggingLazyError=!0;try{for(const r of e){const s=r.error instanceof Error?r.error.message:String(r.error);this._processLog(m.error,[`[LogLayer] Lazy evaluation failed for ${n} key "${r.key}": ${s}`],{},null,null,r.error instanceof Error?r.error:void 0,{})}}finally{this._isLoggingLazyError=!1}}_logAsyncLazyContextErrors(e){if(this._isLoggingLazyError){for(const n of e)console.error(`[LogLayer] Async lazy values are not supported in context (key "${n}"). Use async lazy only in metadata.`);return}this._isLoggingLazyError=!0;try{for(const n of e)this._processLog(m.error,[`[LogLayer] Async lazy values are not supported in context (key "${n}"). Use async lazy only in metadata.`],{},null,null,void 0,{})}finally{this._isLoggingLazyError=!1}}_processLog(e,n,r,s,o,a,i,c=null){const{errorSerializer:g,errorFieldInMetadata:l,muteContext:p,contextFieldName:f,metadataFieldName:u,errorFieldName:h,prefix:E}=this._config,w={contextFieldName:f??void 0,metadataFieldName:u??void 0,errorFieldName:h??"err"},_=this._mergeGroups(c)??void 0;let y=!!s||(p?!1:i!==null?Object.keys(i).length>0:this.contextManager.hasContextData()),v={};if(y)if(f&&f===u){const M=this.formatContext(r)[f],P=this.formatMetadata(s)[u];v={[f]:{...M,...P}}}else v={...this.formatContext(r),...this.formatMetadata(s)};if(a){const M=g?g(a):a;l&&s&&u?v?.[u]?v[u][h]=M:v={...v,[u]:{[h]:M}}:l&&!s&&u?v={...v,[u]:{[h]:M}}:v={...v,[h]:M},y=!0}o&&Object.keys(o).length>0&&(v={...v,...o},y=!0),this.pluginManager.hasPlugins(I.onBeforeDataOut)&&(v=this.pluginManager.runOnBeforeDataOut({data:y?v:void 0,logLevel:e,error:a,metadata:s,context:r,groups:_,schema:w,prefix:E},this),v&&!y&&(y=!0)),this.pluginManager.hasPlugins(I.onBeforeMessageOut)&&(n=this.pluginManager.runOnBeforeMessageOut({messages:[...n],logLevel:e,groups:_,schema:w,prefix:E},this)),this.pluginManager.hasPlugins(I.transformLogLevel)&&(e=this.pluginManager.runTransformLogLevel({data:y?v:void 0,logLevel:e,messages:[...n],error:a,metadata:s,context:r,groups:_,schema:w,prefix:E},this));const O={data:y?v:void 0,error:a,metadata:s,context:r,groups:_,schema:w,prefix:E};if(this.hasMultipleTransports){const M=this._config.transport.filter(P=>!(!P.enabled||!this._shouldTransportReceiveLog(P.id,e,_))).map(async P=>{const D=e;if(!(this.pluginManager.hasPlugins(I.shouldSendToLogger)&&!this.pluginManager.runShouldSendToLogger({messages:[...n],logLevel:D,transportId:P.id,...O},this)))return P._sendToLogger({logLevel:D,messages:[...n],hasData:y,...O})});Promise.all(M).catch(P=>{this._config.consoleDebug&&console.error("[LogLayer] Error executing transports:",P)})}else{if(!this.singleTransport?.enabled||!this._shouldTransportReceiveLog(this.singleTransport.id,e,_)||this.pluginManager.hasPlugins(I.shouldSendToLogger)&&!this.pluginManager.runShouldSendToLogger({messages:[...n],logLevel:e,transportId:this.singleTransport.id,...O},this))return;this.singleTransport._sendToLogger({logLevel:e,messages:[...n],hasData:y,...O})}}};const re={logLayerHandlers:[],pluginsToInit:[],logBuilderHandlers:[]};var Mt=class{err;metadata;structuredLogger;hasMetadata;pluginManager;_groups=null;constructor(t){this.err=null,this.metadata={},this.structuredLogger=t,this.hasMetadata=!1,this.pluginManager=t.pluginManager,re.logBuilderHandlers.length>0&&re.logBuilderHandlers.forEach(e=>{e.onConstruct&&e.onConstruct(this,t)})}withMetadata(t){const{pluginManager:e,structuredLogger:{_config:{consoleDebug:n}}}=this;if(!t)return n&&console.debug("[LogLayer] withMetadata was called with no metadata; dropping."),this;let r=t;return e.hasPlugins(I.onMetadataCalled)&&(r=e.runOnMetadataCalled(t,this.structuredLogger),!r)?(n&&console.debug("[LogLayer] Metadata was dropped due to plugin returning falsy value."),this):(this.metadata={...this.metadata,...r},this.hasMetadata=!0,this)}withError(t){return this.err=t,this}withGroup(t){const e=Array.isArray(t)?t:[t];if(this._groups){const n=new Set([...this._groups,...e]);this._groups=Array.from(n)}else this._groups=[...e];return this}info(...t){if(!this.structuredLogger.isLevelEnabled(m.info))return;const e=G(t);return this.structuredLogger._formatMessage(e),this.formatLog(m.info,e)}warn(...t){if(!this.structuredLogger.isLevelEnabled(m.warn))return;const e=G(t);return this.structuredLogger._formatMessage(e),this.formatLog(m.warn,e)}error(...t){if(!this.structuredLogger.isLevelEnabled(m.error))return;const e=G(t);return this.structuredLogger._formatMessage(e),this.formatLog(m.error,e)}debug(...t){if(!this.structuredLogger.isLevelEnabled(m.debug))return;const e=G(t);return this.structuredLogger._formatMessage(e),this.formatLog(m.debug,e)}trace(...t){if(!this.structuredLogger.isLevelEnabled(m.trace))return;const e=G(t);return this.structuredLogger._formatMessage(e),this.formatLog(m.trace,e)}fatal(...t){if(!this.structuredLogger.isLevelEnabled(m.fatal))return;const e=G(t);return this.structuredLogger._formatMessage(e),this.formatLog(m.fatal,e)}disableLogging(){return this.structuredLogger.disableLogging(),this}enableLogging(){return this.structuredLogger.enableLogging(),this}formatLog(t,e){const{muteMetadata:n}=this.structuredLogger._config,r=n?!1:this.hasMetadata;return this.structuredLogger._formatLog({logLevel:t,params:e,metadata:r?this.metadata:null,err:this.err,groups:this._groups})}},Hr=class extends Ur{shipToLoggerFn;constructor(t){super(t),this.shipToLoggerFn=t.shipToLogger}shipToLogger(t){return this.shipToLoggerFn(t)}};let qe=!1;const Kr={trace:"log",debug:"log",info:"log",warn:"warn",error:"error",fatal:"error"},rt=new qr({transport:new Hr({shipToLogger:({logLevel:t,messages:e,data:n,hasData:r})=>{const s=Kr[t]??"log";let o,a;if(r&&n){const{_sub:i,...c}=n;o=i?String(i):void 0,Object.keys(c).length>0&&(a=c)}return qe=!0,a?console[s](...e,a):console[s](...e),qe=!1,typeof window<"u"&&window.postMessage({type:"engine-log",level:t,message:e.join(" "),subsystem:o,metadata:a,timestamp:Date.now()},"*"),e}}),prefix:"[engine]"});rt.setLevel(m.info);typeof window<"u"&&(window.setEngineLogLevel=t=>{rt.setLevel(t)});if(typeof window<"u"){const t=new URLSearchParams(window.location.search).get("engineLogLevel");t&&rt.setLevel(t)}const Yr=4,Xr=1e4;async function Jr(t,e,n,r){const s=t.getRunTicksTarget();if(s===null)throw new bt("RUN_TICKS_UNAVAILABLE","runTicksWhenSettled: no run-ticks target is wired — no Game has mounted yet");const o=Xr,a=Yr,i=n?.render??"last";for(let c=0;c<e;c++){if(!t.worldSettled()){const p=Date.now()+o;for(;!t.worldSettled();){if(Date.now()>p)throw new bt("WORLD_UNSETTLED_TIMEOUT",`runTicksWhenSettled: a world-settled probe still answers false after ${o}ms — a scene remount (or a broken probe) is stuck, and driving ticks into it would race it`);await new Promise(f=>setTimeout(f,a))}}const g=c===e-1,l=i==="all"?"all":i==="none"?"none":g?"last":"none";s.runTicks(1,{render:l})}}const Zr="fit",un=[{id:Zr,label:"Fit panel",kind:"fit",width:null,height:null,dpr:null,safeArea:null},{id:"iphone-portrait",label:"iPhone 14 — 390×844 @3x",kind:"phone",width:390,height:844,dpr:3,safeArea:{top:47,right:0,bottom:34,left:0}},{id:"iphone-landscape",label:"iPhone 14 landscape — 844×390 @3x",kind:"phone",width:844,height:390,dpr:3,safeArea:{top:0,right:47,bottom:21,left:47}},{id:"android-portrait",label:"Android — 412×915 @2.6x",kind:"phone",width:412,height:915,dpr:2.6,safeArea:{top:24,right:0,bottom:24,left:0}},{id:"ipad-portrait",label:"iPad — 820×1180 @2x",kind:"tablet",width:820,height:1180,dpr:2,safeArea:{top:24,right:0,bottom:20,left:0}},{id:"desktop-1080p",label:"Desktop — 1920×1080 @1x",kind:"desktop",width:1920,height:1080,dpr:1,safeArea:null}],st=un[0];function dn(t){return un.find(e=>e.id===t)??st}let k=st,H=null,fn=0;const He=new Set;function ot(){fn++;for(const t of He)t()}function ko(t){return He.add(t),()=>{He.delete(t)}}const Oo=()=>fn;function Do(){return k}function gn(){return H??(k.kind==="phone"||k.kind==="tablet")}function Fo(t){const e=dn(t);e!==k&&(k=e,H=null,hn(),ot())}function Go(t){t!==H&&(H=t,hn(),ot())}function Qr(){return k.dpr}function Bo(){return Math.min(typeof window<"u"&&window.devicePixelRatio||1,2)}function hn(){An({devicePreview:{preset:k.id,touch:H}})}function jo(){const t=xn().devicePreview;return t?.preset?(k=dn(t.preset),H=typeof t.touch=="boolean"?t.touch:null):(k=st,H=null),ot(),k}const St=["pointerdown","pointermove","pointerup","pointercancel"],Pt=new WeakSet;let Ke=null,Fe=null;function Tt(t){if(!gn()||Pt.has(t)||!(t instanceof PointerEvent)||t.pointerType!=="mouse")return;const e=t.target;if(!e)return;t.stopImmediatePropagation();const n=new PointerEvent(t.type,{bubbles:!0,cancelable:t.cancelable,composed:!0,view:t.view,detail:t.detail,clientX:t.clientX,clientY:t.clientY,screenX:t.screenX,screenY:t.screenY,button:t.button,buttons:t.buttons,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey,pointerId:t.pointerId,pointerType:"touch",isPrimary:!0,pressure:t.type==="pointerup"||t.type==="pointercancel"?0:Math.max(t.pressure,.5),width:20,height:20});Pt.add(n),e.dispatchEvent(n),n.defaultPrevented&&t.preventDefault()}function es(t){if(t!==Ke&&(Fe?.(),Fe=null,Ke=t,!!t)){for(const e of St)t.addEventListener(e,Tt,{capture:!0});Fe=()=>{for(const e of St)t.removeEventListener(e,Tt,{capture:!0})}}}function zo(t){Ke===t&&es(null)}function ts(){return{presetId:k.id,presetLabel:k.label,dpr:k.dpr,safeArea:k.safeArea,touchActive:gn()}}typeof window<"u"&&(window.__vgaiDevicePreview=ts);const ns=15e3;function rs(t,e,n){const r=n?` (open ${n})`:"";return`Play start stalled at "${t}" for ${Math.round(e/1e3)}s and the editor tab is HIDDEN — a backgrounded tab has its network requests deprioritized by the browser, so this step is queued rather than broken. Bring the editor tab to the foreground${r} and run play again; the engine loop itself is hidden-safe, only the boot's fetches are starved.`}function ss(t,e,n){const r=n.stallMs??ns,s=n.setTimer??((a,i)=>setTimeout(a,i)),o=n.clearTimer??(a=>clearTimeout(a));return new Promise((a,i)=>{let c=!1;const g=s(()=>{c||n.isHidden()&&(c=!0,i(new Error(rs(t,r,n.editorUrl))))},r);e.then(l=>{c||(c=!0,o(g),a(l))},l=>{c||(c=!0,o(g),i(l instanceof Error?l:new Error(String(l))))})})}function os(t,e,n=Date.now()){const r=t.filter(s=>s.seq>e).sort((s,o)=>s.seq-o.seq);return{entries:r.map(s=>({t:n,level:"info",source:"game-event",msg:s.event,tick:s.tick,simT:s.simT,meta:{seq:s.seq,...s.detail!==void 0?{detail:s.detail}:{}}})),lastSeq:r.at(-1)?.seq??e}}const ye="data-vgai-replay-block",ne="data-vgai-replay-video",Ct="https://replay-assets.invalid/",as=1e3,is=256*1024,ls=/data:image\/(?:png|jpeg|webp|gif|svg\+xml);base64,[a-zA-Z0-9+/=]+/g;function Ge(t){const e=t.getBoundingClientRect();return{left:e.left,top:e.top,width:e.width,height:e.height}}function cs(t){switch(t.toLowerCase()){case"image/png":return"png";case"image/jpeg":return"jpg";case"image/webp":return"webp";case"image/gif":return"gif";case"image/svg+xml":return"svg";default:return null}}function us(t){const e=/^data:([^;,]+);base64,([\s\S]+)$/i.exec(t);if(!e)throw new Error("image data URL is not base64 encoded");const n=atob(e[2]),r=new Uint8Array(n.length);for(let s=0;s<n.length;s+=1)r[s]=n.charCodeAt(s);return new Blob([r],{type:e[1].toLowerCase()})}function ds(t){const e=[];for(let n=t;n&&n!==document.body;n=n.parentElement){const r=n.parentElement;if(!r)break;for(const s of Array.from(r.children))s!==n&&!["STYLE","LINK","SCRIPT"].includes(s.tagName)&&!s.hasAttribute(ye)&&(s.setAttribute(ye,""),e.push(s))}return()=>{for(const n of e)n.removeAttribute(ye)}}function fs(t,e,n){if(n.format!=="canvas-dom"||n.replayPath===null)throw new Error("gameplay DOM recording requires a canvas-dom sink");const r=ds(t),s=e.getAttribute(ne);e.setAttribute(ne,"");const o=()=>{r(),s===null?e.removeAttribute(ne):e.setAttribute(ne,s)},a=[],i=new Map,c=[];let g=0,l=0,p=0,f=0,u=0,h=null,E=Date.now(),w=null,_=Promise.resolve(),y=!1;const v=(b,j)=>{_=_.then(async()=>{if(!w)try{await j()}catch(Y){const $=Y instanceof Error?Y.message:String(Y);w=new Error(`${b}: ${$}`)}})},O=b=>{const j=i.get(b);if(j)return`${Ct}${j}`;const Y=/^data:([^;,]+)/i.exec(b)?.[1]??"",$=cs(Y);if(!$)return b;const fe=`${String(u).padStart(6,"0")}.${$}`;return u+=1,i.set(b,fe),v(`replay asset ${fe}`,async()=>{const yt=us(b);p+=yt.size,await Rn(n,fe,yt)}),`${Ct}${fe}`},M=b=>b.includes("data:image/")?b.replace(ls,O):b,P=()=>{if(a.length===0)return;const b=new Blob([`[${a.join(",")}]`],{type:"application/json"});a.length=0,g=0;const j=f;f+=1,v(`DOM event batch ${j}`,()=>In(n,j,b))};let D;try{D=X({emit(b){h??=b.timestamp;const j=JSON.stringify(b,(Y,$)=>typeof $=="string"?M($):$);a.push(j),g+=j.length,l+=1,g>=is&&P()},blockSelector:`[${ye}], [${ne}]`,recordCanvas:!0,inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,sampling:{mousemove:!1,mouseInteraction:!1,scroll:100,canvas:15},errorHandler(b){return c.push(b instanceof Error?b.message:String(b)),!0}})}catch(b){throw o(),b}if(!D)throw o(),new Error("rrweb could not start the DOM recording");const F=t.ownerDocument.defaultView??window,L={width:F.innerWidth,height:F.innerHeight,dpr:F.devicePixelRatio},A=Ge(t),te=Ge(e),Oe=X.mirror.getId(t),Pn=X.mirror.getId(e),pt=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>{X.addCustomEvent("vgai-canvas-layout",{rect:Ge(e),drawingWidth:e.width,drawingHeight:e.height,dpr:F.devicePixelRatio})});pt?.observe(e),X.addCustomEvent("vgai-canvas-layout",{rect:te,drawingWidth:e.width,drawingHeight:e.height,dpr:F.devicePixelRatio});const Tn=F.setInterval(P,as),mt=()=>{F.clearInterval(Tn),pt?.disconnect(),o()};return{markVideoStarted(b){E=b},async stop(b){if(y)throw new Error("gameplay DOM recording is already stopped");if(y=!0,X.addCustomEvent("vgai-recording-stop",{}),D(),mt(),P(),await _,w)throw w;return{version:1,recorder:"rrweb@2.1.6",events:"events.json",assets:"assets/",video:b,videoStartEpochMs:E,firstEventEpochMs:h,viewport:L,surface:A,surfaceNodeId:Oe,canvas:{...te,nodeId:Pn,drawingWidth:e.width,drawingHeight:e.height},eventCount:l,assetCount:i.size,assetBytes:p,rrwebErrors:c}},async abort(){y||(y=!0,D(),mt(),a.length=0,await _)}}}function gs(){let t=null,e=!1,n=null;const r=`
|
|
3
|
-
let canvas;
|
|
4
|
-
onmessage = async ({data}) => {
|
|
5
|
-
const {bitmap, width, height, type, quality} = data;
|
|
6
|
-
try {
|
|
7
|
-
if (!canvas) canvas = new OffscreenCanvas(width, height);
|
|
8
|
-
if (canvas.width !== width) canvas.width = width;
|
|
9
|
-
if (canvas.height !== height) canvas.height = height;
|
|
10
|
-
const context = canvas.getContext('2d');
|
|
11
|
-
if (!context) throw new Error('No worker canvas context');
|
|
12
|
-
context.globalCompositeOperation = 'copy';
|
|
13
|
-
context.drawImage(bitmap, 0, 0, width, height);
|
|
14
|
-
bitmap.close();
|
|
15
|
-
const blob = await canvas.convertToBlob({type, quality});
|
|
16
|
-
postMessage({blob});
|
|
17
|
-
} catch (error) {
|
|
18
|
-
bitmap.close();
|
|
19
|
-
postMessage({error: error instanceof Error ? error.message : String(error)});
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
`;function s(o){const a=n;n=null,t?.terminate(),t=null,a?.reject(o)}return{encode(o,a,i,c,g){return e?Promise.reject(new Error("Recording preview encoder stopped")):n?Promise.reject(new Error("Recording preview already in flight")):new Promise((l,p)=>{const f={resolve:l,reject:p};n=f;try{if(!t){const u=URL.createObjectURL(new Blob([r],{type:"text/javascript"}));try{t=new Worker(u)}finally{URL.revokeObjectURL(u)}t.onmessage=({data:h})=>{if(h.error||!h.blob){s(new Error(h.error??"No recording preview image"));return}const E=n;n=null,E?.resolve(h.blob)},t.onerror=h=>{h.preventDefault(),s(new Error(h.message||"Recording preview worker failed"))},t.onmessageerror=()=>s(new Error("Recording preview worker message failed"))}createImageBitmap(o).then(u=>{if(e||n!==f||!t){u.close();return}try{t.postMessage({bitmap:u,width:a,height:i,type:c,quality:g},[u])}catch(h){u.close(),s(h instanceof Error?h:new Error(String(h)))}},u=>{n===f&&s(u instanceof Error?u:new Error(String(u)))})}catch(u){s(u instanceof Error?u:new Error(String(u)))}})},dispose(){e=!0,s(new Error("Recording preview encoder stopped"))}}}let N=null;const At=1,xt=60,hs=30,Ae=2,ps=1e3/Ae,xe=12e4,ms=xe/1e3*Ae,ys=256,vs="image/webp",ws=.72;function bs(t,e){const n="'use strict';var t=null;onmessage=function(e){clearInterval(t);t=null;if(e.data&&e.data.ms>0){t=setInterval(function(){postMessage(0)},e.data.ms)}};";try{const r=URL.createObjectURL(new Blob([n],{type:"text/javascript"})),s=new Worker(r);URL.revokeObjectURL(r);let o=null;return s.addEventListener("error",a=>{a.preventDefault(),o===null&&(o=window.setInterval(e,t))}),s.addEventListener("message",()=>e()),s.postMessage({ms:t}),{stop(){s.postMessage({ms:0}),s.terminate(),o!==null&&window.clearInterval(o)}}}catch{const r=window.setInterval(e,t);return{stop(){window.clearInterval(r)}}}}function Ls(t){const e=t??hs;if(!Number.isFinite(e)||!Number.isInteger(e)||e<At||e>xt)throw new Error(`gameplay recording fps must be an integer from ${At} to ${xt}`);return e}function Es(t){const n=(t?["video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus","video/webm"]:["video/webm;codecs=vp9","video/webm;codecs=vp8","video/webm"]).find(r=>MediaRecorder.isTypeSupported(r));if(!n)throw new Error("this browser exposes MediaRecorder but no WebM video codec");return n}function at(){Gn(N?.previewSnapshot??null)}function Be(t,e){t.previewSnapshot={startedAt:t.started.startedAt,width:t.started.width,height:t.started.height,liveEdgeMs:e,sampleFps:Ae,retentionMs:xe,frames:[...t.previewFrames],previewError:t.previewError},N===t&&at()}function _s(t){for(const e of t.previewFrames)URL.revokeObjectURL(e.src);t.previewFrames.length=0}function pn(t,e){if(t.stopping||t.previewEncoding||t.previewError||e<t.nextPreviewAt)return;t.nextPreviewAt=e+ps;const n=Math.min(1,ys/Math.max(1,t.output.width)),r=Math.max(1,Math.round(t.output.width*n)),s=Math.max(1,Math.round(t.output.height*n));t.previewEncoding=!0;const o=new Date().toISOString(),a=t.nextPreviewSequence;t.nextPreviewSequence+=1;const i=t.previewEncoder.encode(t.output,r,s,vs,ws).then(c=>{if(t.stopping)return;if(!c){t.previewError="The browser could not encode recording previews.",Be(t,e);return}const g={sequence:a,mediaTimeMs:Math.max(0,Math.round(e)),capturedAt:o,src:URL.createObjectURL(c),width:r,height:s};for(t.previewFrames.push(g);t.previewFrames.length>ms||(t.previewFrames[0]?.mediaTimeMs??g.mediaTimeMs)<g.mediaTimeMs-xe;){const l=t.previewFrames.shift();l&&URL.revokeObjectURL(l.src)}Be(t,g.mediaTimeMs)}).catch(c=>{t.stopping||(t.previewError=c instanceof Error?c.message:"The browser could not encode recording previews.",Be(t,e))}).finally(()=>{t.previewEncoding=!1});t.previewTask=i}function Ms(){if(N)throw new Error("a gameplay recording is already active; stop it before starting one");if(typeof MediaRecorder>"u")throw new Error("this browser does not support MediaRecorder gameplay capture")}function Ss(t){t.stopping||t.drawing||performance.now()<t.nextFrameAt||(typeof document<"u"&&document.hidden&&(t.hidden=!0),t.drawing=!0,t.frameTask=(async()=>{const e=performance.now();try{if(t.options.refreshFrame?.(),t.started.format==="composite-webm"){const n=t.staging,r=t.overlayCache;if(!n||!r)throw new Error("gameplay recording: composite buffers unavailable");await jt(t.container,n,{canvasFrame:t.options.canvasFrame,snapshots:t.snapshots,overlayCache:r});const{output:s}=t,o=s.getContext("2d");if(!o)throw new Error("gameplay recording: output context unavailable");s.width!==n.width&&(s.width=n.width),s.height!==n.height&&(s.height=n.height),o.globalCompositeOperation="copy",o.drawImage(n,0,0),o.globalCompositeOperation="source-over",pn(t,performance.now()-t.startedWallMs)}t.frames+=1}catch{t.frameErrors+=1}finally{t.drawing=!1;const n=performance.now()-e;t.nextFrameAt=e+Math.max(t.intervalMs/2,2*n)}})())}async function mn(t,e={}){Ms();const n=Ls(e.fps),r=e.format??"composite-webm",s=t.ownerDocument.createElement("canvas"),o=e.audio??null;let a=null,i=null,c=null;const g=Fn(),l=Dn();try{const p=await jt(t,s,{canvasFrame:e.canvasFrame,snapshots:g,overlayCache:l});if(p.canvases===0&&p.domOverlays===0)throw new Error("gameplay recording: no game layers are mounted");const f=Array.from(t.querySelectorAll("canvas")).filter(zt);if(r==="canvas-dom"&&f.length!==1)throw new Error(`canvas-dom recording requires exactly one root canvas; this game has ${f.length}`);const u=r==="canvas-dom"?f[0]:s;if(typeof u.captureStream!="function")throw new Error("this browser cannot capture a canvas as a media stream");if(a=u.captureStream(n),o)for(const v of o.stream.getAudioTracks())a.addTrack(v);const h=Es(a.getAudioTracks().length>0),E=new MediaRecorder(a,{mimeType:h}),w=new Date().toISOString();i=await kn({startedAt:w,mimeType:h,name:e.name??null,format:r}),r==="canvas-dom"&&(c=fs(t,u,i),l.dispose());const _={format:r,startedAt:w,mimeType:h,width:u.width,height:u.height,fps:n,audio:a.getAudioTracks().length>0,layers:p,path:i.path,replayPath:i.replayPath,rotates:i.rotates,logFile:i.logFile},y={started:_,recorder:E,output:u,staging:r==="composite-webm"?t.ownerDocument.createElement("canvas"):null,stream:a,audio:o,sink:i,startedWallMs:performance.now(),intervalMs:1e3/n,container:t,options:{canvasFrame:e.canvasFrame,refreshFrame:e.refreshFrame},clock:null,frameTask:null,drawing:!1,nextFrameAt:0,snapshots:g,overlayCache:r==="composite-webm"?l:null,domRecording:c,previewEncoder:gs(),previewFrames:[],previewSnapshot:{startedAt:w,width:u.width,height:u.height,liveEdgeMs:0,sampleFps:Ae,retentionMs:xe,frames:[],previewError:null},previewTask:null,previewEncoding:!1,previewError:null,nextPreviewAt:0,nextPreviewSequence:0,frames:1,frameErrors:0,hidden:typeof document<"u"&&document.hidden,recorderError:null,uploadError:null,uploads:Promise.resolve(),nextSequence:0,stopping:!1};return E.addEventListener("dataavailable",v=>{if(v.data.size===0||y.uploadError)return;const O=y.nextSequence;y.nextSequence+=1,y.uploads=y.uploads.then(async()=>{if(!y.uploadError)try{await On(y.sink,O,v.data)}catch(M){y.uploadError=M instanceof Error?M:new Error(String(M))}})}),E.addEventListener("error",v=>{y.recorderError=v.error??new Error("gameplay recording failed")}),E.addEventListener("start",()=>{y.domRecording?.markVideoStarted(Date.now())}),E.start(1e3),N=y,at(),r==="composite-webm"&&pn(y,0),y.clock=bs(y.intervalMs,()=>Ss(y)),_}catch(p){await c?.abort(),l.dispose(),i&&await Nt(i);for(const f of a?.getTracks()??[])f.stop();throw o?.dispose(),p}}async function yn(t){const e=N;if(!e)throw new Error("no gameplay recording is active");e.stopping=!0,e.clock?.stop(),e.clock=null,await e.frameTask,e.previewEncoder.dispose(),await e.previewTask;let n=!1;try{if(e.recorder.state!=="inactive"){const c=new Promise(g=>{e.recorder.addEventListener("stop",()=>g(),{once:!0})});e.recorder.stop(),await c}if(e.recorderError)throw e.recorderError;if(await e.uploads,e.uploadError)throw e.uploadError;const r=Math.max(0,Math.round(performance.now()-e.startedWallMs)),s=Math.round(r/1e3*e.started.fps),o={...e.started,durationMs:r,droppedFrames:Math.max(0,s-e.frames),frameErrors:e.frameErrors,effectiveFps:r>0?Math.round(e.frames/(r/1e3)*10)/10:0,hidden:e.hidden},a=e.sink.path.split(/[\\/]/).at(-1)??"video.webm",i=await e.domRecording?.stop(a);return await Bn(e.sink,t??null,void 0,i?{...i,capture:{durationMs:o.durationMs,droppedFrames:o.droppedFrames,frameErrors:o.frameErrors,effectiveFps:o.effectiveFps,hidden:o.hidden,fps:o.fps,width:o.width,height:o.height,mimeType:o.mimeType,audio:o.audio}}:null),n=!0,o}finally{n||(await e.domRecording?.abort(),await Nt(e.sink)),N=null,at(),_s(e),e.overlayCache?.dispose();for(const r of e.stream.getTracks())r.stop();e.audio?.dispose()}}function it(){return N!==null}function Ps(){return N?.started??null}function vn(t,e){return Math.max(0,Math.floor(e-t))}function Ts(){const t=N;return t===null?null:{startedAt:t.started.startedAt,elapsedMs:vn(t.startedWallMs,performance.now())}}const No=Object.freeze(Object.defineProperty({__proto__:null,activeGameplayRecording:Ps,activeGameplayRecordingTimeline:Ts,gameplayRecordingActive:it,recordingTimelineElapsedMs:vn,startGameplayRecording:mn,stopGameplayRecording:yn},Symbol.toStringTag,{value:"Module"})),lt=12e4,Cs=5e3,Rt=["keydown","keyup","pointerdown","pointermove","wheel","touchstart","touchmove"];let x=null,ve=null,It=0,As=null,wn=null;function xs(t){wn=t}function Rs(){return!x||!it()?null:{path:x.started.path,format:x.started.format,replayPath:x.started.replayPath,startedAt:x.started.startedAt,rotates:x.started.rotates,logFile:x.started.logFile,idleAutoStopMs:lt}}function bn(){x&&(x.lastActivityMs=Date.now())}function Is(){if(typeof window>"u")return()=>{};const t=()=>bn();for(const e of Rt)window.addEventListener(e,t,{capture:!0,passive:!0});return()=>{for(const e of Rt)window.removeEventListener(e,t,{capture:!0})}}async function $o(t,e={}){if(x&&await ct("restart"),await ve,!t)return S.warn("Play started, but gameplay recording did not: no game surface is mounted to record.","play-recording"),null;try{return x={started:await mn(t,{format:Array.from(t.querySelectorAll("canvas")).filter(zt).length===1?"canvas-dom":"composite-webm",...e.name?{name:e.name}:{},...e.audio?{audio:e.audio}:{},...e.refreshFrame?{refreshFrame:e.refreshFrame}:{},...e.canvasFrame?{canvasFrame:e.canvasFrame}:{}}),lastActivityMs:Date.now(),poll:null,releaseInput:Is(),ending:!1},x.poll=window.setInterval(()=>{const r=x;!r||r.ending||Date.now()-r.lastActivityMs<lt||Os()},Cs),Rs()}catch(n){return S.warn(`Play started, but gameplay recording did not: ${n instanceof Error?n.message:String(n)}`,"play-recording"),null}}async function ct(t){const e=x;if(!e||e.ending)return ve;if(e.ending=!0,e.poll!==null&&window.clearInterval(e.poll),e.releaseInput?.(),x=null,!it())return null;const n=++It,r=(async()=>{try{const s=await yn(t);return As=s,s}catch(s){return S.warn(`Gameplay recording could not be finalized: ${s instanceof Error?s.message:String(s)}`,"play-recording"),null}finally{It===n&&(ve=null)}})();return ve=r,r}function ks(t){const e=Math.round(t.durationMs/100)/10;return`${t.path} — ${e}s at ${t.effectiveFps} fps${t.hidden?" (tab hidden; that is the cadence actually captured, not the requested one)":""}`}async function Os(){const t=Math.round(lt/1e3),e=await ct("idle-autostop");S.log(e===null?`Play auto-stopped after ${t}s with no session command and no player input.`:`Play auto-stopped after ${t}s with no session command and no player input. Recording finalized: ${ks(e)}`,"play-recording"),wn?.()}C().session.onCommandDispatched(()=>bn());const Ds={source:"live",label:"live",detail:"Running DOM adopted from the playing game. Edits apply to this session only and are discarded when play stops."},kt="structure is owned by the running React tree — play edits are live-DOM only and are discarded on stop; stop play to change structure in source";function je(t,e){const n=[];for(const r of Or(t).nodes.values())r.oid===e&&n.push(r.el);return n}function Ot(t){return t.style?t.style:null}function Fs(t){return{writeStyle:async(e,n,r)=>{const s=je(t,e);if(s.length===0)return{changed:!1,error:`no live element carries oid "${e}"`};for(const o of s){const a=Ot(o);a&&(a[n]=r)}return{changed:!0,route:"live-dom"}},removeStyle:async(e,n)=>{const r=je(t,e);if(r.length===0)return{changed:!1,error:`no live element carries oid "${e}"`};let s=!1;for(const o of r){const a=Ot(o),i=a?.[n];a&&i!==void 0&&i!==null&&i!==""&&(delete a[n],s=!0)}return{changed:s,route:"live-dom"}},writeText:async(e,n)=>{const r=je(t,e).filter(o=>o.children.length===0);if(r.length===0)return{changed:!1,error:`no live leaf element carries oid "${e}"`};const s=r[0]?.textContent??null;for(const o of r)o.textContent=n;return{changed:!0,prevText:s}},writeProp:async(e,n)=>({changed:!1,error:`prop "${n}" is owned by the running React element (its value lives at the parent call site, not in the DOM) — play edits are live-DOM only and are discarded on stop; stop play to change it in source`}),writeStruct:async()=>({changed:!1,error:kt}),writeStructMany:async()=>({changed:!1,error:kt})}}function Gs(t,e){return new kr(t,e.shell,{writeBackend:Fs(t),provenance:Ds})}function Ln(){return{id:"",journalSession:"",name:"",container:null,session:null,presentation:null,unregisterPerformanceSource:null,unsubscribeSystemAdapters:null,determinismDeclared:!1,resizeObserver:null,rootResources:[]}}const d=Ln(),B=[];let se=[],U=null;const Ye=new Set;function ut(){return U&&(U===d.id||B.some(t=>t.id===U))?U:d.id}function Uo(){return d.id}function Vo(t){return Ye.add(t),()=>Ye.delete(t)}function dt(){for(const t of Ye)t()}function Wo(t){Ut(t),ut()!==t&&(U=t,dt())}function Xe(t){if(!T)return!1;const{store:e}=T;return e.shell.playState==="playing"&&e.shell.activeViewportTab==="play"&&ut()===t&&sr()}let T=null;const we=new Set;function Bs(){return T?Promise.resolve():new Promise((t,e)=>{const n=()=>{clearTimeout(r),we.delete(n),t()},r=setTimeout(()=>{we.delete(n),e(new Error("Play mode failed to start: the editor shell did not bind within 15 seconds."))},15e3);we.add(n)})}const Je=new Set,Me=new Set;let Se=null;function En(){return Se}function qo(t){return Me.add(t),()=>Me.delete(t)}function js(t){Se=t;for(const e of Me)e();C().live.notifyChanged()}const ze=new Set;function zs(){if(ze.size>0){const t=[...ze].map(e=>({severity:"warn",message:e}));ze.clear(),Qn("console-resolved",{conditions:t,by:"play-mode"})}if(Se!==null){Se=null;for(const t of Me)t();C().live.notifyChanged()}}function Re(){Mn();for(const t of Je)t()}function Ho(t){return Je.add(t),()=>Je.delete(t)}let R=0,ft=null,Pe=null;vr();let be;function he(t){const e={...t.capabilities,persist:!1},n=hr(),r=()=>ar({resolve:()=>ir("play edits are session-local by architecture",lr),record:()=>{}}),s=t.transforms,o=s&&{...s,get:c=>s.get(c),beginEdit:c=>s.beginEdit(c),apply:(c,g)=>s.apply(c,g),endEdit:c=>(s.endEdit(c),r()),...s.remove?{remove:()=>r()}:{}},a=t.inspector,i=a&&{...a,properties:c=>a.properties(c),get:(c,g)=>a.get(c,g),set:(c,g,l)=>(a.set(c,g,l),r()),...a.remove?{remove:()=>r()}:{}};return new Proxy(t,{get(c,g){if(g==="capabilities")return e;if(g==="persistence")return n;if(g==="transforms"&&o)return o;if(g==="inspector"&&i)return i;const l=Reflect.get(c,g,c);return typeof l=="function"?l.bind(c):l}})}function Ns(){be!==void 0&&(Jt(be),be=void 0)}async function $s(t,e,n,r,s){be=dr();const o=[],a=[],i=()=>{for(const l of a)"dispose"in l&&typeof l.dispose=="function"&&l.dispose()};for(const l of e){const p=n?er(n,l.id):void 0,f=p?{zOrder:p.zOrder,pausable:p.pausable,...p.entry?{content:`Entry · ${p.entry}`}:{}}:{};if(p?.adapter.identity==="ingest-react"){o.push({worldId:l.id,kind:l.kind,adapter:new wt(t.shell,{id:l.id,kind:l.kind,adapter:p.adapter.identity,entryOrScenePath:p.entry,zOrder:p.zOrder,pausable:p.pausable}),...f});continue}const u=l.mounted;if(u.kind==="three"){const h=tt(u).scene,E=l.id===r&&h===t.scene,w=E?await Cr():void 0;if(!s()){i();return}const _=E?Ar(t,h,Sr(l.id),Ne(l.id),{explicitSourceCommit:!0,sourceAnchor:w}):xr(t,h,{frameControl:"host",journal:Ne(l.id)});a.push(_),o.push({worldId:l.id,kind:l.kind,adapter:he(_),...f})}else if(u.kind==="canvas"){if(u.substrate.name==="babylon"){const{BabylonAuthoringAdapter:A}=await z(async()=>{const{BabylonAuthoringAdapter:Oe}=await import("./babylon-authoring-adapter-C8mFMXSr.js");return{BabylonAuthoringAdapter:Oe}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]));if(!s()){i();return}const te=new A(u.substrate.root,t,{canvas:u.canvas,api:u.substrate.api,provenance:{source:"live",label:"live",detail:"Native Babylon.js play scene; ordinary Play edits are ephemeral."}});a.push(te),o.push({worldId:l.id,kind:l.kind,adapter:he(te),...f});continue}if(u.substrate.name!=="pixi"){const A=new wt(t.shell,{id:l.id,kind:l.kind,adapter:u.substrate.name,entryOrScenePath:p?.entry,zOrder:p?.zOrder??0,pausable:p?.pausable??!0},`No authoring adapter is registered for canvas substrate "${u.substrate.name}".`);a.push(A),o.push({worldId:l.id,kind:l.kind,adapter:A,...f});continue}const h=u.substrate.root,[E,w,_,y,v]=await Promise.all([z(()=>import("./physics-registry-B2Jkp8e6.js"),[]),z(()=>import("./system-adapters-rIC8FSGP.js"),[]),z(()=>import("./pixi-authoring-adapter-BChknIdC.js").then(A=>A.p),__vite__mapDeps([14,15,1,2,3,4,5,6,7,8,9,10,12,13,16,17,18,11,19])),z(()=>import("./pixi-live-write-target-BjDsBQbp.js"),__vite__mapDeps([20,1,2,3,4,5,6,7,8,9,10,11,12,13,19])),z(()=>import("./canvas-entry-runtime-UNYuSfG0.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,8,9,10,22]))]);if(!s()){i();return}const{createPhysics2DRegistry:O}=E,{createPhysicsAdapter2D:M}=w,{PixiAuthoringAdapter:P}=_,{createLiveCanvasWriteTarget:D}=y,F=M(l.physics2d??O()),L=new P(h,t,{pixi:await v.resolveCanvasPixiForEditor(),target:D({physics:F}),journal:Ne(l.id),surface:Ws});a.push(L),o.push({worldId:l.id,kind:l.kind,adapter:he(L),...f})}else if(u.kind==="dom"){const h=Gs(u.container,t);a.push(h),o.push({worldId:l.id,kind:l.kind,adapter:he(h),...f})}else Tr(u,"installPlayRootAuthoring")}if(!s()){i();return}d.rootResources=a;const c=tr(Ce()?.config),g=new nr(o,void 0,c);Jt(g),t.shell.notifyIngestEdit()}function Ne(t){return en(d.id,t)}function Us(t){for(const e of d.rootResources)"dispose"in e&&typeof e.dispose=="function"&&e.dispose();d.rootResources=[],d.journalSession&&(t.shell.projectHistory?.expireSession(d.journalSession),d.journalSession="")}function Vs(t){return!(t.defaultPrevented||ur(t.target))}let oe=null,ae=null,ie=null,le=null,ce=null,V=Promise.resolve(),Le=null,q=[],Ee=0;function _n(){const t=d.session?.game;if(!t)return{};const e=t.roots,n=d.presentation?.worldId??(e.length===1?e[0]?.id:void 0),r=t.loop.timeScale;return{...n!==void 0?{world:n}:{},...typeof r=="number"?{simSpeed:r}:{}}}function Ze(){const t=d.session?.game?.systemAdapters?.debug;if(t)try{const e=os(t.events(Ee),Ee);Ee=e.lastSeq;const n=_n();for(const r of e.entries)q.push({...r,...n})}catch{}}Vn(t=>{gr(t),d.session&&js("Project assets changed — restart play to load the revised models or textures.")});function Ws(){return C().workspace.liveDocument.container()}function qs(){const t=()=>{const e=C().workspace.liveDocument.container();if(!e)return;const n=typeof document<"u"?document.activeElement:null;n instanceof HTMLElement&&n!==e&&n.tagName==="BUTTON"&&n.blur(),e.hasAttribute("tabindex")||(e.tabIndex=-1);try{e.focus({preventScroll:!0})}catch{}or("viewport")};t(),setTimeout(t,150),setTimeout(t,600)}Dr(t=>Hs(t));function Hs(t){T={store:t,gameContainer:null},xs(J);for(const e of we)e()}function $e(){return d.session!==null}function pe(){const t=d.session?.game;if(!t)return null;const e=sn(t),n=e?.getRunTicksTarget()??null;return{getInputTarget:r=>e?.getVirtualInputTarget(r)??null,loop:t.loop,runTicks:n?n.runTicks.bind(n):null,runTicksSettled:e&&n?(r,s)=>Jr(e,r,s):null,random:Pr(t),determinismDeclared:d.determinismDeclared}}function Ko(){const t=d.session?.game.defaultRoot.mounted;return t?.kind==="three"?tt(t).scene:null}function Yo(){const t=d.session?.game?.roots;return t?t.map(e=>{const n=e.mounted;let r=!1;if(n.kind==="three")r=Er(tt(n).scene);else if(n.kind==="canvas")try{r=n.substrate.name==="pixi"?Lr(n.substrate.root):n.substrate.name==="babylon"?(n.substrate.root.scenes??[]).some(s=>(s.rootNodes?.length??0)>0):!1}catch{r=!1}else r=_r(n.container);return{rootId:e.id,kind:n.kind,hasRenderableContent:r}}):[]}function Ks(){return d.session?$t(C().workspace.liveDocument.container()).canvas:null}function Ys(t){return!t||t===d.id?C().workspace.liveDocument.container():B.find(e=>e.id===t)?.container??null}function Xo(t){if(!t||t===d.id)return Ks();const e=B.find(n=>n.id===t);return e?.session?$t(e.container).canvas:null}function Xs(){return ft}function Js(){return Pe}function K(){return[d,...B].filter(t=>t.session)}const me=new Set;function Mn(){const t=new Set(K().map(e=>e.session.game.loop));for(const e of me)t.has(e)||me.delete(e);for(const e of t)pr()?me.delete(e)&&e.start():e.liveness!=="stopped"&&(me.add(e),e.stop())}mr(Mn);function Dt(){const t=K(),e=cr();return t.find(n=>n.id===e)??t[0]??null}let Te=null;function Zs(){Te?.(),Te=rr(()=>({projectName:Ce()?.config.name??null,instanceName:K().length>1?Dt()?.name??null:null})),Zt(()=>{const t=Dt();return t?.session?{game:t.session.game,instanceId:t.id,recording:fr}:null})}function Qs(){Te?.(),Te=null,Zt(null)}function Jo(t,e,n){for(const r of K())r.session?.resize(t,e,n)}let Ft=Promise.resolve(),Ie=null,gt=null;function Zo(){return Ie}function eo(){const t=globalThis.crypto?.randomUUID?.()??`private-${Date.now()}`;return{mode:"private",id:t,roomKey:`private:${t}`,revision:null,participantId:$n}}function Gt(t,e=eo(),n,r){const s=r??null,o=Ft.then(()=>(zn(),no(t,e,n??null,s).finally(()=>{Nn()})));return Ft=o.then(()=>{},()=>{}),o}async function to(t){const{autoLaunchIngest:e}=await z(async()=>{const{autoLaunchIngest:s}=await import("./mount-ingest-root-DYR0TMIt.js").then(o=>o.m);return{autoLaunchIngest:s}},__vite__mapDeps([23,1,2,3,4,5,6,7,8,9,10,24,25,26,13,27,28,29,30,31,32,33,34,18,17,35,36]));await e(t);const n=br();if(n)return n.play(),!0;const{isModuleModeActive:r}=await z(async()=>{const{isModuleModeActive:s}=await import("./module-mode-BH2R93XP.js");return{isModuleModeActive:s}},__vite__mapDeps([37,1,2,3,4,5,6,7,8,9,10,26,25,38,39,40,22,27,41,42,43,32,44,45,31,46,47,21,48,49,50,51,33,52,53,54]));return r()}function Ue(t,e){return W(t),ss(t,e,{isHidden:()=>typeof document<"u"&&document.hidden,editorUrl:typeof window<"u"?window.location.href:void 0})}async function no(t,e,n,r){if(!T){const f=R;if(W("waiting for the editor to bind Play"),await Bs(),R!==f)throw new Error("Play start cancelled while waiting for the editor to bind.")}if(!T)throw new Error("Play mode failed to start: the editor shell is not bound.");if(W("waiting for the project bootstrap to settle"),await Wn(),d.session&&J(),gt=r,await to(T.store)||await Rr(T.store))return;const s=++R;Ie=e,ft=Date.now(),Pe=null;const{store:o}=T;uo();const a=V.then(()=>Gr(n));if(V=a,await Ue("starting the play log session",a),s!==R||(q=[],Ee=0,S.setSink(f=>{let u;try{const h=d.session?.game?.systemAdapters.debug?.state("time");typeof h?.tick=="number"&&typeof h.simSeconds=="number"&&(u={tick:h.tick,simT:h.simSeconds})}catch{}q.push({t:f.timestamp,level:f.level,msg:f.message,...f.source?{source:f.source}:{},...f.subsystem?{sub:f.subsystem}:{},...f.metadata?{meta:f.metadata}:{},...u??{},..._n()})}),Le=setInterval(()=>{if(Ze(),q.length>0){const f=q.splice(0);V=V.then(()=>on(f))}},200),oe=f=>{f.key==="Escape"&&Vs(f)&&J()},window.addEventListener("keydown",oe),W("opening the Game document"),await C().workspace.liveDocument.acquire(),s!==R))return;const i=C().workspace.liveDocument.container();if(!i){const f="Play mode failed to start: the game container is not mounted in the workspace.";throw S.error(f,"play-mode"),J(),new Error(f)}const c=i.clientWidth,g=i.clientHeight;i.style.contain||(i.style.cssText+=rn),Vt(i),Ve(i),C().viewport.transition.begin(),o.shell.setPlayState("playing"),qs(),S.log("Play mode started","play-mode"),C().viewport.transition.onSettled(()=>{s===R&&o.shell.playState==="playing"&&qn()});let l=null,p=null;try{const f=Ce();if(!f)throw new Error("No project open — open or create a project first");const u=await Ue("fetching the project manifest",Wt());se=ge(u).map(L=>L.id);for(const L of se)vt({rootId:L,mechanism:"host-mount",source:"declared",state:"waiting"});let h;qt();const{entries:E,mountId:w}=await Ue("resolving the project's root entries",tn(u,f.rootPath,{selectionOverride:r??void 0}));if(S.log(`Resolved manifest composition (${ge(u).length} world${ge(u).length===1?"":"s"}): `+ge(u).map(L=>`${L.id} (${L.surface})`).join(", "),"play-mode"),s!==R)return;const _=i.clientWidth||c,y=i.clientHeight||g;Ve(i,w),l=w,W("mounting the runtime roots");const{mountManifestRoots:v}=await z(async()=>{const{mountManifestRoots:L}=await import("./mount-manifest-DdkFYdVA.js");return{mountManifestRoots:L}},__vite__mapDeps([55,41,1,2,3,4,5,6,7,8,9,10,56,57,58,59,60,61,31,32,62,63,64,65,66,67,68,69,22,70,71,72,73,74,75,76,39,40,27,25,77,78,79,80,81,45,46,82,26,83,11,38,42,43,44,47,21,48,49,50,51,33,52,53,54,84,24,13,85,86,87,88,35,17,18,36,89,34,16,90,91,12,92,93,94,95,96,97,98,99,100,101,102,103,104,105,28,29,30,106]));if(h=await v({manifest:u,container:i,entries:E,width:_,height:y,seed:t,playtest:e}),p=h,s!==R){h.stop(),de(h,w,"Cancelled instance");return}for(const L of Ht(f.rootPath))S.error(Kt(L),"play-mode");for(const L of se)vt({rootId:L,mechanism:"host-mount",source:"declared",state:"ready"});if(Qt(h.game),d.session=h,d.id=w,d.journalSession=en(w,"").session,d.name=Sn(0),d.unregisterPerformanceSource?.(),d.unregisterPerformanceSource=Yt({id:"workspace:game",label:"Game runtime",kind:"game",instanceId:w,profiler:h.game.profiler}),zs(),d.determinismDeclared=u.determinism?.seededRandom===!0,u.configurations.some(L=>L.kind==="process")&&sn(h.game)?.setRoomDeclared(!0),Re(),o.shell.setPlayEditRegime("ephemeral"),d.presentation=Fr(h.game.roots)??Mr(o,h.game.roots),W("installing play authoring for each root"),await $s(o,h.game.roots,u,d.presentation?.worldId??null,()=>s===R),s!==R)return;W("binding the editor to the running game");const O=h.game.systemAdapters;ue(O,w),Ut(w),Zs(),d.unsubscribeSystemAdapters?.(),d.unsubscribeSystemAdapters=h.game.subscribeSystemAdapters?.(()=>{Xt(h.game.systemAdapters,w)})??null,_e(()=>Xe(w),w),_e(()=>Xe(ut()));const M=Hn(O.physics);o.setEcsSyncTransform((L,A)=>{!M||M.ownerOf(L)==="unresolved"||M.commit(L,{position:A.position.toArray(),rotation:A.quaternion.toArray(),scale:A.scale.toArray()})});const P=Qr(),D=i.clientWidth,F=i.clientHeight;D>0&&F>0&&(D!==c||F!==g||P!==null)&&h.resize(D,F,P??void 0),C().viewport.transition.ready(()=>{const L=d.session?.game;if(!L)return null;for(const A of L.roots)if(A.mounted.kind==="three")return A.mounted.camera;return null})}catch(f){const u=`Play mode failed to start: ${f}`;if(S.error(u,"play-mode"),l!==null&&d.id!==l)if(p){try{p.stop()}catch(h){S.error(`Error stopping the failed play session: ${h}`,"play-mode")}de(p,l,"Failed instance")}else ke(l,"Failed instance");throw s===R&&J(),new Error(u)}}async function Qo(t,e){if(!T)throw new Error("Cannot mount an additional instance: play mode is not bound.");if(!d.session)throw new Error("Cannot mount an additional instance: no primary play session is running.");const n=R,r=Ce();if(!r)throw new Error("Cannot mount an additional instance: no project is open.");const s=await Wt();qt();const{entries:o,mountId:a}=await tn(s,r.rootPath,{selectionOverride:gt??void 0});t.style.contain||(t.style.cssText+=rn),Vt(t),Ve(t,a);const{mountManifestRoots:i}=await z(async()=>{const{mountManifestRoots:f}=await import("./mount-manifest-DdkFYdVA.js");return{mountManifestRoots:f}},__vite__mapDeps([55,41,1,2,3,4,5,6,7,8,9,10,56,57,58,59,60,61,31,32,62,63,64,65,66,67,68,69,22,70,71,72,73,74,75,76,39,40,27,25,77,78,79,80,81,45,46,82,26,83,11,38,42,43,44,47,21,48,49,50,51,33,52,53,54,84,24,13,85,86,87,88,35,17,18,36,89,34,16,90,91,12,92,93,94,95,96,97,98,99,100,101,102,103,104,105,28,29,30,106])),c=await i({manifest:s,container:t,entries:o,width:t.clientWidth,height:t.clientHeight,playtest:Ie});for(const f of Ht(r.rootPath))S.error(Kt(f),"play-mode");if(n!==R||!d.session){try{c.stop()}catch{}return de(c,a,e?.trim()||"Cancelled instance"),a}Qt(c.game);const g=Ln();g.id=a,g.name=e?.trim()||Sn(B.length+1),g.container=t,g.session=c,g.unregisterPerformanceSource=Yt({id:`workspace:game:${a}`,label:`Game runtime (instance ${a})`,kind:"game",instanceId:a,profiler:c.game.profiler});const l=c.game.systemAdapters;ue(l,a),g.unsubscribeSystemAdapters=c.game.subscribeSystemAdapters?.(()=>{Xt(c.game.systemAdapters,a)})??null,_e(()=>Xe(a),a),B.push(g);const p=d.session.game.systemAdapters;return ue(p,d.id),Re(),a}function ro(){return B.map(t=>t.id)}function ea(){const t=[];d.id&&t.push({id:d.id,name:d.name});for(const e of B)e.id&&t.push({id:e.id,name:e.name});return t}function so(t){return d.id===t?d.name:B.find(e=>e.id===t)?.name}function ke(t,e){t&&(nn(t),yr(t,e))}function de(t,e,n){t.stopComplete.then(()=>ke(e,n))}function oo(t){const e=B.findIndex(s=>s.id===t);if(e<0)return;const[n]=B.splice(e,1);if(!n)return;n.unsubscribeSystemAdapters?.(),n.unsubscribeSystemAdapters=null;const r=n.session;try{r?.stop()}catch(s){S.error(`Error stopping additional instance ${n.id}: ${s}`,"play-mode")}n.unregisterPerformanceSource?.(),ue(null,n.id),r?de(r,n.id,n.name):ke(n.id,n.name),n.container=null,n.session=null,U===t&&(U=null,dt()),Re()}function ao(){for(const t of ro())oo(t)}let Q=[];const Qe=new Set;function ht(t){if(t===0){const e=Un()?.getPlayerIdentity?.()?.name?.trim();if(e)return e}return`Instance ${t+1}`}function ta(){return Q.length===0?0:Q.length-1}function Sn(t){return Q[t]??ht(t)}function na(t){return Qe.add(t),()=>Qe.delete(t)}function io(){for(const t of Qe)t()}function lo(t){const e=Math.max(0,Math.floor(t));co(e===0?[]:Array.from({length:e+1},(n,r)=>ht(r)))}function co(t){const e=t.length<=1?[]:t.map((n,r)=>n?.trim()?n.trim():ht(r));e.length===Q.length&&e.every((n,r)=>n===Q[r])||(Q=e,io())}function J(){if(R++,jn(),!T||(ct("teardown"),Qs(),gt=null,Ir(T.store)))return;Ie=null,U=null,dt();const{store:t}=T;Ze(),lo(0),ao(),C().viewport.transition.end(),t.setEcsSyncTransform(null);const e=d.id,n=d.name||"Game instance";d.id="",d.unsubscribeSystemAdapters?.(),d.unsubscribeSystemAdapters=null,ue(null,e),d.presentation?.dispose(),d.presentation=null,Us(t),Ns(),t.shell.setPlayEditRegime(null);const r=d.session;if(r)try{r.stop()}catch(s){S.error(`Error stopping play session: ${s}`,"play-mode")}finally{d.unregisterPerformanceSource?.(),d.unregisterPerformanceSource=null,d.session=null,d.determinismDeclared=!1,Re()}r?de(r,e,n):ke(e,n);for(const s of se)Kn(s);if(se=[],_e(()=>!0),nn(),d.resizeObserver?.disconnect(),d.resizeObserver=null,oe&&(window.removeEventListener("keydown",oe),oe=null),S.log("Play mode stopped","play-mode"),Yn(),Le&&(clearInterval(Le),Le=null),Ze(),S.setSink(null),q.length>0){const s=q.splice(0);V=V.then(()=>on(s))}V=V.then(()=>Br()),fo(),t.shell.setPlayState("stopped"),C().workspace.liveDocument.release(),ft!==null&&Pe===null&&(Pe=Date.now())}function ra(){if(!(!d.session||!T)){for(const t of K())t.session?.pause();T.store.shell.setPlayState("paused"),S.log("Play mode paused","play-mode")}}function sa(){if(!(!d.session||!T)){for(const t of K())t.session?.resume();T.store.shell.setPlayState("playing"),S.log("Play mode resumed","play-mode")}}function oa(){if(d.session)for(const t of K())t.session?.step()}function uo(){Xn(),ae=console.log,ie=console.info,le=console.warn,ce=console.error;const t=(e,n)=>{if(qe)return;const r=wr();S.logStructured(e,Zn(n),"game",void 0,r?{instanceId:r,instanceName:so(r)??`Instance ${r}`}:void 0)};console.log=(...e)=>{ae?.apply(console,e),t("info",e)},console.info=(...e)=>{ie?.apply(console,e),t("info",e)},console.warn=(...e)=>{le?.apply(console,e),t("warn",e)},console.error=(...e)=>{ce?.apply(console,e),t("error",e)}}function fo(){Jn(),ae&&(console.log=ae),ie&&(console.info=ie),le&&(console.warn=le),ce&&(console.error=ce),ae=null,ie=null,le=null,ce=null}C().live.register({id:"play",priority:0,mounted:$e,playing:$e,stop:J,instanceContainer:t=>Ys(t),startedAt:Xs,endedAt:Js,restartRequired:En,restart:()=>void Gt(),remount:async t=>{try{return await Gt(void 0,void 0,void 0,t),$e()?{ok:!0}:{ok:!1,error:"Play did not start: the remount was superseded before it finished booting."}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}});C().session.reportFacet(()=>({timeScale:pe()?.loop.timeScale??null,loopLiveness:pe()?.loop.liveness??null,restartRequired:En(),seed:pe()?.random?.seed??null,deterministic:pe()?.determinismDeclared??!1}));export{Xo as A,Rs as B,mn as C,Ts as D,Ko as E,un as F,gn as G,Go as H,Do as I,Fo as J,ko as K,Oo as L,Vo as M,jo as N,es as O,zo as P,Jo as Q,Wo as R,Uo as S,Sn as T,Yo as U,Ho as V,Qo as W,oo as X,Bo as Y,Zr as Z,No as _,ea as a,co as b,yn as c,oa as d,Gt as e,ct as f,pe as g,J as h,$e as i,$o as j,sa as k,Zo as l,Br as m,bn as n,on as o,ra as p,Gr as q,Jr as r,lo as s,Ws as t,ut as u,na as v,ta as w,qo as x,En as y,Ys as z};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BRJMIUK0.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-0Lm0Nf1M.css","assets/gameplay-export-BzYzLZPi.js","assets/output-DK8waum9.js","assets/play-mode-DICV4cKP.js","assets/adapter-runtime-bindings-4cmsRvRh.js","assets/native-debug-module-2_HVupdg.js","assets/native-entry-surface-BE8LJNdu.js","assets/debug-registry-P0_YQGWd.js","assets/contract-system-adapters-Bic_7sev.js","assets/game-contract-seams-BnPFGLll.js","assets/seeded-random-BgCwIAAU.js","assets/game-audio-CaGKzia4.js","assets/game-network-Ct2FQYmu.js","assets/index-OZVqp6xS.js","assets/index-Da9JhEvW.js","assets/rapier-physics-adapter-CaZqWLu0.js","assets/events-156d8d12.esm-CYeuVCYr.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/index-bQE2NA0D.js","assets/live-project-verbs-C3LzprCe.js","assets/capability-coverage-DZ-onC5j.js","assets/edit-mode-authoring-DeCxPcHM.js","assets/json-history-resource-DwS10tqD.js","assets/binding-resolver-dE0GnZT5.js","assets/adapter-surface-Y37Nzcyw.js","assets/entry-adjudication-Dc18TIqT.js","assets/structural-signature-Dc7skRiy.js","assets/webgl-frame-capture-DdJkM2mi.js","assets/realm-services-CnY105XU.js","assets/canvas-entry-runtime-UNYuSfG0.js","assets/three-ingest-runtime-B7rtg3QE.js","assets/EffectComposer-BEAt0PtQ.js","assets/CopyShader-BzTUYzf6.js","assets/ShaderPass-DTnDQXm0.js","assets/Pass-D1MRT672.js","assets/CSS3DRenderer-BsAqfavI.js","assets/relative-path-guard-GiM7Lsz8.js","assets/react-root-BHA-cdrW.js","assets/editor-presentation-activity-C7SNSmTd.js","assets/active-ingest-DA426a81.js","assets/ingest-source-persistence-Dmdo-UBp.js","assets/pixi-story-model-DNkfnWUV.js","assets/surface-content-Dg9Kkazf.js","assets/viewport-root-presentation-vgxsTyj4.js","assets/mounted-authoring-Clftxx0x.js","assets/entity-object-JmYMfLsx.js","assets/user-data-Bpj7diUS.js","assets/workspace-arrangement-BdAlBwvd.js","assets/three-contract-Dkt6PmWY.js","assets/three-TCuY32m_.js","assets/editor-layers-BDJnAAzj.js","assets/component-instance-root-B0C5oNEm.js","assets/viewport-editor-controls-BYaAZ_Ku.js","assets/three-authoring-adapter-htbnVej2.js","assets/source-persistence-backend-CwLYVPXj.js","assets/three-projection-core-CG01r5Ta.js","assets/body-marks-RKb_LTwL.js","assets/user-data-dHvLdpwM.js","assets/object-marks-DwvIEBOK.js","assets/structural-ids-Br2zjINh.js","assets/object3d-authoring-subject-BDrxd1GA.js","assets/r3f-physics-binding-DzrbpqjM.js","assets/deferred-ingest-play-BdR4qGk6.js","assets/rrweb-Cd2ifIRP.js","assets/react-world-authoring-adapter-DOjv2pYm.js","assets/board-guides-BEKPgD9M.js","assets/relative-import-specifier-BFKIWEWs.js","assets/story-arg-descriptors-Ek86ExX7.js","assets/inspect-Dr4qvDpJ.js","assets/inference-diagnostics-xecGdohW.js","assets/writer-tw6EcuVO.js","assets/three-state-DwFE3ay2.js","assets/editor-shell-store-ChLcVeNB.js","assets/output-pass-HurwNl0G.js","assets/viewport-door-Bj_ZIP85.js","assets/editor-api-BFTIRlWa.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{q as y,aa as g,_ as f,ab as R,a3 as w}from"./index-BRJMIUK0.js";import{c as T,n as D,d as A,f as F,h as M,e as O,j as $,g as L,k as N,p as q}from"./play-mode-DICV4cKP.js";import{r as W}from"./index-CtzuWnCS.js";import{n as z,s as k}from"./command-results-CUQD49AB.js";import{s as H,a as j}from"./run-selection-DzEkGesJ.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-CinJrH5C.js";import"./adapter-runtime-bindings-4cmsRvRh.js";import"./native-debug-module-2_HVupdg.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-P0_YQGWd.js";import"./contract-system-adapters-Bic_7sev.js";import"./game-contract-seams-BnPFGLll.js";import"./seeded-random-BgCwIAAU.js";import"./game-audio-CaGKzia4.js";import"./game-network-Ct2FQYmu.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-C3LzprCe.js";import"./capability-coverage-DZ-onC5j.js";import"./edit-mode-authoring-DeCxPcHM.js";import"./json-history-resource-DwS10tqD.js";import"./binding-resolver-dE0GnZT5.js";import"./adapter-surface-Y37Nzcyw.js";import"./entry-adjudication-Dc18TIqT.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-CnY105XU.js";import"./canvas-entry-runtime-UNYuSfG0.js";import"./three-ingest-runtime-B7rtg3QE.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./editor-presentation-activity-C7SNSmTd.js";import"./active-ingest-DA426a81.js";import"./ingest-source-persistence-Dmdo-UBp.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-vgxsTyj4.js";import"./mounted-authoring-Clftxx0x.js";import"./entity-object-JmYMfLsx.js";import"./user-data-Bpj7diUS.js";import"./workspace-arrangement-BdAlBwvd.js";import"./three-contract-Dkt6PmWY.js";import"./three-TCuY32m_.js";import"./editor-layers-BDJnAAzj.js";import"./component-instance-root-B0C5oNEm.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-htbnVej2.js";import"./source-persistence-backend-CwLYVPXj.js";import"./three-projection-core-CG01r5Ta.js";import"./body-marks-RKb_LTwL.js";import"./user-data-dHvLdpwM.js";import"./object-marks-DwvIEBOK.js";import"./structural-ids-Br2zjINh.js";import"./object3d-authoring-subject-BDrxd1GA.js";import"./r3f-physics-binding-DzrbpqjM.js";import"./deferred-ingest-play-BdR4qGk6.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-DOjv2pYm.js";import"./board-guides-BEKPgD9M.js";import"./relative-import-specifier-BFKIWEWs.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-Dr4qvDpJ.js";import"./inference-diagnostics-xecGdohW.js";import"./writer-tw6EcuVO.js";import"./three-state-DwFE3ay2.js";import"./editor-shell-store-ChLcVeNB.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-Bj_ZIP85.js";import"./configurations-BXU4GGbV.js";const St="workspace.command";async function x(e){const{liveCanvasFrame:t}=await f(async()=>{const{liveCanvasFrame:r}=await import("./index-BRJMIUK0.js").then(o=>o.tT);return{liveCanvasFrame:r}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]));return t(e)}function B(){const e=L();e?.loop.liveness==="loop-starved"&&e.runTicks?.(1,{render:"last"})}function J(){const e=w().audio,t=e?.renderOffline;if(!e||!t)return;let r=null;try{const o=w().debug?.state("time");typeof o?.simSeconds=="number"&&Number.isFinite(o.simSeconds)&&(r=o.simSeconds)}catch{r=null}if(r!==null)return{startSeconds:r,render:t.bind(e)}}let d=null;const _t={play:{timeoutMs:12e4,derivedRefresh:"always",handle:async e=>{try{const o=e.seed,l=e.name,m=await j();if(!m.ok)return{ok:!1,error:`${m.title}: ${m.detail}`};await O(typeof o=="number"?o:void 0,void 0,typeof l=="string"?l:null)}catch(o){return{ok:!1,error:o instanceof Error?o.message:String(o)}}if(!y().live.playing())return{ok:!1,error:"Play did not start: the run was superseded before it finished booting (a stop, or a newer play, landed during startup). Nothing is running."};const t=e.record,r=await $(g()??y().workspace.liveDocument.container(),{name:typeof t=="string"?t:null,audio:w().audio?.acquireRecordingStream?.()??null,canvasFrame:x,refreshFrame:B});return{ok:!0,...r?{data:{recording:r}}:{}}}},stop:{timeoutMs:3e4,derivedRefresh:"always",handle:async()=>{d?.abort(new Error("Video export cancelled by Stop."));const e=await F("stop");return M(),await H(),{ok:!0,...e?{data:{recording:e}}:{}}}},pause:{derivedRefresh:"always",handle:()=>(q(),{ok:!0})},resume:{derivedRefresh:"always",handle:()=>(N(),{ok:!0})},step:{derivedRefresh:"always",handle:()=>(A(),{ok:!0})},"bridge-recording-export":{timeoutMs:6e5,derivedRefresh:"none",handle:async e=>{const t=y();if(t.session.playState()!=="paused")return{ok:!1,error:"Pause the game before exporting video."};const r=g();if(!r)return z();if(d)return{ok:!1,error:"A video export is already active."};const{exportGameplayVideo:o,validateGameplayExport:l,assertGameplayVideoSupport:m}=await f(async()=>{const{exportGameplayVideo:n,validateGameplayExport:u,assertGameplayVideoSupport:s}=await import("./gameplay-export-BzYzLZPi.js");return{exportGameplayVideo:n,validateGameplayExport:u,assertGameplayVideoSupport:s}},__vite__mapDeps([10,0,1,2,3,4,5,6,7,8,9,11])),h={frames:Number(e.frames),fps:e.fps===void 0?30:Number(e.fps)};try{l(h)}catch(n){return k(n)}if(d)return{ok:!1,error:"A video export is already active."};const i=new AbortController;d=i,R(!0);const S=setTimeout(()=>i.abort(new Error("Video export exceeded its ten-minute deadline.")),59e4),v=t.live.runWindow()?.startedAt??null,_=t.session.subscribe(()=>{(t.session.playState()!=="paused"||(t.live.runWindow()?.startedAt??null)!==v)&&i.abort(new Error("Video export cancelled: the Play session changed."))}),b=J();try{await m(r),i.signal.throwIfAborted();const{gameplayRecordingActive:n}=await f(async()=>{const{gameplayRecordingActive:a}=await import("./play-mode-DICV4cKP.js").then(p=>p._);return{gameplayRecordingActive:a}},__vite__mapDeps([12,0,1,2,3,4,5,6,7,8,9,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84]));n()&&await T();const{blob:u,...s}=await o(r,h,{step:()=>W.flushSync(()=>A()),assertActive:()=>{if(D(),t.session.playState()!=="paused"||g()!==r||(t.live.runWindow()?.startedAt??null)!==v)throw new Error("Video export interrupted: its game must remain paused and mounted.")},canvasFrame:x,signal:i.signal,...b?{audio:b}:{}}),{beginGameplayRecordingSink:E,appendGameplayRecordingChunk:P,finishGameplayRecordingSink:G,abortGameplayRecordingSink:V}=await f(async()=>{const{beginGameplayRecordingSink:a,appendGameplayRecordingChunk:p,finishGameplayRecordingSink:I,abortGameplayRecordingSink:C}=await import("./editor-api-BFTIRlWa.js");return{beginGameplayRecordingSink:a,appendGameplayRecordingChunk:p,finishGameplayRecordingSink:I,abortGameplayRecordingSink:C}},__vite__mapDeps([85,0,1,2,3,4,5,6,7,8,9,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84]));i.signal.throwIfAborted();const c=await E({startedAt:new Date().toISOString(),mimeType:"video/webm",purpose:"export",name:typeof e.name=="string"?e.name:`export-${Date.now()}`},i.signal);try{for(let a=0,p=0;a<u.size;a+=4*1024*1024,p++)i.signal.throwIfAborted(),await P(c,p,u.slice(a,a+4*1024*1024),i.signal);i.signal.throwIfAborted(),await G(c,s.audio?`fixed-step export with audio (${s.audio.codec}, ${s.audio.channels}ch @ ${s.audio.sampleRate} Hz)`:"fixed-step export, video only: this world has no AudioAdapter.renderOffline",i.signal),i.signal.throwIfAborted()}catch(a){throw await V(c),a}return{ok:!0,data:{...s,path:c.path}}}catch(n){return k(n)}finally{_(),clearTimeout(S),d=null,R(!1)}}}};export{_t as commands,St as point};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as h}from"./jsx-runtime-DPjLkJKQ.js";import{Z as p,$ as w,eF as m,aI as d,cR as b,cS as x}from"./index-BRJMIUK0.js";import{r as g}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";const v=[{label:"Fill",width:null,height:null},{label:"iPhone SE — 375×667",width:375,height:667},{label:"iPhone 14 — 390×844",width:390,height:844},{label:"iPhone 14 Pro Max — 430×932",width:430,height:932},{label:"iPad Mini — 768×1024",width:768,height:1024},{label:"iPad Pro 11″ — 834×1194",width:834,height:1194},{label:"Laptop — 1366×768",width:1366,height:768},{label:"Desktop — 1920×1080",width:1920,height:1080}];function E({resolution:e,onResolutionChange:i,scale:u,title:a="Change preview resolution",options:r=v}){const[n,o]=g.useState(!1),c=g.useRef(null),s=e.width===null,f=s?"Fill":`${e.width}×${e.height}`;return h.jsxs("div",{className:"vgai-playbar-popover-anchor",children:[h.jsxs(p,{ref:c,variant:"ghost",size:"comfortable","aria-haspopup":"menu","aria-expanded":n,"aria-controls":n?"vgai-resolution-picker-menu":void 0,onClick:()=>o(t=>!t),title:a,children:[h.jsx(w,{icon:m,size:"md"}),h.jsx(d,{variant:"code",children:f}),!s&&u<1&&h.jsxs(d,{variant:"caption",tone:"dim",children:[Math.round(u*100),"%"]})]}),n&&h.jsx(b,{id:"vgai-resolution-picker-menu",anchorRef:c,className:"vgai-resolution-menu",gap:4,onDismiss:()=>o(!1),children:r.map(t=>h.jsx(x,{role:"menuitemradio","aria-checked":t.label===e.label,onSelect:()=>{i(t),o(!1)},children:t.label},t.label))})]})}function l(e){return Number.isFinite(e)&&e>0?e:0}function M(e,i,u={}){const a=l(e.width),r=l(e.height),n=l(i.width),o=l(i.height);if(a===0||r===0||n===0||o===0)return{scale:1,width:n,height:o,offsetX:0,offsetY:0};const c=Math.min(a/n,r/o),s=u.allowUpscale===!0?c:Math.min(c,1),f=n*s,t=o*s;return{scale:s,width:f,height:t,offsetX:(a-f)/2,offsetY:(r-t)/2}}const P={kind:"fill"};function F(e,i){return e.width!==null&&e.height!==null?{kind:"logical",width:e.width,height:e.height,source:"device",allowUpscale:!1}:i!==void 0&&l(i.width)>0&&l(i.height)>0?{kind:"logical",width:i.width,height:i.height,source:"manifest",allowUpscale:!0}:P}export{E as R,v as a,M as f,F as r};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/r3f-source-authoring-adapter-DbbeRcvt.js","assets/component-instance-root-B0C5oNEm.js","assets/user-data-Bpj7diUS.js","assets/workspace-arrangement-BdAlBwvd.js","assets/index-BRJMIUK0.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-0Lm0Nf1M.css","assets/live-gesture-lock-DJbrjOqf.js","assets/relative-import-specifier-BFKIWEWs.js","assets/three-projection-core-CG01r5Ta.js","assets/editor-layers-BDJnAAzj.js","assets/three-TCuY32m_.js","assets/entity-object-JmYMfLsx.js","assets/three-contract-Dkt6PmWY.js","assets/viewport-editor-controls-BYaAZ_Ku.js","assets/three.core-3arARmh6.js","assets/inference-diagnostics-xecGdohW.js","assets/instance-fork-actions-D3sRzS3K.js","assets/oid-transform-D5Kxt6ij.js","assets/writer-tw6EcuVO.js","assets/r3f-physics-binding-DzrbpqjM.js","assets/object3d-authoring-subject-BDrxd1GA.js","assets/user-data-dHvLdpwM.js","assets/object-marks-DwvIEBOK.js","assets/three.module-BLhyNg0e.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{gd as $e,a8 as Ae,gM as Ce,_ as Ee,f$ as Pe,M as T,p as ce,dD as de,k7 as xe,dl as ue,k8 as Fe,k9 as Ie,bo as De,ka as je,kb as Be,kc as He,bn as Le,au as Ve,bs as pe,dj as Oe,h3 as _e}from"./index-BRJMIUK0.js";import{p as Ge,B as fe,q as ye}from"./edit-mode-authoring-DeCxPcHM.js";import{w as ze,a as We,e as qe}from"./adapter-runtime-bindings-4cmsRvRh.js";import{a as Ue}from"./entry-adjudication-Dc18TIqT.js";import{a as Ne}from"./realm-services-CnY105XU.js";import{p as Qe}from"./scene-framing-BQt72ZCw.js";import{i as Je,b as Ke,n as Xe,a as Ze}from"./native-debug-module-2_HVupdg.js";import{createAssetCache as Ye}from"./assets-BcrMQHRv.js";import{d as ke,a as et,b as tt}from"./create-runtime-DBfUy0SO.js";import{T as st}from"./three.module-BLhyNg0e.js";import{_ as me,fp as ee,el as ot}from"./three.core-3arARmh6.js";import{w as nt,l as rt}from"./live-gesture-lock-DJbrjOqf.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"./seeded-random-BgCwIAAU.js";import"./debug-registry-P0_YQGWd.js";import"./game-audio-CaGKzia4.js";import"./game-network-Ct2FQYmu.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-C3LzprCe.js";import"./capability-coverage-DZ-onC5j.js";import"./game-contract-seams-BnPFGLll.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./canvas-entry-runtime-UNYuSfG0.js";import"./three-ingest-runtime-B7rtg3QE.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./editor-layers-BDJnAAzj.js";import"./workspace-arrangement-BdAlBwvd.js";import"./native-entry-surface-BE8LJNdu.js";import"./contract-system-adapters-Bic_7sev.js";import"./loader-BTUKnX5Q.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./adapter-surface-Y37Nzcyw.js";import"./binding-Bmxqznjk.js";import"./root-stacking-BEd9ZvxC.js";import"./setup-renderer-Cwkl1Ar6.js";import"./index-DHhMOs_s.js";import"./defaults-DKiBJCPN.js";import"./render-settings-DS5leCed.js";import"./render-features-rxbawsRb.js";import"./loop-gate-report-N52EWFGD.js";import"./system-slot-E2mEdiih.js";import"./user-data-dHvLdpwM.js";import"./object-marks-DwvIEBOK.js";import"./performance-profiler-OwnXQX0M.js";function it(t,e){const i=()=>{},a=new Set(["dispose","forceContextLoss","forceContextRestore","setAnimationLoop","setSize","setPixelRatio","setDrawingBufferSize"]),p=new Map,v={...e.shadowMap};let R=e.xr.enabled;const b=e.getClearColor(new me);let C=e.getClearAlpha(),$=null,V=0,O=0;const u=e.getViewport(new ee),h=e.getScissor(new ee);let P=e.getScissorTest(),y=!1,x=!1,F=!1;const _=(c,s,o,r,w)=>{typeof s=="number"?c.set(s,o,r,w):c.copy(s)},B=new Proxy(e.xr,{get(c,s){if(s==="enabled")return R;if(s==="setAnimationLoop"||s==="addEventListener"||s==="removeEventListener")return i;const o=Reflect.get(c,s,c);return typeof o=="function"?o.bind(c):o},set(c,s,o){return s==="enabled"?(R=o,!0):Reflect.set(c,s,o,c)}}),q=new Proxy(e.renderLists,{get(c,s){if(s==="dispose")return i;const o=Reflect.get(c,s,c);return typeof o=="function"?o.bind(c):o}});function G(c,s){const o=new Map,r={...e.shadowMap},w=e.xr.enabled,M=e.getClearColor(new me),I=e.getClearAlpha(),J=e.getRenderTarget(),K=e.getActiveCubeFace(),W=e.getActiveMipmapLevel(),U=e.getViewport(new ee),te=e.getScissor(new ee),X=e.getScissorTest();try{for(const[D,N]of p)o.set(D,Reflect.get(e,D)),Reflect.set(e,D,N);return Object.assign(e.shadowMap,v),e.xr.enabled=R,e.setClearColor(b,C),e.setViewport(u),e.setScissor(h),e.setScissorTest(P),e.setRenderTarget($,V,O),y&&e.setViewport(u),x&&e.setScissor(h),F&&e.setScissorTest(P),c.apply(e,s)}finally{for(const[D,N]of o)Reflect.set(e,D,N);Object.assign(e.shadowMap,r),e.xr.enabled=w,e.setClearColor(M,I),e.setViewport(U),e.setScissor(te),e.setScissorTest(X),e.setRenderTarget(J,K,W)}}const z=new Map;return new Proxy(e,{get(c,s){if(s==="domElement")return t;if(s==="shadowMap")return v;if(s==="xr")return B;if(s==="renderLists")return q;if(a.has(s))return i;if(s==="getRenderTarget")return()=>$;if(s==="getActiveCubeFace")return()=>V;if(s==="getActiveMipmapLevel")return()=>O;if(s==="setRenderTarget")return(r,w=0,M=0)=>{$=r,V=w,O=M,y=x=F=!1};if(s==="getViewport")return r=>r.copy(u);if(s==="getCurrentViewport")return r=>$&&!y?r.copy($.viewport):(r.copy(u).multiplyScalar(e.getPixelRatio()),y?r.round():r.floor());if(s==="getScissor")return r=>r.copy(h);if(s==="getScissorTest")return()=>P;if(s==="setViewport")return(r,w,M,I)=>{_(u,r,w,M,I),y=!0};if(s==="setScissor")return(r,w,M,I)=>{_(h,r,w,M,I),x=!0};if(s==="setScissorTest")return r=>{P=r,F=!0};if(s==="getClearColor")return r=>r.copy(b);if(s==="getClearAlpha")return()=>C;if(s==="setClearColor")return(r,w=C)=>{b.set(r),C=w};if(s==="setClearAlpha")return r=>{C=r};if(p.has(s))return p.get(s);const o=Reflect.get(c,s,c);if(typeof o!="function")return o;if(!z.has(s)){const r=/^(render|compile|clear|copy|init|readRenderTarget)/.test(String(s));z.set(s,r?(...w)=>{if(!((s==="render"||String(s).startsWith("clear"))&&!$))return G(o,w)}:o.bind(c))}return z.get(s)},set(c,s,o){return s!=="domElement"&&p.set(s,o),!0}})}class at{pending=new WeakMap;remember(e,i){const a=[...i];a.length===0?this.pending.delete(e):this.pending.set(e,a)}take(e,i){const a=[...i],p=this.pending.get(e)??[];return this.pending.delete(e),a.length>0?a:p}}function he(t){return decodeURIComponent(t.split("?")[0]).replace(/^\/@fs\/(?=[A-Za-z]:\/)/,"").replace(/^\/@fs/,"")}class lt{sources=new Map;applied=new Map;expected=new Map;missingRevision=!1;source(e){this.sources.set(e.file,e)}complete(e){for(const[i,a]of this.sources){const p=e.filter(R=>a.timestamp===R.timestamp);(a.boundaries?a.boundaries.every(R=>p.some(b=>b.acceptedPath===R)):p.some(R=>he(R.acceptedPath)===i))&&(this.applied.set(a.path,a.sha),this.sources.delete(i))}}matches(e){const i=he(e.acceptedPath);return[...this.sources.values()].some(a=>a.timestamp===e.timestamp&&(a.boundaries?a.boundaries.includes(e.acceptedPath):a.file===i))}revision(e){for(const i of e)this.expected.set(i.path,i.sha),i.sha===null&&this.applied.delete(i.path)}needsRemount(){if(this.missingRevision)return!0;for(const[e,i]of this.expected)if(i===null||this.applied.get(e)!==i)return!0;return!1}missing(){this.missingRevision=!0}mounted(){this.expected.clear(),this.applied.clear(),this.sources.clear(),this.missingRevision=!1}}function ct(t){return t instanceof ot||t!==null&&typeof t=="object"&&t.isScene===!0}function dt(t){return t.find(e=>e.surface==="three")?.id??null}const ge=new at;function ut(t,e,i){return new Error(`three root "${t}" failed to mount: ${e} did not export a RootAdapter or a default React component (exports: ${i.join(", ")||"(nothing)"}).`)}function pt(t,e){const i=De(e);T.error(`[r3f-design] world "${t}" failed to mount: ${i}`,"authoring");const a=je(i);return a&&Be(a).then(p=>T.error(`[r3f-design] world "${t}": ${He(p)}`,"authoring")),Le({worldId:t,kind:"three",identity:"default-three",message:i}),i}async function ft(t,e,i,a){const p=await t.loadEntryModule(i,e,"three"),v=a===i?p:await t.loadEntryModule(a,e,"three");return{designModule:p,rootModule:v}}function mt(t,e,i,a,p,v){ke(t,e,i,{id:a}),Je(t,p?[p]:[]),Ke(t,We(t,v?[v]:[]))}function ht(t){const e=document.createElement("canvas"),i=it(e,t),a=Ye(),p=et({loop:tt({update:()=>{}}),assets:a});return{game:p,host:{three:st,surface:{canvas:e,width:1280,height:720},renderer:i,assets:a,headless:!1,game:p},dispose:()=>p.dispose()}}function we(t){return{id:t.id,kind:t.surface,adapter:t.adapter,entryOrScenePath:t.entry??t.scene,zOrder:t.zOrder??0,pausable:t.pausable??!0}}function re(t){let e=!1,i=!1;const a=()=>{e||i||t.shell.playState!=="stopped"||(i=!0,ye())},p=t.shell.subscribe(a);return a(),()=>{e=!0,p()}}async function $s(t,e,i){const a=Ve();if(!a)return()=>{};const p=await $e();if(t.shell.playState!=="stopped")return re(t);const v=Ge(p);if(!v)return()=>{};const R=dt(Ae(v)),b=R?Ce(v,R):void 0;if(!b)return()=>{};const C=b.world?.entry??b.entry,$=b.world?.export;if(!C||!/\.(tsx|jsx)$/.test(C))return()=>{};const V=Ee(()=>import("./r3f-source-authoring-adapter-DbbeRcvt.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31])),O=Pe();let u=!1,h=!1,P=null,y=null,x=!1,F=null,_=!1,B=!1,q,G,z,c=null,s=null;const o=b.id,r=C,w=()=>{s||!c||u||h||t.shell.playState!=="stopped"||(s=c.systemAdapters,pe(s))},M=()=>{s&&(s=null,pe(null))},I=async()=>{const n=await Ne(a.rootPath,Oe()),{designModule:d,rootModule:f}=await ft(n,o,r,b.entry??r),l=Xe(o,f),m=Ze(o,f,"three"),g=await Ue(d,o,{...$===void 0?{}:{namedExport:$},entryPath:r});if(!g)throw ut(o,r,Object.keys(d));return $!==void 0?{adapter:g,entryDebug:l,entrySystems:m}:{adapter:g,entryDebug:l,entrySystems:m,components:d.components??d.behaviors}},J=async(n,d,f)=>{const{host:l,game:m,dispose:g}=ht(i);let S;try{S=await n.mount(l)}catch(Y){throw g(),Y}if(S.kind!=="three"||!ct(S.scene))throw S.dispose(),g(),new Error(`entry adapter for world "${o}" did not mount a three scene`);return mt(m,n,S,o,d,f),{root:S,game:m,disposeHost:g}},K=n=>{P=n.root,c=n.game,G?.();const d=n.game;G=d.subscribeSystemAdapters?.(()=>{if(c!==d)return;const f=d.systemAdapters;s&&(s=f,_e(f)),t.shell.notifyIngestEdit()}),q=n.disposeHost},W=()=>{M(),G?.(),G=void 0,c=null;try{P?.dispose()}catch(n){T.error(`[r3f-design] dispose failed: ${n}`,"authoring")}P=null;try{q?.()}catch(n){T.error(`[r3f-design] design host dispose failed: ${n}`,"authoring")}q=void 0},U=()=>{if(!x)return;x=!1;const n=F;F=null,n?t.releaseAdoptedScene(n):t.exitPlayScene()},te=()=>{h=!0,U(),W(),e.replaceChild(o,new fe(t.shell,we(b),"R3F design session suspended by play mode — Stop restores it.")),t.shell.notifyIngestEdit()},X=n=>{const d=pt(o,n);e.replaceChild(o,new fe(t.shell,we(b),d)),t.shell.notifyIngestEdit()},D=setTimeout(()=>{T.warn(`[r3f-design] world "${o}" is still importing after 20s (${r}). The in-browser compiler or a module download may be stalled on a slow connection — it keeps trying; reload the tab if nothing appears.`,"authoring")},2e4);try{const[n,{R3fSourceAuthoringAdapter:d},f]=await Promise.all([I(),V,O]);if(clearTimeout(D),!n)return T.warn(`[r3f-design] world "${o}" produced no design entry (${r}) — the scene stays empty. This is a bug worth reporting; reload the tab to retry.`,"authoring"),()=>{};if(u)return()=>{};if(t.shell.playState!=="stopped")return re(t);const l=await J(n.adapter,n.entryDebug,n.entrySystems);if(K(l),u||t.shell.playState!=="stopped")return W(),u?()=>{}:re(t);y=new d(t,l.root.scene,{worldId:o,entryPath:r,writeBackend:f,physics:()=>ce(c?.systemAdapters.physics)}),e.replaceChild(o,y),ze(l.root.scene).then(S=>{S&&!u&&t.shell.notifyIngestEdit()});const m=ge.take(t,t.shell.selectedEntityIds);t.enterPlayScene(l.root.scene,l.root.rendererConfig),x=!0,F=l.root.scene,t.focusOnScene(()=>Qe(null,l.root.scene));const g=m.filter(S=>e.hierarchy.node(S)!==null);g.length>0&&t.shell.selectMultiple(g),de(o),w(),t.shell.notifyIngestEdit(),T.log(`[r3f-design] world "${o}" mounted for design-time authoring (${r})`,"authoring")}catch(n){clearTimeout(D),X(n)}const N=(n,d,f,l,m)=>{const g=performance.now()-d;g<400||console.info(`[r3f-design] world "${n}" remounted in ${g.toFixed(0)}ms (import ${(f-d).toFixed(0)}ms, mount ${(l-f).toFixed(0)}ms, settle ${(m-l).toFixed(0)}ms, adopt ${(performance.now()-m).toFixed(0)}ms)`)},be=async()=>{if(u||h)return;const n=[...t.shell.selectedEntityIds],d=H,f=t.shell.projectHistory?.getSnapshot().busy===!0;let l="importing";const m=setTimeout(()=>{T.warn(`[r3f-design] world "${o}" remount is still ${l} after 20s (${r}) — it keeps trying; reload the tab if nothing appears.`,"authoring")},2e4),g=performance.now();let S=g,Y=g,ae=g;try{const j=await I();if(S=performance.now(),!j||u||h){console.info(`[r3f-design] world "${o}" remount abandoned after import (${j?u?"torn down":"suspended":"no entry"})`);return}l="mounting";const A=await J(j.adapter,j.entryDebug,j.entrySystems);Y=performance.now();for(let E=0;E<50&&(await nt(),await Se(),!(!rt()&&t.shell.projectHistory?.getSnapshot().busy!==!0));E+=1);if(ae=performance.now(),!u&&!h&&H!==d){A.root.dispose(),A.disposeHost(),L();return}if(u||h){console.info(`[r3f-design] world "${o}" remount abandoned after mount (${u?"torn down":"suspended"})`),A.root.dispose(),A.disposeHost();return}const k=new Set(t.shell.selectedEntityIds);if(U(),W(),K(A),y)y.adoptScene(A.root.scene),e.childAdapters().find(ne=>ne.worldId===o)?.adapter!==y&&(e.replaceChild(o,y),T.log(`[r3f-design] world "${o}" recovered and remounted for design-time authoring (${r})`,"authoring"));else{const[{R3fSourceAuthoringAdapter:E},ne]=await Promise.all([V,O]);y=new E(t,A.root.scene,{worldId:o,entryPath:r,writeBackend:ne,physics:()=>ce(c?.systemAdapters.physics)}),e.replaceChild(o,y),T.log(`[r3f-design] world "${o}" recovered and mounted for design-time authoring (${r})`,"authoring")}const Me=k.size>0&&(k.size!==n.length||n.some(E=>!k.has(E)));t.enterPlayScene(A.root.scene,A.root.rendererConfig),x=!0,F=A.root.scene;const le=(Me?[...k]:n).filter(E=>y?.hierarchy.node(E)!==null);le.length>0&&t.shell.selectMultiple(le),de(o),w(),t.shell.notifyIngestEdit(),N(o,g,S,Y,ae),Q.mounted(),clearTimeout(Z),B=!1}catch(j){X(j),!B&&!u&&!h?(B=!0,setTimeout(()=>{!u&&!h&&L()},400)):!u&&!h&&(H===d&&!f?ve(j):(B=!1,L()))}finally{clearTimeout(m),!u&&!h&&H!==d&&L()}},Se=async()=>{const n=t.shell.projectHistory;if(!n)return;const d=Date.now()+1e4;for(;n.getSnapshot().busy&&Date.now()<d;)await new Promise(f=>{const l=setTimeout(f,250),m=n.subscribe(()=>{clearTimeout(l),m(),f()})})},ve=async n=>{const d=n instanceof Error?n.message:String(n);if(!d.includes("fiber crashed"))return;if(/Could not load |Failed to fetch|Unexpected token '<'|not valid JSON/.test(d)){T.error(`World "${o}" failed to load a project asset (${d}). The edit is kept; the world remounts once the asset can be served.`,"authoring");return}const f=t.shell.projectHistory;if(!f)return;const l=f.getSnapshot(),m=l.canUndo?l.transactions[l.cursor-1]:void 0;if(!m||Date.now()-m.timestamp>15e3){console.info(`[r3f-design] world "${o}" crash auto-undo skipped (${m?"last edit too old":l.canUndo?"no entry":`cannot undo: busy=${l.busy} blocked=${l.blocked}`})`);return}if(!await f.undo().catch(()=>!1)){console.info(`[r3f-design] world "${o}" crash auto-undo refused by history`);return}B=!1,T.error(`Undid “${m.label}”: that edit crashed world "${o}" (${n instanceof Error?n.message:String(n)}). The previous source is restored.`,"authoring"),L()};let H=0;const Q=new lt;let Z;const L=()=>{if(u||h){console.info(`[r3f-design] world "${o}" remount skipped: ${u?"session torn down":"suspended for play"}`);return}_||(_=!0,setTimeout(()=>{_=!1,be()},80))},Re=xe(n=>{qe(n).then(()=>{H+=1,L()})});let se=ue()?.revision??0;const Te=Fe(n=>{H+=1;const f=ue()?.revisions.filter(m=>m.revision>se)??[];f.length!==n-se&&Q.missing(),se=n;const l=f.flatMap(m=>m.resources);Q.revision(l),!(l.length&&!Q.needsRemount())&&(clearTimeout(Z),Z=setTimeout(()=>{l.length&&!Q.needsRemount()||(H+=1,L())},2e3))});let ie=!1,oe=!1;return z=t.shell.subscribe(()=>{if(!u){if(t.shell.playState==="stopped"?w():M(),!h&&!oe&&t.shell.playState!=="stopped"){oe=!0,Ie(()=>{oe=!1,!(u||h||t.shell.playState==="stopped")&&te()});return}h&&!ie&&t.shell.playState==="stopped"&&(ie=!0,ye())}}),()=>{u=!0,console.info(`[r3f-design] world "${o}" design session torn down`),M(),Re(),Te(),clearTimeout(Z),z?.(),!h&&t.shell.playState==="stopped"&&t.shell.selectedEntityIds.size>0&&ge.remember(t,t.shell.selectedEntityIds),U(),W()}}export{ft as loadR3FDesignEntryModules,$s as mountR3FDesignSession,mt as registerR3FDesignRoot,pt as reportDesignMountFailure,ut as unresolvedDesignEntryError};
|