@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/index-DHhMOs_s.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/stage-transform-tools-BQB7EY4l.js","assets/jsx-runtime-DPjLkJKQ.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-BRJMIUK0.js","assets/index-nmcBqr7Y.js","assets/index-D_NuPfjr.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-0Lm0Nf1M.css","assets/editor-shell-store-ChLcVeNB.js","assets/output-pass-HurwNl0G.js","assets/Pass-D1MRT672.js","assets/editor-layers-BDJnAAzj.js","assets/workspace-arrangement-BdAlBwvd.js","assets/user-data-Bpj7diUS.js","assets/entity-object-JmYMfLsx.js","assets/three-contract-Dkt6PmWY.js","assets/Toolbar-DkTHnQto.js","assets/transform-mode-request-DzD9aUNA.js","assets/three-state-DwFE3ay2.js","assets/standard-viewport-dressing-BCA51Tum.js","assets/content-bounds-BeuIXKYu.js","assets/hierarchy-marks-Cc_3lxw6.js","assets/environment-Dg-YaLsA.js","assets/RoomEnvironment-BkknvS_I.js","assets/EXRLoader-CITMBvGd.js","assets/HDRLoader-BTGuGhVo.js","assets/preview-renderer-BrYNFV1p.js","assets/renderer-ownership-BovSEcLv.js","assets/live-mixers-B-bwLZ7c.js","assets/live-gesture-lock-DJbrjOqf.js","assets/model-inspection-CXHxrafK.js","assets/three-viewport-presentation-B0z_cECu.js","assets/clip-planes-CnAI6DZn.js","assets/three-TCuY32m_.js","assets/component-instance-root-B0C5oNEm.js","assets/viewport-editor-controls-BYaAZ_Ku.js","assets/model-thumbnail-BEKPWg4l.js","assets/studio-environment-DRxxq_QX.js","assets/KTX2Loader-CaqVE6nY.js","assets/GLTFLoader-KeoruJgS.js","assets/BufferGeometryUtils-B22h7jo4.js","assets/OrbitControls-B13MKuwC.js","assets/LineSegments2-DN9pUfWA.js","assets/three.quarks.esm-C_HmSKXo.js","assets/three-integration-BdN5Nhsg.js","assets/host-hierarchy-objects-BV3WqU2w.js","assets/layered-pick-kiQf53t5.js","assets/root-stacking-BEd9ZvxC.js","assets/object3d-document-session-registry-DJDEDM0p.js","assets/viewport-door-Bj_ZIP85.js","assets/asset-preview-B1tDziF1.js","assets/bitmap-label-Ct4k6ehY.js","assets/scene-framing-BQt72ZCw.js","assets/source-object3d-authoring-adapter-DF679Ncb.js","assets/three-projection-core-CG01r5Ta.js","assets/editor-presentation-activity-C7SNSmTd.js","assets/transport-strip-CUjNltnb.js","assets/viewport-surface-status-cwCiBGa7.js","assets/stage-overlay-set-BGE03mqb.js","assets/TransientHint-BpDLhRLd.js","assets/ViewportShadingMenu-CXPi6fl8.js","assets/stage-keyboard-B8BEW592.js","assets/camera-authoring-DYjhU5Zp.js","assets/stage-presence-markers-DIP7YMcO.js","assets/collaboration-presence-BVIQuN1l.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{kF as Cr,ld as ur,kM as Ie,M as us,f1 as zn,lA as In,_ as Ye,aH as Nn,lB as $n,jD as Ys,cF as Ue,aJ as Te,$ as we,c$ as Gn,d$ as Un,Z as Ne,lC as qn,d0 as Yn,d1 as Xn,aI as hs,d2 as ds,lD as Xs,lE as Kn,jy as Zn,cA as vr,cB as ps,dR as ct,ad as qe,ew as Jn,lF as Qn,lG as ei,a0 as ve,ac as ti,lH as ri,lI as si,lJ as ni,lK as ii,lL as oi,hY as ai,lM as ci,b2 as li,lN as Ks,aN as ui,gA as hi,lO as fs,lP as ms,lQ as gs,a_ as vs,kE as ws,cz as bs,lR as di,aG as pi,dT as fi,dS as ys,lS as mi,dZ as gi,lT as vi,g7 as Ss,lU as wi,lV as bi,lW as yi,hT as Si,dw as xi,kN as Pi,kD as Ci,fI as ki,g1 as Mi,lX as xs,aE as Ei,lY as Oi,e2 as Ri}from"./index-BRJMIUK0.js";import{a as d}from"./jsx-runtime-DPjLkJKQ.js";import{t as wr,a as ji}from"./three-state-DwFE3ay2.js";import{i as N,b as Ti,a as Ai,w as Vi,c as Li,s as Ps}from"./standard-viewport-dressing-BCA51Tum.js";import{r as f}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{a as br}from"./content-bounds-BeuIXKYu.js";import{EDITOR_LAYER as Zs,isInEditorOwnedSubtree as Fi}from"./editor-layers-BDJnAAzj.js";import{createStandardEnvironment as Di}from"./environment-Dg-YaLsA.js";import{a as _i}from"./preview-renderer-BrYNFV1p.js";import{s as Js}from"./user-data-Bpj7diUS.js";import{s as Hi,a as Bi}from"./live-mixers-B-bwLZ7c.js";import{n as Wi,T as Qs,ej as kr,c1 as Cs,cu as zi,cp as At,aI as Ii,d as Ni,ct as $i,cx as Gi,_ as pe,bh as Lt,N as en,M as tn,dg as rn,df as sn,fo as z,d5 as yr,d9 as Ui,L as ks,I as Sr,ez as qi,dp as Ms,cj as xr,em as Yi,c0 as Xi,aO as Ki,bX as Zi,fx as Es,bi as Ji,eu as Qi,cg as me,el as nn,A as eo,d7 as to,eW as Os,fd as Tt,e6 as Rs,cm as js}from"./three.core-3arARmh6.js";import{l as ro,w as so}from"./live-gesture-lock-DJbrjOqf.js";import{v as no}from"./output-pass-HurwNl0G.js";import{a as Ae}from"./three-contract-Dkt6PmWY.js";import{d as Ft,f as io}from"./model-inspection-CXHxrafK.js";import{c as oo,p as Vt,d as Ts,i as As,r as ao,b as co,a as lo,t as Vs,s as Ls,C as uo,e as ho,f as po,E as fo}from"./three-viewport-presentation-B0z_cECu.js";import{s as Pr}from"./workspace-arrangement-BdAlBwvd.js";import{a as mo,b as go,L as vo}from"./LineSegments2-DN9pUfWA.js";import{s as wo,o as bo,a as yo,c as So}from"./object3d-document-session-registry-DJDEDM0p.js";import{S as xo}from"./source-object3d-authoring-adapter-DF679Ncb.js";import{s as Po,i as hr}from"./editor-presentation-activity-C7SNSmTd.js";import{a as Co}from"./three-integration-BdN5Nhsg.js";import{r as Fs,d as Ds}from"./viewport-door-Bj_ZIP85.js";import{T as ko}from"./transport-strip-CUjNltnb.js";import{V as Mo,O as Eo}from"./viewport-surface-status-cwCiBGa7.js";import{t as on}from"./editor-shell-store-ChLcVeNB.js";const an=30;function cn(n,e,t){return n<e?e:n>t?t:n}function Oo(n,e){const t=n.animations;if(t.length===0)return null;const r=new Wi(n);let i=t[0];if(!i)return null;const a=o=>{r.stopAllAction();const l=r.clipAction(o);l.paused=!1,l.play(),i=o};a(i);const c=e.attach({id:n.uuid,label:n.name||i.name||"Clip",range:()=>({start:0,end:i?.duration??0,fps:an}),seek:o=>{r.setTime(cn(o,0,i?.duration??0))},clips:()=>t.map(o=>({id:o.name,label:o.name})),setClip:o=>{const l=t.find(p=>p.name===o);l&&a(l)}});return()=>{c(),r.stopAllAction(),r.uncacheRoot(n)}}function Ro(n,e){const t=Bi(n);if(!t)return null;let r=t.clips.values().next().value;if(!r)return null;const i=c=>{t.mixer.stopAllAction();const o=t.mixer.clipAction(c);o.paused=!1,o.play(),r=c};return e.attach({id:n.uuid,label:n.name||r.name||"Animation",range:()=>({start:0,end:r?.duration??0,fps:an}),seek:c=>{t.mixer.setTime(cn(c,0,r?.duration??0))},clips:()=>[...t.clips.entries()].map(([c,o])=>({id:c,label:o.name||c})),setClip:c=>{const o=t.clips.get(c);o&&i(o)}})}function _s(n,e,t={}){const r=new Map,i=()=>{const o=new Set;(typeof n=="function"?n():n)?.traverse(p=>{if(r.has(p.uuid)){o.add(p.uuid);return}const x=Ro(p,e)??Oo(p,e);x&&(r.set(p.uuid,x),o.add(p.uuid))});for(const[p,x]of[...r])o.has(p)||(x(),r.delete(p))};i();const a=t.rescanOnLiveMixers,c=a?Hi(()=>{a()&&i()}):()=>{};return{refresh:i,dispose:()=>{c();for(const o of r.values())o();r.clear()}}}const ke=()=>globalThis.performance?.now()??Date.now();function jo(n,e){return n.length===0?0:n[Math.min(n.length-1,Math.floor((n.length-1)*e))]??0}function To(n=!1){const e=new Set,t=[],r=new Map,i=new Map,a=new Map;let c=[],o=[],l=n,p=!1,x=!1,v=0,P=0,w=0;const L=[];let F=0,M=0,C={gpuMs:null,drawCalls:0,triangles:0,geometries:0,textures:0,renderPasses:null},D={enabled:l,recording:x,fps:0,cpuMs:0,p95Ms:0,p99Ms:0,frames:[],phases:[],systems:[],components:[],render:C};function K(){const b=t.at(-1),I=t.slice();let _;const U=j=>(_??=I.map(H=>H.intervalMs).filter(H=>H>0).sort((H,T)=>H-T),jo(_,j));D={enabled:l,recording:x,fps:b?.intervalMs?1e3/b.intervalMs:0,cpuMs:b?.cpuMs??0,get p95Ms(){return U(.95)},get p99Ms(){return U(.99)},frames:I,phases:b?.phases??[],systems:[...i].map(([j,H])=>({name:j,ms:H})).sort((j,H)=>H.ms-j.ms),components:[...a].map(([j,H])=>({name:j,ms:H})).sort((j,H)=>H.ms-j.ms),render:C};for(const j of e)j()}return{get enabled(){return l},set enabled(b){l!==b&&(l=b,b&&!p&&(w=0),K())},get telemetryEnabled(){return p},set telemetryEnabled(b){if(p===b)return;const I=!l&&!p;p=b,b&&I&&(w=0),K()},get recording(){return x},startRecording(){const b=!l&&!p;l=!0,b&&(w=0),x=!0,t.length=0,K()},stopRecording(){x=!1,K()},clear(){t.length=0,K()},beginFrame(){!l&&!p||(r.clear(),i.clear(),a.clear(),c=[],o=[],L.length=0,C={gpuMs:null,drawCalls:0,triangles:0,geometries:0,textures:0,renderPasses:null},P=ke())},beginPhase(){l&&L.push(ke())},endPhase(b){if(!l)return;const I=L.pop()??P,_=ke()-I,U=r.get(b);r.set(b,{ms:(U?.ms??0)+_,startMs:U?.startMs??I-P}),x&&performance.measure(`vgai.phase.${b}`,{start:I,duration:_})},systemObserver:{beginSystem(){l&&(F=ke())},endSystem(b,I,_){if(!l)return;const U=ke(),j=`${b} / ${I} / ${_}`;i.set(j,(i.get(j)??0)+U-F),c.push({name:j,phase:I,startMs:F-P,ms:U-F})}},beginComponent(){x&&(M=ke())},endComponent(b,I=""){if(!x)return;const _=ke();a.set(b,(a.get(b)??0)+_-M),o.push({name:b,phase:I,startMs:M-P,ms:_-M})},reportRender(b){l&&(C={gpuMs:b.gpuMs??C.gpuMs,drawCalls:C.drawCalls+b.drawCalls,triangles:C.triangles+b.triangles,geometries:C.geometries+b.geometries,textures:C.textures+b.textures,renderPasses:b.renderPasses===void 0?C.renderPasses:(C.renderPasses??0)+b.renderPasses})},endFrame(){if(!l&&!p)return;const b=ke(),I=w===0?0:P-w;w=P;const _={id:++v,timestamp:b,intervalMs:I,cpuMs:b-P,phases:[...r].map(([U,{ms:j,startMs:H}])=>({name:U,ms:j,startMs:H})).sort((U,j)=>j.ms-U.ms),systems:c.slice(),components:o.slice(),render:{...C}};t.push(_),t.length>600&&t.splice(0,t.length-600),x&&performance.measure("vgai.frame",{start:P,duration:_.cpuMs}),K()},subscribe(b){return e.add(b),()=>{e.delete(b)}},getSnapshot(){return D},exportJSON(){return JSON.stringify({version:2,capturedAt:new Date().toISOString(),frames:t},null,2)}}}const ln=256;function Ao(n){const e=Math.min(1,Math.max(0,n));return e<=.0031308?e*12.92:1.055*e**(1/2.4)-.055}function dr(n,e,t){const r=Math.hypot(n,e,t)||1;return[n/r,e/r,t/r]}function Vo(n=ln){const e=document.createElement("canvas");e.width=n,e.height=n;const t=e.getContext("2d");if(!t)return e;const r=t.createImageData(n,n),i=dr(-.45,.62,.64),a=dr(.65,-.35,.5),c=dr(i[0],i[1],i[2]+1),o=[.7,.69,.68],l=[.34,.4,.52],p=[.85,.88,1];for(let x=0;x<n;x++)for(let v=0;v<n;v++){const P=(v+.5)/n/.5-1,w=1-(x+.5)/n/.5,L=P*P+w*w,F=L>1,M=F?1/Math.sqrt(L):1,C=P*M,D=w*M,K=F?0:Math.sqrt(Math.max(0,1-L)),b=Math.max(0,C*i[0]+D*i[1]+K*i[2]),I=Math.max(0,C*a[0]+D*a[1]+K*a[2]),_=Math.max(0,C*c[0]+D*c[1]+K*c[2])**42*.5,U=(1-K)**3.2*.4,j=(x*n+v)*4;for(let H=0;H<3;H++){const T=o[H]*(.16+.8*b)+l[H]*.3*I+p[H]*U+_;r.data[j+H]=Math.round(Ao(T)*255)}r.data[j+3]=255}return t.putImageData(r,0,0),e}function Lo(n=ln){const e=new Qs(Vo(n));return e.colorSpace=kr,e.minFilter=Cs,e.magFilter=Cs,e.generateMipmaps=!1,e.needsUpdate=!0,e}function Fo(n){return n.color?.clone()??new pe(12502993)}function pr(n,e){return n[e]??null}class Do{_derived=new Map;_normals=new zi;_matcap=null;_matcapTexture=null;_overdraw=new At({color:16777215,transparent:!0,opacity:.08,depthTest:!1,depthWrite:!1,blending:Ni,side:Ii,toneMapped:!1});render(e,t,r,i=()=>!0){if(t==="solid"||t==="preview"||t==="rendered"){r();return}const a=[];e.traverse(c=>{const o=c;!o.isMesh||!o.material||!i(o)||(a.push({mesh:o,material:o.material}),o.material=Array.isArray(o.material)?o.material.map(l=>this._materialFor(l,t)):this._materialFor(o.material,t))});try{r()}finally{for(const{mesh:c,material:o}of a)c.material=o}}dispose(){for(const e of this._derived.values())e.clay.dispose(),e.unlit.dispose(),e.wireframe.dispose();this._derived.clear(),this._normals.dispose(),this._overdraw.dispose(),this._matcap?.dispose(),this._matcapTexture?.dispose(),this._matcap=null,this._matcapTexture=null}_materialFor(e,t){if(t==="normals")return this._normals;if(t==="overdraw")return this._overdraw;if(t==="matcap")return this._matcap||(this._matcapTexture=Lo(),this._matcap=new $i({matcap:this._matcapTexture,toneMapped:!1})),this._matcap;let r=this._derived.get(e);if(!r){const i={color:Fo(e),map:pr(e,"map"),alphaMap:pr(e,"alphaMap"),alphaTest:e.alphaTest,opacity:e.opacity,transparent:e.transparent,side:e.side,depthTest:e.depthTest,depthWrite:e.depthWrite,vertexColors:!!e.vertexColors,fog:e.fog??!0};r={clay:new Gi({color:11450048,roughness:.82,metalness:0,flatShading:!0,alphaMap:pr(e,"alphaMap"),alphaTest:e.alphaTest,opacity:e.opacity,transparent:e.transparent,side:e.side,depthTest:e.depthTest,depthWrite:e.depthWrite}),unlit:new At(i),wireframe:new At({...i,wireframe:!0})},this._derived.set(e,r)}return r[t]}}class _o extends Lt{constructor(e,t){super(),this.bones=e;const r=new Set;for(const o of e){const l=o.parent;l?.isBone&&this.addSegment(l,o,r);for(const p of o.children)p.isBone&&this.addSegment(o,p,r)}this.linePositions=new Float32Array(Math.max(this.segments.length*6,6));const i=new mo;i.setPositions(this.linePositions),this.lineMaterial=new go({color:t,linewidth:5,worldUnits:!1,depthTest:!1,depthWrite:!1,toneMapped:!1,alphaToCoverage:!0}),this.lines=new vo(i,this.lineMaterial),this.lines.onBeforeRender=o=>{o.getSize(this.lineMaterial.resolution)},this.lines.frustumCulled=!1,this.lines.renderOrder=1001,this.add(this.lines),this.pointPositions=new Float32Array(Math.max(e.length*3,3));const a=new en;a.setAttribute("position",new tn(this.pointPositions,3));const c=new rn({color:t,size:11,sizeAttenuation:!1,depthTest:!1,depthWrite:!1,toneMapped:!1});this.points=new sn(a,c),this.points.frustumCulled=!1,this.points.renderOrder=1002,this.add(this.points),this.name="__object3d_document_bone_selection",Pr(this,"editorHelper",!0),this.traverse(o=>o.layers.set(Zs)),this.update()}segments=[];linePositions;pointPositions;lines;lineMaterial;points;worldPosition=new z;setColor(e){this.lineMaterial.color.setHex(e),this.points.material.color.setHex(e)}update(){let e=0;for(const[i,a]of this.segments)i.getWorldPosition(this.worldPosition),this.linePositions.set(this.worldPosition.toArray(),e),a.getWorldPosition(this.worldPosition),this.linePositions.set(this.worldPosition.toArray(),e+3),e+=6;const t=this.lines.geometry.getAttribute("instanceStart");t&&(t.data.needsUpdate=!0),e=0;for(const i of this.bones)i.getWorldPosition(this.worldPosition),this.pointPositions.set(this.worldPosition.toArray(),e),e+=3;const r=this.points.geometry.getAttribute("position");r&&(r.needsUpdate=!0)}dispose(){this.lines.geometry.dispose(),this.lineMaterial.dispose(),this.points.geometry.dispose(),this.points.material.dispose()}addSegment(e,t,r){const i=`${e.uuid}:${t.uuid}`;r.has(i)||(r.add(i),this.segments.push([e,t]))}}const Ho="skeletons",fr=new pe(58879),mr=new pe(16756736);function Bo(n){const e=n.geometry.getAttribute("color");for(let r=0;r<e.count;r+=2)e.setXYZ(r,fr.r,fr.g,fr.b),r+1<e.count&&e.setXYZ(r+1,mr.r,mr.g,mr.b);e.needsUpdate=!0,n.renderOrder=999;const t=n.material;t.depthTest=!1,t.depthWrite=!1,t.toneMapped=!1,Pr(n,"editorHelper",!0),Pr(n,"editorHelperType",Ho),n.traverse(r=>r.layers.set(Zs))}const Wo=1,zo=700,Io=.001,No=Math.PI-.001,$o=n=>n<.5?4*n*n*n:1-(-2*n+2)**3/2,Go=n=>n;function $e(n,e){return typeof n=="number"&&Number.isFinite(n)?n:e}const Hs={mode:"solid",background:"neutral",projection:"perspective",skeleton:!1,bounds:!1},Bs=1119773;class Uo{constructor(e,t,r,i,a,c,o=new pe(2106410),l=null){this.documentId=e,this.root=t,this.scene=r,this.renderer=i,this.viewport=a,this.authoring=c,this.neutralBackground=o,this.frameBox=l,this.unsubscribeSelectionTheme=Cr(i.domElement,this.syncSelectionTheme),a.orbitControls.addEventListener("start",this.cancelLookForHuman),this.unsubscribeRotateStart=a.onRotateStart(this.autoPerspective),this.unsubscribeAxisView=a.onAxisView(this.axisView)}profiler=To();shading=new Do;helpers=[];skeletonHelper=null;boundsHelper=null;boneSelectionHighlight=null;boneSelectionSignature="";composer=null;composerLoading=!1;disposed=!1;sceneRenderPass=null;selectionOutline=null;selectionOutlinePass=null;selectedObjects=[];selectionOrigins=null;renderWidth=1;renderHeight=1;orthographicCamera=new yr;captureAspect=null;cameraOverride=null;cameraViewSource=null;through=null;leaving=!1;viewMemo=null;throughPerspective=new Ui;throughOrthographic=new yr;beforeRender=null;state=Hs;version=0;listeners=new Set;unsubscribeSelectionTheme=()=>{};flight=null;flightPose=new z;topologyOverlay=null;topologyFollowers=[];unsubscribeRotateStart;unsubscribeAxisView;axisView=()=>(this.leaveCameraView(!1),this.settleFlight("superseded"),ur().autoPerspective&&this.setProjection("orthographic"),!0);autoPerspective=()=>{if(!ur().autoPerspective||this.cameraView()!==null||this.state.projection!=="orthographic")return;const e=this.viewport.camera,t=e.position.clone().sub(this.viewport.orbitControls.target),r=new z(0,1,0).applyQuaternion(e.quaternion);Ft(t,r)!==null&&this.setProjection("perspective")};replaceContent(e,t){N(),this.selectionOutline?.selection.clear(),this.selectedObjects=[],this.boneSelectionSignature="",this.clearBoneSelectionHighlight(),this.clearSkeletonHelper(),this.clearBoundsHelper(),this.clearTopologyOverlay(),this.root=e,this.authoring=t,this.state.mode==="wireframe"&&this.buildTopologyOverlay(),this.state.bounds&&(this.boundsHelper=new ks(e,16757844),this.addHelper(this.boundsHelper,"bounds")),this.syncSelectionPresentation(),this.refreshSkeletonHelper(),this.notify()}cancelLookForHuman=()=>{this.settleFlight("human")};selectionColors=null;syncSelectionTheme=()=>{this.selectionColors=Ie(this.renderer.domElement);const e=this.selectionColors.visible;this.selectionOutline&&oo(this.selectionOutline,Ie(this.renderer.domElement)),this.boneSelectionHighlight?.setColor(e)};subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));getSnapshot=()=>this.version;presentation(){return this.state}resolveFrameBounds(e="selection"){const t=e==="all"?[]:this.authoring?.selection?.get()??[];if(t.length>0){const r=new Sr;let i=!1;for(const a of t){const c=this.authoring?Ae(this.authoring.hierarchy,a):null;if(!c)continue;const o=br(c);o.isEmpty()||(r.union(o),i=!0)}if(i)return r}return this.frameBox&&!this.frameBox.isEmpty()?this.frameBox:br(this.root)}frame(e=1,t="selection"){this.leaveCameraView(!1);const r=this.resolveFrameBounds(t);if(r.isEmpty()){let l=0,p=0;return this.root.traverse(x=>{const v=x.geometry;v&&(l+=1,p+=v.getAttribute("position")?.count??0)}),us.warn(`frame: nothing to frame — root "${this.root.name}" (${this.root.children.length} children, ${l} meshes, ${p} positions), selection ${JSON.stringify(this.authoring?.selection?.get()??[])}, frameBox ${this.frameBox?this.frameBox.isEmpty()?"empty":"set":"none"}`,"document"),!1}this.settleFlight("superseded");const i=r.getCenter(new z),a=this.viewport.camera.position.clone().sub(this.viewport.orbitControls.target).normalize();a.lengthSq()===0&&a.set(.8,.5,-1).normalize();const c=Math.min(10,Math.max(.1,$e(e,1))),o=Vt(r,this.viewport.camera,a)*c;return this.viewport.setPose(i.clone().addScaledVector(a,o),i),!0}orbit(e){return this.launchFlight($e(e.azimuth,0),$e(e.elevation,0),Math.min(60,Math.max(0,$e(e.duration,.6))),$o)}turntable(e){const t=$e(e.revolutions,1);return this.launchFlight(t*Math.PI*2,0,Math.min(60,Math.max(0,$e(e.seconds,6))),Go)}looking(){return this.flight!==null}launchFlight(e,t,r,i){this.settleFlight("superseded");const a=this.viewport.camera,c=this.viewport.orbitControls.target.clone(),o=new qi().setFromVector3(a.position.clone().sub(c)),l=o.radius>1e-4?o.radius:Math.max(this.resolveFrameBounds().getSize(new z).length(),1),p={pivot:c,radius:l,startTheta:o.theta,startPhi:o.phi,deltaTheta:e,deltaPhi:-t,duration:r,ease:i,elapsed:0,theta:o.theta,phi:o.phi,settle:null};this.flight=p;const x=new Promise(v=>{p.settle=v});return this.applyFlightPose(p,0),r<=0&&this.settleFlight(null),x}applyFlightPose(e,t){const r=e.ease(t);e.theta=e.startTheta+e.deltaTheta*r,e.phi=Math.min(No,Math.max(Io,e.startPhi+e.deltaPhi*r));const i=this.viewport.camera;i.position.setFromSphericalCoords(e.radius,e.phi,e.theta).add(e.pivot),this.viewport.orbitControls.target.copy(e.pivot),i.lookAt(e.pivot),i.updateMatrixWorld(),this.flightPose.copy(i.position)}advanceLook(e){const t=this.flight;if(!t)return;const r=Math.max(1e-4,t.radius*.001);if(this.viewport.camera.position.distanceToSquared(this.flightPose)>r*r){this.settleFlight("human");return}e>0&&Number.isFinite(e)&&(t.elapsed+=e);const i=t.duration<=0?1:Math.min(1,t.elapsed/t.duration);this.applyFlightPose(t,i),i>=1&&this.settleFlight(null)}settleFlight(e){const t=this.flight;if(!t)return;this.flight=null;const r={completed:e===null,azimuth:t.theta,elevation:Math.PI/2-t.phi,seconds:Math.min(t.elapsed,t.duration)};t.settle?.(e===null?r:{...r,cancelledBy:e})}select(e){N(),this.authoring&&zn(this.authoring,[...e])}selection(){return[...this.authoring?.selection?.get()??[]]}idForObject(e){return this.authoring?.hierarchy.idForObject3D?.(e)??null}syncSelectionPresentation(){N();const e=(this.authoring?.selection?.get()??[]).map(i=>this.authoring?Ae(this.authoring.hierarchy,i):null).filter(i=>i!==null);if(this.selectedObjects=e,this.selectionOutline&&(Ts(this.selectionOutline,this.selectionOutlineWanted?e:[]),this.syncComposerOutput()),this.selectionOrigins){const i=Ie(this.renderer.domElement);this.selectionOrigins.update(e,{visible:i.visible,...i.active?{active:i.active.visible}:{}})}const t=e.filter(i=>!!i.isBone),r=t.map(i=>i.uuid).join("\0");r!==this.boneSelectionSignature&&(this.boneSelectionSignature=r,this.clearBoneSelectionHighlight(),t.length>0&&(this.boneSelectionHighlight=new _o(t,Ie(this.renderer.domElement).visible),this.scene.add(this.boneSelectionHighlight)),this.refreshSkeletonHelper())}frameSelection(){return this.frameIds(this.authoring?.selection?.get()??[])}frameIds(e){this.leaveCameraView(!1),this.settleFlight("superseded");const t=e.map(r=>this.authoring?Ae(this.authoring.hierarchy,r):null).filter(r=>r!==null);return t.length===0?!1:t.every(r=>r.isBone)?(this.frameBones(t),!0):(this.viewport.focusOnMultiple(t),!0)}setViewPreset(e,t="bounds"){N(),this.leaveCameraView(!1),this.settleFlight("superseded");const r=io(e);let i,a;if(t==="view")i=this.viewport.orbitControls.target.clone(),a=this.viewport.camera.position.distanceTo(i);else{const l=this.resolveFrameBounds();if(l.isEmpty())return;i=l.getCenter(new z),a=Vt(l,this.viewport.camera,r)}const c=i.clone().addScaledVector(r,a),o=e==="top"?{x:0,y:0,z:-1}:e==="bottom"?{x:0,y:0,z:1}:{x:0,y:1,z:0};this.viewport.setPose(c,i,void 0,o),this.setProjection(e==="isometric"?"perspective":"orthographic")}setCameraPose(e,t,r){N(),this.leaveCameraView(!1),this.settleFlight("superseded"),this.viewport.setPose(e,t,r)}cameraPose(){return{position:this.viewport.camera.position.toArray(),target:this.viewport.orbitControls.target.toArray(),fov:this.viewport.camera.fov}}camera(){if(this.cameraOverride)return this.cameraOverride;const e=this.drawnCamera();return this.viewport.setGizmoCamera(e===this.viewport.camera?null:e),e}drawnCamera(){const e=this.through?this.cameraView():null;return e?this.throughCamera(e):(this.through&&!this.leaving&&(this.leaving=!0,queueMicrotask(()=>{this.leaving=!1,this.through&&!this.cameraView()&&this.leaveCameraView(!1)})),this.state.projection==="perspective"?this.viewport.camera:(this.syncOrthographicCamera(),this.orthographicCamera))}setCameraViewSource(e){this.cameraViewSource!==e&&(this.cameraViewSource=e,e||this.leaveCameraView(!1),this.notify())}hasCameraView(){return this.cameraViewSource!==null}cameraView(){const e=this.through,t=this.cameraViewSource;if(!e||!t)return null;const r=this.renderer.domElement,i=this.captureAspect?{width:this.captureAspect,height:1}:{width:r.clientWidth,height:r.clientHeight},a=this.viewport.camera,c=e.locked?`${a.position.toArray().join(",")}|${a.quaternion.toArray().join(",")}`:"",o=`${e.camera}|${i.width}|${i.height}|${e.zoom}|${e.offset.join(",")}|${c}`;if(this.viewMemo?.key===o)return this.viewMemo.view;const l=t.view(e.camera,i,e.zoom,e.offset),p=l&&e.locked?{...l,position:a.position.toArray(),quaternion:a.quaternion.toArray()}:l;return this.viewMemo={key:o,view:p},queueMicrotask(()=>{this.viewMemo=null}),p}toggleCameraView(){if(this.through)return this.leaveCameraView(!0),!0;const e=this.cameraViewSource,t=e?.camera()??null;if(!e)return!1;if(t===null)return us.warn("camera view: No active camera — the scene has no camera to look through","document"),!1;N(),this.settleFlight("superseded");const r=this.viewport,i=r.orbitControls,a=i.enableDamping;return i.enableDamping=!1,i.update(),i.enableDamping=a,this.through={camera:t,zoom:e.zoom.opening,offset:[0,0],left:{position:r.camera.position.clone(),target:r.orbitControls.target.clone(),up:r.camera.up.clone(),projection:this.state.projection},release:this.captureCameraViewInput(),locked:!1},e.showing?.(t),this.notify(),!0}cameraViewLocked(){return!this.through||!this.cameraViewSource?.setPose?null:this.through.locked}toggleCameraViewLock(){const e=this.through,t=this.cameraViewSource;if(!(!e||!t?.setPose)){if(e.release(),e.locked=!e.locked,!e.locked)e.release=this.captureCameraViewInput();else{const r=this.cameraView(),i=this.viewport.orbitControls,a=this.viewport.camera;if(r){const M=new z(...r.position),C=new Ms(...r.quaternion),D=e.left.position.distanceTo(e.left.target);a.up.set(0,1,0).applyQuaternion(C),a.position.copy(M),a.quaternion.copy(C),i.target.copy(M).addScaledVector(new z(0,0,-1).applyQuaternion(C),D),i.update()}const c=i.enabled;i.enabled=!0;const o=i.enableDamping;i.enableDamping=!1;const l=e.camera,p=M=>({position:a.position.toArray(),quaternion:a.quaternion.toArray(),final:M});let x=!1,v=null,P=!1;const w=M=>{if(x){v={...M,final:M.final||(v?.final??!1)};return}x=!0,v=null,Promise.resolve(t.setPose(l,M.position,M.quaternion,M.final)).catch(()=>{}).finally(()=>{x=!1,v&&w(v)})},L=()=>{P=!0,N(),this.notify(),w(p(!1))},F=()=>{P&&(P=!1,w(p(!0)))};i.addEventListener("change",L),i.addEventListener("end",F),e.release=()=>{F(),i.removeEventListener("change",L),i.removeEventListener("end",F),i.enabled=c,i.enableDamping=o}}this.viewMemo=null,N(),this.notify()}}cameraViewZoom(){return this.through?.zoom??null}setCameraViewZoom(e){const t=this.through,r=this.cameraViewSource;!t||!r||!Number.isFinite(e)||e<=0||(t.zoom=Math.min(r.zoom.max,Math.max(r.zoom.min,e)),N(),this.notify())}zoomCameraView(e){this.through&&this.setCameraViewZoom(this.through.zoom*e)}panCameraView(e,t){const r=this.through,i=this.cameraViewSource;if(!r||!i)return;const[a,c]=i.pan(r.offset,r.zoom,e,t);r.offset=[a,c],N(),this.notify()}leaveCameraView(e){const t=this.through;if(!t)return;const r=this.cameraView();t.release(),this.through=null,this.viewMemo=null,this.cameraViewSource?.showing?.(null),this.viewport.setGizmoCamera(null);const i=this.viewport;if(e)i.camera.position.copy(t.left.position),i.camera.up.copy(t.left.up),i.orbitControls.target.copy(t.left.target),this.state={...this.state,projection:t.left.projection};else if(r){const a=t.left.position.distanceTo(t.left.target),c=new z(...r.position),o=new Ms(...r.quaternion),l=new z(0,0,-1).applyQuaternion(o);i.camera.up.set(0,1,0).applyQuaternion(o),i.camera.position.copy(c),i.orbitControls.target.copy(c).addScaledVector(l,a);const p=Ft(t.left.position.clone().sub(t.left.target),t.left.up)!==null,x=ur().autoPerspective&&p?"perspective":t.left.projection;this.state={...this.state,projection:x}}i.camera.lookAt(i.orbitControls.target),i.orbitControls.update(),N(),this.notify()}throughCamera(e){const{left:t,right:r,top:i,bottom:a}=e.window,c=this.viewport.camera.layers.mask;if(e.projection==="orthographic"){const l=this.throughOrthographic;return Object.assign(l,{left:t,right:r,top:i,bottom:a,near:e.near,far:e.far,zoom:1}),l.position.set(...e.position),l.quaternion.set(...e.quaternion),l.layers.mask=c,l.updateProjectionMatrix(),l.updateMatrixWorld(!0),l}const o=this.throughPerspective;return o.near=e.near,o.far=e.far,o.fov=xr.radToDeg(2*Math.atan((i-a)/2)),o.aspect=(r-t)/(i-a),o.zoom=1,o.position.set(...e.position),o.quaternion.set(...e.quaternion),o.layers.mask=c,o.projectionMatrix.makePerspective(t*e.near,r*e.near,i*e.near,a*e.near,e.near,e.far),o.projectionMatrixInverse.copy(o.projectionMatrix).invert(),o.updateMatrixWorld(!0),o}captureCameraViewInput(){const e=this.viewport.orbitControls,t=this.renderer.domElement,r=t.parentElement??t,i=e.enabled;e.enabled=!1;const a=o=>{o.target!==t||o.deltaY===0||(o.preventDefault(),this.zoomCameraView(o.deltaY<0?1.2:1/1.2))},c=o=>{if(o.target!==t)return;const l=e.mouseButtons;let p=[l.LEFT,l.MIDDLE,l.RIGHT][o.button]??null;const x=o.ctrlKey||o.metaKey||o.shiftKey;if(o.button===1&&(o.ctrlKey||o.metaKey)&&p===me.ROTATE?p=me.DOLLY:x&&p===me.ROTATE?p=me.PAN:x&&p===me.PAN&&(p=me.ROTATE),p===me.ROTATE){this.leaveCameraView(!1);return}if(p!==me.PAN&&p!==me.DOLLY)return;o.preventDefault();const v=t.getBoundingClientRect();let P=o.clientX,w=o.clientY;const L=this.through?.zoom??1,F=Math.max(5+o.clientY-v.top,1),M=D=>{if(p===me.PAN){this.panCameraView((D.clientX-P)/Math.max(v.width,1),(D.clientY-w)/Math.max(v.height,1)),P=D.clientX,w=D.clientY;return}const K=Math.max(.01,2*((5+D.clientY-v.top)/F-1)+1);this.setCameraViewZoom(L/K)},C=()=>{window.removeEventListener("pointermove",M),window.removeEventListener("pointerup",C),window.removeEventListener("pointercancel",C)};window.addEventListener("pointermove",M),window.addEventListener("pointerup",C),window.addEventListener("pointercancel",C)};return r.addEventListener("wheel",a,{capture:!0,passive:!1}),r.addEventListener("pointerdown",c,{capture:!0}),()=>{r.removeEventListener("wheel",a,{capture:!0}),r.removeEventListener("pointerdown",c,{capture:!0}),e.enabled=i}}projection(){return this.state.projection}setProjection(e){N(),this.state.projection!==e&&(this.state={...this.state,projection:e},this.notify())}setMode(e){N(),this.state.mode!==e&&(this.clearDiagnosticPresentation(),this.state={...this.state,mode:e},e==="uv"?this.scene.overrideMaterial=new Yi({vertexShader:"varying vec2 vUv; void main(){ vUv=uv; gl_Position=projectionMatrix*modelViewMatrix*vec4(position,1.0); }",fragmentShader:"varying vec2 vUv; void main(){ gl_FragColor=vec4(vUv,0.0,1.0); }"}):e==="vertex-colors"?this.scene.overrideMaterial=new At({vertexColors:!0}):e==="wireframe"&&this.buildTopologyOverlay(),this.notify())}buildTopologyOverlay(){const e=new Lt,t=[];this.root.updateMatrixWorld(!0),this.root.traverse(r=>{const i=r;if(!i.isMesh||!i.geometry)return;const a=new Xi(new Ki(i.geometry,Wo),new Zi({color:Bs,toneMapped:!1,transparent:!0,opacity:.85,depthTest:!1,depthWrite:!1}));a.matrixAutoUpdate=!1,a.matrixWorldAutoUpdate=!1,a.matrixWorld.copy(i.matrixWorld),a.frustumCulled=!1,a.renderOrder=2,e.add(a),t.push({line:a,source:i})}),t.length!==0&&(this.topologyOverlay=e,this.topologyFollowers=t,this.addHelper(e,"topology"))}syncTopologyOverlay(){this.topologyFollowers.some(({source:i})=>i.parent===null)&&(this.clearTopologyOverlay(),this.buildTopologyOverlay()),this.selectionColors??=Ie(this.renderer.domElement);const e=this.selectionColors,t=this.selectedObjects.at(-1)??null,r=(i,a)=>{for(let c=i;c;c=c.parent)if(c===a)return!0;return!1};for(const{line:i,source:a}of this.topologyFollowers){i.matrixWorld.copy(a.matrixWorld),i.visible=a.visible;const c=i.material,o=t!==null&&r(a,t),l=o||this.selectedObjects.some(x=>r(a,x)),p=o?e.active?.visible??e.visible:l?e.visible:null;c.color.setHex(p??Bs)}}clearTopologyOverlay(){for(const{line:r}of this.topologyFollowers.splice(0))r.geometry.dispose(),r.material.dispose();const e=this.topologyOverlay;if(this.topologyOverlay=null,!e)return;e.removeFromParent();const t=this.helpers.indexOf(e);t>=0&&this.helpers.splice(t,1)}setBounds(e){N(),this.state.bounds!==e&&(this.state={...this.state,bounds:e},e?(this.boundsHelper=new ks(this.root,16757844),this.addHelper(this.boundsHelper,"bounds")):this.clearBoundsHelper(),this.notify())}setSkeleton(e){N(),this.state.skeleton!==e&&(this.state={...this.state,skeleton:e},this.refreshSkeletonHelper(),this.notify())}neutralBackgroundTexture(){return this.neutralBackground}setNeutralBackground(e){N();const t=this.scene.background,r=this.neutralBackground,i=t===r||t instanceof pe&&r instanceof pe&&t.equals(r);this.neutralBackground=e,i&&(this.scene.background=e)}setBackground(e){N(),this.state.background!==e&&(this.scene.background=e==="transparent"?null:this.neutralBackground,this.state={...this.state,background:e},this.notify())}resetPresentation(){N(),In(this.documentId),this.clearDiagnosticPresentation(),this.state=Hs,this.refreshSkeletonHelper(),this.clearBoundsHelper(),this.scene.background=this.neutralBackground,this.viewport.camera.up.set(0,1,0),this.frame(),this.notify()}setBeforeRender(e){this.beforeRender=e}presentedFrameWaiters=[];presentsFrames=!1;setPresentsFrames(e){this.presentsFrames=e,e||this.resolvePresentedFrame(null)}requestPresentedFrame(){return this.presentsFrames?new Promise(e=>{let t=!1;const r=i=>{t||(t=!0,e(i))};this.presentedFrameWaiters.push(r),N(),setTimeout(()=>r(null),zo)}):Promise.resolve(null)}needsFrame(){return this.flight!==null||this.presentedFrameWaiters.length>0}servePresentedFrame(){if(this.presentedFrameWaiters.length===0)return;const e=this.renderer.domElement,t=document.createElement("canvas");t.width=Math.max(1,e.width),t.height=Math.max(1,e.height);const r=t.getContext("2d");if(!r){this.resolvePresentedFrame(null);return}r.drawImage(e,0,0),this.resolvePresentedFrame(t)}resolvePresentedFrame(e){const t=this.presentedFrameWaiters;this.presentedFrameWaiters=[];for(const r of t)r(e)}render(e){this.beforeRender?.(),this.boneSelectionHighlight?.update();const t=this.camera(),r=this.state.mode;if(this.boundsHelper?.update(),this.selectionOrigins?.place(),r==="uv"||r==="vertex-colors"){e(t);return}if(r==="wireframe"&&this.topologyOverlay){if(this.syncTopologyOverlay(),this.xray.enabled&&this.xray.alpha<=0){const i=new Set;this.root.traverse(a=>{const c=a;if(c.isMesh)for(const o of Array.isArray(c.material)?c.material:[c.material])o?.visible&&(o.visible=!1,i.add(o))});try{e(t)}finally{for(const a of i)a.visible=!0}return}this.shading.render(this.scene,"clay",()=>e(t),As);return}this.shading.render(this.scene,r,()=>e(t),As)}renderViewport(e=0){this.advanceLook(e),this.ensureComposer(),this.render(t=>{const r=this.composer;if(!r){this.renderer.render(this.scene,t);return}r.setMainScene(this.scene),r.setMainCamera(t),r.render(e)})}resize(e,t){N(),this.renderWidth=Math.max(1,e),this.renderHeight=Math.max(1,t),this.composer?.setSize(this.renderWidth,this.renderHeight)}renderCapture(e,t){this.render(r=>{if(!t){e(r);return}const i=this.scene.background,a=this.renderer.getClearColor(new pe),c=this.renderer.getClearAlpha();try{this.scene.background=null,this.renderer.setClearColor(0,0),e(r)}finally{this.scene.background=i,this.renderer.setClearColor(a,c)}})}captureImage(e=512){const t=typeof e=="number"?e:e.width,r=typeof e=="number"?e:e.height;if(!Number.isFinite(t)||t<1||!Number.isFinite(r)||r<1)return null;const i=Math.min(2048,Math.round(t)),a=Math.min(2048,Math.round(r)),c=i*2,o=a*2,l=new Es(c,o,{type:Ji}),p=new Es(c,o),x=this.renderer.getRenderTarget(),v=this.renderer.getPixelRatio(),P=this.viewport.camera,w=P.aspect;try{this.captureAspect=i/a;const L=typeof e=="number"?void 0:e.camera;L?this.cameraOverride=L:(P.aspect=i/a,P.updateProjectionMatrix()),this.renderer.setPixelRatio(1),this.renderer.setRenderTarget(l),this.renderCapture(_=>this.renderSolidForCapture(_,l,c,o),typeof e!="number"&&e.transparent===!0),no(typeof e!="number"&&e.transparent===!0).render(this.renderer,p,l,0,!1);const F=c*4,M=new Uint8Array(F*o);this.renderer.readRenderTargetPixels(p,0,0,c,o,M);const C=document.createElement("canvas");C.width=c,C.height=o;const D=C.getContext("2d");if(!D)return null;const K=D.createImageData(c,o);for(let _=0;_<o;_++){const U=(o-1-_)*F,j=_*F;K.data.set(M.subarray(U,U+F),j)}D.putImageData(K,0,0);const b=document.createElement("canvas");b.width=i,b.height=a;const I=b.getContext("2d");return I?(I.drawImage(C,0,0,i,a),b.toDataURL("image/png")):null}finally{this.captureAspect=null,this.cameraOverride=null,P.aspect=w,P.updateProjectionMatrix(),this.renderer.setRenderTarget(x),this.renderer.setPixelRatio(v),this.composer?.setSize(this.renderWidth,this.renderHeight,!1),p.dispose(),l.dispose()}}dispose(){this.disposed=!0,this.leaveCameraView(!1),this.selectionOrigins?.dispose(),this.selectionOrigins=null,this.settleFlight("closed"),this.viewport.orbitControls.removeEventListener("start",this.cancelLookForHuman),this.unsubscribeRotateStart(),this.unsubscribeAxisView(),this.unsubscribeSelectionTheme(),this.clearDiagnosticPresentation(),this.clearBoneSelectionHighlight(),this.clearBoundsHelper(),this.clearSkeletonHelper(),this.selectionOutline&&ao(this.renderer,this.selectionOutline,this.selectionOutlinePass),this.composer?.dispose(),this.sceneRenderPass=null,this.selectionOutline=null,this.selectionOutlinePass=null,this.composer=null,this.shading.dispose(),this.listeners.clear()}addHelper(e,t){e.name=`__object3d_document_${t}`,Js(e,"editorHelper",!0),this.scene.add(e),this.helpers.push(e)}get selectionOutlineEnabled(){return this.selectionOutlineWanted}set selectionOutlineEnabled(e){e!==this.selectionOutlineWanted&&(this.selectionOutlineWanted=e,e?this.syncSelectionPresentation():(this.selectionOutline?.selection.clear(),this.syncComposerOutput()))}selectionOutlineWanted=!0;xray={enabled:!1,alpha:1};setXray(e){this.xray.enabled===e.enabled&&this.xray.alpha===e.alpha||(this.xray=e,N())}set selectionOriginsEnabled(e){e!==(this.selectionOrigins!==null)&&(e?(this.selectionOrigins=new Xo,this.scene.add(this.selectionOrigins),this.syncSelectionPresentation()):(this.selectionOrigins?.dispose(),this.selectionOrigins=null,N()))}ensureComposer(){this.selectionOutlineWanted&&(this.composer||this.composerLoading||this.disposed||(this.composerLoading=!0,Ye(()=>import("./index-DHhMOs_s.js"),__vite__mapDeps([0,1,2])).then(e=>{if(this.composerLoading=!1,this.disposed||this.composer)return;const t=this.camera(),r=new e.EffectComposer(this.renderer);this.sceneRenderPass=new e.RenderPass(this.scene,t),r.addPass(this.sceneRenderPass),this.selectionOutline=co(e,this.renderer,this.scene,t,Ie(this.renderer.domElement)),this.syncSelectionTheme(),Ts(this.selectionOutline,this.selectedObjects),this.selectionOutlinePass=new e.EffectPass(t,this.selectionOutline),r.addPass(this.selectionOutlinePass),this.composer=r,this.syncComposerOutput(),r.setSize(this.renderWidth,this.renderHeight),N()}).catch(()=>{this.composerLoading=!1})))}renderSolidForCapture(e,t,r,i){const a=this.composer,c=(this.selectionOutline?.selection.size??0)>0;if(!a||!c||!this.sceneRenderPass||!this.selectionOutlinePass){this.renderer.render(this.scene,e);return}const o=this.renderWidth,l=this.renderHeight;try{this.sceneRenderPass.renderToScreen=!1,this.selectionOutlinePass.renderToScreen=!1,a.setSize(r,i,!1),this.sceneRenderPass.render(this.renderer,a.inputBuffer,a.outputBuffer,0),this.selectionOutlinePass.render(this.renderer,a.inputBuffer,t,0)}finally{a.setSize(o,l,!1),this.syncComposerOutput(),this.renderer.setRenderTarget(t)}}syncComposerOutput(){const e=(this.selectionOutline?.selection.size??0)>0;this.sceneRenderPass&&(this.sceneRenderPass.renderToScreen=!e),this.selectionOutlinePass&&(this.selectionOutlinePass.enabled=e,this.selectionOutlinePass.renderToScreen=e)}refreshSkeletonHelper(){const e=this.state.skeleton||this.boneSelectionHighlight!==null;e&&!this.skeletonHelper?(this.skeletonHelper=new Qi(this.root),Bo(this.skeletonHelper),this.scene.add(this.skeletonHelper)):e||this.clearSkeletonHelper()}clearSkeletonHelper(){this.skeletonHelper&&(this.skeletonHelper.removeFromParent(),this.skeletonHelper.dispose(),this.skeletonHelper=null)}clearBoneSelectionHighlight(){this.boneSelectionHighlight&&(this.boneSelectionHighlight.removeFromParent(),this.boneSelectionHighlight.dispose(),this.boneSelectionHighlight=null)}clearBoundsHelper(){if(!this.boundsHelper)return;const e=this.boundsHelper;this.boundsHelper=null;const t=this.helpers.indexOf(e);t>=0&&this.helpers.splice(t,1),e.removeFromParent(),e.geometry.dispose(),Array.isArray(e.material)?e.material.forEach(r=>{r.dispose()}):e.material.dispose()}frameBones(e){const t=new Sr,r=new z;for(const l of e){t.expandByPoint(l.getWorldPosition(r)),l.parent?.isBone&&t.expandByPoint(l.parent.getWorldPosition(r));for(const p of l.children)p.isBone&&t.expandByPoint(p.getWorldPosition(r))}const i=t.getCenter(new z),a=Math.max(t.getSize(new z).length(),.2);t.expandByScalar(a*.35);const c=this.viewport.camera.position.clone().sub(this.viewport.orbitControls.target).normalize(),o=Vt(t,this.viewport.camera,c);this.viewport.setPose(i.clone().addScaledVector(c,o),i)}syncOrthographicCamera(){const e=this.viewport.camera,t=this.viewport.orbitControls.target,r=Math.max(e.position.distanceTo(t),.001),i=Math.max(r*Math.tan(xr.degToRad(e.fov)/2),.001),a=Math.max(this.renderer.domElement.clientWidth,1),c=Math.max(this.renderer.domElement.clientHeight,1),o=this.captureAspect??a/c;this.orthographicCamera.left=-i*o,this.orthographicCamera.right=i*o,this.orthographicCamera.top=i,this.orthographicCamera.bottom=-i,this.orthographicCamera.near=e.near,this.orthographicCamera.far=e.far,this.orthographicCamera.position.copy(e.position),this.orthographicCamera.quaternion.copy(e.quaternion),this.orthographicCamera.up.copy(e.up),this.orthographicCamera.layers.mask=e.layers.mask,this.orthographicCamera.updateProjectionMatrix(),this.orthographicCamera.updateMatrixWorld(!0)}clearDiagnosticPresentation(){this.clearTopologyOverlay(),this.scene.overrideMaterial?.dispose(),this.scene.overrideMaterial=null;for(const e of this.helpers.splice(0)){e.removeFromParent();const t=e;t.geometry?.dispose();const r=t.material;Array.isArray(r)?r.forEach(i=>{i.dispose()}):r?.dispose()}}notify(){this.version++;for(const e of this.listeners)e()}}const qo=7;let at=null;function Yo(){if(at)return at;const n=64,e=document.createElement("canvas");e.width=n,e.height=n;const t=e.getContext("2d");return t.beginPath(),t.arc(n/2,n/2,n/2-1,0,Math.PI*2),t.fillStyle="rgba(0, 0, 0, 0.75)",t.fill(),t.beginPath(),t.arc(n/2,n/2,n/2-8,0,Math.PI*2),t.fillStyle="#ffffff",t.fill(),at=new Qs(e),at.colorSpace=kr,at}class Xo extends sn{objects=[];origin=new z;constructor(){super(new en,new rn({map:Yo(),size:qo,sizeAttenuation:!1,transparent:!0,alphaTest:.05,depthTest:!1,depthWrite:!1,toneMapped:!1})),this.name="vgai:selection-origins",this.userData.editorHelper=!0,this.renderOrder=1e3,this.frustumCulled=!1,this.raycast=()=>{}}update(e,t){this.objects=e,this.material.color.setHex(e.length===1&&t.active!==void 0?t.active:t.visible),this.visible=e.length>0}place(){const e=this.objects.length;let t=this.geometry.getAttribute("position");(t===void 0||t.count<e)&&(this.geometry.dispose(),t=new tn(new Float32Array(Math.max(e,8)*3),3),this.geometry.setAttribute("position",t)),this.geometry.setDrawRange(0,e),this.objects.forEach((r,i)=>{r.getWorldPosition(this.origin),t.setXYZ(i,this.origin.x,this.origin.y,this.origin.z)}),t.needsUpdate=!0}dispose(){this.removeFromParent(),this.geometry.dispose(),this.material.dispose()}}class Ko{constructor(e){this.options=e}active=null;settling=!1;idleWaiters=new Set;begin(e){if(this.active||this.settling)return!1;try{const t=this.options.begin(e);return t?(this.active={pointerId:e.pointerId,gesture:t},!0):!1}catch(t){return this.options.reportError(t),!1}}update(e){if(!(!this.active||this.active.pointerId!==e.pointerId))try{this.active.gesture.update(e)}catch(t){this.cancelWithError(t)}}async commit(e){const t=this.take(e.pointerId);if(!t)return!1;this.settling=!0;try{return await t.commit(e),await this.options.persist(t.label),!0}catch(r){try{await t.cancel()}catch(i){return this.options.reportError({operationError:r,rollbackError:i}),!1}return this.options.reportError(r),!1}finally{this.settling=!1;for(const r of this.idleWaiters)r();this.idleWaiters.clear()}}async cancel(e){const t=this.take(e);if(!t)return!1;this.settling=!0;try{return await t.cancel(),!0}catch(r){return this.options.reportError(r),!1}finally{this.settling=!1;for(const r of this.idleWaiters)r();this.idleWaiters.clear()}}async settle(){this.active&&await this.cancel(),this.settling&&await new Promise(e=>this.idleWaiters.add(e))}hasActiveGesture(){return this.active!==null}take(e){if(!this.active||e!==void 0&&this.active.pointerId!==e)return null;const t=this.active.gesture;return this.active=null,t}async cancelWithError(e){const t=this.take();if(t){this.settling=!0;try{await t.cancel(),this.options.reportError(e)}catch(r){this.options.reportError({operationError:e,rollbackError:r})}finally{this.settling=!1;for(const r of this.idleWaiters)r();this.idleWaiters.clear()}}}}class Zo{constructor(e,t){this.frame=e,this.releaseRenderer=t,this.unsubscribeActivity=Po(()=>this.syncActivity())}rafId=0;running=!1;disposed=!1;active=!1;unsubscribeActivity;get isDisposed(){return this.disposed}get isRunning(){return this.running}setActive(e){this.disposed||(this.active=e,this.syncActivity())}syncActivity(){this.active&&hr()?this.start():this.stop()}redraw(){this.running&&!this.disposed&&hr()&&this.guardedFrame(performance.now())}dispose(){this.stop(),!this.disposed&&(this.disposed=!0,this.unsubscribeActivity(),this.releaseRenderer())}start(){this.disposed||this.running||(this.running=!0,this.guardedFrame(performance.now(),!0),!(!this.running||this.disposed)&&(this.rafId=requestAnimationFrame(this.tick)))}lastFrameFailure=null;guardedFrame(e,t=!1){try{this.frame(e,t),this.lastFrameFailure=null}catch(r){const i=r instanceof Error?r.message:String(r);i!==this.lastFrameFailure&&(this.lastFrameFailure=i,console.error("[document renderer] a frame threw; the loop continues:",r))}}stop(){this.running=!1,this.rafId!==0&&(cancelAnimationFrame(this.rafId),this.rafId=0)}tick=e=>{if(!(!this.running||this.disposed)){if(!hr()){this.stop();return}this.guardedFrame(e),!(!this.running||this.disposed)&&(this.rafId=requestAnimationFrame(this.tick))}}}const Jo=new Set(["solid","clay","unlit","wireframe","normals","overdraw"]);function Qo(n,e){return{read:()=>{const t=n.cameraPose;if(!t)return null;const{position:r,target:i}=t;return{camera:{position:{x:r.x,y:r.y,z:r.z},target:{x:i.x,y:i.y,z:i.z},...t.fov?{fov:t.fov}:{}},diagnostic:n.shadingMode,grid:Nn(e)}},setDiagnostic:t=>Jo.has(t)?(n.setShadingMode(t),!0):!1,setCamera:t=>typeof t!="string"?(n.shell.setCameraPose(t.position,t.target,t.fov),!0):t==="isometric"?!1:(n.shell.setViewPreset(t),!0),frame:t=>t==="document"?!1:(n.shell.focusOnSelection(),!0)}}function ea(n){const e=wr();return e?$n(Ys(e.shell,n)):"none"}const ta=f.lazy(()=>Ye(()=>import("./stage-transform-tools-BQB7EY4l.js"),__vite__mapDeps([3,4,5,6,7,8,9,10,11,12,13,14,15,1,2,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])).then(n=>({default:n.ThreeStageTransformTools}))),ra=f.lazy(()=>Ye(()=>import("./stage-transform-tools-BQB7EY4l.js"),__vite__mapDeps([3,4,5,6,7,8,9,10,11,12,13,14,15,1,2,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])).then(n=>({default:n.ThreeStageTransformControls})));function Ws(n){return{transformTools:()=>ea(n),TransformTools:ta,TransformControls:ra}}class sa{constructor(e,t,r){this.create=e,this.isOpen=t,this.subscribe=r}states=new Map;generations=new WeakMap;unsubscribe=null;claim(e){const t=this.states.get(e)??[];let r=t.find(i=>!i.inUse);return r||(r=this.create(e),t.push(r),this.states.set(e,t)),r.inUse=!0,this.generations.set(r,this.generation(r)+1),this.unsubscribe??=this.subscribe(()=>this.discardClosed()),r}generation(e){return this.generations.get(e)??0}release(e,t=this.generation(e)){this.generation(e)===t&&(e.inUse=!1,queueMicrotask(()=>this.discardClosed()))}retain(e,t,r){if(!this.isOpen(e.documentId)||!this.states.get(e.documentId)?.includes(e)||this.generation(e)!==r){t.dispose();return}const i=e.source;e.source=t,i!==t&&i?.dispose()}discardClosed(){const e=[];for(const[r,i]of this.states){if(this.isOpen(r))continue;const a=i.filter(c=>c.inUse);e.push(...i.filter(c=>!c.inUse)),a.length?this.states.set(r,a):this.states.delete(r)}this.states.size===0&&(this.unsubscribe?.(),this.unsubscribe=null);const t=[];for(const r of e){const i=r.source;r.source=null;try{i?.dispose()}catch(a){t.push(a)}}if(t.length)throw new AggregateError(t,"Retained document cleanup failed")}}const na=f.lazy(async()=>({default:(await Ye(()=>import("./stage-overlay-set-BGE03mqb.js"),__vite__mapDeps([64,4,5,7,8,6,9,10,11,12,13,54,65,66,24,14,15,1,2,16,17,18,19,20,21,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,55,56,57,58,59,60,61,62,63]))).StageOverlaySet}));function ia(n){return d.jsx(f.Suspense,{fallback:null,children:d.jsx(na,{...n})})}function zs(n,e,t){if(e==="orthographic"){const r=Ft(n.camera.position.clone().sub(n.orbitControls.target),new z(0,1,0).applyQuaternion(n.camera.quaternion));return r!==null?r:t==="short"?"Iso":"Orthographic"}return t==="short"?"Persp":"Perspective"}const oa=()=>()=>{},Is=()=>0;function aa({shell:n,documentId:e,label:t,kebab:r=!1}){const i=f.useSyncExternalStore(lo,Vs,Vs);f.useSyncExternalStore(wo,bo);const a=e?yo(e):null;f.useSyncExternalStore(a?.subscribe??oa,a?.getSnapshot??Is,a?.getSnapshot??Is);const c=a?a.projection():i.projection,o=P=>{a?a.setProjection(P):Ls(P)},[l,p]=f.useState(!1),x=f.useRef(null);f.useEffect(()=>{if(!l)return;const P=w=>{x.current?.contains(w.target)||p(!1)};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[l]);const v=P=>{if(a){a.setViewPreset(P,"view");return}Ls("orthographic"),n.setViewPreset(P)};return d.jsxs("div",{ref:x,className:"vgai-viewport-popover-anchor",children:[t===void 0?d.jsx(Ue,{text:c==="perspective"?"Perspective":"Orthographic",children:d.jsx(Te,{"aria-label":"Viewport views","aria-expanded":l,size:"comfortable",onClick:()=>p(P=>!P),children:d.jsx(we,{icon:l?Gn:Un,size:"md"})})}):d.jsxs(Ne,{size:"comfortable",variant:"ghost","aria-label":"Viewport views","aria-expanded":l,"data-testid":"viewport-view-name",onClick:()=>p(P=>!P),children:[r?d.jsx(we,{icon:qn,size:"sm"}):null,t]}),l?d.jsx(Yn,{style:{minWidth:230},children:d.jsxs(Xn,{gap:3,children:[d.jsx(hs,{variant:"caption",tone:"muted",children:"Projection"}),d.jsxs(ds,{gap:1,children:[d.jsx(Ne,{size:"compact",variant:c==="perspective"?"primary":"ghost",onClick:()=>o("perspective"),children:"Perspective"}),d.jsx(Ne,{size:"compact",variant:c==="orthographic"?"primary":"ghost",onClick:()=>o("orthographic"),children:"Orthographic"})]}),d.jsx(hs,{variant:"caption",tone:"muted",children:"Axis View"}),d.jsxs(ds,{gap:1,children:[d.jsx(Ne,{size:"compact",variant:"ghost",onClick:()=>v("top"),children:"Top"}),d.jsx(Ne,{size:"compact",variant:"ghost",onClick:()=>v("front"),children:"Front"}),d.jsx(Ne,{size:"compact",variant:"ghost",onClick:()=>v("right"),children:"Right"})]})]})}):null]})}const ca=po;function Ns(n){return Cr(null,n)}const la=()=>()=>{},$s=()=>0,ua=5,ha=58;function da(n,e){const t=e?.camera()??n.renderCamera,r=n.camera.position,i=n.orbitControls.target,a=t.isOrthographicCamera?un(t,n,e):0;return[r.x,r.y,r.z,i.x,i.y,i.z,a].map(c=>c.toPrecision(6)).join(",")}function un(n,e,t){const r=e.orbitControls.domElement,i=Math.max(1,t?.renderer.domElement.height??(r?.clientHeight??1)*(r?.ownerDocument.defaultView?.devicePixelRatio??1));return(n.top-n.bottom)/n.zoom/i}function pa({viewport:n,documentId:e,session:t,store:r,projection:i,displayName:a,objectName:c,statistics:o,subject:l,gridScale:p}){f.useSyncExternalStore(r.subscribe,r.getShellSnapshot??r.getSnapshot),f.useSyncExternalStore(f.useCallback(T=>{const W=n?.orbitControls;return W?.addEventListener("change",T),()=>W?.removeEventListener("change",T)},[n]),()=>n?da(n,t):""),f.useSyncExternalStore(t?.subscribe??la,t?.getSnapshot??$s,t?.getSnapshot??$s);const x=f.useSyncExternalStore(Ns,Xs),v=f.useSyncExternalStore(Ns,Kn),P=x&&!v?qe.content.onAccent:qe.content.primary,w=Zn();f.useSyncExternalStore(vr,ps,ps);const L=ct(e).overlays.navigationControls;if(!n)return null;const F=Ft(n.camera.position.clone().sub(n.orbitControls.target),new z(0,1,0).applyQuaternion(n.camera.quaternion))??"User",M=t?.projection()??i,C=t?.cameraView()??null,D=C?`Camera ${C.projection==="perspective"?"Perspective":"Orthographic"}`:`${F} ${M==="perspective"?"Perspective":"Orthographic"}`,K=r.selectedEntityId,b=(K===null?null:c(K))||null,I=l??(b===null||b===a?a:`${a} | ${b}`),_=t?.camera()??n.renderCamera,U=p&&!C&&F!=="User"&&_.isOrthographicCamera?p(un(_,n,t)):null,j=T=>{T.preventDefault();const W=T.currentTarget;W.setPointerCapture(T.pointerId);const be=n.orbitControls.domElement?.getBoundingClientRect().top??0,Me=Math.max(5+T.clientY-be,1),oe=n.camera,le=n.orbitControls.target,ae=oe.position.clone().sub(le),te=!t&&n.renderCamera instanceof yr?n.renderCamera:null,se=te?.zoom??1,Ee=t?.cameraViewZoom()??null,ue=he=>{const Ve=5+he.clientY-be,ye=Math.max(.01,2*(Ve/Me-1)+1);Ee!==null&&t?.cameraView()?t.setCameraViewZoom(Ee/ye):te?(te.zoom=se/ye,te.updateProjectionMatrix()):oe.position.copy(le).addScaledVector(ae,ye),n.orbitControls.update()},Q=()=>{W.removeEventListener("pointermove",ue),W.removeEventListener("pointerup",Q),W.removeEventListener("pointercancel",Q),W.removeEventListener("lostpointercapture",Q)};W.addEventListener("pointermove",ue),W.addEventListener("pointerup",Q),W.addEventListener("pointercancel",Q),W.addEventListener("lostpointercapture",Q)},H=T=>{T.preventDefault();const W=T.currentTarget;W.setPointerCapture(T.pointerId);let be=T.clientX,Me=T.clientY;const oe=new z,le=new z,ae=se=>{const Ee=se.clientX-be,ue=se.clientY-Me;if(be=se.clientX,Me=se.clientY,t?.cameraView()){const Ke=t.renderer.domElement;t.panCameraView(Ee/Math.max(Ke.clientWidth,1),ue/Math.max(Ke.clientHeight,1));return}const Q=n.camera,he=n.orbitControls.target,Ve=Q.position.distanceTo(he),ye=Math.max(1,W.ownerDocument.defaultView?.innerHeight??1),Xe=2*Ve*Math.tan(xr.degToRad(Q.fov/2))/ye;oe.setFromMatrixColumn(Q.matrixWorld,0).multiplyScalar(-Ee*Xe),le.setFromMatrixColumn(Q.matrixWorld,1).multiplyScalar(ue*Xe),Q.position.add(oe).add(le),he.add(oe).add(le),n.orbitControls.update()},te=()=>{W.removeEventListener("pointermove",ae),W.removeEventListener("pointerup",te),W.removeEventListener("pointercancel",te),W.removeEventListener("lostpointercapture",te)};W.addEventListener("pointermove",ae),W.addEventListener("pointerup",te),W.addEventListener("pointercancel",te),W.addEventListener("lostpointercapture",te)};return d.jsxs(d.Fragment,{children:[w.viewName==="text"?d.jsxs("div",{"data-testid":"viewport-view-text","aria-hidden":"true",style:{position:"absolute",top:"var(--vgai-space-3)",left:"calc(var(--vgai-space-4) + var(--vgai-control-comfortable-height) * 2 + var(--vgai-space-4))",display:"flex",flexDirection:"column",gap:"var(--vgai-space-1)",fontSize:"var(--vgai-font-sm)",color:P,textShadow:"var(--vgai-content-text-shadow, none)",pointerEvents:"none",userSelect:"none"},children:[d.jsx("span",{children:D}),d.jsx("span",{children:I}),U?d.jsx("span",{"data-testid":"viewport-grid-scale",children:U}):null,o&&o.length>0?d.jsx("div",{"data-testid":"viewport-statistics",style:{display:"grid",gridTemplateColumns:`${ha}px auto`,rowGap:"var(--vgai-space-1)",marginTop:Jn[ua]},children:o.map(T=>d.jsxs(f.Fragment,{children:[d.jsx("span",{children:T.label}),d.jsx("span",{children:T.value})]},T.id))}):null]}):null,w.viewName==="menu"?d.jsx("div",{className:"vgai-viewport-view-pill",style:{position:"absolute",top:"var(--vgai-viewport-overlay-top, var(--vgai-space-4))",left:"var(--vgai-stage-name-left, calc(var(--vgai-space-4) + var(--vgai-control-comfortable-height) * 2 + var(--vgai-space-4)))",zIndex:"calc(var(--vgai-z-dropdown, 1000) - 1)",pointerEvents:"auto"},children:d.jsx(aa,{shell:r,documentId:e,label:zs(n,M,"long"),kebab:!0})}):null,w.viewName==="gizmo"?d.jsxs("button",{type:"button","data-testid":"viewport-view-name",className:"vgai-viewport-gizmo-label","aria-label":M==="perspective"?"Switch to orthographic":"Switch to perspective",onClick:()=>{const T=M==="perspective"?"orthographic":"perspective";t?t.setProjection(T):n.setProjection(T)},style:{position:"absolute",top:ho+4,right:uo,transform:"translateX(50%)",display:"inline-flex",alignItems:"center",gap:"var(--vgai-space-1)",padding:0,border:0,background:"none",fontSize:"var(--vgai-font-sm)",color:P,textShadow:"var(--vgai-content-text-shadow, none)",cursor:"pointer",pointerEvents:"auto"},children:[d.jsx(we,{size:"xs",icon:M==="perspective"?Qn:ei}),zs(n,M,"short")]}):null,L?d.jsxs("div",{"data-testid":"viewport-navigation",role:"toolbar","aria-label":"Navigation","aria-orientation":"vertical",className:"vgai-chrome-island vgai-viewport-navigation",style:{position:"absolute",top:ca,right:"var(--vgai-space-6)",display:"flex",flexDirection:"column",gap:"var(--vgai-space-1)",padding:"var(--vgai-space-1) 0",borderRadius:"var(--vgai-radius-full)",background:"var(--vgai-island-surface, var(--vgai-surface-overlay))",pointerEvents:"auto"},children:[d.jsx(Ue,{text:"Zoom (drag)",children:d.jsx(Te,{size:"comfortable","aria-label":"Zoom the view",onPointerDown:j,children:d.jsx(we,{size:"2xl",icon:ve.viewport.zoomIn})})}),d.jsx(Ue,{text:"Pan (drag)",children:d.jsx(Te,{size:"comfortable","aria-label":"Pan the view",onPointerDown:H,children:d.jsx(we,{size:"2xl",icon:ve.viewport.pan})})}),t?.hasCameraView()?d.jsx(Ue,{text:C?"Leave the camera view":"Look through the camera",children:d.jsx(Te,{size:"comfortable","aria-label":"Toggle the camera view",onClick:()=>t.toggleCameraView(),children:d.jsx(we,{size:"2xl",icon:C?ve.viewport.cameraView:ve.viewport.camera})})}):null,C&&t?.cameraViewLocked()!==null?d.jsx(Ue,{text:t?.cameraViewLocked()?"Unlock the camera from the view":"Lock the camera to the view",children:d.jsx(Te,{size:"comfortable","aria-label":"Lock the camera to the view",onClick:()=>t?.toggleCameraViewLock(),children:d.jsx(we,{size:"2xl",icon:t?.cameraViewLocked()?ve.viewport.cameraLocked:ve.viewport.cameraUnlocked})})}):null,C||w.viewName==="gizmo"?null:d.jsx(Ue,{text:M==="perspective"?"Orthographic":"Perspective",children:d.jsx(Te,{size:"comfortable","aria-label":"Toggle perspective and orthographic",onClick:()=>{const T=M==="perspective"?"orthographic":"perspective";t?t.setProjection(T):n.setProjection(T)},children:d.jsx(we,{size:"2xl",icon:M==="orthographic"?ve.viewport.projectionOrthographic:ve.viewport.projection})})})]}):null,C&&t?d.jsx(fa,{view:C,canvas:t.renderer.domElement,locked:t.cameraViewLocked()===!0}):null]})}function fa({view:n,canvas:e,locked:t}){const[r,i]=f.useState(null),[,a]=f.useState(0);f.useEffect(()=>{const M=new ResizeObserver(()=>a(C=>C+1));return M.observe(e),()=>M.disconnect()},[e]);const c=e.clientWidth,o=e.clientHeight,l=e.ownerDocument.defaultView?.devicePixelRatio??1,p=e.getBoundingClientRect(),x=r?.getBoundingClientRect(),v=1/l,P=n.frame.left*c-v,w=n.frame.top*o-v,L=n.frame.width*c+2*v,F=n.frame.height*o+2*v;return d.jsx("div",{ref:i,"aria-hidden":"true",style:{position:"absolute",inset:0,pointerEvents:"none"},children:x?d.jsxs("svg",{"data-testid":"viewport-camera-frame",width:c,height:o,style:{position:"absolute",left:p.left-x.left,top:p.top-x.top},children:[n.passepartout.opacity>0?d.jsx("path",{d:`M0 0H${c}V${o}H0Z M${P} ${w}V${w+F}H${P+L}V${w}Z`,fill:n.passepartout.color,fillOpacity:n.passepartout.opacity,fillRule:"evenodd"}):null,n.passepartout.opacity>0?d.jsx("rect",{x:P,y:w,width:L,height:F,fill:"none",stroke:n.border.solid,strokeWidth:v,shapeRendering:"crispEdges"}):null,d.jsx("rect",{x:P,y:w,width:L,height:F,fill:"none",stroke:n.border.dashed,strokeWidth:v,strokeDasharray:`${3*v} ${3*v}`,shapeRendering:"crispEdges"}),t?d.jsx("rect",{x:P-v,y:w-v,width:L+2*v,height:F+2*v,fill:"none",stroke:n.border.locked,strokeWidth:v,strokeDasharray:`${3*v} ${3*v}`,shapeRendering:"crispEdges"}):null]}):null})}const ma=f.lazy(async()=>({default:(await Ye(()=>import("./stage-keyboard-B8BEW592.js"),__vite__mapDeps([67,7,5,8,68,6,4,9,10,11,12,13,54,23]))).StageKeyboardBinding})),ga=n=>{const e=n.split(":");return(e[0]==="document"?e[1]:e[0])??n},Gs=()=>Ri(),gr=12;function Us(n){if(!n)return null;const e=new Sr(new z(n.min[0],n.min[1],n.min[2]),new z(n.max[0],n.max[1],n.max[2]));return e.isEmpty()?null:e}const va=500;function wa(n){return Cr(null,n)}const ba=["solid","preview","rendered","clay","unlit","wireframe","matcap","normals","overdraw"];let ya=0;const Ge=new sa(n=>({documentId:n,store:on(new Ks),inUse:!1,source:null,camera:null,presentation:null,transport:null,contentSeconds:0,transportAdvances:0}),n=>ui().some(e=>e.descriptor.id===n),hi);function Sa({canvasHostRef:n}){return d.jsx("div",{ref:n,style:{position:"absolute",inset:0}})}function xa(n,e,t,r,i){if(e==="inspector-preview"){const l=_i();return l.canvas.setAttribute("aria-label",`${t} authoring viewport`),n.appendChild(l.canvas),{canvas:l.canvas,renderer:l.renderer,lease:l}}const a=Co(r.width,r.height,i),{canvas:c,renderer:o}=a;return c.setAttribute("aria-label",`${t} authoring viewport`),n.appendChild(c),{canvas:c,renderer:o,lease:a}}class qs{constructor(e,t,r){this.lane=e,this.surface=t,this.store=r??on(new Ks),this.transport=new Oi(this.store.shell)}scene=new nn;store;cleanups=[];rendererSession=new Zo((e,t)=>this.frame?.(e,t),()=>{});viewport=null;session=null;dressing=null;presentationRig=null;applyPresentation=null;backdropOverridden=!1;documentStudio=null;contentLights=[];contentHas={light:!1,"directional-light":!1};darkened=[];darkenContentLights(){for(const t of this.contentLights)t.visible&&(t.visible=!1,this.darkened.push(t));if(this.darkened.length===0)return 0;const e=this.darkened.length;return this.scene.onAfterRender=()=>{for(const t of this.darkened)t.visible=!0;this.darkened=[],this.scene.onAfterRender=()=>{}},e}defaultEnvironment=null;defaultBackground=null;adapter=null;presentationAdapter=null;content=null;frame=null;syncHostScene=null;presence=null;initialized=!1;contentSeconds=0;transportAdvances=0;users=0;closed=!1;released=!1;get isClosed(){return this.closed}transport;borrow(){this.users++;let e=!1;return()=>{e||(e=!0,this.users--,this.releaseIfClosed())}}close(){this.closed=!0,this.frame=null,this.syncHostScene=null,this.session?.setBeforeRender(null),this.session?.setPresentsFrames(!1),this.rendererSession.setActive(!1),this.content?.dispose(),this.transport.dispose(),this.releaseIfClosed()}releaseIfClosed(){if(!this.closed||this.users!==0||this.released)return;this.released=!0;const{lease:e,renderer:t,canvas:r}=this.surface;for(const i of[...this.cleanups.splice(0),()=>this.session?.dispose(),()=>this.viewport?.dispose(),()=>this.rendererSession.dispose(),()=>this.dressing?.dispose(),...e?[()=>e.release()]:[()=>t.dispose(),()=>t.forceContextLoss(),()=>r.remove()]])try{i()}catch(a){console.error("Object3D document cleanup failed.",a)}}}function hn({documentId:n,sourcePath:e,build:t,displayName:r="Source Object3D",background:i,cameraDirection:a,persistence:c,documentSource:o,authoring:l,interaction:p,selectionOutline:x=!0,active:v=!0,audit:P=!0,chromeless:w=!1,modelSource:L,assetType:F,sourceAuthoring:M,dressing:C,rendererLane:D="own",onOpenNode:K,frameBounds:b,openingFrameBounds:I,openingFit:_,openingView:U,presentation:j,cameraView:H,stageKind:T,statistics:W,subject:be,gridScale:Me,content:oe}){const le=T??ga(n);f.useEffect(()=>{if(!w)return ti(n)},[n,w]);const ae=ji(ri()),te=ae??wr(),se=te?Ys(te.shell,n,w?"embedded":"document"):null,Ee=f.useSyncExternalStore(wa,Xs),ue=se!==null&&si(se,Ee),Q=f.useRef(ue);Q.current=ue;const he=se!==null&&ni(se),Ve=f.useRef(he);Ve.current=he;const ye=se!==null&&ii(se),Xe=f.useRef(ye);Xe.current=ye;const Ke=oi(),Dt=f.useRef(Ke);Dt.current=Ke;const _t=f.useRef(null),Ht=f.useRef(null),q=f.useRef(null),Oe=f.useRef(null);(!Oe.current||Oe.current.documentId!==n)&&(Oe.current&&Ge.release(Oe.current),Oe.current=Ge.claim(n)),f.useEffect(()=>{const O=Oe.current,de=Ge.generation(O);return()=>Ge.release(O,de)},[n]);const $=Oe.current,Le=oe?.kind==="world-root",Bt=v||Le,Mr=f.useRef(oe?.kind==="world-root"?oe.load:null);Mr.current=oe?.kind==="world-root"?oe.load:null;const[Fe,Wt]=f.useState(Bt);f.useEffect(()=>Wt(Bt),[Bt]);const zt=f.useRef(x);f.useEffect(()=>{zt.current=x;const O=q.current?.session;O&&(O.selectionOutlineEnabled=D!=="inspector-preview"&&x),q.current?.applyPresentation?.()},[x,D]);const Er=f.useRef(Promise.resolve()),It=f.useRef(!1);f.useEffect(()=>{if(Fe)return Ze.current=!1,Ut("building"),()=>{const O=q.current;if(O&&!Le){It.current=!lt.current;const de=O.store.cameraPose;$.camera=de&&O.viewport?{...de,up:O.viewport.camera.up.clone()}:null,$.presentation=O.session?.presentation()??null,$.transport=O.transport.snapshot(),$.contentSeconds=O.contentSeconds,$.transportAdvances=O.transportAdvances}dt.current=null,pt.current=null,ht.current=null,ut.current=null,O?.close(),q.current=null}},[n,D,$,Fe,Le]);const Or=f.useRef(K);Or.current=K;const Rr=f.useRef(b);Rr.current=b;const jr=f.useRef(I);jr.current=I;const Nt=f.useRef(U);Nt.current=U;const Tr=f.useRef(j);Tr.current=j;const Ar=f.useRef(H);Ar.current=H;const lt=f.useRef(v);lt.current=v;const Vr=f.useRef(v),Lr=f.useRef({build:t,sourcePath:e});f.useEffect(()=>{const O=Lr.current;Lr.current={build:t,sourcePath:e},!(O.build===t&&O.sourcePath===e)&&!Fe&&$.source&&($.source.dispose(),$.source=null)},[t,$,e,Fe]);const ut=f.useRef(null),Ze=f.useRef(!1),ht=f.useRef(null),dt=f.useRef(null),pt=f.useRef(null),[$t,ne]=f.useState(null),[Gt,Ut]=f.useState("building"),[Fr,dn]=f.useState(null),[pn,fn]=f.useState("mounting"),[mn,gn]=f.useState([]),Dr=f.useRef(null),[_r,vn]=f.useState("perspective"),[wn,Hr]=f.useState(null),ft=f.useRef(null);ft.current=wn;const qt=a?.[0],Yt=a?.[1],Xt=a?.[2],Je=L?.kind,Kt=L?.kind==="project-file"?L.path:void 0,mt=L?.kind==="entity"?L.entityId:void 0,Br=C?.environment,Wr=C?.background,zr=C?.keyLight,Zt=C?.grid,Qe=C?.viewLocked,Jt=C?.toneMapping;v&&ai(n),f.useEffect(()=>{let O=!1;if(!Fe)return;const de=async Se=>{const G=_t.current,et=Ht.current;if(!G||!et||q.current)return;const E=Dt.current;if(!E){ne("The world root needs the editor shell above it; this host has none.");return}const tt=await Se();if(O||q.current)return;dn(()=>tt),fs();const s=new qs("own",tt.mountWorldRootSurface(et,G,r),wr()??void 0);q.current=s,s.cleanups.push(ms(n,s.store.shell)),s.cleanups.push(gs(n,s.transport)),s.cleanups.push(Ei(n,{...Qo(s.store,n),...Ws(n)}));const ie=tt.installWorldRootStage({store:s.store,documentId:n,container:G,canvas:s.surface.canvas,renderer:s.surface.renderer,stats:E,cameraPreview:()=>Dr.current,onMountStatus:fn,onRootIds:gn,runFrame:xe=>Fs(n,xe)});s.viewport=ie.viewport,s.frame=ie.frame,s.content={scene:ie.scene,settle:()=>Promise.resolve(),dispose:async()=>ie.dispose()};const A=_s(()=>s.store.scene??ie.scene,s.transport,{rescanOnLiveMixers:()=>s.store.shell.playState==="stopped"});let re=0;s.cleanups.push(()=>A.dispose()),s.cleanups.push(s.store.shell.subscribe(()=>{if(s.store.shell.playState!=="stopped")return;const xe=performance.now();xe-re<va||(re=xe,A.refresh())})),s.cleanups.push(Ds({camera:ie.viewport.camera,drawCamera:()=>ie.viewport.renderCamera,orbit:ie.viewport.orbitControls,scene:ie.scene},ie.present,ie.setHelper,{documentId:n})),ut.current=s.rendererSession,s.initialized=!0,xs(),Ut("ready"),s.rendererSession.setActive(!0)},yn=async()=>{for(await q.current?.content?.settle();ro();)await so();if(O)return;const Se=Mr.current;if(Se)return de(Se);const G=_t.current,et=Ht.current;if(!G||!et)return;if(!t||e===void 0){ne("This stage shows `build` content and was given no `build()`/`sourcePath`.");return}let E;const tt=Ge.generation($);try{E=$.source??t(),$.source=null}catch(ee){ne(ee instanceof Error?ee.message:String(ee));return}try{q.current||(fs(),q.current=new qs(D,xa(et,D,r,{width:Math.max(1,G.clientWidth),height:Math.max(1,G.clientHeight)},()=>{Wt(!1),window.setTimeout(()=>{lt.current&&Wt(!0)},0)}),$.store),q.current.contentSeconds=$.contentSeconds,q.current.transportAdvances=$.transportAdvances)}catch(ee){throw E.dispose(),ee}const s=q.current,ie=s.borrow(),{renderer:A,canvas:re,lease:xe}=s.surface,V=s.store;w||(s.cleanups.push(ms(n,V.shell)),s.cleanups.push(gs(n,s.transport)));const vt=vs();vt&&V.shell.attachHistory(vt);const er=D==="inspector-preview",De=Q.current,Nr=Ve.current,$r=Xe.current,B=new nn,wt=E.root.parent;B.add(E.root),E.animations&&(E.root.animations=[...E.animations]);const tr={root:E.root,animations:E.root.animations};let _e=null,He=null,Be=null,Pe=null,ce=null,bt=null,yt=null,St=null,xt=null,Pt=null,rr=null,Gr=null,Ur=null,qr=!1,Ct=!1,kt=null;const sr={scene:B,settle:()=>ce?.settle()??Promise.resolve(),dispose:()=>{if(kt)return kt;Ct=!0;const ee=It.current;return It.current=!1,bt&&G.removeEventListener("pointerdown",bt,!0),yt&&G.removeEventListener("pointermove",yt,!0),St&&G.removeEventListener("pointerup",St,!0),xt&&G.removeEventListener("pointercancel",xt,!0),Pt&&window.removeEventListener("keydown",Pt),rr?.(),rr=null,kt=(async()=>{await ce?.settle();const rt=[];for(const Mt of[()=>Pe?.dispose(),()=>He?.dispose?.(),()=>_e?.dispose(),()=>B.removeFromParent(),()=>{ee?Ge.retain($,E,tt):E.dispose()},ie])try{Mt()}catch(fe){rt.push(fe)}rt.length&&console.error("Object3D source cleanup failed.",...rt)})(),kt}};try{const ee=async u=>{try{const g=tr;if(o&&!c){if(!g)throw new Error("Project history is unavailable; the edit was not saved.");const h=vs();if(!h)throw new Error("Project history is unavailable; the edit was not saved.");const m=o.serialize(g);if(m===null)return ne(null),!1;const y=await Gs().replaceSource(h,{file:o.path,source:m,label:u??o.label??`Edit ${r}`});return ne(null),y}if(!c)throw new Error("This Asset Lab document has no persistence binding.");if(!Be||!g)throw new Error("Project history is unavailable; the edit was not saved.");const{persisted:k}=await(await Be).commit(g,u);return ne(null),k}catch(g){throw ne(g instanceof Error?g.message:JSON.stringify(g)),g}};_e=new xo(V,B,{documentId:n,title:r,sourcePath:e,documentKind:$r?"asset":"source",audit:P,...E.hierarchyRoots?{hierarchyRoots:E.hierarchyRoots}:{},...Je==="project-file"&&Kt?{modelSource:{kind:Je,path:Kt}}:Je==="entity"&&mt?{modelSource:{kind:Je,entityId:mt}}:{}});const rt={documentId:n,sourcePath:e,root:E.root,animations:E.root.animations,scene:B,defaultAdapter:_e,commit:ee};He=l?.(rt)??null;const Mt=He?_e:null;!He&&M&&(He=M({store:V,scene:B,...E.hierarchyRoots?{hierarchyRoots:E.hierarchyRoots}:{}}),_e.dispose()),Be=c&&vt?Gs().openPersistence({binding:c,document:tr,history:vt}):null,Be&&Be.catch(u=>{!Ct&&q.current?.content===sr&&ne(u instanceof Error?u.message:JSON.stringify(u))});const fe=He?.adapter??_e;if(!s.dressing){A.outputColorSpace=kr,A.toneMapping=Jt??eo,A.shadowMap.enabled=!0,A.shadowMap.type=to,A.info.autoReset=!1,A.setPixelRatio(Math.min(window.devicePixelRatio,2)),De&&A.setClearColor(0,0);const u=Br===!1?null:xe&&"environment"in xe?xe.environment():Di(A),g=ws(re);s.dressing=Ti(s.scene,{environment:u,background:!De&&i===void 0&&Wr!==!1,keyLight:!1,grid:Zt===!0,content:E.root}),!De&&i!==void 0?s.scene.background=new pe(i):!De&&g.background!==null&&(s.scene.background=new pe(g.background)),s.defaultEnvironment=s.scene.environment,s.defaultBackground=s.scene.background;{const k=new Ai(s.scene,N);s.presentationRig=k,bs(n,le);const h=()=>{const m=ct(n);if(k.apply(m,A,Jt),s.viewport?.setStageFunction(m.world,m.interaction),s.viewport?.setFieldOfView(m.camera.fov),s.viewport?.setSelectionMarks(m.overlays.selection),s.viewport?.setGridMajorEvery(m.overlays.grid.majorEvery),s.viewport?.setAxisLines(m.overlays.axes),s.viewport?.setNavigation(m.overlays.navigation),s.viewport?.setGridVisible(m.overlays.grid.visible),s.session){const y=s.session.presentation().mode==="wireframe"&&m.xray.enabled&&m.xray.alpha<=0;s.session.selectionOutlineEnabled=!er&&zt.current&&m.overlays.selection.outline&&!y,s.session.selectionOriginsEnabled=!er&&m.overlays.selection.origins,s.session.setXray(m.xray)}N()};s.applyPresentation=h,h(),s.cleanups.push(vr(h)),s.cleanups.push(di(()=>{k.forgetFailedImages(),h()})),s.cleanups.push(()=>{k.dispose(),s.presentationRig===k&&(s.presentationRig=null)})}s.cleanups.push(()=>{s.defaultBackground instanceof Os&&s.defaultBackground!==s.dressing?.backgroundTexture&&s.defaultBackground.dispose()})}const Yr=(u,g)=>{const k=s.adapter,h=s.viewport;if(!k||!h)return null;const m=re.getBoundingClientRect(),y=new Tt((u-m.left)/Math.max(m.width,1)*2-1,-((g-m.top)/Math.max(m.height,1))*2+1),R=new Rs;R.layers.enableAll(),R.params.Line2={threshold:4},R.setFromCamera(y,s.session?.camera()??h.camera);const J=s.presentationAdapter,ge=X=>{for(let Z=X;Z;Z=Z.parent){const it=J?.hierarchy.idForObject3D?.(Z)??k.hierarchy.idForObject3D?.(Z);if(it)return it}return null};let je=null;for(const X of R.intersectObjects([...V.objectMap.values()],!0)){if(Fi(X.object))continue;const Z=ge(X.object);if(Z){je={distance:X.distance,id:Z};break}}const jt=h.visibleHelpers().filter(X=>X.userData.vgaiPickable===!0);for(const X of R.intersectObjects(jt,!0)){let Z=null,it=!0;for(let ot=X.object;ot;ot=ot.parent)ot.visible||(it=!1),Z??=ot.userData.vgaiPicksAs??null;if(!it)continue;const ls=Z?ge(Z):null;if(ls){(!je||X.distance<je.distance)&&(je={distance:X.distance,id:ls});break}}return je?.id??null};if(!s.viewport){s.viewport=new fo(re,s.scene,V,G,{renderer:A,authoring:()=>s.adapter??fe,pick:Yr,drawCamera:()=>s.session?.camera()??s.viewport.camera,publishPickContext:!1,onProjectionChange:vn,chromeInsetPx:w||Nr?0:gr,lightRig:!1}),Zt===!0&&s.viewport.grid.removeFromParent();const u=g=>{const k=Yr(g.clientX,g.clientY),h=k&&s.adapter?Ae(s.adapter.hierarchy,k):null;h&&Or.current?.(h)};G.addEventListener("dblclick",u),s.cleanups.push(()=>G.removeEventListener("dblclick",u))}const S=s.viewport;if(Qe){const u=S.camera;s.scene.add(u);const g=new Lt;g.name="vgai:document-studio",g.add(Qe),u.add(g),s.documentStudio=g,s.cleanups.push(()=>{Qe.removeFromParent(),g.removeFromParent(),s.documentStudio===g&&(s.documentStudio=null),u.removeFromParent()})}if(p){const u=new Lt;u.name="__object3d_document_overlay",Js(u,"editorHelper",!0),B.add(u),Pe=p.setup({root:E.root,scene:B,renderer:A,overlay:u,camera:()=>s.session?.camera()??S.camera,writable:c!==void 0||o!==void 0});const g=h=>{const m=re.getBoundingClientRect(),y=new Tt((h.clientX-m.left)/Math.max(m.width,1)*2-1,-((h.clientY-m.top)/Math.max(m.height,1))*2+1),R=new Rs;return R.layers.enableAll(),R.setFromCamera(y,s.session?.camera()??S.camera),{pointerId:h.pointerId,button:h.button,buttons:h.buttons,clientX:h.clientX,clientY:h.clientY,altKey:h.altKey,ctrlKey:h.ctrlKey,metaKey:h.metaKey,shiftKey:h.shiftKey,ray:R.ray.clone(),hits:R.intersectObjects([E.root,u],!0)}};ce=new Ko({begin:h=>{if(!c&&!o)throw new Error("This Asset Lab document has no persistence binding; project gestures are read-only.");return Pe.begin(h)},persist:async h=>{await ee(h)},reportError:h=>ne(h instanceof Error?h.message:JSON.stringify(h))});const k=h=>{h.preventDefault(),h.stopPropagation()};bt=h=>{h.target instanceof Element&&h.target.closest('[role="alert"], [role="toolbar"]')!==null||ce?.begin(g(h))&&(k(h),h.isTrusted&&re.setPointerCapture?.(h.pointerId))},yt=h=>{ce?.hasActiveGesture()&&(k(h),ce.update(g(h)))},St=h=>{ce?.hasActiveGesture()&&(k(h),re.hasPointerCapture?.(h.pointerId)&&re.releasePointerCapture?.(h.pointerId),ce.commit(g(h)))},xt=h=>{ce?.hasActiveGesture()&&(k(h),ce.cancel(h.pointerId))},Pt=h=>{h.key!=="Escape"||!ce?.hasActiveGesture()||(h.preventDefault(),ce.cancel())},Gr=()=>{G.addEventListener("pointerdown",bt,!0),G.addEventListener("pointermove",yt,!0),G.addEventListener("pointerup",St,!0),G.addEventListener("pointercancel",xt,!0),window.addEventListener("keydown",Pt)}}const Re=s.content,Xr=[...V.shell.selectedEntityIds],st=s.adapter,xn=s.presentationAdapter,Pn=new Map(V.objectMap),We=s.session?.root,Cn=s.frame,kn=s.syncHostScene,Mn=dt.current,En=pt.current,On=ht.current,Kr=s.session?.neutralBackgroundTexture(),Rn=s.dressing.lights.map(u=>u.visible),jn=s.cleanups.length,Tn=s.initialized;if(Ur=()=>{B.removeFromParent(),wt&&wt.add(E.root),Re&&s.scene.add(Re.scene),s.adapter=st,s.presentationAdapter=xn,s.content=Re,s.frame=Cn,s.syncHostScene=kn,s.initialized=Tn;for(const u of s.cleanups.splice(jn))u();!We&&s.session&&(s.session.dispose(),s.session=null),V.objectMap.clear();for(const[u,g]of Pn)V.objectMap.set(u,g);Re&&V.bindScene(Re.scene,A,S.batchedRenderer,S.camera),We&&st&&s.session?.replaceContent(We,st),dt.current=Mn,pt.current=En,ht.current=On,ft.current=st,Hr(st),Kr!==void 0&&s.session?.setNeutralBackground(Kr),s.dressing?.lights.forEach((u,g)=>{u.visible=Rn[g]??!0}),We&&(s.dressing?.frameContent(We),s.presentationRig?.placeFloor(We)),V.shell.selectMultiple(Xr),V.notifyIngestObjectMapEdit()},Re?.scene.removeFromParent(),s.scene.add(B),s.adapter=fe,s.presentationAdapter=Mt,s.content=sr,V.bindScene(B,A,S.batchedRenderer,S.camera),V.setOrbitTarget(S.orbitControls.target),V.objectMap.clear(),B.traverse(u=>{const g=Mt?.hierarchy.idForObject3D?.(u)??fe.hierarchy.idForObject3D?.(u);g&&V.objectMap.set(g,u)}),s.session)s.session.replaceContent(E.root,fe);else{const u=Us(Rr.current),g=Us(jr.current)??u,k=ct(n).camera;S.setFieldOfView(k.fov);const h=Nt.current,m=qt!==void 0&&Yt!==void 0&&Xt!==void 0;if(!h&&!m){const y=S.orbitControls.target,R=S.camera.position.distanceTo(y);S.camera.position.copy(y).addScaledVector(new z(...k.opening).normalize(),R)}if(g||S.focusOn(E.root),h){const y=new z(...h.target),R=new z(...h.direction).normalize();S.camera.position.copy(y).addScaledVector(R,h.distance),S.camera.up.set(0,1,0),h.up&&S.camera.up.set(...h.up),S.orbitControls.target.copy(y)}else if(m){const y=g??br(E.root),R=y.getCenter(new z),J=new z(qt,Yt,Xt).normalize(),ge=Vt(y,S.camera,J)*Math.min(10,Math.max(.1,_??1));S.camera.position.copy(R).add(J.multiplyScalar(ge)),S.orbitControls.target.copy(R)}if(s.session=new Uo(n,E.root,s.scene,A,S,fe,De?null:i===void 0?s.dressing.backgroundTexture:new pe(i),u),s.session.selectionOutlineEnabled=!er&&zt.current,s.session.setCameraViewSource(Ar.current??null),s.applyPresentation?.(),Nt.current?.projection==="orthographic"&&s.session.setProjection("orthographic"),!De&&i===void 0&&s.dressing.backgroundTexture){const y=s.session;s.cleanups.push(Vi(()=>{const R=ws(re).background,J=s.defaultBackground;s.defaultBackground=R!==null?new pe(R):Li(),y.neutralBackgroundTexture()===J&&y.setNeutralBackground(s.defaultBackground),J instanceof Os&&J!==s.dressing?.backgroundTexture&&J.dispose()}))}}const nt=$.camera;nt&&(S.setPose(nt.position,nt.target,nt.fov||void 0,nt.up),S.setProjection(_r),$.camera=null);const Y=s.session;dt.current=tr,pt.current=Be,ht.current=Pe,ft.current=fe,Hr(fe);const nr=pi(le)?.all?.lighting!==void 0||fi(le)?null:Qe?{all:{lighting:{source:"studio",studioPreset:ys.id,auto:null}}}:zr===!1?{all:{lighting:{source:"scene"}}}:null,ir=Tr.current??null;bs(n,le,nr&&ir?mi(nr,ir):ir??nr);const or=new Set(ba);let Zr;const Jr=()=>{const u=s.session?.presentation().mode;u!==Zr&&(Zr=u,s.applyPresentation?.()),!(u===void 0||!or.has(u))&&ct(n).drawMode!==u&&gi(n,{drawMode:u})},ar=vi(n).drawMode;ar!==void 0&&or.has(ar)&&s.session?s.session.setMode(ar):Jr();const An=s.session?.subscribe(Jr),Vn=vr(()=>{const u=s.session,g=ct(n).drawMode;u&&u.presentation().mode!==g&&or.has(u.presentation().mode)&&u.setMode(g)});s.cleanups.push(()=>{An?.(),Vn()});const Et=[];E.root.traverse(u=>{u.isLight&&Et.push(u)});const Ln={light:Et.length>0,"directional-light":Et.some(u=>u.isDirectionalLight)};s.contentLights=Et,s.contentHas=Ln,s.dressing.frameContent(E.root),s.presentationRig?.placeFloor(E.root),s.cleanups.push(V.shell.subscribe(()=>s.presentationRig?.placeFloor(E.root)));const Qr=new Set;V.shell.selectMultiple(Xr.filter(u=>{const g=V.objectMap.get(u)??Ae(fe.hierarchy,u);if(g===null&&!V.objectMap.has(u))return!1;const k=g??u;return Qr.has(k)?!1:(Qr.add(k),!0)})),V.notifyIngestObjectMapEdit(),Y.syncSelectionPresentation(),Gr?.(),ne(null),w||Ss(n);let Ot=B.background;Y.setNeutralBackground(Ot??s.defaultBackground);const ze=$.presentation;ze&&(Y.setMode(ze.mode),Y.setBackground(ze.background),Y.setProjection(ze.projection),Y.setSkeleton(ze.skeleton),Y.setBounds(ze.bounds),$.presentation=null);const Fn=()=>{s.viewport?.alignGridToView(Y.camera(),A.domElement.width),s.scene.environment=B.environment??s.defaultEnvironment,s.scene.fog=B.fog,s.scene.environmentIntensity=B.environmentIntensity,s.scene.environmentRotation.copy(B.environmentRotation),s.scene.backgroundIntensity=B.backgroundIntensity,s.scene.backgroundBlurriness=B.backgroundBlurriness,s.scene.backgroundRotation.copy(B.backgroundRotation);const u=s.presentationRig;if(u){const g=u.resolveSource({...s.contentHas,environment:B.environment!==null}),k=u.environment();k&&(s.scene.environment=k.texture??s.defaultEnvironment,s.scene.environmentIntensity=k.intensity,s.scene.environmentRotation.set(0,k.rotation,0));const h=u.backdrop();h!=="keep"?(s.scene.background=h.value,s.scene.backgroundBlurriness=h.blur,s.scene.backgroundIntensity=h.intensity,s.scene.backgroundRotation.set(0,h.rotation,0),s.backdropOverridden=!0):s.backdropOverridden&&(s.scene.background=Y.neutralBackgroundTexture(),s.scene.backgroundBlurriness=B.backgroundBlurriness,s.scene.backgroundIntensity=B.backgroundIntensity,s.backdropOverridden=!1);const m=g==="studio"&&u.presetId()===ys.id;s.documentStudio&&(s.documentStudio.visible=m);const y=g==="studio"&&!m||g==="preview"&&!u.sceneLightsShown()?s.darkenContentLights():0;u.update(Y.camera()),wi(n,{source:g,presetId:u.presetId(),presetLights:u.lightsVisible(),documentStudio:s.documentStudio?s.documentStudio.visible:null,contentLights:s.contentLights.length,contentLightsDarkened:y,environmentIntensity:s.scene.environmentIntensity,environmentImage:u.imageReport().shown,environmentImagePending:u.imageReport().pending,toneMapping:String(A.toneMapping)})}Ot!==B.background&&(Ot=B.background,Y.setNeutralBackground(Ot??s.defaultBackground))};s.syncHostScene=Fn,Y.setBeforeRender(()=>s.syncHostScene?.()),Y.setPresentsFrames(!0);const Dn=u=>{Ct||!(u>0)||!Number.isFinite(u)||(s.contentSeconds+=u,s.transportAdvances++,E.update?.(u))},_n=_s(E.root,s.transport);s.cleanups.push(()=>_n.dispose());const Ce=$.transport;Ce&&(Ce.activeSubject&&s.transport.setActiveSubject(Ce.activeSubject),s.transport.setLoop(Ce.range.loop),s.transport.setTimeScale(Ce.timeScale),s.transport.seek(Ce.time),Ce.playbackState==="playing"?s.transport.play():Ce.playbackState==="paused"&&s.transport.pause(),$.transport=null);let cr=performance.now();const es=typeof E.onChange=="function";let lr=!0;const Rt=()=>{lr=!0};if(es){const u=E.onChange(Rt),g=V.shell.subscribe(Rt),k=["pointerdown","pointermove","pointerup","pointerleave","wheel","keydown","keyup"];for(const h of k)G.addEventListener(h,Rt,{capture:!0,passive:!0});rr=()=>{u(),g();for(const h of k)G.removeEventListener(h,Rt,{capture:!0})}}let ts=-1;const rs=new js,ss=new js,ns=new Tt,is=new Tt;let os,as=null,cs=Number.NaN;const Hn=u=>{if(!es||lr||u>0||Ps()!==ts||Y.needsFrame()||s.presence?.live()||Pe?.prepareFrame||Pe?.update||(S.batchedRenderer.batches?.length??0)>0)return!0;const g=Y.camera();return g.updateMatrixWorld(),A.getDrawingBufferSize(is),!g.matrixWorld.equals(rs)||!g.projectionMatrix.equals(ss)||!is.equals(ns)||s.scene.background!==os||A.toneMapping!==as||A.toneMappingExposure!==cs},Bn=()=>{lr=!1,ts=Ps();const u=Y.camera();rs.copy(u.matrixWorld),ss.copy(u.projectionMatrix),A.getDrawingBufferSize(ns),os=s.scene.background,as=A.toneMapping,cs=A.toneMappingExposure},Wn=(u,g)=>{if(Ct||!A||!S)return;const k=A,h=S,m=Y?.profiler;m?.beginFrame(),g&&(cr=u);const y=Math.min((u-cr)/1e3,.1);cr=u,m?.beginPhase();const R=s.transport.tick(y);if(R>0&&Dn(R),Pe?.prepareFrame?.(y),Pe?.update?.(y),m?.endPhase("animation"),m?.beginPhase(),s.presence?.syncMarkers(y),S.update(y),w||Fs(n,y),S.batchedRenderer.update(y),m?.endPhase("editor"),!g&&!Hn(R)){m?.endFrame();return}m?.beginPhase(),k.info.reset();const J=!Ze.current&&bi()===n;J&&yi(n);const ge=J?Date.now():0,je=s.scene.overrideMaterial,jt=Y.presentation().mode;jt!=="uv"&&jt!=="vertex-colors"&&(s.scene.overrideMaterial=B.overrideMaterial);try{h.renderWithInfrastructure(()=>{Y.renderViewport(y),h.renderViewCube(k)})}finally{s.scene.overrideMaterial=je}Y.servePresentedFrame(),Bn(),Ze.current||(Ze.current=!0,J&&Si("first-render",Date.now()-ge),xi(n),Ut("ready")),m?.reportRender({gpuMs:null,drawCalls:k.info.render.calls,triangles:k.info.render.triangles,geometries:k.info.memory.geometries,textures:k.info.memory.textures}),m?.endPhase("render"),m?.endFrame();const X=Dt.current;if(X&&ae&&Pi(ae.shell)===V.shell){const Z=Y.cameraPose();X.frameTime=y*1e3,X.fps=y>0?1/y:0,X.drawCalls=k.info.render.calls,X.triangles=k.info.render.triangles,X.cameraPosition.x=Z.position[0],X.cameraPosition.y=Z.position[1],X.cameraPosition.z=Z.position[2],X.cameraTarget.x=Z.target[0],X.cameraTarget.y=Z.target[1],X.cameraTarget.z=Z.target[2]}};if(s.frame=Wn,ut.current=s.rendererSession,!s.initialized){w||(s.cleanups.push(Ds({camera:S.camera,drawCamera:()=>s.session?.camera()??S.camera,orbit:S.orbitControls,scene:s.scene},()=>null,(m,y)=>S.setHelper(m,y),{documentId:n})),Ye(()=>import("./stage-presence-markers-DIP7YMcO.js"),__vite__mapDeps([69,4,5,7,8,9,10,6,11,12,13,26,27,18,2,70])).then(m=>{if(s.isClosed||q.current!==s||s.presence)return;const y=m.bindStagePresenceMarkers({scene:s.scene,store:V,documentId:n,container:G,canvas:re,viewport:S,readVisibleCameraPose:()=>{const R=s.session?.camera()??S.renderCamera,J=R.getWorldPosition(new z),ge=R.fov;return{position:J,target:S.orbitControls.target,fov:typeof ge=="number"?ge:0}}});s.presence=y,s.cleanups.push(()=>y.dispose())}),s.cleanups.push(So(Y,Ws(n))),s.cleanups.push(Ci({id:n,label:r,kind:$r?"asset":"source",profiler:Y.profiler}))),!w&&!Nr&&s.cleanups.push(ki(n,()=>({adapter:s.adapter,nodeId:s.adapter?.selection?.get()[0]??null})));const u=w?`${n}#chromeless-${++ya}`:n;s.cleanups.push(Mi({id:u,label:r,contentClock:()=>s.contentSeconds,transportAdvances:()=>s.transportAdvances})),s.cleanups.push(V.shell.onViewportAction(m=>{switch(m.type){case"focus-selection":case"focus-scene":!s.session?.frame()&&s.session?.root&&S.focusOn(s.session.root);break;case"focus-entity":{const y=s.adapter?Ae(s.adapter.hierarchy,m.id):null;y&&S.focusOn(y);break}case"snap-selection-to-floor":S.snapSelectionToFloor();break;case"set-view-preset":s.session?s.session.setViewPreset(m.preset==="perspective"?"isometric":m.preset,"view"):S.setViewPreset(m.preset);break;case"toggle-camera-view":s.session?.toggleCameraView();break;case"frame-all":!s.session?.frame(1,"all")&&s.session?.root?S.focusOn(s.session.root):s.session||S.focusOnScene();break;case"zoom-view":s.session?.cameraView()&&!s.session.cameraViewLocked()?s.session.zoomCameraView(m.direction>0?1.2:1/1.2):S.zoomStep(m.direction);break;case"step-view":if(s.session?.cameraView()&&!s.session.cameraViewLocked())break;S.stepView(m.step);break;case"toggle-projection":{const y=s.session;if(y?.cameraView())break;const J=(y?y.projection():S.projection)==="perspective"?"orthographic":"perspective";y?y.setProjection(J):S.setProjection(J);break}case"set-camera-pose":S.setPose(m.position,m.target,m.fov);break}}));let g="";s.cleanups.push(V.shell.subscribe(()=>{S.objectMap=V.objectMap,S.syncFromStore(),s.session?.syncSelectionPresentation();const m=(s.adapter?.selection?.get()??[]).join("\0");m!==g&&(g=m,w||Ss(n))}));const k=()=>{const m=Math.max(1,G.clientWidth),y=Math.max(1,G.clientHeight),R=A.getPixelRatio();(re.width!==Math.floor(m*R)||re.height!==Math.floor(y*R))&&A.setSize(m,y,!1),S.resize(m,y),s.session?.resize(m,y),s.rendererSession.redraw()},h=new ResizeObserver(k);h.observe(G),s.cleanups.push(()=>h.disconnect()),k(),s.initialized=!0,xs()}S.objectMap=V.objectMap,S.syncFromStore(),s.rendererSession.setActive(lt.current),s.rendererSession.redraw(),qr=!0,Re?.dispose()}catch(ee){if(!qr)try{Ur?.()}finally{wt&&E.root.parent===B&&wt.add(E.root),sr.dispose()}console.error(`[object3d document] ${r}: source update failed`,ee),ne(ee instanceof Error?ee.message:String(ee))}},Sn=Er.current.then(yn);return Er.current=Sn.catch(Se=>{O||ne(Se instanceof Error?Se.message:String(Se))}),()=>{O=!0}},[l,i,t,qt,Yt,Xt,r,n,ue,Wr,Br,Zt,zr,Qe,Jt,w,mt,Je,Kt,p,c,o,D,$,Fe,M,e,Le]),f.useEffect(()=>{const O=ut.current,de=v&&!Vr.current;Vr.current=v,O&&(de&&(Ze.current=!1,ci(n)),O.setActive(v||Le))},[v,n,Le]);const gt=q.current,Qt=Gt==="ready"&>?.viewport?{store:gt.store,viewport:gt.viewport,canvas:gt.surface.canvas}:null,bn=f.useCallback(()=>{const O=ft.current;return O?{adapter:O,nodeId:O.selection?.get()[0]??O.hierarchy.roots()[0]?.id??null}:null},[]),Ir=d.jsx("div",{"data-testid":"tool-object3d-authoring","data-vgai-chromeless":w||void 0,className:ue?"vgai-object3d-studio-stage":void 0,style:{position:w||he?"relative":"absolute",...w?{width:"100%",height:"100%"}:he?{flex:1,minHeight:0}:{inset:-gr},overflow:"hidden",background:ue?void 0:qe.surface.raised,pointerEvents:"auto"},children:d.jsxs("div",{ref:_t,style:{position:"absolute",inset:0,minHeight:0,overflow:"hidden"},children:[d.jsx(Sa,{canvasHostRef:Ht}),v&&Qt&&!w?d.jsx(f.Suspense,{fallback:null,children:d.jsx(ma,{stage:Qt})}):null,ae&&!w?d.jsx(ia,{store:ae,documentId:n,stage:Qt,active:v,chrome:"document"}):null,ae&&Fr?d.jsx(Fr.Overlays,{store:ae,documentId:n,cameraPreviewRef:Dr,mountStatus:pn,rootIds:mn}):null,$t&&d.jsx("div",{role:"alert",style:{position:"absolute",insetInline:0,top:0,display:"flex",justifyContent:"center",padding:"var(--vgai-space-3)",pointerEvents:"none"},children:d.jsxs("div",{className:"vgai-chrome-island",style:{display:"flex",alignItems:"center",gap:"var(--vgai-space-3)",maxWidth:"80%",padding:"var(--vgai-space-2) var(--vgai-space-3)",borderRadius:"var(--vgai-radius-md)",border:`var(--vgai-stroke-resting) solid ${qe.semantic.danger}`,background:qe.surface.raised,color:qe.semantic.danger,pointerEvents:"auto"},children:[d.jsx("span",{children:$t}),d.jsx(Te,{size:"compact","aria-label":"Dismiss",onClick:()=>ne(null),"data-testid":"object3d-document-error-dismiss",children:d.jsx(we,{icon:ve.action.close})})]})}),!$t&&Gt==="building"&&d.jsx(Mo,{testId:"object3d-document-status",children:Eo}),d.jsx("div",{style:{position:"absolute",inset:w||he?0:gr,pointerEvents:"none"},children:!w&&Gt==="ready"&&q.current&&d.jsx(pa,{viewport:q.current.viewport,documentId:n,session:q.current.session,store:q.current.store.shell,projection:_r,displayName:r,...W?{statistics:W}:{},...be!==void 0?{subject:be}:{},...Me?{gridScale:Me}:{},objectName:O=>(de=>de?Ae(de.hierarchy,O)?.name:void 0)(q.current?.adapter)??q.current?.store.objectMap.get(O)?.name??null})})]})});return he?d.jsx(li,{documentId:n,active:v,type:F??(mt?"entity":"model"),title:r,status:e,selection:bn,fill:!0,children:d.jsxs("div",{className:"vgai-object3d-asset-workspace",children:[Ir,d.jsx(ko,{transport:q.current?.transport??null})]})}):Ir}function Pa(n){return d.jsx(hn,{...n})}const Qa=Object.freeze(Object.defineProperty({__proto__:null,Object3DDocumentViewport:hn,ToolObject3DAuthoring:Pa},Symbol.toStringTag,{value:"Module"}));export{hn as O,Qa as S,aa as V,zs as s,ea as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./jsx-runtime-DPjLkJKQ.js";import{J as O,cV as D,cW as C,cE as R,a0 as x,cF as m,aJ as h,$ as p,cX as v,cY as z,cZ as B,c_ as P,Z as w,c$ as M,d0 as N,d1 as A,aI as c,aK as f,d2 as S,aP as g,d3 as b,d4 as G,d5 as V,d6 as F,cR as $,cS as L,cT as K,cK as _,d7 as H,d8 as U,d9 as X}from"./index-BRJMIUK0.js";import{r as l}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{r as k}from"./transform-mode-request-DzD9aUNA.js";function y({active:a,onArm:n,faIcon:t,action:i,label:s}){return e.jsx(m,{text:s,hotkey:v(i),children:e.jsx(h,{"aria-label":s,"aria-pressed":a,shape:"segment",size:"comfortable",onClick:n,children:e.jsx(p,{icon:t,size:"md"})})})}function I({store:a,dimensions:n="3d",size:t="comfortable",variant:i="ghost",showValues:s=!1}){const[o,j]=l.useState(!1),d=l.useRef(null);return l.useEffect(()=>{if(!o)return;const r=u=>{d.current&&!d.current.contains(u.target)&&j(!1)};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[o]),e.jsxs("div",{ref:d,className:"vgai-viewport-popover-anchor",children:[e.jsxs(z,{children:[n==="2d"&&e.jsx(m,{text:"Smart Snap",children:e.jsx(h,{"aria-label":"Toggle smart snap","aria-pressed":a.smartSnap.enabled,variant:i,size:t,onClick:()=>a.setSmartSnap({enabled:!a.smartSnap.enabled}),children:e.jsx(p,{icon:B,size:"md"})})}),e.jsx(m,{text:n==="2d"?"Grid Snap":"Toggle Snap",hotkey:v("viewport.toggleSnap"),children:e.jsx(h,{"aria-label":"Toggle snap","aria-pressed":a.snapEnabled,variant:i,size:t,onClick:()=>a.toggleSnap(),children:e.jsx(p,{icon:P,size:"md"})})}),s?[["translate",x.tool.move,`${a.snapValues.translate}`],["rotate",x.tool.rotate,`${a.snapValues.rotate}°`],["scale",x.tool.scale,`${a.snapValues.scale}`]].map(([r,u,T])=>e.jsx(m,{text:"Snap Settings",children:e.jsxs(w,{"aria-label":`${r} snap step`,"aria-haspopup":"dialog","aria-expanded":o,variant:i,size:t,"data-snap-step":r,onClick:()=>j(!o),children:[e.jsx(p,{icon:u,size:"xs"}),T]})},r)):e.jsx(m,{text:"Snap Settings",children:e.jsx(h,{"aria-label":"Snap settings","aria-haspopup":"dialog","aria-expanded":o,variant:i,size:t,onClick:()=>j(!o),children:e.jsx(p,{icon:M,size:"xs"})})})]}),o&&e.jsx(N,{className:"vgai-snap-popover",children:e.jsxs(A,{gap:2,children:[n==="2d"?e.jsxs(e.Fragment,{children:[e.jsx(c,{variant:"caption",tone:"muted",children:"Grid Step (px)"}),e.jsx(f,{type:"number","aria-label":"Grid step",value:a.snap2D.step,step:1,min:1,onChange:r=>a.setSnap2D({step:Number(r.target.value)||8})}),e.jsx(c,{variant:"caption",tone:"muted",children:"Grid Offset (px)"}),e.jsxs(S,{gap:1,children:[e.jsx(f,{type:"number","aria-label":"Grid offset x",value:a.snap2D.offsetX,step:1,onChange:r=>a.setSnap2D({offsetX:Number(r.target.value)||0})}),e.jsx(f,{type:"number","aria-label":"Grid offset y",value:a.snap2D.offsetY,step:1,onChange:r=>a.setSnap2D({offsetY:Number(r.target.value)||0})})]})]}):e.jsxs(e.Fragment,{children:[e.jsx(c,{variant:"caption",tone:"muted",children:"Translate"}),e.jsx(f,{type:"number",value:a.snapValues.translate,step:.25,min:.01,onChange:r=>a.setSnapValues({translate:Number(r.target.value)||1})})]}),e.jsx(c,{variant:"caption",tone:"muted",children:"Rotate (deg)"}),e.jsx(f,{type:"number",value:a.snapValues.rotate,step:5,min:1,onChange:r=>a.setSnapValues({rotate:Number(r.target.value)||15})}),e.jsx(c,{variant:"caption",tone:"muted",children:"Scale"}),e.jsx(f,{type:"number",value:a.snapValues.scale,step:.05,min:.01,onChange:r=>a.setSnapValues({scale:Number(r.target.value)||.25})}),n==="2d"&&e.jsxs(e.Fragment,{children:[[["Use Rotation Snap",a.rotationSnap,()=>a.setRotationSnap(!a.rotationSnap)],["Use Scale Snap",a.scaleSnap,()=>a.setScaleSnap(!a.scaleSnap)],["Snap Relative",a.snap2D.relative,()=>a.setSnap2D({relative:!a.snap2D.relative})],["Use Pixel Snap",a.snap2D.pixel,()=>a.setSnap2D({pixel:!a.snap2D.pixel})]].map(([r,u,T])=>e.jsxs(S,{gap:2,align:"center",role:"menuitemcheckbox","aria-checked":u,onClick:T,children:[e.jsx(g,{checked:u,readOnly:!0}),e.jsx(c,{children:r})]},r)),e.jsx(c,{variant:"caption",tone:"muted",children:"Smart Snapping"}),[["parent","Snap to Parent"],["others","Snap to Other Nodes"],["guides","Snap to Guides"]].map(([r,u])=>e.jsxs(S,{gap:2,align:"center",role:"menuitemcheckbox","aria-checked":a.smartSnap[r],onClick:()=>a.setSmartSnap({[r]:!a.smartSnap[r]}),children:[e.jsx(g,{checked:a.smartSnap[r],readOnly:!0}),e.jsx(c,{children:u})]},r))]}),n==="3d"&&e.jsxs(e.Fragment,{children:[e.jsxs(S,{gap:2,align:"center",onClick:()=>a.toggleSnapToSurface(),children:[e.jsx(g,{checked:a.snapToSurface,readOnly:!0}),e.jsx(c,{children:"Snap to Surface"})]}),e.jsxs(c,{variant:"caption",tone:"dim",children:["Hold ",e.jsx(b,{children:"Ctrl"})," while dragging to snap once ·"," ",e.jsx(b,{children:v("viewport.toggleSnap")})," toggles"]}),e.jsxs(c,{variant:"caption",tone:"dim",children:["Hold ",e.jsx(b,{children:v("viewport.vertexSnapHold")})," during translate for vertex snap"]})]})]})})]})}const Y={"active-element":"Active Element","median-point":"Median Point","individual-origins":"Individual Origins"};function J({store:a}){const n=["active-element","median-point","individual-origins"],t=`Pivot: ${Y[a.pivotMode]}`;return e.jsx(m,{text:t,hotkey:v("viewport.cyclePivot"),children:e.jsx(h,{"aria-label":t,"aria-pressed":a.pivotMode!=="active-element",variant:"secondary",onClick:()=>{const i=n.indexOf(a.pivotMode);a.setPivotMode(n[(i+1)%n.length])},children:e.jsx(p,{icon:_,size:"md"})})})}const W={auto:"Auto",pivot:"Pivot",center:"Center"};function Z({store:a}){const n=["auto","pivot","center"],t=`Anchor: ${W[a.gizmoAnchor]}`;return e.jsx(m,{text:t,children:e.jsx(h,{"aria-label":t,"aria-pressed":a.gizmoAnchor!=="auto",variant:"secondary",onClick:()=>{const i=n.indexOf(a.gizmoAnchor);a.setGizmoAnchor(n[(i+1)%n.length])},children:e.jsx(p,{icon:a.gizmoAnchor==="center"?H:U,size:"md"})})})}function q({store:a}){const[n,t]=l.useState(!1),i=l.useRef(null);return l.useEffect(()=>{if(!n)return;const s=o=>{i.current?.contains(o.target)||t(!1)};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[n]),e.jsxs("div",{ref:i,className:"vgai-viewport-popover-anchor",children:[e.jsx(m,{text:"Transform options",children:e.jsx(h,{"aria-label":"Transform options","aria-haspopup":"dialog","aria-expanded":n,variant:"secondary",onClick:()=>t(s=>!s),children:e.jsx(p,{icon:X,size:"md"})})}),n?e.jsx(N,{style:{minWidth:240},children:e.jsxs(A,{gap:3,children:[e.jsxs(w,{size:"compact",variant:"ghost",onClick:()=>{a.snapSelectionToFloor(),t(!1)},children:["Snap Selection to Floor ",e.jsx(b,{children:v("viewport.snapToFloor")})]}),e.jsxs(S,{gap:2,align:"center",onClick:()=>a.togglePreserveChildrenTransform(),style:{cursor:"pointer"},children:[e.jsx(g,{checked:a.preserveChildrenTransform,readOnly:!0}),e.jsx(c,{children:"Preserve Children Transform"})]}),e.jsx(c,{variant:"caption",tone:"dim",children:"Keep source-writable children fixed in world space while their parent moves."})]})}):null]})}function Q({store:a}){const[n,t]=l.useState(!1),i=l.useRef(null),s=a.transformSpace==="world"?"Global":"Local";return e.jsxs("div",{className:"vgai-viewport-popover-anchor",children:[e.jsx(m,{text:`Transform orientation: ${s}`,children:e.jsxs(w,{ref:i,type:"button",size:"compact",variant:"secondary","aria-label":`Transform orientation: ${s}`,"aria-haspopup":"menu","aria-expanded":n,onClick:()=>t(o=>!o),className:"vgai-transform-orientation-trigger",children:[e.jsx(p,{icon:a.transformSpace==="world"?V:F,size:"sm"}),e.jsx("span",{children:s}),e.jsx(p,{icon:M,size:"xs"})]})}),n&&e.jsx($,{anchorRef:i,align:"start",clamp:!0,"aria-label":"Transform orientation",onDismiss:()=>t(!1),children:["world","local"].map(o=>e.jsxs(L,{role:"menuitemradio","aria-checked":a.transformSpace===o,onSelect:()=>{a.setTransformSpace(o),t(!1)},children:[e.jsx("span",{className:"vgai-menu-check",children:a.transformSpace===o&&e.jsx(p,{icon:K,size:"xs"})}),o==="world"?"Global":"Local"]},o))})]})}function oe({store:a}={}){const n=O(),t=a??n;l.useSyncExternalStore(t.subscribe,t.getShellSnapshot??t.getSnapshot),l.useSyncExternalStore(D,C,C);const[i,s]=l.useState(null),o=i?.closest(".vgai-stage-bar")!=null;return e.jsxs(G,{compact:!0,label:"Transform controls","data-testid":"transform-header-controls",className:"vgai-transform-header-controls",children:[e.jsx("span",{ref:s,hidden:!0}),e.jsx(Q,{store:t}),e.jsxs(z,{children:[e.jsx(J,{store:t}),e.jsx(Z,{store:t})]}),e.jsx(I,{store:t,size:"default",variant:"secondary",showValues:o}),e.jsx(q,{store:t})]})}const ee=()=>()=>{},E=()=>null;function ie({dimensions:a="3d",door:n,store:t}={}){const i=O(),s=t??i;l.useSyncExternalStore(s.subscribe,s.getShellSnapshot??s.getSnapshot),l.useSyncExternalStore(D,C,C);const o=l.useSyncExternalStore(n?.subscribe??ee,n?.armed??E,n?.armed??E),j=[{mode:"translate",faIcon:x.tool.move,action:"transform.translate",label:"Move"},{mode:"rotate",faIcon:x.tool.rotate,action:"transform.rotate",label:"Rotate"},{mode:"scale",faIcon:x.tool.scale,action:"transform.scale",label:"Scale"}];return e.jsxs(R,{label:"Transform tools","data-testid":a==="2d"?"canvas-2d-toolstrip":"threejs-toolstrip",className:"vgai-viewport-toolbar vgai-viewport-toolbar-left",children:[n?null:e.jsx(y,{faIcon:x.tool.select,action:"transform.select",label:"Select",active:s.transformMode==="select"||a==="2d"&&s.transformMode==="combined",onArm:()=>k(s,"select")}),j.map(d=>e.jsx(y,{faIcon:d.faIcon,action:d.action,label:d.label,active:n?o===d.mode:s.transformMode===d.mode,onArm:()=>n?n.begin(d.mode):k(s,d.mode)},d.mode)),n||a==="2d"?null:e.jsx(y,{faIcon:x.tool.transform,action:"transform.combined",label:"Transform (all handles)",active:s.transformMode==="combined",onArm:()=>k(s,"combined")}),a==="2d"?e.jsx(I,{store:s,dimensions:"2d"}):null]})}export{ie as T,oe as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./jsx-runtime-DPjLkJKQ.js";import{g9 as k,cS as j,$ as c,cT as w,cU as b,Z as y,c$ as g,cY as C,cF as f,aJ as v,ga as M,gb as z,cR as N,ad as V}from"./index-BRJMIUK0.js";import{r as x}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";function B(){return e.jsxs("svg",{viewBox:"0 0 16 16",className:"vgai-viewport-overlays-glyph","aria-hidden":"true",focusable:"false",children:[e.jsx("path",{d:"M5.24 4.51 A5.3 5.3 0 1 1 11.89 11.16 A5.85 5.85 0 0 0 5.24 4.51 Z",fill:"currentColor"}),e.jsx("circle",{cx:"6.1",cy:"10.3",r:"4.4",fill:"none",stroke:"currentColor",strokeWidth:"1.1"})]})}function D({label:a="Overlays",choices:p,master:n,glyph:t,word:h}){const[r,l]=x.useState(!1),s=x.useRef(null),m=p.some(o=>o.enabled),d=n?.enabled??m,u=t??e.jsx(c,{icon:d?M:z,size:"md"});x.useEffect(()=>{if(!r)return;const o=S=>{s.current&&!s.current.contains(S.target)&&l(!1)};return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[r]);const i=r?e.jsxs(k,{className:"vgai-helpers-menu",onDismiss:()=>l(!1),children:[n?e.jsxs(e.Fragment,{children:[e.jsxs(j,{role:"menuitemcheckbox","aria-checked":n.enabled,onSelect:n.onToggle,children:[e.jsx("span",{className:"vgai-menu-check",children:n.enabled&&e.jsx(c,{icon:w,size:"xs"})}),"Show ",a]}),e.jsx(b,{})]}):null,p.map(o=>e.jsxs(j,{role:"menuitemcheckbox","aria-checked":o.enabled,disabled:o.disabled,onSelect:o.onToggle,children:[e.jsx("span",{className:"vgai-menu-check",children:o.enabled&&e.jsx(c,{icon:w,size:"xs"})}),o.label]},o.id))]}):null;return h!==void 0?e.jsxs("div",{ref:s,className:"vgai-viewport-popover-anchor",children:[e.jsxs(y,{variant:"ghost",size:"comfortable","aria-label":`Choose ${a.toLowerCase()}`,"aria-expanded":r,onClick:()=>l(!r),children:[h,e.jsx(c,{icon:g,size:"xs"})]}),i]}):e.jsxs("div",{ref:s,className:"vgai-viewport-popover-anchor",children:[n?e.jsxs(C,{children:[e.jsx(f,{text:`${a}: ${d?"On":"Off"}`,children:e.jsx(v,{"aria-label":`Toggle ${a.toLowerCase()}`,"aria-pressed":d,size:"comfortable",onClick:n.onToggle,children:u})}),e.jsx(v,{"aria-label":`Choose ${a.toLowerCase()}`,"aria-expanded":r,size:"comfortable",onClick:()=>l(!r),children:e.jsx(c,{icon:g,size:"xs"})})]}):e.jsx(f,{text:`${a}: ${d?"On":"Off"}`,children:e.jsx(v,{"aria-label":`Choose ${a.toLowerCase()}`,"aria-expanded":r,"aria-pressed":d,size:"comfortable",onClick:()=>l(!r),children:u})}),i]})}const $=[{mode:"solid",label:"Material",description:"Authored materials and lighting"},{mode:"clay",label:"Solid",description:"Neutral flat-shaded geometry"},{mode:"unlit",label:"Unlit",description:"Base color without scene lighting"},{mode:"wireframe",label:"Wireframe",description:"Renderable triangle edges"},{mode:"matcap",label:"Matcap",description:"Neutral clay sphere — form without color"},{mode:"normals",label:"Normals",description:"Surface-normal direction colors"},{mode:"overdraw",label:"Overdraw",description:"Additive overlap visualization"}],O={preview:"Material Preview",rendered:"Rendered",uv:"UV","vertex-colors":"Vertex Colors"},I=[{mode:"wireframe",glyph:"wireframe",label:"Wireframe"},{mode:"clay",glyph:"sphere",label:"Solid"},{mode:"solid",glyph:"preview",label:"Material"}];function F(a){return[{mode:"wireframe",glyph:"wireframe",label:"Wireframe"},{mode:"solid",glyph:"sphere",label:"Solid"},...a.has("preview")?[{mode:"preview",glyph:"preview",label:"Material Preview"}]:[],...a.has("rendered")?[{mode:"rendered",glyph:"rendered",label:"Rendered"}]:[]]}function E({glyph:a}){return e.jsxs("svg",{viewBox:"0 0 16 16",className:"vgai-viewport-shading-glyph","aria-hidden":"true",focusable:"false",children:[a==="sphere"||a==="rendered"?e.jsx("circle",{cx:"8",cy:"8",r:"7.3",fill:"currentColor"}):e.jsx("circle",{cx:"8",cy:"8",r:"7.3",fill:"none",stroke:"currentColor",strokeWidth:"1.05"}),a==="wireframe"?e.jsxs("g",{stroke:"currentColor",strokeWidth:"1.05",children:[e.jsx("line",{x1:"1.7",y1:"5.4",x2:"14.3",y2:"5.4"}),e.jsx("line",{x1:"1.7",y1:"10.6",x2:"14.3",y2:"10.6"}),e.jsx("line",{x1:"5.4",y1:"1.7",x2:"5.4",y2:"14.3"})]}):null,a==="rendered"?e.jsx("circle",{cx:"5.6",cy:"5.6",r:"2.3",fill:"var(--vgai-surface-overlay, #ffffff)",fillOpacity:"0.7"}):null,a==="preview"?e.jsx("path",{d:"M7.73 1.23 L7.73 10.43 L1.22 8.04 A6.78 6.78 0 0 1 7.73 1.23 Z",fill:"currentColor"}):null]})}function W({mode:a,onChange:p,choices:n,disabled:t=!1,segments:h,children:r}){const[l,s]=x.useState(!1),m=x.useRef(null),d=n.find(i=>i.mode===a)??n[0];if(!d)return null;const u=l&&!t?e.jsxs(N,{id:"vgai-viewport-shading-menu",anchorRef:m,"aria-label":"Viewport shading modes",onDismiss:()=>s(!1),style:{minWidth:230},children:[n.map(i=>e.jsxs(j,{role:"menuitemradio","aria-checked":i.mode===a,onSelect:()=>{p(i.mode),s(!1)},style:{display:"grid",gridTemplateColumns:"14px 1fr",gap:7},children:[e.jsx("span",{style:{opacity:i.mode===a?1:0},children:e.jsx(c,{icon:w,size:"xs"})}),e.jsxs("span",{children:[e.jsx("span",{style:{display:"block"},children:i.label}),e.jsx("span",{style:{display:"block",color:V.content.dim,fontSize:10},children:i.description})]})]},i.mode)),r?e.jsxs(e.Fragment,{children:[e.jsx(b,{}),e.jsx("div",{className:"vgai-viewport-shading-options",children:r})]}):null]}):null;return h?e.jsxs("div",{className:"vgai-viewport-popover-anchor",children:[e.jsxs("span",{className:"vgai-viewport-shading-segments",role:"group","aria-label":"Viewport shading",children:[h.map(i=>e.jsx(f,{text:`Viewport shading: ${i.label}`,children:e.jsx(v,{size:"compact",shape:"segment",variant:"secondary","aria-pressed":i.mode===a,"aria-label":`Viewport shading: ${i.label}`,disabled:t,onClick:()=>p(i.mode),children:e.jsx(E,{glyph:i.glyph})})},i.mode)),e.jsx(f,{text:"Shading options",children:e.jsx(v,{ref:m,size:"compact",shape:"segment",variant:"secondary","aria-label":"Shading options","aria-haspopup":"menu","aria-expanded":l,"aria-controls":l?"vgai-viewport-shading-menu":void 0,disabled:t,onClick:()=>s(i=>!i),children:e.jsx(c,{icon:g,size:"xs"})})})]}),u]}):e.jsxs("div",{style:{position:"relative"},children:[e.jsx(f,{text:`Viewport shading: ${d.label}`,children:e.jsxs(y,{ref:m,type:"button",size:"compact",variant:"secondary","aria-label":`Viewport shading: ${d.label}`,"aria-haspopup":"menu","aria-expanded":l,"aria-controls":l?"vgai-viewport-shading-menu":void 0,disabled:t,onClick:()=>s(i=>!i),style:{display:"inline-flex",alignItems:"center",gap:5,minWidth:66},children:[e.jsx("span",{children:d.label}),e.jsx(c,{icon:g,size:"xs"})]})}),u]})}function G({mode:a,onChange:p,disabled:n=!1,words:t}){const h=x.useMemo(()=>{const r=$.map(s=>({...s,label:t?.[s.mode]??s.label}));if(r.some(s=>s.mode===a))return r;const l=t?.[a]??O[a]??a;return[...r,{mode:a,label:l,description:"The mode this view is drawn in"}]},[t,a]);return e.jsx(W,{mode:a,onChange:p,choices:h,disabled:n})}export{W as V,I as a,D as b,B as c,G as d,F as p,$ as v};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DUZeuA7g.js","assets/extends-CF3RwP-h.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/client-DNXj_opT.js","assets/index-CinJrH5C.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/events-156d8d12.esm-CYeuVCYr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-bQE2NA0D.js","assets/Gltf-GjdUJfpn.js","assets/BufferGeometryUtils-FJZNEiJN.js","assets/OrthographicCamera-QGDXU8-_.js","assets/Fbo-BwAOPGSM.js","assets/PerspectiveCamera-CzyDwUe8.js","assets/OrbitControls-DqeA2OK1.js","assets/index-BRJMIUK0.js","assets/index-CtzuWnCS.js","assets/index-FUuS4qwW.js","assets/index-0Lm0Nf1M.css","assets/RoundedBox-DrJK5JOI.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as C,e9 as O,by as F,p as B,L as U,gW as L,h7 as G,h8 as V,h9 as z}from"./index-BRJMIUK0.js";import{i as W,b as H}from"./native-debug-module-2_HVupdg.js";import{T as b,c as J}from"./seeded-random-BgCwIAAU.js";import{g as j,D as m}from"./debug-registry-P0_YQGWd.js";import{o as Y}from"./game-audio-CaGKzia4.js";import{o as Q}from"./game-network-Ct2FQYmu.js";import{createRapierBodyEditing as q}from"./rapier-physics-adapter-CaZqWLu0.js";import{_ as K}from"./events-156d8d12.esm-CYeuVCYr.js";import{fo as S,dp as x}from"./three.core-3arARmh6.js";import{p as M,a as $}from"./live-project-verbs-C3LzprCe.js";async function kt(t){if(t.length===0)return;const{useGLTF:n,useTexture:o}=await C(async()=>{const{useGLTF:r,useTexture:e}=await import("./index-DUZeuA7g.js");return{useGLTF:r,useTexture:e}},__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]));for(const r of t)n.clear(r),o.clear(r)}const X=60;function Z(t){if(t.length===0)return{ms:null,fps:null,worstMs:null,samples:[]};let n=0,o=0;for(const e of t)n+=e,e>o&&(o=e);const r=n/t.length;return{ms:g(r,2),fps:r>0?g(1e3/r,1):null,worstMs:g(o,2),samples:t.map(e=>g(e,2))}}function g(t,n){const o=10**n;return Math.round(t*o)/o}const tt="No physics adapter on this game implements setDebugDrawEnabled, so nothing can draw its colliders. A first-party three root with Rapier physics registers one; a game with no physics has no colliders to draw.",R=O([]);function et(t){const n=[];let o=v();const r=t.onRenderStep(()=>{const a=v();n.push(a-o),o=a,n.length>X&&n.shift()});let e=!1;const s=()=>{const a=B(t.systemAdapters.physics);return a?.setDebugDrawEnabled?a:null};return{instruments:[{id:"timescale",label:"Time scale",hint:"Sim speed multiplier. 1 is real time, 0 freezes the simulation while the game keeps drawing.",unit:"x",control:{kind:"scale",action:"set",min:b.min,max:b.max,step:.05},actions:[{id:"set",label:"Set",hint:`Set the sim speed multiplier (${b.min}–${b.max}).`,args:O([F()]),run:a=>(t.loop.timeScale=J(a[0]),t.loop.timeScale)}],read:()=>t.loop.timeScale},{id:"paused",label:"Paused",hint:"Freeze the simulation. The game keeps drawing, so you can look at a frozen frame.",control:{kind:"toggle",action:"toggle"},actions:[{id:"toggle",label:"Toggle",hint:"Pause or resume the simulation.",args:R,run:()=>(t.play.paused?t.play.resume():t.play.pause(),t.play.paused)},{id:"step",label:"Step",hint:"Advance exactly one fixed substep. Pauses first if the game is running.",args:R,run:()=>(t.play.paused||t.play.pause(),t.play.step(),t.play.paused)}],read:()=>t.play.paused},{id:"colliders",label:"Colliders drawn",hint:"Draw the physics colliders over the world, through the game's own physics adapter.",control:{kind:"toggle",action:"toggle"},actions:[{id:"toggle",label:"Toggle",hint:"Turn collider wireframes on or off.",args:R,run:()=>{const a=s();if(!a)throw new Error(tt);return e=!e,a.setDebugDrawEnabled?.(e),e}}],read:()=>s()===null?null:e},{id:"frame-time",label:"Frame time",hint:"Wall-clock milliseconds per display frame, newest last. The window is where a hitch shows; the mean hides it.",unit:"ms",control:{kind:"plot"},actions:[{id:"clear",label:"Clear",hint:"Forget the sampled window and start measuring again.",args:R,run:()=>(n.length=0,null)}],read:()=>Z(n)}],dispose(){r(),n.length=0}}}function v(){return typeof performance>"u"?Date.now():performance.now()}const nt="instruments",ot="__instruments__";function rt(t){const n={name:`instrument.${t.id}`,id:t.id,label:t.label,hint:t.hint,...t.unit===void 0?{}:{unit:t.unit},control:t.control,actions:t.actions.map(o=>({name:`instrument.${t.id}.${o.id}`,id:o.id,label:o.label,hint:o.hint}))};try{return{...n,value:t.read()}}catch(o){return{...n,value:null,error:o instanceof Error?o.message:String(o)}}}function st(t){const n=j(t);if(!n)throw new Error("Cannot publish dev instruments: mounted Game has no debug registry.");const o=et(t),r=n.forRoot(ot);for(const e of o.instruments){r.registerStateProvider(`instrument.${e.id}`,()=>e.read(),{tier:"assisted"});for(const s of e.actions)r.registerCommand(`instrument.${e.id}.${s.id}`,{description:`${e.label}: ${s.label} — ${s.hint}`,locus:"client",args:s.args},(...i)=>s.run(i))}return r.registerStateProvider(nt,()=>o.instruments.map(rt),{tier:"assisted"}),()=>o.dispose()}function it(t){if(!t||typeof t!="object")return!1;const n=t;return n.rigidBodyStates instanceof Map&&n.colliderStates instanceof Map&&n.world!==void 0&&n.rapier!==void 0}let T=null,at=null;function ct(){return T||(at??=(async()=>{if(!await U()){T=K;return}const t=await import(L);if(!(t.r3fRoots instanceof Map))throw new Error("The packaged runtime's synthetic R3F module did not export `r3fRoots` — see R3F_DOORWAY in vite-plugin-module-doorways.ts.");T=t.r3fRoots})(),null)}function y(t){const n=ct();if(!n)return null;for(const o of n.values()){if(o.store.getState().scene!==t)continue;const r=o.fiber.current,e=r?[r]:[];for(;e.length>0;){const s=e.pop(),i=s.memoizedProps?.value;if(it(i))return i;s.sibling&&e.push(s.sibling),s.child&&e.push(s.child)}}return null}function Pt(t,n=6e4){const o=performance.now();return new Promise(r=>{const e=()=>{if(y(t))return r(!0);if(performance.now()-o>n)return r(!1);setTimeout(e,250)};e()})}function _(t,n){let o;for(const r of t)if(r.object.traverse(e=>{!o&&e.userData.entityId===n&&(o=e)}),o)return o}function I(t,n){const o=new Map;for(const r of n)o.set(r.object,r.rigidBody);for(let r=t;r;r=r.parent){const e=o.get(r);if(e)return e}}const h=t=>[t.x,t.y,t.z],w=t=>[t.x,t.y,t.z,t.w];function D(t,n){const{ShapeType:o}=t.rapier;switch(n.shapeType()){case o.Cuboid:return{type:"cuboid",halfExtents:h(n.halfExtents())};case o.Ball:return{type:"ball",radius:n.radius()};case o.Capsule:return{type:"capsule",halfHeight:n.halfHeight(),radius:n.radius()};default:return{type:"unsupported",kind:o[n.shapeType()]??`shapeType ${n.shapeType()}`}}}function lt(t,n){const{JointType:o}=t.rapier;switch(n){case o.Revolute:return"revolute";case o.Fixed:return"fixed";case o.Prismatic:return"prismatic";case o.Rope:return"rope";case o.Spring:return"spring";case o.Spherical:return"spherical";default:return"generic"}}function N(t,n){return h(new S(n.x,n.y,n.z).applyQuaternion(new x(...w(t.rotation()))).add(new S(...h(t.translation()))))}function ut(t,n){const o=n.body1(),r=n.body2(),e=n.anchor1(),s=n.anchor2(),i=lt(t,n.type()),a=i==="revolute"||i==="prismatic",d=a?n.frameX1():null,f=d?new S(1,0,0).applyQuaternion(new x(d.x,d.y,d.z,d.w)):null,p=n;return{id:String(n.handle),type:i,body1:String(o.handle),body2:String(r.handle),anchor1:h(e),anchor2:h(s),worldAnchor1:N(o,e),worldAnchor2:N(r,s),body1Position:h(o.translation()),body2Position:h(r.translation()),body1Rotation:w(o.rotation()),body2Rotation:w(r.rotation()),...f?{axis:h(f),worldAxis:h(f.clone().applyQuaternion(new x(...w(o.rotation()))))}:{},...a&&p.limitsEnabled()?{limits:{min:p.limitsMin(),max:p.limitsMax()}}:{},contactsEnabled:n.contactsEnabled()}}function dt(t){const n=r=>{const e=y(t);if(!e)return{kind:"unresolved"};const s=[...e.rigidBodyStates.values()],i=_(s,r);if(!i)return{kind:"unresolved"};const a=I(i,s);return a?{kind:"body",body:a}:{kind:"no-body"}},o=r=>{const e=y(t);if(!e)return null;const s=[...e.rigidBodyStates.values()],i=_(s,r),a=i?I(i,s):void 0;return a?{context:e,body:a}:null};return{...q(n),colliders(r){const e=o(r);if(!e)return[];const s=[];for(const i of e.context.colliderStates.values()){if(i.collider.parent()?.handle!==e.body.handle)continue;i.object.updateWorldMatrix(!0,!1);const a=i.object.getWorldScale(new S);s.push({id:String(i.collider.handle),shape:D(e.context,i.collider),position:h(i.collider.translation()),rotation:w(i.collider.rotation()),scale:[Math.abs(a.x),Math.abs(a.y),Math.abs(a.z)],sensor:i.collider.isSensor()})}return s.sort((i,a)=>Number(i.id)-Number(a.id))},previewCollider(r,e){const s=y(t),i=s?[...s.colliderStates.values()].find(a=>String(a.collider.handle)===r)?.collider:void 0;if(!(!s||!i||D(s,i).type!==e.type))switch(e.type){case"cuboid":i.setHalfExtents({x:e.halfExtents[0],y:e.halfExtents[1],z:e.halfExtents[2]});break;case"ball":i.setRadius(e.radius);break;case"capsule":i.setHalfHeight(e.halfHeight),i.setRadius(e.radius);break}},joints(r){const e=o(r);if(!e)return[];const s=[],i=e.context.world.impulseJoints;return i.forEachJointHandleAttachedToRigidBody(e.body.handle,a=>{const d=i.get(a);d&&s.push(ut(e.context,d))}),s.sort((a,d)=>Number(a.id)-Number(d.id))},previewJointAnchor(r,e,s){const i=y(t)?.world.impulseJoints.get(Number(r));if(!i)return;const a={x:s[0],y:s[1],z:s[2]};e===0?i.setAnchor1(a):i.setAnchor2(a)}}}const pt="__adapter__",k=new WeakSet;function P(t,n){const o=[];for(const r of t.roots){const e=r.binding?.observation[n];e&&o.push(e)}return o}function ft(t,n){return n.some(o=>o.slots.audio||o.absent.some(r=>r.slot==="audio"))?n:t.roots.map(o=>{const r=n.find(e=>e.rootId===o.id);return{rootId:o.id,slots:{...r?.slots,audio:Y},absent:r?.absent??[]}})}const ht=["@colyseus/sdk","colyseus.js"];function mt(t,n){const o=n.some(p=>p.slots.networking||p.absent.some(c=>c.slot==="networking"));M();const r=$(),e=r===null||r.some(p=>ht.includes(p)),s=t.roots[0];if(o||!e||!s)return n;const i=n.findIndex(p=>p.rootId===s.id),a=i>=0?n[i]:void 0,d={rootId:s.id,slots:{...a?.slots,networking:Q},absent:a?.absent??[]},f=[...n];return i>=0?f[i]=d:f.push(d),f}const yt=["@react-three/rapier","@dimforge/rapier3d-compat"];function wt(t,n){M();const o=$(),r=o===null||o.some(s=>yt.includes(s)),e=[...n];for(const s of t.roots){if(s.mounted.kind!=="three"||s.mounted.systems?.physics)continue;const i=e.findIndex(c=>c.rootId===s.id),a=i>=0?e[i]:void 0;if(a&&(a.slots.physics||a.absent.some(c=>c.slot==="physics")))continue;const d=s.mounted.scene;if(!r&&!y(d))continue;const f=dt(d),p={rootId:s.id,slots:{...a?.slots,physics:f},absent:a?.absent??[]};i>=0?e[i]=p:e.push(p)}return e}function bt(t,n,o){const r=n.forRoot(pt);for(const e of o){if(e.kind==="state"){r.registerStateProvider(e.id,()=>{if(!e.answer)throw new m("OBSERVATION_UNANSWERED",`Observation "${e.id}" (state) is declared by this game's adapter with no answer.`);return e.answer(t)},{tier:"assisted"});continue}r.registerCommand(e.id,{...e.description?{description:e.description}:{},locus:e.locus??"client"},(...s)=>{if(!e.answer)throw new m("OBSERVATION_UNANSWERED",`Observation "${e.id}" (command) is declared by this game's adapter with no answer.`);return e.answer(t,...s)})}}function A(t,n){const o=t.actions(n);if(!Array.isArray(o))throw new Error("vgai.adapter.ts input.actions must return an array.");const r=new Map;for(const e of o){if(typeof e?.name!="string"||e.name.length===0||!V.includes(e.valueType))throw new Error("vgai.adapter.ts input.actions returned an invalid action; each action needs a non-empty `name` and a supported `valueType`.");if(r.has(e.name))throw new Error(`vgai.adapter.ts input.actions returned duplicate action "${e.name}".`);r.set(e.name,e.valueType)}return r}function gt(t,n){return t==="digital"?typeof n=="boolean":t==="scalar"?typeof n=="number"&&Number.isFinite(n):typeof n=="object"&&n!==null&&typeof n.x=="number"&&Number.isFinite(n.x)&&typeof n.y=="number"&&Number.isFinite(n.y)}function Rt(t,n,o){if(!t.world(o.root))throw new Error(`vgai.adapter.ts input.root names "${o.root}", which is not a mounted manifest root.`);const r=[],e=[];let s=!1;const i=(c,u)=>{const l=A(o,t).get(c);if(!l)throw new m("INPUT_ACTION_NOT_FOUND",`Adapter input has no action named "${c}".`,{registered:[...A(o,t).keys()]});if(!gt(l,u))throw new m("INPUT_ACTION_VALUE_TYPE",`Adapter input action "${c}" expects ${l}, not ${typeof u}.`,{action:c,expected:l});return l},a=(c,u,l)=>{i(c,u),o.set(t,c,u),s&&e.push({tick:l,action:c,value:u})},d=()=>{const c=n.getGameTick(),u=r.filter(l=>l.tick===c);if(u.length!==0){for(let l=r.length-1;l>=0;l--)r[l].tick===c&&r.splice(l,1);for(const l of u)a(l.action,l.value,c)}};t.systems.add("input",d,{name:"adapter.input"});const f=c=>{throw new m("ADAPTER_INPUT_SOURCE_UNSUPPORTED",`${c} addresses an engine test source, but this game declares an app-owned action store. Drive it by action name instead.`)},p={setVirtualAction(c,u){return a(c,u,n.getGameTick()),{delivered:!0}},tapVirtualAction(c){const u=n.getGameTick();return a(c,!0,u),r.push({tick:u+1,action:c,value:!1}),{delivered:!0}},clearVirtualActions(){r.length=0,o.clear(t)},scheduleActionAtTick(c,u,l){const E=n.getGameTick();if(!Number.isInteger(c)||c<E)throw new m("TICK_ALREADY_PASSED",`Cannot schedule adapter input for tick ${c}; current tick is ${E}.`,{tick:c,currentTick:E});i(u,l),r.push({tick:c,action:u,value:l})},startInputRecording(){e.length=0,s=!0},stopInputRecording(){s=!1},isInputRecording(){return s},injectAxis(){f("injectAxis")},injectVector2(){f("injectVector2")},injectPointerDelta(){f("injectPointerDelta")},injectPointerPosition(){f("injectPointerPosition")}};n.setInputActionsSource(o.root,()=>[...A(o,t)].map(([c,u])=>({name:c,valueType:u}))),n.setInputTraceSource(o.root,()=>({version:1,seed:null,fixedDt:t.loop.fixedDt,ticks:[...e]})),n.setVirtualInputTarget(o.root,p)}function Ot(t){if(k.has(t))return;W(t,P(t,"entryDebug")),H(t,mt(t,wt(t,ft(t,P(t,"entrySystems"))))),st(t);const n=j(t);if(!n)throw new Error("Cannot install adapter runtime bindings: mounted Game has no debug registry.");t.roots.some(e=>e.mounted.systems?.debug!==void 0&&e.mounted.systems.debug!==n.adapter)||bt(t,n,z());const r=G();r&&Rt(t,n,r),k.add(t)}export{wt as a,kt as e,Ot as i,Pt as w};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{x as i,q as m}from"./index-BRJMIUK0.js";import{e as p}from"./play-mode-DICV4cKP.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"./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";const jt="workspace.service";function e(o){p().catch(t=>{m().console.error(`${o}: ${t instanceof Error?t.message:String(t)}`,"play")})}function zt(){let o,t=!1;const r=i(()=>{t||new URLSearchParams(window.location.search).get("play")==="1"&&(t=!0,o=window.setTimeout(()=>e("Could not enter requested Play mode"),0))});return()=>{o!==void 0&&window.clearTimeout(o),r()}}export{jt as point,zt as start};
|
|
@@ -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"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{ed as h,_ as v,dj as y,ee as w,a8 as g}from"./index-BRJMIUK0.js";import{n as b,a as R}from"./native-debug-module-2_HVupdg.js";import{assertNever as f}from"./adapter-surface-Y37Nzcyw.js";import{a as E}from"./entry-adjudication-Dc18TIqT.js";import{a as A}from"./realm-services-CnY105XU.js";import{r as j}from"./relative-path-guard-GiM7Lsz8.js";import{f as k,m as x}from"./capability-coverage-DZ-onC5j.js";import{a as M,b as $}from"./react-root-BHA-cdrW.js";function P(e,o){const r=n=>{throw new Error(`resolveRootBinding: world "${e.id}" declares { module: "${o}" } — ${n} (the module path must be game-folder-relative, normalized, with no \`..\` escape).`)},t=j(o);t==="empty"&&r("the module path is empty"),t==="nul"&&r("the module path contains a NUL byte"),t==="absolute"&&r("the module path is absolute, not game-folder-relative"),t==="traversal"&&r("the module path contains a `..` segment and would escape the game folder"),o.includes("\\")&&r("the module path contains a backslash (not POSIX-relative)");const a=o.split("/").filter(n=>n.length>0&&n!==".").join("/");return a===""&&r("the module path resolves to nothing (empty after normalization)"),a}function u(e,o,r){const t=n=>{throw new Error(`resolveRootBinding: world "${e.id}"'s custom adapter module "${o}" ${n} — a { module } adapter must default-export an object shaped like \`RootAdapter\`: \`{ id: string, mount(host): Promise<MountedThreeRoot> }\`.`)};(r===null||typeof r!="object")&&t("has no default export (or it is not an object)");const a=r;(typeof a.id!="string"||a.id.length===0)&&t("default-exports an object with no non-empty string `id`"),typeof a.mount!="function"&&t("default-exports an object with no `mount` function")}const D="this world mounts through the project’s own adapter module, so every capability the editor has here is one that module hands it";function p(e,o){return{id:o.id,async mount(r){const t=await o.mount(r),a=k(e.id,x(t),D,t.kind);if(a){const{editorConsole:n}=await v(async()=>{const{editorConsole:i}=await import("./index-BRJMIUK0.js").then(s=>s.tD);return{editorConsole:i}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]));n.warn(a,"adapter")}return t}}}async function S(e,o,r){const{adapter:t}=e;if(t.type!=="module")throw new Error(`resolveModuleAdapter: world "${e.id}" is not a { module } world.`);const a=P(e,t.module),i=await import(h(o,a,r)),s=i.default;switch(e.surface){case"three":return u(e,t.module,s),{resolved:{surface:"three",adapter:p(e,s)},module:i};case"canvas":return u(e,t.module,s),{resolved:{surface:"canvas",adapter:p(e,s)},module:i};case"dom":return u(e,t.module,s),{resolved:{surface:"dom",adapter:p(e,s)},module:i};default:return f(e.surface,"resolveModuleAdapter")}}async function _(e,o,r,t){const{adapter:a,module:n}=await O(e,o,t);return{adapter:a,declaration:I(e,r,n)}}function I(e,o,r){const t=b(e.id,r),a=R(e.id,r,e.surface);return{root:e,definition:o,entry:{reach:"full",module:r},...t?{entryDebug:t}:{},...a?{entrySystems:a}:{}}}async function O(e,o,r){const{adapter:t}=e;switch(t.identity){case"three":return B(e,o,r);case"canvas":return C(e,o,r);case"dom":{let a={};return{adapter:{surface:"dom",adapter:await $(e,o,i=>{a=i})},module:a}}case"module":{const{resolved:a,module:n}=await S(e,o.projectRoot,o.epoch);return{adapter:a,module:n}}case"ingest-react":{const{adapter:a,module:n}=await M(e,o);return{adapter:{surface:"dom",adapter:a},module:n}}case"ingest-pixi":case"ingest-three":return T(e);default:{const a=t;throw new Error(`resolveRootBinding: unhandled adapter identity ${JSON.stringify(a)}`)}}}async function B(e,o,r){if(e.entry===void 0)throw new Error(`resolveRootBinding: world "${e.id}" is a three root with no \`entry\` — this should have been rejected by manifest validation. A three root is authored as a TSX/R3F world module.`);const t=await o.loadEntryModule(e.entry,e.id,"three",r?.selectionOverride),a=await E(t,e.id,{entryPath:e.entry});if(!a)throw new Error(`Project script at ${e.entry} neither exports \`adapter\` nor default-exports a React world component — every explicit first-party entry module satisfies one of the two (\`export default function World() { … }\`, or an \`adapter\` export for full control).`);return{adapter:{surface:"three",adapter:a},module:t}}async function C(e,o,r){if(e.entry===void 0)throw new Error(`resolveRootBinding: world "${e.id}" is a canvas root with no \`entry\` — this should have been rejected by manifest validation. A canvas root is authored as a TSX world module; point \`entry\` at it.`);const t=await o.loadEntryModule(e.entry,e.id,"canvas",r?.selectionOverride),a=await o.pixiRuntime(t,e.id);if(!a)throw new Error(`Project script at ${e.entry} (canvas root "${e.id}") must default-export a React component (\`export default function World() { … }\`) — or export an \`adapter\` for full control.`);return{adapter:{surface:"canvas",adapter:a},module:t}}function T(e){const o=e.adapter.identity==="ingest-pixi"?"resolveIngest2DDescriptor + mountCanvasIngestRootFromManifest":"resolveIngestDescriptor + mountThreeIngestRootFromManifest";throw new Error(`resolveRootBinding: world "${e.id}" (${e.adapter.identity}) is a captured foreign runtime, not a host-mounted RootAdapter; dispatch it through ${o}`)}async function m(e,o,r){const t=y(),a=await A(o,t),n=await w(),i=[];for(const s of g(e)){const d=r?.selectionOverride,c=await _(s,a,n,{...d&&s.id===d.regionId?{selectionOverride:{selection:d.selection,key:d.key}}:{}});i.push({world:s,resolved:c})}return{roots:i,mountId:String(t)}}async function J(e,o){const{roots:r}=await m(e,o),t=[];for(const{world:a,resolved:n}of r){const i={id:a.id,zOrder:a.zOrder,pausable:a.pausable,declaration:n.declaration},s=n.adapter;switch(s.surface){case"canvas":t.push({...i,kind:"canvas",adapter:s.adapter});break;case"dom":t.push({...i,kind:"dom",adapter:s.adapter});break;case"three":t.push({...i,kind:"three",adapter:s.adapter});break;default:f(s,"resolveAllRoots")}}return t}async function V(e,o,r){const{roots:t,mountId:a}=await m(e,o,r),n={};for(const{world:i,resolved:s}of t){const{root:d,...c}=s.declaration,l=s.adapter;switch(l.surface){case"canvas":n[i.id]={kind:"canvas",adapter:l.adapter,declaration:c};break;case"dom":n[i.id]={kind:"dom",adapter:l.adapter,declaration:c};break;case"three":n[i.id]={kind:"three",adapter:l.adapter,declaration:c};break;default:f(l,"resolveAllRootEntries")}}return{entries:n,mountId:a}}export{V as a,J as r};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e="workspace.keymap",t={id:"blender",title:"Blender",description:"Blender bindings: W select, G/R/S gizmo modes, X delete, Shift+D duplicate, A select all, Alt+A deselect, . frames.",bindings:{"transform.select":[{key:"w"}],"transform.translate":[{key:"g"}],"transform.rotate":[{key:"r"}],"transform.scale":[{key:"s"}],"edit.delete":[{key:"x"}],"edit.duplicate":[{key:"d",shift:!0}],"edit.selectAll":[{key:"a"},{key:"a",mod:!0}],"edit.deselectAll":[{key:"a",alt:!0}],"viewport.frameSelection":[{key:"."},{key:"",code:"NumpadDecimal"}],"viewport.cyclePivot":[{key:","}],"view.perspective":[],"view.projection":[{key:"",code:"Numpad5"}],"view.back":[{key:"",code:"Numpad1",ctrl:!0}],"view.left":[{key:"",code:"Numpad3",ctrl:!0}],"view.bottom":[{key:"",code:"Numpad7",ctrl:!0}],"view.orbitLeft":[{key:"",code:"Numpad4"}],"view.orbitRight":[{key:"",code:"Numpad6"}],"view.orbitUp":[{key:"",code:"Numpad8"}],"view.orbitDown":[{key:"",code:"Numpad2"}],"view.opposite":[{key:"",code:"Numpad9"}],"view.rollLeft":[{key:"",code:"Numpad4",shift:!0}],"view.rollRight":[{key:"",code:"Numpad6",shift:!0}],"view.all":[{key:"",code:"Home"}],"view.zoomIn":[{key:"",code:"NumpadAdd"},{key:"",code:"Equal",ctrl:!0}],"view.zoomOut":[{key:"",code:"NumpadSubtract"},{key:"",code:"Minus",ctrl:!0}]},navigation:{orbit:"middle",turntable:{degreesPerPixel:.4},autoPerspective:!0,zoom:{step:1.2,drag:"dolly"}}};export{t as keymap,e as point};
|
|
@@ -1,3 +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/editor-api-BFTIRlWa.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"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a3 as _,jI as N,jJ as $,jK as f,jL as g,jM as M,_ as R,jN as V,Q as U,jO as B,M as C,jP as G,B as E}from"./index-BRJMIUK0.js";import{g as l,i as b,z as D,A as j,B as F,c as O,C as x,D as q}from"./play-mode-DICV4cKP.js";import{e as H,c as z}from"./gameplay-replay-BwdxV4oF.js";import{n as A,s as h}from"./command-results-CUQD49AB.js";import{z as K,i as y}from"./active-ingest-DA426a81.js";import{g as W}from"./capability-coverage-DZ-onC5j.js";import{w as J,H as Q}from"./debug-bridge-D3_-EgRE.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"./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"./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"./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"./ingest-source-persistence-Dmdo-UBp.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"./output-DK8waum9.js";const k=()=>_().debug!=null;function d(e,t,s){const a=new Error(t);return a.code=e,s&&(a.data=s),a}function T(e){return Array.isArray(e)?new Set(e.filter(t=>!!(t&&typeof t=="object"&&typeof t.name=="string")).map(t=>t.name)):new Set}function X(e,t,s,a,i){if(e==="commands"){const c=T(t);return Array.isArray(t)&&[...a].every(o=>c.has(o))}if(e==="providers"){const c=T(t);return Array.isArray(t)&&[...i].every(o=>c.has(o))}return s?e==="state"?i.has(s):e==="invoke"?a.has(s):!1:!1}function S(e,t,s){const a=K(),i=a?.systems;if(!a||!i)return;const c=new Set((i.commands??[]).map(n=>n.name)),o=new Set((i.state??[]).map(n=>n.name));X(e,t,s,c,o)&&f({seam:"contract.systems",subject:"game",epoch:W(a),stage:"operation",outcome:"pass",source:"consumer",detail:`the session wire consumed contract systems through debug.${e}`})}async function Y(e,t,s){let a;try{a=N(s).debug}catch(o){throw o instanceof $?d("INSTANCE_UNRESOLVED",`session wire: "${e}" — ${o.message}`,{instances:o.instances}):o}const i=()=>{if(!a)throw d("DEBUG_ADAPTER_UNAVAILABLE",`session wire: "${e}" — this game exposes no debug adapter`);return a},c=(o,n,r)=>{const u=i(),m=g(u);try{const p=r();return f({seam:`system.debug.${o}`,subject:"game",epoch:m,stage:n,outcome:"pass",source:"consumer",detail:`the session wire called debug.${o} and received its result`}),f({seam:"system.debug",subject:"game",epoch:m,stage:"operation",outcome:"pass",source:"consumer",detail:"the session wire consumed the mounted debug adapter"}),S(o,p,t[0]),p}catch(p){throw f({seam:`system.debug.${o}`,subject:"game",epoch:m,stage:n,outcome:"fail",source:"consumer",detail:`the session wire called debug.${o} and it failed: ${p instanceof Error?p.message:String(p)}`}),p}};switch(e){case"state":return c("state","operation",()=>i().state(t[0]));case"stateAll":return c("stateAll","operation",()=>i().stateAll());case"providers":return c("providers","operation",()=>i().providers());case"commands":return c("commands","operation",()=>i().commands());case"events":return c("events","operation",()=>i().events(t[0]));case"snapshot":{const o=i();return{time:c("state","operation",()=>o.state("time")),state:c("stateAll","operation",()=>o.stateAll()),events:c("events","operation",()=>o.events(t[0])),pageErrors:M()}}case"invoke":{const o=t[0],n=t[1]??[];try{const r=await i().invoke(o,n),u=i();return f({seam:"system.debug.invoke",subject:"game",epoch:g(u),stage:"effect",outcome:"pass",source:"consumer",detail:`the session wire invoked debug command "${o}" and received its result`}),f({seam:"system.debug",subject:"game",epoch:g(u),stage:"operation",outcome:"pass",source:"consumer",detail:"the session wire consumed the mounted debug adapter"}),S("invoke",r,o),r}catch(r){const u=i();throw f({seam:"system.debug.invoke",subject:"game",epoch:g(u),stage:"effect",outcome:"fail",source:"consumer",detail:`the session wire invoked debug command "${o}" and it failed: ${r instanceof Error?r.message:String(r)}`}),r}}case"runTicks":{const o=l();if(!o?.runTicks)throw d("RUN_TICKS_UNAVAILABLE","this play session has no first-party Game to run ticks on");const n=t[0],r=t[1];o.runTicks(n,r);return}case"runTicksSettled":{const o=l();if(!o?.runTicksSettled)throw d("RUN_TICKS_UNAVAILABLE","this play session has no first-party Game to run ticks on");const n=t[0],r=t[1];await o.runTicksSettled(n,r);return}case"input.setVirtualAction":case"input.tapVirtualAction":case"input.clearVirtualActions":case"input.startRecording":case"input.stopRecording":case"input.isRecording":{const o=l(),n=e==="input.setVirtualAction"?t[2]:e==="input.tapVirtualAction"?t[1]:t[0],r=o?o.getInputTarget(n):null;if(!r)throw d("DEBUG_INPUT_UNAVAILABLE",`session wire: ${e}() has no virtual-input target wired — no root entry exports \`debug.input\` (the game's own input door), or none has mounted yet`);if(e==="input.setVirtualAction")return r.setVirtualAction(t[0],t[1]);if(e==="input.tapVirtualAction")return r.tapVirtualAction(t[0]);if(e==="input.clearVirtualActions"){r.clearVirtualActions();return}if(e==="input.startRecording"){r.startInputRecording();return}if(e==="input.stopRecording"){r.stopInputRecording();return}return r.isInputRecording()}case"input.scheduleActionAtTick":{const o=l(),n=t[0],r=t[1],u=t[2],m=t[3],p=o?o.getInputTarget(m):null;if(!p)throw d("DEBUG_INPUT_UNAVAILABLE","session wire: input.scheduleActionAtTick() has no virtual-input target wired — no root entry exports `debug.input` (the game's own input door), or none has mounted yet");return p.scheduleActionAtTick(n,r,u)}case"input.injectPointerDelta":case"input.injectPointerPosition":{const o=l(),n=t[0],r=t[1],u=t[2],m=o?o.getInputTarget(u):null;if(!m)throw d("DEBUG_INPUT_UNAVAILABLE",`session wire: ${e}() has no virtual-input target wired — no root entry exports \`debug.input\` (the game's own input door), or none has mounted yet`);e==="input.injectPointerDelta"?m.injectPointerDelta(n,r):m.injectPointerPosition(n,r);return}case"holdFor":{const o=l(),n=t[2],r=o?o.getInputTarget(n):null;if(!r)throw d("DEBUG_INPUT_UNAVAILABLE","session wire: holdFor() has no virtual-input target wired — no root entry exports `debug.input` (the game's own input door), or none has mounted yet");const u=t[0],m=t[1],p=r.setVirtualAction(u,!0);if(!p.delivered)return r.clearVirtualActions(),{delivered:!1,reason:p.reason};const{stalled:v,starvedWithoutDriver:w}=await J(i(),m,o?.runTicks?L=>o.runTicks?.(L,{render:"last"}):void 0);return r.clearVirtualActions(),v?{delivered:!1,reason:w?Q:"play stopped during hold"}:{delivered:!0}}default:throw d("UNKNOWN_BRIDGE_METHOD",`session wire: unknown bridge method "${e}"`)}}async function Z(e){if(!b()&&!k())return y()?{ok:!1,error:"this ingest mount is live, but it publishes no debug plane — the mount installs no SystemAdapters.debug, so there is nothing to enumerate, read or drive through the game seam. Starting play will not change that; the game itself must declare the vgai game contract (or carry a contract shim beside it) for these calls to have an answer."}:A();const t=e.method,s=e.callArgs??[];try{const a=e.instance;return{ok:!0,data:{result:await Y(t,s,a)}}}catch(a){return h(a)}}async function P(e){const{liveCanvasFrame:t}=await R(async()=>{const{liveCanvasFrame:s}=await import("./index-BRJMIUK0.js").then(a=>a.tT);return{liveCanvasFrame:s}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]));return t(e)}function ee(){const e=l();e?.loop.liveness==="loop-starved"&&e.runTicks?.(1,{render:"last"})}function I(e,t){const s=te();return{ok:!0,data:{base64:e,mimeType:"image/png",composite:t.composite,...t.layers?{layers:t.layers}:{},...t.flatness?{flatness:t.flatness}:{},...t.loopRecoveryFrame?{loopRecoveryFrame:!0}:{},...s?{recording:s}:{}}}}function te(){const e=F();return e?{path:e.path,startedAt:e.startedAt,notice:[`This run is being RECORDED — the still above is one frame of ${e.path}.`,"A still cannot answer a question about a moving game (did the jump land, did the shot","register). If that is the question, read the clip:","",` recording: ${e.path}${e.rotates?` (the next ${E("play")} replaces this file)`:" (named — never rotated)"}`,...e.format==="canvas-dom"?[` HUD replay: ${e.replayPath}`," The raw WebM contains the canvas only. Reconstruct HUD stills with"," editor.recording.captureReplay, or export a full video with editor.recording.exportReplay."]:[],` startedAt: ${e.startedAt} (clip offset 0)`,` play log: ${e.logFile===null?"(none — nothing is logging this run)":`logs/${e.logFile}`} (event timestamps → clip offsets)`,"","THE BAR for a temporal question: examine AT LEAST 10 frames spanning no more than 5","seconds around the moment. One frame, or ten frames spread across the run, is the same","guess a single screenshot was.","",`The clip is finalized and readable when play stops — ${E("stop")}, or the idle`,`auto-stop after ${Math.round(e.idleAutoStopMs/1e3)}s with no session command and no player input.`].join(`
|
|
3
|
-
`)}:null}async function re(e){if(!b()&&!k()&&!y())return A();const t=e.instance,s=D(t),a=j(t),i=V(s).medium,c=l();let o=!1,n=null;if(a&&c?.loop.liveness==="loop-starved")if(e.refreshStarvedFrame===!0&&c.runTicks)try{c.runTicks(1,{render:"last"}),o=!0}catch(r){return h(r)}else return{ok:!1,error:"cannot capture a fresh game frame while the host loop reports 'loop-starved' — inspect the separate visibility readings, let presentation resume, or request a deterministic loop-recovery frame",data:{code:"BRIDGE_SCREENSHOT_STALE"}};if(s&&typeof Image<"u"&&typeof XMLSerializer<"u"&&typeof s.getBoundingClientRect=="function")try{const r=await U(s,{canvasFrame:P,...i==="unknown"?{}:{presentsOnCanvas:i==="canvas"}});if(r.layers.canvases===0&&r.layers.domOverlays===0)throw new B(i==="dom"?"dom-overlay":"composite-output","no game layers were mounted");return I(r.base64,{composite:!0,layers:r.layers,flatness:r.flatness,loopRecoveryFrame:o})}catch(r){n=r,C.warn(`Full-stack screenshot failed; returning the canvas-only fallback — ${r instanceof Error?r.message:String(r)}`,"screenshot")}if(!a){const r=n instanceof Error?n.message:String(n);return{ok:!1,error:n!==null?`full game-stack capture failed — ${r}; no canvas layer is available as a fallback`:y()?"the ingest mount is live but no DOM overlay or canvas layer is mounted for capture":"no play-mode DOM overlay or canvas layer is mounted yet",data:{code:"BRIDGE_SCREENSHOT_UNAVAILABLE"}}}try{const r=await R(()=>import("./index-BRJMIUK0.js").then(w=>w.tT),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])),u=r.readablePngSource(await r.liveCanvasFrame(a))??a,m=u.toDataURL("image/png"),p=m.indexOf(","),v=p>=0?m.slice(p+1):m;return I(v,{composite:!1,flatness:G(u,a.ownerDocument),loopRecoveryFrame:o})}catch(r){return{ok:!1,error:`bridge-screenshot: canvas layer capture failed — ${r instanceof Error?r.message:String(r)}`+(n===null?"":`; full game-stack capture also failed — ${n instanceof Error?n.message:String(n)}`),data:{code:"BRIDGE_SCREENSHOT_UNAVAILABLE"}}}}const Vt="workspace.command",Ut={"bridge-call":{timeoutMs:6e4,derivedRefresh:"always",handle:Z},"bridge-screenshot":{timeoutMs:15e3,derivedRefresh:"if-content-changed",handle:re},"bridge-recording-start":{timeoutMs:15e3,derivedRefresh:"none",handle:async e=>{if(!b()&&!k()&&!y())return A();const t=D();if(!t)return{ok:!1,error:"no play-mode game surface is mounted yet"};const s=_().audio?.acquireRecordingStream?.()??null;try{return{ok:!0,data:{...await x(t,{fps:typeof e.fps=="number"?e.fps:void 0,format:e.format==="canvas-dom"||e.format==="composite-webm"?e.format:void 0,name:typeof e.name=="string"||e.name===null?e.name:void 0,canvasFrame:P,refreshFrame:ee,audio:s})}}}catch(a){return h(a)}}},"bridge-recording-stop":{timeoutMs:6e4,derivedRefresh:"none",handle:async()=>{try{return{ok:!0,data:{...await O()}}}catch(e){return h(e)}}},"bridge-recording-timeline":{derivedRefresh:"none",handle:()=>{const e=q();return e===null?{ok:!1,error:"no gameplay recording is active"}:{ok:!0,data:{...e}}}},"bridge-recording-replay-capture":{timeoutMs:6e4,derivedRefresh:"none",handle:async e=>{try{return typeof e.replayPath!="string"?{ok:!1,error:"replayPath is required"}:typeof e.positionMs!="number"||!Number.isFinite(e.positionMs)?{ok:!1,error:"finite positionMs is required"}:{ok:!0,data:{...await z(e.replayPath,e.positionMs)}}}catch(t){return h(t)}}},"bridge-recording-replay-export":{timeoutMs:6e5,derivedRefresh:"none",handle:async e=>{try{if(typeof e.replayPath!="string")return{ok:!1,error:"replayPath is required"};const{blob:t,...s}=await H({replayPath:e.replayPath,...typeof e.fps=="number"?{fps:e.fps}:{},...typeof e.startMs=="number"?{startMs:e.startMs}:{},...typeof e.endMs=="number"?{endMs:e.endMs}:{}}),{beginGameplayRecordingSink:a,appendGameplayRecordingChunk:i,finishGameplayRecordingSink:c,abortGameplayRecordingSink:o}=await R(async()=>{const{beginGameplayRecordingSink:r,appendGameplayRecordingChunk:u,finishGameplayRecordingSink:m,abortGameplayRecordingSink:p}=await import("./editor-api-BFTIRlWa.js");return{beginGameplayRecordingSink:r,appendGameplayRecordingChunk:u,finishGameplayRecordingSink:m,abortGameplayRecordingSink:p}},__vite__mapDeps([10,0,1,2,3,4,5,6,7,8,9,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,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83])),n=await a({startedAt:new Date().toISOString(),mimeType:"video/webm",purpose:"export",name:typeof e.name=="string"?e.name:`replay-export-${Date.now()}`});try{for(let r=0,u=0;r<t.size;r+=4*1024*1024,u++)await i(n,u,t.slice(r,r+4*1024*1024));await c(n,"post-processed canvas and DOM recording")}catch(r){throw await o(n),r}return{ok:!0,data:{...s,path:n.path}}}catch(t){return h(t)}}}};export{Ut as commands,Vt as point};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./jsx-runtime-DPjLkJKQ.js";import{b1 as O,cf as E,cq as D,et as P,eu as z,ev as H,ew as i,$ as M,ex as F,aW as a,ey as n,d5 as L,aK as j,Z as R,a_ as G,ez as _,eA as J,bR as V,eB as U,eC as q}from"./index-BRJMIUK0.js";import{r}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{s as K,b as A,u as Y,c as Z,g as Q,d as X,r as ee,f as C}from"./build-session-GZcSAfPN.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./configurations-BXU4GGbV.js";const f="vgai.project.json",S={name:"My Game",resolution:{width:1280,height:720},appId:"com.example.mygame"};function te(){r.useSyncExternalStore(K,A,A);const s=Q(),p=G(),o=p?O(p):null,[y,T]=r.useState(S),m=Y(),[c,$]=r.useState("");r.useEffect(()=>{!c&&m.length>0&&$(m[0]?.id??"")},[m,c]);const g=r.useRef(null),x=r.useCallback(async()=>{const t=await E(f),l=t?JSON.parse(t):S;T({...S,...l,resolution:{...S.resolution,...l.resolution}})},[]);r.useEffect(()=>(x().catch(()=>{}),o?.subscribeAll(t=>{t===f&&x().catch(()=>{})})??(()=>{})),[o,x]),r.useEffect(()=>()=>{g.current&&clearTimeout(g.current)},[]);const v=r.useCallback(t=>{g.current&&clearTimeout(g.current),g.current=setTimeout(async()=>{const l=await E(f);if(!l)throw new Error(`Cannot edit build settings: ${f} is missing`);const u=JSON.parse(l),h=`${JSON.stringify({...u,name:t.name,resolution:t.resolution,appId:t.appId},null,2)}
|
|
2
|
-
`;if(!o){await D(f,h);return}await o.write(f,h,{label:"Edit Build Settings",kind:"settings",contentType:"application/json"}).catch(()=>void x().catch(()=>{}))},500)},[o,x]),I=r.useCallback(t=>{T(l=>{const u={...l,...t};return v(u),u})},[v]),N=r.useCallback((t,l)=>{T(u=>{const h={...u,resolution:{...u.resolution,[t]:Math.round(l)}};return v(h),h})},[v]),d=s.phase,b=s.result?.report?.artifact??null;return e.jsxs("div",{"data-testid":"build-profiles-document",style:{display:"flex",flex:1,minHeight:0,background:P[1],pointerEvents:"auto"},children:[e.jsx("div",{style:se,children:m.map(t=>e.jsx(H,{selected:c===t.id,disabled:d==="building",onClick:()=>{d!=="building"&&$(t.id)},style:{padding:`${i[4]} ${i[6]}`,opacity:d==="building"&&c!==t.id?.4:1},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:i[4]},children:[e.jsx(M,{icon:L,style:{fontSize:n.lg,color:c===t.id?F:a[2]}}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:n.md,fontWeight:600,color:c===t.id?a[1]:a[2]},children:t.label}),e.jsx("div",{style:{fontSize:n.sm,color:a[3],marginTop:1},children:t.subtitle})]})]})},t.id))}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",minWidth:0,padding:`${i[5]} ${i[8]}`,maxWidth:560},children:[e.jsx("div",{style:W,children:"Project"}),e.jsxs("div",{style:w,children:[e.jsx("label",{style:B,children:"Name"}),e.jsx(j,{className:"vgai-input",style:{flex:1},value:y.name,onChange:t=>I({name:t.target.value})})]}),e.jsxs("div",{style:w,children:[e.jsx("label",{style:B,children:"Resolution"}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:i[2],flex:1},children:[e.jsx(j,{type:"number",className:"vgai-input",style:{width:0,flex:1},value:y.resolution.width,onChange:t=>{const l=Number.parseInt(t.target.value,10);Number.isFinite(l)&&l>0&&N("width",l)}}),e.jsx("span",{style:{fontSize:n.sm,color:a[3]},children:"×"}),e.jsx(j,{type:"number",className:"vgai-input",style:{width:0,flex:1},value:y.resolution.height,onChange:t=>{const l=Number.parseInt(t.target.value,10);Number.isFinite(l)&&l>0&&N("height",l)}})]})]}),e.jsxs("div",{style:w,children:[e.jsx("label",{style:B,children:"App ID"}),e.jsx(j,{className:"vgai-input",style:{flex:1},value:y.appId,onChange:t=>I({appId:t.target.value})})]}),e.jsxs("div",{style:{...w,marginTop:i[2]},children:[e.jsx("label",{style:B,children:"Output"}),e.jsx("span",{style:{fontSize:n.md,color:a[2]},children:b??"Artifact appears here after a build"})]}),e.jsx("div",{style:{marginTop:i[6],display:"flex",alignItems:"center",gap:i[4],paddingTop:i[4],borderTop:`1px solid ${z[1]}`},children:d==="building"?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontSize:n.md,fontWeight:600,color:F},children:["Building for ",m.find(t=>t.id===s.target)?.label??s.target,"… (log in Build Output below)"]}),e.jsx(R,{size:"compact",onClick:X,children:"Cancel"})]}):e.jsxs(e.Fragment,{children:[d==="done"&&s.result&&e.jsx("span",{"data-testid":"build-profiles-result",style:{fontSize:n.md,fontWeight:600,color:s.result.ok?_:J},children:s.result.ok?"✓ Build complete":`✗ Build failed (exit ${s.result.code??"unknown"})`}),d==="done"&&s.result?.ok&&b&&e.jsx("a",{href:V(b),download:b,className:"vgai-btn","data-variant":"secondary","data-size":"default",style:{textDecoration:"none",display:"inline-flex"},children:"Download"}),e.jsx(R,{variant:"primary","data-testid":"build-profiles-build",onClick:()=>{c&&(d==="done"&&ee(),Z(c))},style:{marginLeft:"auto"},children:d==="done"?"Build Again":"Build"})]})}),d==="done"&&s.result?.report&&e.jsx(ie,{report:s.result.report})]})]})}function ie({report:s}){const p=s.largestFiles[0]?.bytes??1;return e.jsxs("section",{"data-testid":"build-report",style:{marginTop:i[6],paddingTop:i[5],borderTop:`1px solid ${z[1]}`},children:[e.jsx("div",{style:W,children:"Build report"}),e.jsxs("div",{style:{display:"flex",gap:i[4],marginBottom:i[5]},children:[e.jsx(k,{label:"Package",value:C(s.artifactBytes)}),e.jsx(k,{label:"Output",value:C(s.outputBytes)}),e.jsx(k,{label:"Files",value:String(s.fileCount)})]}),e.jsx("div",{style:{fontSize:n.sm,color:a[3],marginBottom:i[2]},children:"Largest output files"}),e.jsx("div",{style:{display:"grid",gap:3},children:s.largestFiles.slice(0,8).map(o=>e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr) max-content",gap:i[3]},children:[e.jsxs("div",{title:o.path,style:{position:"relative",minWidth:0,overflow:"hidden",borderRadius:2},children:[e.jsx("div",{"aria-hidden":"true",style:{position:"absolute",inset:0,width:`${Math.max(2,o.bytes/p*100)}%`,background:"color-mix(in srgb, var(--vgai-accent) 16%, transparent)"}}),e.jsx("div",{style:{position:"relative",padding:`${i[1]} ${i[2]}`,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:U,fontSize:n.sm,color:a[2]},children:o.path})]}),e.jsx("div",{style:{textAlign:"right",padding:`${i[1]} 0`,fontSize:n.sm,color:a[2]},children:C(o.bytes)})]},o.path))})]})}function k({label:s,value:p}){return e.jsxs("div",{style:{flex:1,padding:`${i[3]} ${i[4]}`,background:P[2],borderRadius:q.sm},children:[e.jsx("div",{style:{fontSize:n.sm,color:a[3]},children:s}),e.jsx("div",{style:{marginTop:i[1],fontSize:n.lg,fontWeight:650,color:a[1]},children:p})]})}const se={width:160,flexShrink:0,borderRight:`1px solid ${z[1]}`,overflowY:"auto"},W={fontSize:n.sm,fontWeight:700,textTransform:"uppercase",color:a[3],letterSpacing:"0.05em",marginBottom:i[3]},w={display:"flex",alignItems:"center",gap:i[3],marginBottom:i[2]},B={width:65,fontSize:n.base,color:a[2],flexShrink:0},ge="workspace.document",xe="Build Profiles";function he(s){return e.jsx(te,{})}export{he as default,ge as point,xe as title};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{l as D,b as _}from"./configurations-BXU4GGbV.js";import{q as p}from"./index-BRJMIUK0.js";import{r as m}from"./index-nmcBqr7Y.js";function b(e){if(e<1024)return`${e} B`;const s=["KB","MB","GB"];let t=e/1024,n=s[0];for(let o=1;o<s.length&&t>=1024;o++)t/=1024,n=s[o];return`${t>=10?t.toFixed(1):t.toFixed(2)} ${n}`}const B="build",v="build-profiles.document";function N(){return p().workspace.openContributedDocument(v)}function P(){const[e,s]=m.useState([]);return m.useEffect(()=>{let t=!1;return D().then(n=>{t||s(n.filter(o=>o.role==="build").map(o=>({id:o.id,label:o.id,subtitle:o.describe??o.kind})))}).catch(()=>{t||s([])}),()=>{t=!0}},[]),e}let i={phase:"idle",target:"",log:[],result:null},w=0;const f=new Set;let $=null;function u(e){i={...i,...e},w++,x();for(const s of f)s()}function U(e){return f.add(e),()=>{f.delete(e)}}function L(){return w}function y(){return i}function M(){i.phase!=="building"&&u({phase:"idle",log:[],result:null})}function W(){$?.abort(),u({phase:"idle"})}function E(){x(),p().output.show(B)}function x(){const e=y();let s=e.log.length?`${e.log.join(`
|
|
2
|
-
`)}
|
|
3
|
-
`:"";if(e.phase==="done"&&e.result&&(s+=`
|
|
4
|
-
${e.result.ok?"Build complete.":`Build failed (exit code: ${e.result.code??"unknown"}).`}
|
|
5
|
-
`,e.result.report)){const t=e.result.report;s+=`${b(t.artifactBytes)} package · ${b(t.outputBytes)} output · ${t.fileCount} files
|
|
6
|
-
`}p().output.write(B,"Build",s,O(s))}function O(e){const s=[],t=e.replace(/\u001b\[[0-9;]*m/g,"");for(const n of t.split(/\r?\n/)){const o=n.match(/^(.+?)\((\d+),(\d+)\):\s*(error|warning)\s+(.*)$/)??n.match(/^(.+?):(\d+):(\d+)\s*[-:]?\s*(error|warning)\s*:?[ ]*(.*)$/i);if(!o)continue;const l=o[1].trim();l.startsWith("/")||l.split(/[\\/]/).includes("..")||s.push({path:l,line:Math.max(1,Number(o[2])),column:Math.max(1,Number(o[3])),severity:o[4].toLowerCase()==="warning"?"warning":"error",message:o[5]})}return s}async function F(e){if(i.phase==="building")return;u({phase:"building",target:e,log:[],result:null}),E();const s=new AbortController;$=s;try{const t=await _(e,s.signal);if(!t.ok){const c=await t.json().catch(()=>({error:"Build request failed"}));u({phase:"done",log:[...i.log,`Error: ${c.error??t.statusText}`],result:{ok:!1,code:null}});return}const n=t.body.getReader(),o=new TextDecoder;let l="";for(;;){const{done:c,value:k}=await n.read();if(c)break;l+=o.decode(k,{stream:!0});const h=l.split(`
|
|
7
|
-
|
|
8
|
-
`);l=h.pop();for(const g of h){if(g.startsWith(":"))continue;const S=g.split(`
|
|
9
|
-
`);let d="",a="";for(const r of S)r.startsWith("event: ")?d=r.slice(7):r.startsWith("data: ")&&(a=r.slice(6));if(d==="log"){let r;try{r=JSON.parse(a)}catch{r=a}u({log:[...i.log,r]})}else if(d==="done"){let r;try{r=JSON.parse(a)}catch{r={ok:!1,code:null}}u({phase:"done",result:r})}}}}catch(t){t.name!=="AbortError"&&u({phase:"done",log:[...i.log,`Error: ${t.message}`],result:{ok:!1,code:null}})}}export{E as a,L as b,F as c,W as d,b as f,y as g,N as o,M as r,U as s,P as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as r}from"./jsx-runtime-DPjLkJKQ.js";import{q as e,Z as a,$ as s,a0 as i}from"./index-BRJMIUK0.js";import{r as p}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{o as n}from"./build-session-GZcSAfPN.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./configurations-BXU4GGbV.js";const b="workspace.header",h=10;function v(){const{session:t}=e(),o=p.useSyncExternalStore(t.subscribe,t.playState,t.playState)!=="stopped";return r.jsxs(a,{variant:"ghost",size:"compact","data-testid":"project-export","aria-label":"Export project",disabled:o,title:o?"Stop Play mode before exporting the project":"Export project",className:"vgai-chrome-island vgai-glass-island",onClick:()=>{n()},children:[r.jsx(s,{icon:i.action.export}),"Export"]})}export{v as default,h as order,b as point};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/r3f-physics-binding-DzrbpqjM.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/syntactic-prop-specs-eiQXwMIc.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{el as Ue,h1 as He,cw as Ke,eP as Ze,di as se,h2 as $e,bk as Xe,bl as Qe,M as q,_ as xe,bm as Ye,dj as et,bs as de,h3 as ke,f$ as tt,cy as nt,au as rt}from"./index-BRJMIUK0.js";import{BabylonAuthoringAdapter as ot}from"./babylon-authoring-adapter-C8mFMXSr.js";import{i as Se,a as pe,o as st,r as fe,P as it,c as at}from"./pixi-authoring-adapter-BChknIdC.js";import{f as me,t as ct,p as he}from"./pixi-transform-channels-P4rvmusc.js";import{r as lt,c as ut}from"./relative-import-specifier-BFKIWEWs.js";import{l as Pe}from"./oid-transform-D5Kxt6ij.js";import{f as dt,a as pt,b as ft}from"./writer-tw6EcuVO.js";import{s as mt}from"./index-SS9EugVg.js";import{registerPresentedCanvasFrame as ht,withApplicationCollector as gt,capturePixiDisplayObjectThumbnail as wt}from"./canvas-preview-frames-C0QTagA3.js";import{a as vt}from"./source-persistence-backend-CwLYVPXj.js";import{resolveCanvasEntryAdapterForEditor as yt,resolveCanvasPixiForEditor as bt}from"./canvas-entry-runtime-UNYuSfG0.js";import{a as Me}from"./json-history-resource-DwS10tqD.js";import{a as $t}from"./realm-services-CnY105XU.js";import{n as xt,a as St,i as Pt,b as Ct}from"./native-debug-module-2_HVupdg.js";import{createAssetCache as Tt}from"./assets-BcrMQHRv.js";import{r as Ot,a as At,b as Et}from"./create-runtime-DBfUy0SO.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"./ingest-source-persistence-Dmdo-UBp.js";import"./component-instance-root-B0C5oNEm.js";import"./user-data-Bpj7diUS.js";import"./workspace-arrangement-BdAlBwvd.js";import"./r3f-physics-binding-DzrbpqjM.js";import"./debug-registry-P0_YQGWd.js";import"./three-ingest-runtime-B7rtg3QE.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./native-entry-surface-BE8LJNdu.js";import"./contract-system-adapters-Bic_7sev.js";import"./game-contract-seams-BnPFGLll.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"./seeded-random-BgCwIAAU.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";const Ce="this session has no source-write backend",jt=new Set(["key","ref","data-oid","children","style","className"]),Te=new Set(["x","y","rotation","scale","scale-x","scale-y","label","visible"]),Rt=new Set(["x","y","name","children"]),Oe=/^-?\d+(\.\d+)?$/,Ae={container:'<pixiContainer label="Container" />',sprite:'<pixiSprite label="Sprite" />',text:'<pixiText label="Text" text="Text" />',graphics:'<pixiGraphics label="Graphics" />'},_t={container:"Container",sprite:"Sprite",text:"Text",graphics:"Graphics"};function Ee(u){return jt.has(u)||/^on[A-Z]/.test(u)||u.startsWith("__vgai")}function je(u){const m=u.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").trim();return m?m[0].toUpperCase()+m.slice(1):u}function kt(u,m,h){const P=u.slice(u.lastIndexOf(`
|
|
3
|
-
`,m-1)+1,m),c=u.slice(m,h);return/^\s*$/.test(P)?c.split(`
|
|
4
|
-
`).map((w,l)=>l>0&&w.startsWith(P)?w.slice(P.length):w).join(`
|
|
5
|
-
`):c}function Mt(u,m){const h=new Set(u);return[...h].filter(P=>{let c=m(P);for(;c;){if(h.has(c))return!1;c=m(c)}return!0})}function Dt(u){const{worldId:m,entryPath:h}=u,P=u.pixi??mt;let c,w=()=>{},l,J,M=null,x=new Map,I=new Map;const O=new Map,k=new Set,D=new Map;let L=Promise.resolve();const p=e=>{const t=c.displayObject(e);return(t?pe(t):void 0)??st(m,e)},A=()=>{const e=new Set,t=n=>{const r=c.displayObject(n),o=fe(r);o!==void 0&&e.add(o);const s=r?pe(r):void 0;s!==void 0&&e.add(s);for(const i of c.node(n)?.childIds??[])t(i)};for(const n of c.roots())t(n.id);return e},y=async()=>{if(!(!l?.index||!l.readSource))try{const e=await l.index();x=new Map(Object.entries(e));const t=new Set;for(const r of A()){const o=x.get(r);o&&t.add(o.file)}const n=new Map;await Promise.all([...t].map(async r=>{const o=await l.readSource(r);n.set(r,o.source)})),I=n,w()}catch{}},j=e=>{const t=p(e);if(!t)return null;const n=x.get(t);if(!n)return null;const r=I.get(n.file);if(r===void 0)return null;const o=Pe(r,n.line,n.col);if(r[o]!=="<")return null;const s=dt(r,o);return s<0?null:pt(r,o,s)},$=e=>{const t=e.replaceAll("\\","/"),n=h.replaceAll("\\","/").replace(/^\.?\//,"");if(!t.startsWith("/")&&!/^[A-Za-z]:\//.test(t))return t;for(const r of x.values()){const o=r.file.replaceAll("\\","/");if(o!==n&&!o.endsWith(`/${n}`))continue;const s=o.slice(0,-n.length);if(t.startsWith(s))return t.slice(s.length)}return n},F=e=>{const t=p(e);return(t?x.get(t)?.props:void 0)??[]},V=e=>{const t=c.displayObject(e);if(!t||!Se(t))return null;const n=fe(t),r=pe(t);return n&&n!==r?n:null},R=e=>{const t=c.displayObject(e);if(!t||!Se(t))return null;const n=V(e),r=n?x.get(n):void 0,o=p(e),s=o?x.get(o):void 0,i=r?.component??s?.tag;return i?{name:i,...r?.file?{sourcePath:$(r.file)}:{}}:null},Z=e=>{const t=p(e);if(!t)return{anchored:!1,reason:"This rendered Canvas object has no authored source identity."};const n=x.get(t);if(!n)return{anchored:!1,reason:"Source metadata is still loading or unavailable."};const r=$(n.file);return{anchored:!0,kind:"source",file:r,line:n.line,col:n.col,display:`${r}:${n.line}`}},ie=u.writeBackend?{isDirty:()=>!1,save:async()=>{},destination:h,lastError:()=>{const e=J?.shell.projectHistory?.getSnapshot().lastError;return e&&(e.code==="apply-failed"||e.code==="compensation-failed"||e.code==="history-limit")?e.message:null}}:void 0,X=e=>c.getTransform(e)??{position:[0,0],rotation:0,scale:[1,1]},Y=(e,t,n,r)=>{if(!R(e))return!1;const o=he(t,r,n);if(!o.writable)return!1;const s=F(e);return o.writes.some(i=>!n.some(a=>a.name===i.prop)&&!s.some(a=>a.name===i.prop))},ee=e=>{if(!e.isLiteral)return`{${e.rawValue}}`;const t=e.rawValue;return e.isExpression?t==="true"?!0:t==="false"?!1:Oe.test(t)?Number(t):t.replace(/^['"]|['"]$/g,""):t},ae=e=>e.isExpression?e.rawValue==="true"||e.rawValue==="false"?"boolean":Oe.test(e.rawValue)?"number":"string":"string",te=e=>typeof e=="number"?me(e):typeof e=="boolean"?e?"true":"false":String(e),ce=(e,t,n)=>{const r=e?.find(s=>s.name===n);if(r)return ee(r);const o=t.find(s=>s.name===n);return o?o.defaultValue??o.defaultText:void 0},W=(e,t,n)=>!!(t?.isLiteral&&n?.optional&&l?.removeProp&&!k.has(`${e}|jsx.${t.name}`)),ne=async(e,t)=>{const n=X(e),r=["position","rotation","scale"].filter(v=>ct(v,t,n));if(r.length===0)return!1;const o=v=>{v==="position"?c.setTransform(e,{position:t.position}):v==="rotation"?c.setTransform(e,{rotation:t.rotation}):c.setTransform(e,{scale:t.scale}),w()},s=p(e);if(!s||!l?.writeProp){console.warn(`[canvas-source ${h}] transform on "${e}" is not persistable (${s?"no source-write backend":"node has no source stamp"}) — reverting.`);for(const v of r)o(v);return!1}const i=j(e)??[],a=R(e),d=v=>Y(e,v,i,n),f=[];for(const v of r){if(d(v)){k.add(`${e}|${v}`),se(`${v} is owned by <${a?.name??"this component"}>'s own code — see Console`),q.warn(`${v} on <${a?.name??"this component"}> is not writable — the component declares no prop for it, so a written value would never reach the running game (the component's own code owns that channel). Edit ${a?.sourcePath??"the component definition"} instead. Reverting.`,"authoring"),o(v);continue}const B=he(v,n,i);if(!B.writable){k.add(`${e}|${v}`),console.warn(`[canvas-source ${h}] ${v} on "${e}" is not writable — ${B.reason} Reverting the live object.`),o(v);continue}for(const N of B.writes)f.push({channel:v,...N})}if(f.length===0)return!1;let S=!1;const C=async v=>{for(const B of f){const N=await v.writeProp(s,B.prop,B.value,{addIfMissing:!0,...B.prop==="scale"?{allowShapeUpgrade:!0}:{}});if(N.changed){S=!0;continue}!N.dynamic&&!N.error||(N.dynamic&&k.add(`${e}|${B.channel}`),console.warn(`[canvas-source ${h}] ${B.prop} write refused for oid "${s}": ${N.dynamic?"dynamic expression (guarded)":N.error??"no change"} — reverting.`),o(B.channel))}};return f.length>1&&l.runGesture?await l.runGesture("Transform",v=>C(v)):await C(l),await y(),w(),S},le=(e,t)=>{const n=c.displayObject(e);if(n)return t==="label"?n.label:t in n?n[t]:void 0},re=(e,t,n)=>{const r=c.displayObject(e);r&&(t==="label"?r.label=String(n):t in r&&(r[t]=n))},ue=async(e,t,n,r)=>{const o=p(e);if(!o||!l?.writeProp)return console.warn(`[canvas-source ${h}] cannot write "${n}" on "${e}": ${o?"no source-write backend in this session":"node has no source stamp"}.`),!1;const s=`${e}|${t}`,i=le(e,n);O.set(s,r),re(e,n,r),w();let a;try{a=await l.writeProp(o,n,te(r),{addIfMissing:!0})}catch(d){return O.delete(s),w(),console.warn(`[canvas-source ${h}] prop write failed for oid "${o}" prop "${n}": ${String(d)}`),!1}if(!a.changed){O.delete(s),a.dynamic&&k.add(s),i!==void 0&&re(e,n,i),w();const d=R(e)?.name??c.displayObject(e)?.label??e,f=a.dynamic?`it is bound to an expression in <${d}>'s own source, so a direct edit cannot land`:`the component declares no ${JSON.stringify(n)} prop to write${a.error?` (${a.error})`:""}`;return se(`${n} on <${d}> is not writable — see Console`),q.warn(`${JSON.stringify(n)} on <${d}> is not writable — ${f}. Edit the component definition (right-click the row → Open Component Source), or the prop that drives it. Reverting.`,"authoring"),!1}return await y(),!0},E=e=>{const t=Z(e);return t.anchored?t.file:h},G=(e,t=l?.writeProp!==void 0,n=h)=>Xe({resolve:()=>t?{reaches:"writer",anchorKind:"source-prop",destination:n,write:e}:Qe(Ce),record:()=>{},report:r=>{console.warn(`[canvas-source ${n}] this edit stays live-only — ${r}.`)}}),U=e=>{console.warn(`[canvas-source ${h}] ${e}`)},Q=ut({report:U,noWriterReason:Ce,backend:()=>l,onChanged:async()=>{await y(),w()}}),_=e=>Q.structRefusal(e),T=(e,t,n,r)=>Q.structOp(r??p(e),e,t,n,E(e)),oe=(e,t,n)=>{const r=[...new Set(e.map(p).filter(o=>!!o))];return r.length!==new Set(e).size?_(`${t} refused: every selected node must be source-addressable.`):Q.structMany(r,t,n,E(e[0]??""))},g=e=>{const t=Mt(e,i=>c.node(i)?.parentId??null),n=i=>{const a=p(i),d=a?x.get(a):void 0,f=d?I.get(d.file):void 0;if(!a||!d||f===void 0)return null;const S=Pe(f,d.line,d.col),C=ft(f,S);return f[S]==="<"&&C>S?{file:d.file,offset:S,text:kt(f,S,C)}:null},r=[],o=new Set;for(const i of t){const a=p(i);if(!a||o.has(a))continue;o.add(a);const d=n(i);if(!d)return null;r.push(d)}if(r.length===0)return null;const s=r[0].file;return r.some(i=>i.file!==s)?null:(r.sort((i,a)=>i.offset-a.offset),{sourceFile:s,text:r.map(i=>i.text).join(`
|
|
6
|
-
`),count:r.length})},b=e=>(U(e),se(e),!1),z=async e=>{M=null;const t=g(e);if(!t)return b("Copy needs source-addressable Canvas nodes from one source file.");const n=globalThis.navigator?.clipboard;if(!n?.writeText)return b("The system clipboard is unavailable.");try{await n.writeText(t.text)}catch{return b("The system clipboard refused the Canvas copy.")}return M=t,se(`Copied ${t.count} ${t.count===1?"node":"nodes"}.`),!0},H=async e=>{if(l?.writeStructMany)return oe(e,"delete");let t=Ye;for(const n of e)t=await T(n,"delete");return t},ge=e=>{const t=(o,s,i)=>{const a=V(o),d=a??p(o),f=d?x.get(d):void 0;return d&&f?{id:o,oid:d,file:f.file,op:s,definition:!!a}:null};if(e)return t(e,"create");const n=c.roots().at(-1);if(!n)return null;const r=t(n.id,"create-sibling");return r?{...r,op:r.definition?"create":"create-sibling"}:null},De=e=>{const t=ge(e);return!!M&&!!t&&t.file===M.sourceFile},Fe=async e=>{const t=M;if(!t)return b("Copy or cut a Canvas node before pasting.");const n=globalThis.navigator?.clipboard;if(!n?.readText)return b("The system clipboard is unavailable.");try{if(await n.readText()!==t.text)return b("The clipboard changed after the Canvas copy.")}catch{return b("The system clipboard refused the Canvas paste.")}const r=ge(e);return r?r.file!==t.sourceFile?b("Cross-file paste is refused because the destination may not import the copied dependencies."):$e(await T(r.id,r.op,{snippet:t.text},r.oid)):b("Paste needs a source-addressable Canvas parent.")},we=e=>{const t=[];let n=e;for(;n;)t.push(n),n=n.parent;const r=new P.Matrix;for(let o=t.length-1;o>=0;o--){const s=t[o];s.updateLocalTransform(),r.append(s.localTransform)}return r},Be=(e,t)=>{const n=c.displayObject(e),r=c.displayObject(t);if(!n||!r)return null;const o=we(r).clone().invert().append(we(n)),s=new P.Transform;o.decompose(s);const i=n.pivot??{x:0,y:0};return{position:[o.tx+i.x*o.a+i.y*o.c,o.ty+i.x*o.b+i.y*o.d],rotation:[s.rotation],scale:[s.scale.x,s.scale.y],scalarChannels:["rotation"]}},ve=e=>{let t=0;const n=r=>{fe(c.displayObject(r))===e&&t++;for(const o of c.node(r)?.childIds??[])n(o)};for(const r of c.roots())n(r.id);return t},Ne=(e,t)=>{const n=V(e);if(!n)return 0;let r=1;const o=s=>{s!==e&&V(s)===n&&!j(s)?.some(i=>i.name===t)&&(r+=1);for(const i of c.node(s)?.childIds??[])o(i)};for(const s of c.roots())o(s.id);return r},Ie=async(e,t)=>{const n=p(e),r=t.startsWith("jsx.")?t.slice(4):null;if(!n||!r||!l?.removeProp)return!1;const o=await l.removeProp(n,r);return o.changed?(O.delete(`${e}|${t}`),await y(),w(),!0):(U(`revert ${r} refused/no-op: ${o.error??"no change"}.`),!1)},ye=(e,t)=>(e==="position"?["x","y"]:e==="rotation"?["rotation"]:t.some(r=>r.name==="scale-x"||r.name==="scale-y")?["scale-x","scale-y"]:["scale"]).filter(r=>t.some(o=>o.name===r)),Ve=async(e,t)=>{const n=p(e),r=j(e);if(!n||!r||!l?.removeProp)return!1;const o=ye(t,r);if(o.length===0)return!1;let s=!1;const i=async a=>{for(const d of o){const f=await a.removeProp?.(n,d);f?.changed?s=!0:U(`revert ${d} refused/no-op: ${f?.error??"no change"}.`)}};return o.length>1&&l.runGesture?await l.runGesture(`Remove ${t}`,a=>i(a)):await i(l),s?(await y(),w(),!0):!1},ze={openComponent:()=>{Ke(Ze)},describe:e=>{const t=R(e);if(!t||He(t.name,t.sourcePath).length===0)return null;const n=j(e);if(!n)return null;const r=F(e),o=n.map(s=>{const i=`jsx.${s.name}`,a=r.find(f=>f.name===s.name);if(Ee(s.name)||Te.has(s.name)||!W(e,s,a))return null;const d=!!(a?.defaultValue!==void 0&&V(e)&&l?.runGesture&&l.writeComponentDefault&&l.removeProp);return{path:i,label:je(s.name),value:ee(s),...a?.defaultText===void 0?{}:{defaultText:a.defaultText},canApplyToComponent:d,affectedInstanceCount:Ne(e,s.name),...d?{}:{applyUnavailableReason:a?.defaultValue===void 0?"The component default is computed or absent, so source cannot be changed safely.":"This session cannot atomically update the component and its callsite."}}}).filter(s=>s!==null);return{componentName:t.name,...t.sourcePath?{sourcePath:t.sourcePath}:{},overrides:o}},revert:async(e,t)=>{let n=!1;const r=async o=>{const s=p(e);if(s)for(const i of t){const a=i.startsWith("jsx.")?i.slice(4):null;if(!a)continue;const d=await o.removeProp?.(s,a);n||=d?.changed===!0}};return t.length>1&&l?.runGesture?await l.runGesture(`Revert ${t.length} Overrides`,r):l&&await r(l),await y(),w(),n?{destination:E(e),persisted:!0}:void 0},applyToComponent:async(e,t)=>{const n=t.startsWith("jsx.")?t.slice(4):null,r=n?F(e).find(d=>d.name===n):void 0,o=V(e),s=p(e),i=R(e);if(!n||r?.defaultValue===void 0||!o||!s||!l?.runGesture||!l.writeComponentDefault||!l.removeProp)return{changed:!1,message:"Apply was refused because both literal source writes are not available."};const a=ce(j(e),F(e),n);return await l.runGesture(`Apply ${n} to ${i?.name??"Component"}`,async d=>{const f=await d.writeComponentDefault?.(o,n,te(a));if(!f?.changed)throw new Error(f?.error??"The component default did not change.");const S=await d.removeProp?.(s,n);if(!S?.changed)throw new Error(S?.error??"The callsite override was not removed.")}),await y(),w(),{changed:!0,message:`${n} now defaults to ${String(a)} in ${i?.name??"the component"}.`,write:{destination:i?.sourcePath??E(e),persisted:!0}}}},be={create:(e,t)=>{const n=Ae[e];if(!n||!l?.writeStruct)return{id:"",ack:void 0};if(t)return{id:"",ack:T(t,"create",{snippet:n})};const r=c.roots().at(-1);return r?{id:"",ack:T(r.id,"create-sibling",{snippet:n})}:{id:"",ack:_("create refused: the source needs one addressable root insertion point.")}},creatableKinds:e=>l?.writeStruct?e&&!p(e)?[]:!e&&c.roots().length===0?[]:Object.keys(Ae).map(t=>({kind:t,label:_t[t]??t})):[],remove:e=>T(e,"delete"),removeMany:e=>H(e),copy:e=>z(e),canCopy:e=>g(e)!==null,cut:async e=>await z(e)?$e(await H(e)):!1,paste:e=>Fe(e),canPaste:e=>De(e),duplicate:e=>({id:e,ack:T(e,"duplicate")}),wrap:(e,t)=>T(e,"wrap",{wrapperTag:t??"pixiContainer"}),unwrap:e=>T(e,"unwrap"),group:e=>{const t=[...new Set(e)];if(t.length<2)return{id:null,ack:void 0};const n=c.node(t[0])?.parentId??null;return t.some(r=>c.node(r)?.parentId!==n)?{id:null,ack:_("group refused: select two or more siblings.")}:{id:"",ack:oe(t,"group",{wrapperTag:"pixiContainer"})}},canUngroup:e=>{const t=p(e);return!!(t&&x.get(t)?.tag==="pixiContainer"&&(c.node(e)?.childIds.length??0)>0)},ungroup:e=>be.canUngroup?.(e)?{ids:[...c.node(e)?.childIds??[]],ack:T(e,"unwrap")}:{ids:[],ack:void 0},reparent:(e,t)=>{if(!t)return _("reparent refused: drop onto a source-addressable container.");const n=p(t),r=p(e),o=Be(e,t);return!n||!r||!o?_("reparent refused: the source or destination is not addressable."):T(e,"reparent",{parentOid:n,rebase:o,destinationInstances:ve(n),sourceInstances:ve(r)})},reorder:(e,t)=>{if(t){const o=p(t);return o?T(e,"reorder",{targetOid:o}):_("reorder refused: the target has no source identity.")}const n=c.node(e)?.parentId,r=n?p(n):null;return r?T(e,"reorder",{parentOid:r}):_("reorder-to-end refused: the parent has no source identity.")}},Le=(e,t)=>lt($(e),$(t)),We=async e=>{const t=e.sourcePath;if(!t||!l?.readSource)return null;try{const{source:n}=await l.readSource(t),{parseAuthoringTsx:r}=await xe(async()=>{const{parseAuthoringTsx:s}=await import("./r3f-physics-binding-DzrbpqjM.js").then(i=>i.t);return{parseAuthoringTsx:s}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])),{localComponentPropSpecs:o}=await xe(async()=>{const{localComponentPropSpecs:s}=await import("./syntactic-prop-specs-eiQXwMIc.js");return{localComponentPropSpecs:s}},__vite__mapDeps([11,1,2,3,4,5,6,7,8,9,10]));return o(r(t,n),new Map).get(e.name)??null}catch{return null}},Ge=e=>e.filter(t=>!t.optional&&t.defaultText===void 0&&t.type!=="enum"&&!Rt.has(t.name)),qe=e=>e.filter(t=>!t.optional&&t.defaultText===void 0&&t.type==="enum"&&t.options?.[0]!==void 0).map(t=>{const n=t.options?.[0];return typeof n=="string"?` ${t.name}=${JSON.stringify(n)}`:` ${t.name}={${n}}`}).join("");return{provenance:{source:"source-code",label:"Pixi source",detail:"Live @pixi/react display tree; literal JSX props write back to the .tsx source (expression-bound props are read-only)."},...ie?{persistence:ie}:{},structure:be,assetDrop:{accepts:(e,t,n)=>{if(!l?.writeStruct||!(e?p(e):c.roots().at(-1)?.id))return!1;const o=n?.item;return o?.kind==="component"?o.surface==="canvas":/\.(?:png|jpe?g|webp|gif|avif|svg)$/i.test(t)},drop:async(e,t,n)=>{const r=e||c.roots().at(-1)?.id||"",o=p(r),s=o?x.get(o):void 0;if(!r||!s)return _("asset drop refused: there is no source-addressable insertion point.");const i=n?.item,a=n?.position,d=a?` x={${me(a[0])}} y={${me(a[1])}}`:"";let f,S;if(i?.kind==="component"){if(i.surface!=="canvas")return _(`${i.name} is a ${i.surface} component, not a Canvas prefab.`);const C=await We(i),v=C?Ge(C):[];if(v.length>0){const K=v.map(Je=>`\`${Je.name}\``).join(", ");return _(`${i.name} needs ${K} — required props with no default, which a drop cannot supply. Place it from a story that provides them, or give them defaults in ${i.sourcePath??"its component"}.`)}const N=(C?C.some(K=>K.name==="x"||K.name==="y"):null)===!1;if(N&&a){const K=`${i.name} places itself — its own code owns x/y, so the drop point was not written. Move it by editing that component, or give it x/y props.`;se(K),U(K)}f=`<${i.name}${N?"":d}${C?qe(C):""} />`,S={name:i.name,module:Le(s.file,i.sourcePath),kind:i.exportKind}}else{if(!/\.(?:png|jpe?g|webp|gif|avif|svg)$/i.test(t))return _(`${t} is not an image or Canvas prefab.`);f=`<pixiSprite label="${(t.split("/").pop()?.replace(/\.[^.]+$/,"")||"Sprite").replace(/["\\]/g,"")}" texture={Texture.from(${JSON.stringify(t)})}${d} />`,S={name:"Texture",module:"pixi.js"}}return T(r,e?"create":"create-sibling",{snippet:f,ensureImport:S})}},truth:e=>({site:Z(e),writeAnchorKind:l&&p(e)?"source-prop":"live-only"}),componentIdentity:R,instances:()=>ze,bind(e){c=e.a2d,w=e.notify,J=e.store,l=Ue(u.writeBackend,e.store.shell.projectHistory),y()},onReindex(){for(const e of A()){const t=x.get(e);if(t===void 0||!I.has(t.file)){y();return}}},transformEditability(e,t){if(!p(e))return{writable:!1,reason:"This rendered part has no authored source identity."};if(!l?.writeProp)return{writable:!1,reason:"This session has no source writer."};if(k.has(`${e}|${t}`))return{writable:!1,reason:`${t} is controlled by a JSX expression.`};const r=j(e);if(!r)return{writable:!1,reason:"Source metadata is still loading or unavailable."};if(Y(e,t,r,X(e))){const s=R(e)?.name??"this component";return{writable:!1,reason:`${t} is owned by <${s}>'s own code — it declares no prop for it.`}}const o=he(t,X(e),r);return o.writable?{writable:!0,...l.removeProp&&ye(t,r).length>0?{removable:!0}:{}}:{writable:!1,reason:o.reason}},beginTransformEdit(e){D.has(e)||D.set(e,X(e))},writeTransform(e,t){c.setTransform(e,t),w()},endTransformEdit(e){const t=D.get(e);if(!t)return;D.delete(e);const n=L.then(()=>G(()=>ne(e,t).catch(r=>(console.error(`[canvas-source ${E(e)}] transform commit failed`,r),!1)),l?.writeProp!==void 0,E(e)));return L=n.then(()=>{},r=>{console.error(`[canvas-source ${h}] transform commit failed`,r)}),n},removeTransform(e,t){return G(()=>Ve(e,t),l?.removeProp!==void 0,E(e))},reportStructureLiveOnly(e,t){console.warn(`[canvas-source ${h}] ${e} stayed live-only — ${t}.`)},properties(e){if(!c.displayObject(e))return[];const t=[{path:"name",label:"Name",type:"string"},{path:"visible",label:"Visible",type:"boolean",group:"Visibility"}],n=j(e)??[],r=F(e),o=new Map(n.map(a=>[a.name,a])),s=[...r.map(a=>a.name),...n.filter(a=>!r.some(d=>d.name===a.name)).map(a=>a.name)],i=R(e)?.name??"Properties";for(const a of s){if(Ee(a)||Te.has(a))continue;const d=o.get(a),f=r.find(v=>v.name===a),S=!d&&f?.defaultText!==void 0&&f.defaultValue===void 0,C=W(e,d,f);t.push({path:`jsx.${a}`,label:je(a),type:S?"string":f?.type??(d?ae(d):"string"),...f?.options?{options:[...f.options]}:{},readonly:S||(d?!d.isLiteral:!1),...d?{}:{defaulted:!0},...C?{resettable:!0}:{},...C&&f?.defaultText!==void 0?{revertsTo:f.defaultText}:{},group:i})}return t},get(e,t){const n=c.displayObject(e);if(!n)return;const r=O.get(`${e}|${t}`);if(r!==void 0)return r;if(t==="name")return n.label??"";if(t==="visible")return n.visible;if(t.startsWith("jsx."))return ce(j(e),F(e),t.slice(4))},set(e,t,n){const r=t==="name"?"label":t==="visible"?"visible":t.startsWith("jsx.")?t.slice(4):null;if(r)return G(()=>ue(e,t,r,n),void 0,E(e))},remove(e,t){return G(()=>Ie(e,t),l?.removeProp!==void 0,E(e))},dispose(){O.clear(),k.clear(),D.clear()}}}function Ft(u,m,h,P=.1){const c=u.getBoundingClientRect();if(c.width<2||c.height<2||!(m.width>0)||!(m.height>0))return!1;const w=Math.min(4,Math.max(P,Math.min((c.width-96)/m.width,(c.height-96)/m.height)));return h.setView(c.width/2-(m.x+m.width/2)*w,c.height/2-(m.y+m.height/2)*w,w),!0}function Bt(u,m){return ht(u,async()=>{for(let h=0;h<24;h++){if(m())return null;await new Promise(P=>setTimeout(P,0))}return null})}const Re={width:1280,height:720};function Nt(){return At({loop:Et({update:()=>{}}),assets:Tt()})}function It(){const u=document.createElement("canvas");return u.dataset.vgaiCanvasSceneSurface="true",u.style.position="absolute",u.style.inset="0",u.style.width="100%",u.style.height="100%",u.style.display="block",u}function Vt(u){const{worldId:m,entry:h,layer:P,canvas:c,game:w,mounted:l,store:J,onFirstFrame:M}=u,x=vt({history:J.shell.projectHistory}),I=new ot(l.substrate.root,J,{canvas:c,api:l.substrate.api,persistence:x,journal:Me(m),provenance:{source:"source-code",label:"babylon",detail:"Native Babylon.js scene graph; imperative edits write to the construction site in the game’s own source."}});let O=w.systemAdapters;de(O);const k=w.subscribeSystemAdapters?.(()=>{O=w.systemAdapters,ke(O),J.shell.notifyIngestEdit()}),D=()=>{const $=P.getBoundingClientRect();$.width>0&&$.height>0&&l.resize?.($.width,$.height)},L=new ResizeObserver(D);L.observe(P),D();let p=!1,A=!1,y=0;const j=()=>{if(y=requestAnimationFrame(j),!p)try{l.update?.(0),A||(A=!0,M?.())}catch($){cancelAnimationFrame(y),q.error(`[babylon-design] world "${m}" failed to render: ${String($)}`,"authoring")}};return y=requestAnimationFrame(j),q.log(`[babylon-design] world "${m}" mounted as a native Babylon Scene (${h})`,"authoring"),{adapter:I,dispose(){p=!0,cancelAnimationFrame(y),L.disconnect(),I.dispose(),k?.(),de(null),l.dispose(),c.remove(),w.dispose()}}}const _e=new WeakSet;async function Hn(u,m,h,P,c,w,l){if(!m)throw new Error(`canvas root "${u}": no \`entry\` declared — nothing to mount.`);const M=await(await $t(P,et())).loadEntryModule(m,u,"canvas"),x=xt(u,M),I=St(u,M,"canvas"),O=await yt(M,u);if(!O)throw new Error(`canvas root "${u}": entry module "${m}" must default-export a React component (\`export default function World() { … }\`) — or export an \`adapter\` for full control.`);const k=rt(),D=k?.config.resolution?.width??Re.width,L=k?.config.resolution?.height??Re.height,p=w??nt,A=It();h.appendChild(A);const y=Nt(),j={canvas:A,width:D,height:L,game:y,headless:!1,transparent:!0,preserveDrawingBuffer:!0};let $,F;try{$=await gt(async g=>{const b=await O.mount(j);return F=g[0],b})}catch(g){throw A.remove(),y.dispose(),g}if(Ot(y,O,$,{id:u}),Pt(y,x?[x]:[]),Ct(y,I?[I]:[]),$.substrate.name==="babylon")return Vt({worldId:u,entry:m,layer:h,canvas:A,game:y,mounted:$,store:c,onFirstFrame:l});if($.substrate.name!=="pixi")throw $.dispose(),A.remove(),y.dispose(),new Error(`canvas root "${u}" mounted undeclared editor substrate "${$.substrate.name}" — declare pixi or babylon and provide its authoring adapter.`);const V=$.substrate.root,R=await bt();F===void 0&&q.error(`[canvas-design] world "${u}" mounted, but its Pixi Application was never handed to the design view (Pixi's \`__PIXI_APP_INIT__\` hook did not report one) — this Scene will render no frames at all. The world itself is fine; the editor cannot draw it.`,"authoring");let Z=y.systemAdapters;de(Z);const ie=y.subscribeSystemAdapters?.(()=>{Z=y.systemAdapters,ke(Z),c.shell.notifyIngestEdit()}),X=await tt(),Y=new it(V,c,{pixi:R,identity:at(u),journal:Me(u),target:Dt({worldId:u,entryPath:m,pixi:R,writeBackend:X}),surface:()=>A,capturePreview:(g,b)=>wt(g,{...b,pixi:R}),pointFromClient:(g,b,z)=>{const H=p.get();return{x:(g-z.left-H.x)/H.zoom,y:(b-z.top-H.y)/H.zoom}}}),ee=()=>{const g=h.getBoundingClientRect(),b=F?.renderer;b&&g.width>0&&g.height>0&&b.resize(g.width,g.height)},ae=new ResizeObserver(ee);ae.observe(h),ee();const te=()=>{const g=F?.renderer;if(!g)return!1;const b=h.getBoundingClientRect();b.width>0&&b.height>0&&(g.screen.width!==b.width||g.screen.height!==b.height)&&g.resize(b.width,b.height);const z=p.get();return g.render({container:V,transform:new R.Matrix(z.zoom,0,0,z.zoom,z.x,z.y)}),!0},ce=Bt(A,te);let W=0,ne=!1,le=!1;const re=()=>{if(W=requestAnimationFrame(re),!ne)try{te()&&!le&&(le=!0,l?.())}catch(g){cancelAnimationFrame(W),W=0,q.error(`[canvas-design] world "${u}" failed to render — the design view is frozen: ${String(g)}`,"authoring")}};W=requestAnimationFrame(re);const ue=_e.has(p);_e.add(p);const E=h.getBoundingClientRect();!ue&&E.width>0&&E.height>0&&p.setView(E.width/2,E.height/2,1);let G=0,U=0,Q=ue;const _=p.subscribe(()=>{Q=!0}),T=()=>{const g=h.getBoundingClientRect();return g.width<2||g.height<2?1:Math.max(1,Math.min((g.width-96)/D,(g.height-96)/L))},oe=()=>{if(Q||ne||U++>180)return;const g=V.getBounds();Ft(h,g,p,T())||(G=requestAnimationFrame(oe))};return G=requestAnimationFrame(oe),q.log(`[canvas-design] world "${u}" mounted for design-time authoring (${m})`,"authoring"),{adapter:Y,dispose(){ne=!0,cancelAnimationFrame(W),cancelAnimationFrame(G),_(),ae.disconnect(),ce(),Y.dispose(),ie?.(),de(null);try{$.dispose()}catch(g){q.error(`[canvas-design] dispose failed: ${String(g)}`,"authoring")}A.remove(),y.dispose()}}}export{Hn as mountCanvasDesignLayer};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-C3Pw-9So.js","assets/extend-Cc-nEa_A.js","assets/jsx-runtime-DPjLkJKQ.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-bQE2NA0D.js","assets/index-nmcBqr7Y.js","assets/index-D_NuPfjr.js","assets/index-SS9EugVg.js","assets/index-BRJMIUK0.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-0Lm0Nf1M.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{L as H,es as Y,_ as A}from"./index-BRJMIUK0.js";import{r as u}from"./index-nmcBqr7Y.js";import{g as q}from"./debug-registry-P0_YQGWd.js";import"./jsx-runtime-DPjLkJKQ.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-D_NuPfjr.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";const _=1e4,T=new WeakSet;function G(e){if(e===null||typeof e!="object")return!1;const r=e;return typeof r.id=="string"&&r.id.length>0&&typeof r.mount=="function"}function J(e,r,n){const{createElement:o,Fragment:F,useEffect:O,useLayoutEffect:C,createRoot:b,extend:D}=n,M=o(r);return{id:e,async mount(i){const m=i.game?q(i.game):null,c=i.canvas;if(T.has(c))throw new Error(`canvas world "${e}": this lane has already mounted this canvas. @pixi/react keys its reconciler roots off the canvas element, so re-using one would resurrect a root whose Application is destroyed. Hand each mount a fresh canvas (every vgai host already does).`);T.add(c),D(n.pixi);let p;const S=new Promise(t=>{p=t});let E;const $=new Promise(t=>{E=t});let v;const I=new Promise(t=>{v=t});let y;const U=new Promise(t=>{y=t});function N(){return C(()=>(p(),v),[]),O(()=>(E(),y),[]),null}const V=o(F,null,M,o(N)),g=b(c),h={antialias:!0,width:i.width,height:i.height,resolution:i.dpr??globalThis.devicePixelRatio??1,autoDensity:!0,backgroundAlpha:i.transparent?0:1,preserveDrawingBuffer:i.preserveDrawingBuffer??!1,autoStart:!1,sharedTicker:!1};let w;const j=new Promise(t=>{w=t}),x=t=>{w(`the Pixi tree crashed before its first commit — ${t.message} (mount() fails loudly instead of hanging)`)};globalThis.addEventListener?.("error",x);let l,d;try{l=await g.render(V,h);const f=new Promise(B=>{d=setTimeout(()=>B(`no first commit within ${_/1e3}s (mount() fails loudly instead of hanging)`),_)}),P=await Promise.race([Promise.all([S,$]).then(()=>null),j,f]);if(P!==null)throw new Error(`canvas world "${e}": ${P}`)}catch(t){try{l?.destroy(!1,{children:!0})}catch{}throw t}finally{d!==void 0&&clearTimeout(d),globalThis.removeEventListener?.("error",x)}if(l===void 0)throw new Error(`canvas world "${e}": initialized without an Application`);const a=l;a.ticker.lastTime=0;let R=0,s=!1;const W=m?{debug:m.adapter}:{},z=Promise.all([I,U]).then(()=>{s=!0,a.destroy(!1,{children:!0})});return{kind:"canvas",canvas:c,substrate:{name:"pixi",root:a.stage},drivesOwnLoop:!1,systems:W,disposeComplete:z,update(t){s||(R+=t*1e3,a.ticker.update(R))},resize(t,f){s||a.renderer.resize(t,f)},dispose(){s||(s=!0,a.renderer.events.setTargetElement(null),g.render(null,h))}}}}}function K(e,r,n){const o=e;return G(o?.adapter)?o.adapter:typeof o?.default=="function"?J(r,o.default,n):null}let L=null;const Q=["createElement","Fragment","useEffect","useLayoutEffect","createPixiRoot","extendPixi","projectPixi"];async function X(){const e=await import(Y),r=Q.filter(n=>e[n]===void 0||e[n]===null);if(r.length>0)throw new Error(`The packaged runtime's synthetic canvas module did not export ${r.join(", ")} — see CANVAS_DOORWAY in vite-plugin-module-doorways.ts.`);return{createElement:e.createElement,Fragment:e.Fragment,useEffect:e.useEffect,useLayoutEffect:e.useLayoutEffect,createRoot:e.createPixiRoot,extend:e.extendPixi,pixi:e.projectPixi}}async function Z(){const[e,r]=await Promise.all([A(()=>import("./index-C3Pw-9So.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])),A(()=>import("./index-SS9EugVg.js").then(n=>n.s),__vite__mapDeps([7,8,5,3,6,2,9,10,11,12,13]))]);return{createElement:u.createElement,Fragment:u.Fragment,useEffect:u.useEffect,useLayoutEffect:u.useLayoutEffect,createRoot:e.createRoot,extend:e.extend,pixi:r}}async function k(){return L??=(async()=>await H()?X():Z())(),L}async function ue(){return(await k()).pixi}async function de(e,r){return K(e,r,await k())}export{de as resolveCanvasEntryAdapterForEditor,ue as resolveCanvasPixiForEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as o,b as a,u as l,c as u}from"./fork-menu-DpKqRhF5.js";import{fo as c,av as s,fp as p,fq as m,fr as g,fs as I}from"./index-BRJMIUK0.js";import"./instance-fork-actions-D3sRzS3K.js";import"./editor-shell-store-ChLcVeNB.js";import"./output-pass-HurwNl0G.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./Pass-D1MRT672.js";import"./editor-layers-BDJnAAzj.js";import"./workspace-arrangement-BdAlBwvd.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"./user-data-Bpj7diUS.js";import"./entity-object-JmYMfLsx.js";import"./three-contract-Dkt6PmWY.js";const f="Reveal Internals",E="Hide Internals";function i(n,e){const t=n;return typeof t.hasInternals!="function"||!t.hasInternals(e)||p(t,m()).isInternal(e)?null:{label:I(e)?E:f,toggle:()=>{g(e)}}}let r=null;function R(){r||(r=c(({nodeId:n,store:e})=>i(s(e),n)!==null,({nodeId:n,store:e})=>{const t=i(s(e),n);return t?[{label:t.label,action:()=>{t.toggle(),e.notifyIngestEdit()}}]:[]}))}function v(){r?.(),r=null}const V="workspace.service";function z(){return o(),a(),R(),()=>{l(),u(),v()}}export{V as point,z as start};
|