@volter/game-editor 0.5.79 → 0.5.80

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.
Files changed (294) hide show
  1. package/BUNDLED_NOTICES +22 -22
  2. package/catalog/entries/blender.json +2 -2
  3. package/catalog/entries/music.json +2 -2
  4. package/dist/.vite/manifest.json +2123 -2123
  5. package/dist/assets/{AssetBudgetPanel-oKdjrwih.js → AssetBudgetPanel-C-RNso12.js} +3 -3
  6. package/dist/assets/{AudioViewer-B1k9_wIO.js → AudioViewer-BQ4yQJmw.js} +1 -1
  7. package/dist/assets/{CanvasBoardDocument-CidIZfJc.js → CanvasBoardDocument-D1_2Ahx7.js} +1 -1
  8. package/dist/assets/{CanvasSceneViewport-D-a2OjoE.js → CanvasSceneViewport-BdHcsAyR.js} +1 -1
  9. package/dist/assets/{ColorInput-CsU6nBCb.js → ColorInput-B-GRGKwB.js} +1 -1
  10. package/dist/assets/{EntityModelDocument-BGtt8kn8.js → EntityModelDocument-BkRbfE7C.js} +1 -1
  11. package/dist/assets/{EnvironmentAssetDocument-Cv_9BvF0.js → EnvironmentAssetDocument-BbWPrmTc.js} +1 -1
  12. package/dist/assets/{GameplaySessionTimeline-c77A4RAA.js → GameplaySessionTimeline-Bi_Z_lDm.js} +1 -1
  13. package/dist/assets/{ImageViewer-BpjPWpIS.js → ImageViewer-CVYDgTSj.js} +1 -1
  14. package/dist/assets/InspectorObjectPreview-BooanIbq.js +1 -0
  15. package/dist/assets/{JsonAssetDocument-BPN3E7Ai.js → JsonAssetDocument-O-o1eVJB.js} +1 -1
  16. package/dist/assets/{LiveModuleDocument-CqN29siR.js → LiveModuleDocument-CCpe63vw.js} +1 -1
  17. package/dist/assets/{LutAssetDocument-BV6N2-qQ.js → LutAssetDocument-C_QGvjj7.js} +1 -1
  18. package/dist/assets/{ModelAssetDocument-Bf5JZ8TF.js → ModelAssetDocument-DKyxph4r.js} +1 -1
  19. package/dist/assets/{NonThreeAuthoringBootstrap-CZvbouNB.js → NonThreeAuthoringBootstrap-DkfIBzMs.js} +1 -1
  20. package/dist/assets/{Object3DDocumentToolbar-Cm4ma8tv.js → Object3DDocumentToolbar-BGkgzg_Y.js} +1 -1
  21. package/dist/assets/Object3DDocumentViewport-C81c8PFJ.js +2 -0
  22. package/dist/assets/{Object3DPreview-BlzCte35.js → Object3DPreview-DI7aoPKe.js} +1 -1
  23. package/dist/assets/{OnlineAssetDetail-DaIvao3s.js → OnlineAssetDetail-BIRXvQsJ.js} +1 -1
  24. package/dist/assets/{PlayBar-DJ1LfrgS.js → PlayBar-BYVJHvd5.js} +1 -1
  25. package/dist/assets/{QuarksAssetDocument-DcjHKYru.js → QuarksAssetDocument-DEcSmewA.js} +1 -1
  26. package/dist/assets/{ReactCanvasControls-DSwW_3qn.js → ReactCanvasControls-DplBODky.js} +1 -1
  27. package/dist/assets/{RootSelectionOverlay-QJRz70Z_.js → RootSelectionOverlay-BzEZwAaO.js} +1 -1
  28. package/dist/assets/{ShaderAssetDocument-BCAyVHUs.js → ShaderAssetDocument-ysUJR4Np.js} +1 -1
  29. package/dist/assets/{ShadowEditor-ChBlM7up.js → ShadowEditor-BKz_sq1R.js} +1 -1
  30. package/dist/assets/{SourceAssetViewer-t8M_wt4P.js → SourceAssetViewer-DhoQonvP.js} +1 -1
  31. package/dist/assets/{StageHost-BToQY05P.js → StageHost-CSw286Im.js} +2 -2
  32. package/dist/assets/{StoryPreviewMount-DQQUiOyt.js → StoryPreviewMount-BF6vqmhx.js} +1 -1
  33. package/dist/assets/{ThreeBoardDocument-B0E8STg7.js → ThreeBoardDocument-vedTeiN9.js} +2 -2
  34. package/dist/assets/{ThreeIsolationSceneContent-C5fELwmY.js → ThreeIsolationSceneContent-TT4T-ehp.js} +1 -1
  35. package/dist/assets/{ToolObject3DPreview-COEdg5Yk.js → ToolObject3DPreview-C52QCJAO.js} +1 -1
  36. package/dist/assets/{Toolbar-Dc2590c_.js → Toolbar-Bo-l61Lo.js} +1 -1
  37. package/dist/assets/{TransientHint-Ck6-tCTl.js → TransientHint-DFAcEEFI.js} +1 -1
  38. package/dist/assets/{VideoViewer-Ceo0o85u.js → VideoViewer-BM_9gSgl.js} +1 -1
  39. package/dist/assets/{ViewportShadingMenu-pE6Hv73N.js → ViewportShadingMenu-CWutLX1G.js} +1 -1
  40. package/dist/assets/{active-ingest-DIgBJBWV.js → active-ingest-BuNeO4Mb.js} +2 -2
  41. package/dist/assets/{animation-clock-BsTiJqzv.js → animation-clock-B-fl-HTL.js} +1 -1
  42. package/dist/assets/{animation-mixers.service-DZMXEUKZ.js → animation-mixers.service-DgxB7R_k.js} +1 -1
  43. package/dist/assets/{animation-timeline.utility-C1kYhS_b.js → animation-timeline.utility-RWwRwQvM.js} +1 -1
  44. package/dist/assets/{asset-budget-asset.menu-CgLl0jxU.js → asset-budget-asset.menu-D2Tdwqxf.js} +1 -1
  45. package/dist/assets/{asset-budget.action-BM9nPYFm.js → asset-budget.action-WMiFAlTi.js} +1 -1
  46. package/dist/assets/{asset-budget.document-CIBwqW8O.js → asset-budget.document-CckPEzno.js} +1 -1
  47. package/dist/assets/{asset-budget.menu-CIYQlzVL.js → asset-budget.menu-DPMPOTSo.js} +1 -1
  48. package/dist/assets/{asset-editor-persistence-FoI6VqbB.js → asset-editor-persistence-DttxUta0.js} +1 -1
  49. package/dist/assets/{asset-loaders-DIhOedSj.js → asset-loaders-9M6lxMew.js} +1 -1
  50. package/dist/assets/{asset-preview-J56EM7ai.js → asset-preview-C36PaXvM.js} +1 -1
  51. package/dist/assets/{audio-unlock.service-CQhkc6fU.js → audio-unlock.service-BeHFOKOB.js} +1 -1
  52. package/dist/assets/{audio.utility-ZTVc6wlz.js → audio.utility-HRjVG-Co.js} +1 -1
  53. package/dist/assets/autoplay.service-EjNkSGFD.js +1 -0
  54. package/dist/assets/{babylon-authoring-adapter-qU-GP8QL.js → babylon-authoring-adapter-BHQY7yIy.js} +1 -1
  55. package/dist/assets/{binding-resolver-iMKdp_Dm.js → binding-resolver-TD7-fKuX.js} +2 -2
  56. package/dist/assets/{blender-node-editor.document-BktVlaBT.js → blender-node-editor.document-Bw2QbNTV.js} +1 -1
  57. package/dist/assets/{blender-properties-tab-Bi7EkqZ4.js → blender-properties-tab-BnIbJN4f.js} +1 -1
  58. package/dist/assets/blender-runtime-host-W_QVh8pY.js +4 -0
  59. package/dist/assets/{blender-runtime-skin-DGPSGVTB.js → blender-runtime-skin-CwXXiusi.js} +1 -1
  60. package/dist/assets/blender-runtime.document-CxTCG8RI.js +12 -0
  61. package/dist/assets/{blender-timeline.document-BdKv86rL.js → blender-timeline.document-CESN0FrA.js} +1 -1
  62. package/dist/assets/{blender-uv-editor.document-B8KDPYF0.js → blender-uv-editor.document-BdIUMC5X.js} +1 -1
  63. package/dist/assets/{blender-version.status-Tujyesw9.js → blender-version.status-CBKgGtQ0.js} +1 -1
  64. package/dist/assets/{blender.command-0Er75bJF.js → blender.command-ChUV_DJE.js} +1 -1
  65. package/dist/assets/{board-guides-BvzDdD2y.js → board-guides-ClHJXXuu.js} +1 -1
  66. package/dist/assets/{bridge.command-CRyms6ax.js → bridge.command-DK8zE8yt.js} +3 -3
  67. package/dist/assets/{browserAll-DUlxC8yY.js → browserAll-Be-P25YM.js} +1 -1
  68. package/dist/assets/{build-player.document-BuFNx_-Q.js → build-player.document-Clkf52m6.js} +1 -1
  69. package/dist/assets/{build-profiles.document-xu8oCc9h.js → build-profiles.document-CNZvcPor.js} +1 -1
  70. package/dist/assets/{build-progress.status-BPDoYt8o.js → build-progress.status-BMfffkUW.js} +1 -1
  71. package/dist/assets/{build-session-BrAG7tBV.js → build-session-BHUOWzok.js} +1 -1
  72. package/dist/assets/{build.action-CCppyLBx.js → build.action-BGriOSGD.js} +1 -1
  73. package/dist/assets/{build.command-Inptj7R-.js → build.command-BU7Wcsn5.js} +1 -1
  74. package/dist/assets/{build.header-DXGyFt56.js → build.header-B6KRt0O_.js} +1 -1
  75. package/dist/assets/{build.menu-8VNdh6Kh.js → build.menu-CpxN2aww.js} +1 -1
  76. package/dist/assets/{build.service-B98j6yu1.js → build.service-LRCZ0vL7.js} +1 -1
  77. package/dist/assets/{camera-PuR5cfKw.js → camera-D8fxcMUB.js} +1 -1
  78. package/dist/assets/{camera-runtime.inspector-DuLoTNGH.js → camera-runtime.inspector-5RS6wvw2.js} +1 -1
  79. package/dist/assets/{canvas-design-mount-DFvmQJTh.js → canvas-design-mount-CoKGVZii.js} +3 -3
  80. package/dist/assets/{canvas-entry-runtime-BVnhMBaW.js → canvas-entry-runtime-Do5zL9dN.js} +2 -2
  81. package/dist/assets/{canvas-preview-frames-C-dFTVWu.js → canvas-preview-frames-Jsd4Gi5S.js} +1 -1
  82. package/dist/assets/{canvas-story-capture.service-Bg4fphDj.js → canvas-story-capture.service-0SYz8LrL.js} +2 -2
  83. package/dist/assets/{capability-coverage-B0oT2N3Z.js → capability-coverage-BqCZSu0R.js} +1 -1
  84. package/dist/assets/{collaboration-presence-CP5gEnxY.js → collaboration-presence-WWC9ZQsq.js} +1 -1
  85. package/dist/assets/{collider-DrfGXvUO.js → collider-DsdfCyWG.js} +1 -1
  86. package/dist/assets/{component-board.service-mzEFwa--.js → component-board.service-6JDsY08Z.js} +2 -2
  87. package/dist/assets/{component-board.service-MhNc_Ru3.js → component-board.service-DZWOfhbB.js} +2 -2
  88. package/dist/assets/{component-board.service-CvEW_Te9.js → component-board.service-Dj_INzxs.js} +2 -2
  89. package/dist/assets/{component-contracts.service-zrpqDXgQ.js → component-contracts.service-DXfwve-4.js} +1 -1
  90. package/dist/assets/{component-instance-root-BpMFxtbQ.js → component-instance-root-pq7uyyej.js} +1 -1
  91. package/dist/assets/{component-verbs.command-8Kl0HNWX.js → component-verbs.command-Cd_-gQ-Z.js} +1 -1
  92. package/dist/assets/{component-verbs.service-CxZFYomt.js → component-verbs.service-Do8eBA--.js} +1 -1
  93. package/dist/assets/{config-BKyBW2FV.js → config-CnqnR-iz.js} +2 -2
  94. package/dist/assets/{configurations-B391DE84.js → configurations-DFYaoXBK.js} +1 -1
  95. package/dist/assets/{connection.status-CDK2Dxmh.js → connection.status-BkhMFG12.js} +1 -1
  96. package/dist/assets/{constraints.inspector-BvDktIDy.js → constraints.inspector-CPWFDlY8.js} +1 -1
  97. package/dist/assets/{content-bounds-BM2BJV41.js → content-bounds-Ax7CFkXJ.js} +1 -1
  98. package/dist/assets/{contract-system-adapters-Dv5mUMr_.js → contract-system-adapters-0Odxcy6d.js} +1 -1
  99. package/dist/assets/{coverage.service-BLbBH9i2.js → coverage.service-CcKdk7iJ.js} +1 -1
  100. package/dist/assets/{create-runtime-BvzMRqkg.js → create-runtime-BhdSylT1.js} +1 -1
  101. package/dist/assets/{curve-BbX4M8ka.js → curve-DiuqWf0-.js} +1 -1
  102. package/dist/assets/{data-asset-DEfrCU5L.js → data-asset-BiqUYQnI.js} +1 -1
  103. package/dist/assets/{data-ref-CwypqVYb.js → data-ref-mo1ecq_T.js} +1 -1
  104. package/dist/assets/{debug-bridge-B3ag_ARb.js → debug-bridge-BN4INYe7.js} +1 -1
  105. package/dist/assets/{debug-registry-DlrL6r1z.js → debug-registry-BW5cue8V.js} +1 -1
  106. package/dist/assets/{deferred-ingest-play-tx7qVcg3.js → deferred-ingest-play-C6qytzjB.js} +2 -2
  107. package/dist/assets/{design-time-canvas-mount-L1S8lY0u.js → design-time-canvas-mount-mhxQlHHP.js} +2 -2
  108. package/dist/assets/{design-time-layers-DxZgHWM2.js → design-time-layers-CCEX-9ul.js} +1 -1
  109. package/dist/assets/{design-time-mount.service-Bo9K8hZb.js → design-time-mount.service-Cs_mT_-d.js} +2 -2
  110. package/dist/assets/{design-time-mount.service-DVYJJr4l.js → design-time-mount.service-DPEpO4ny.js} +2 -2
  111. package/dist/assets/{design-time-react-mount-Cw_YU4iA.js → design-time-react-mount-RdZmD9Dp.js} +1 -1
  112. package/dist/assets/{document-preview-three-BS7op9Kh.js → document-preview-three-D4M5qFH3.js} +1 -1
  113. package/dist/assets/{dom-authoring-adapter-DeVD6HLk.js → dom-authoring-adapter-B97hwEwz.js} +1 -1
  114. package/dist/assets/{draco3d-_8eRv2Qk.js → draco3d-B_PtVdzj.js} +1 -1
  115. package/dist/assets/{edit-mode-audio.service-BO6CbCXN.js → edit-mode-audio.service-BZxbnyf-.js} +1 -1
  116. package/dist/assets/{edit-mode-authoring-RAf4S6PI.js → edit-mode-authoring-CVKwIPOy.js} +1 -1
  117. package/dist/assets/{edit-mode-networking.service-QiUNWbxh.js → edit-mode-networking.service-2aXyBwkO.js} +1 -1
  118. package/dist/assets/{editor-api-B_UrHHhL.js → editor-api-B0aNu3G5.js} +1 -1
  119. package/dist/assets/{editor-layers-C47WUNtv.js → editor-layers-DI1Wkr8F.js} +1 -1
  120. package/dist/assets/{editor-shell-store-B-64vpgA.js → editor-shell-store-DlGykD-E.js} +1 -1
  121. package/dist/assets/{entity-object-DBXB7ABG.js → entity-object-C374JqRs.js} +1 -1
  122. package/dist/assets/{extend-hLINO4Zy.js → extend-BOaYynPp.js} +1 -1
  123. package/dist/assets/{fork-menu-BWis777M.js → fork-menu-DGjsgL8L.js} +1 -1
  124. package/dist/assets/{frame-debugger-store-CiuSELDU.js → frame-debugger-store-Czy2FTqO.js} +1 -1
  125. package/dist/assets/{game-contract-seams-D4x_QFfy.js → game-contract-seams-GoIZaA0s.js} +1 -1
  126. package/dist/assets/{game-css-scope-transform-BFCy45PO.js → game-css-scope-transform-9t97Smqk.js} +1 -1
  127. package/dist/assets/{game-document.service-LgRTA5er.js → game-document.service-DBSsz8Ne.js} +1 -1
  128. package/dist/assets/{game-eval.command-i4tbTEzA.js → game-eval.command-BYEEWjUv.js} +1 -1
  129. package/dist/assets/{game-module-access-CmfN4vfG.js → game-module-access-BqevF7uR.js} +1 -1
  130. package/dist/assets/{game-network-Bs_aLrfo.js → game-network-DtzKFtge.js} +3 -3
  131. package/dist/assets/{gameplay-export-DMycxmRI.js → gameplay-export-BNVUERuW.js} +1 -1
  132. package/dist/assets/{gameplay-replay-CQwJHBcQ.js → gameplay-replay-DEKg9ROx.js} +1 -1
  133. package/dist/assets/{gameplay.command-DwbIk4qS.js → gameplay.command-BrleMyQK.js} +1 -1
  134. package/dist/assets/{generation-jobs-DHR06-Ow.js → generation-jobs-Bmm6k_GH.js} +1 -1
  135. package/dist/assets/{generation.service-C3sjmS56.js → generation.service-nVpgwKEB.js} +1 -1
  136. package/dist/assets/{generations-QDWWr3sT.js → generations-AU4LkWAl.js} +1 -1
  137. package/dist/assets/{generations.status-8UpzzSN6.js → generations.status-CSeb5inI.js} +1 -1
  138. package/dist/assets/{hierarchy-marks-DDRF3quV.js → hierarchy-marks-EEQa08In.js} +1 -1
  139. package/dist/assets/{hosted-asset-materialization-DFetjs7r.js → hosted-asset-materialization-DZlaRGkJ.js} +1 -1
  140. package/dist/assets/{index-DL3yQMTk.js → index-BHccVo52.js} +2 -2
  141. package/dist/assets/{index-CUyoEnie.js → index-BpXj_ZfC.js} +1 -1
  142. package/dist/assets/{index-DZg4GXi0.js → index-CUBra63E.js} +1 -1
  143. package/dist/assets/{index-DxV6Akny.js → index-DlFjiZgV.js} +1 -1
  144. package/dist/assets/{index-DGgVCKlK.js → index-N4BP9b5x.js} +1 -1
  145. package/dist/assets/{index-CkpBXMDJ.js → index-OlF4eBxk.js} +1 -1
  146. package/dist/assets/{index-BlOoiZ_I.js → index-PKSmixoy.js} +1 -1
  147. package/dist/assets/{index-JjEYIC4G.js → index-flxMlfV4.js} +7 -7
  148. package/dist/assets/{index-Cdjg29qG.js → index-ynpEqujB.js} +1 -1
  149. package/dist/assets/{inference-diagnostics-kHRsQw1P.js → inference-diagnostics-MWqnRUsN.js} +1 -1
  150. package/dist/assets/{ingest-boot-viewport-BO7yl504.js → ingest-boot-viewport-CT1eaWqO.js} +1 -1
  151. package/dist/assets/{ingest-siblings-C-RhYsUb.js → ingest-siblings-BJ66Uen_.js} +1 -1
  152. package/dist/assets/{ingest-source-persistence-B52PvpPx.js → ingest-source-persistence-CJGE5-AU.js} +1 -1
  153. package/dist/assets/{ingest.service-CXx-aW-5.js → ingest.service-2TRoiqQ8.js} +1 -1
  154. package/dist/assets/{inspect-KwcXV5-u.js → inspect-Dl5bH02T.js} +1 -1
  155. package/dist/assets/instances.command-2QbcHvH-.js +1 -0
  156. package/dist/assets/{json-history-resource-B0kkSep8.js → json-history-resource-DTUpacfx.js} +1 -1
  157. package/dist/assets/{layered-pick-ClYksj6v.js → layered-pick-DKNj5L29.js} +1 -1
  158. package/dist/assets/{light-C33qOzVd.js → light-CX-83nBK.js} +1 -1
  159. package/dist/assets/{live-project-verbs-CIlCfET4.js → live-project-verbs-nmQ1saHI.js} +1 -1
  160. package/dist/assets/{machine.document-KKGimt_o.js → machine.document-DE8aRbOi.js} +1 -1
  161. package/dist/assets/{machines.finder-DA-qVsE-.js → machines.finder-CZ3P0odZ.js} +1 -1
  162. package/dist/assets/{material-BPlHfj-y.js → material-f1KOKE_r.js} +1 -1
  163. package/dist/assets/{material-factory-DIU9do_v.js → material-factory-DkCPSCLt.js} +1 -1
  164. package/dist/assets/{mesh-D3gE3KD_.js → mesh-DM3TH9xS.js} +1 -1
  165. package/dist/assets/{model-asset-sections.service-HoRKwaP6.js → model-asset-sections.service-CL4Rlwvc.js} +1 -1
  166. package/dist/assets/{model-inspection-BMy0MuzJ.js → model-inspection-BS3uYvYU.js} +1 -1
  167. package/dist/assets/{model-thumbnail-ICdHSiW1.js → model-thumbnail-WJb6B3qQ.js} +1 -1
  168. package/dist/assets/{models.finder-DvULfruZ.js → models.finder-BXJhCiw9.js} +1 -1
  169. package/dist/assets/{module-mode-BTXto0oj.js → module-mode-CtoVZDhp.js} +2 -2
  170. package/dist/assets/{mount-canvas-ingest-root-BFQfgTuE.js → mount-canvas-ingest-root-DI8iSEV4.js} +2 -2
  171. package/dist/assets/{mount-dom-ingest-root-C4Deoodh.js → mount-dom-ingest-root-n4tbYw-j.js} +2 -2
  172. package/dist/assets/{mount-ingest-root-BnX5FYpQ.js → mount-ingest-root-pyV6jEkB.js} +2 -2
  173. package/dist/assets/{mount-manifest-CK1RiS8E.js → mount-manifest-DsGMOkm4.js} +1 -1
  174. package/dist/assets/{mount-three-ingest-root-C6pYTH-h.js → mount-three-ingest-root-CeH_uOP0.js} +1 -1
  175. package/dist/assets/{mounted-authoring-BRmJcses.js → mounted-authoring-BHpx-z2Y.js} +1 -1
  176. package/dist/assets/{mounted-story-viewport-source-DghPnLY9.js → mounted-story-viewport-source-D8kOfa96.js} +1 -1
  177. package/dist/assets/{native-debug-module-ojTkP52T.js → native-debug-module-lR1oG4Vd.js} +1 -1
  178. package/dist/assets/{navigation-CTZYysxE.js → navigation-DvTw5hJ4.js} +1 -1
  179. package/dist/assets/{navmesh.menu-COJ77FTK.js → navmesh.menu-BaBNScgJ.js} +1 -1
  180. package/dist/assets/{navmesh.service-tVf8xf8f.js → navmesh.service-BK6BlOz3.js} +1 -1
  181. package/dist/assets/network-observer.service-CskzAy97.js +1 -0
  182. package/dist/assets/{network.utility-DNmrBkHK.js → network.utility-BJ3bZOCQ.js} +1 -1
  183. package/dist/assets/{object3d-document-session-registry-CIdYrDwO.js → object3d-document-session-registry-DI9WfJDy.js} +2 -2
  184. package/dist/assets/{oid-transform-BMGB2u8Z.js → oid-transform-RlofQ4tU.js} +1 -1
  185. package/dist/assets/{particles-CmcHZZqz.js → particles-CjR9Po6N.js} +1 -1
  186. package/dist/assets/{pixi-authoring-adapter-BLptyAwL.js → pixi-authoring-adapter-B_mXxWkJ.js} +1 -1
  187. package/dist/assets/{pixi-live-write-target-DMGlsQdL.js → pixi-live-write-target-tm5yHKss.js} +1 -1
  188. package/dist/assets/{play.command-D0aUzhnI.js → play.command-BmsyGtu0.js} +2 -2
  189. package/dist/assets/{presentation-BOKcaCle.js → presentation-gTgwItzD.js} +1 -1
  190. package/dist/assets/{product-DBhE7XzM.js → product-Cmel9X9k.js} +1 -1
  191. package/dist/assets/{profiler.action-DFPR0GaW.js → profiler.action-DSM2uSYR.js} +1 -1
  192. package/dist/assets/{profiler.menu-Cjq4IMjK.js → profiler.menu-CcYyqUfU.js} +1 -1
  193. package/dist/assets/{profiler.utility-O_BbyzQ6.js → profiler.utility-CQtqdQgC.js} +1 -1
  194. package/dist/assets/{project-authoring-session-Fg6BVKiU.js → project-authoring-session-BqZuntp2.js} +2 -2
  195. package/dist/assets/{properties-bone-constraints.inspector-Df8r9rGo.js → properties-bone-constraints.inspector-D3XrqptB.js} +1 -1
  196. package/dist/assets/{properties-bone.inspector-BHOmG-w_.js → properties-bone.inspector-CmVamAC6.js} +1 -1
  197. package/dist/assets/{properties-collection.inspector-COUpmMSs.js → properties-collection.inspector-BGi5eXmI.js} +1 -1
  198. package/dist/assets/{properties-constraints.inspector-DSDh4Uba.js → properties-constraints.inspector-C62EOuWg.js} +1 -1
  199. package/dist/assets/{properties-data.inspector-DjjFOVxW.js → properties-data.inspector-qDFtLdw8.js} +1 -1
  200. package/dist/assets/{properties-material.inspector-DPKY8b2v.js → properties-material.inspector-B--PD0se.js} +1 -1
  201. package/dist/assets/{properties-modifiers.inspector-BtNVTrKN.js → properties-modifiers.inspector-1tdk1EKp.js} +1 -1
  202. package/dist/assets/{properties-object.inspector-DYNpha7x.js → properties-object.inspector-CYH5w2un.js} +1 -1
  203. package/dist/assets/{properties-output.inspector-CBzwfSQQ.js → properties-output.inspector-C78QuVlY.js} +1 -1
  204. package/dist/assets/{properties-particles.inspector-5DlYLg0u.js → properties-particles.inspector-DyDiMjmC.js} +1 -1
  205. package/dist/assets/{properties-physics.inspector-D__Z169g.js → properties-physics.inspector-DG5GOyLE.js} +1 -1
  206. package/dist/assets/{properties-render.inspector-Dvnehd8j.js → properties-render.inspector-D8ldGTdq.js} +1 -1
  207. package/dist/assets/{properties-scene.inspector-DxGBiL_G.js → properties-scene.inspector-Cf_KBWbv.js} +1 -1
  208. package/dist/assets/{properties-texture.inspector-5qsUhAvc.js → properties-texture.inspector-BznU5kNc.js} +1 -1
  209. package/dist/assets/{properties-view-layer.inspector-BHv0B73V.js → properties-view-layer.inspector-pnRv91FS.js} +1 -1
  210. package/dist/assets/{properties-world.inspector-D53Cc2Fs.js → properties-world.inspector-CzUtvYuC.js} +1 -1
  211. package/dist/assets/{r3f-design-session-BhddL1e6.js → r3f-design-session-Dwqxg13i.js} +2 -2
  212. package/dist/assets/{r3f-physics-binding-D41qQnHD.js → r3f-physics-binding-D6DKTgwF.js} +1 -1
  213. package/dist/assets/{r3f-source-authoring-adapter-ZnrWHj5Z.js → r3f-source-authoring-adapter-nqn_PR3m.js} +1 -1
  214. package/dist/assets/{react-canvas-navigation-DFspvY8K.js → react-canvas-navigation-WxI8Mxyc.js} +1 -1
  215. package/dist/assets/{react-inspector.service-Co5AHjHR.js → react-inspector.service-C1Prvq6u.js} +1 -1
  216. package/dist/assets/{react-story-board--jvx8x-C.js → react-story-board-BRUE9hN1.js} +1 -1
  217. package/dist/assets/{react-three-rapier.esm-BS-6eWKp.js → react-three-rapier.esm-CA7vFsM3.js} +1 -1
  218. package/dist/assets/{react-world-authoring-adapter-CKQ-MAMv.js → react-world-authoring-adapter-DVNps-az.js} +1 -1
  219. package/dist/assets/{realm-services-DUEIrJNn.js → realm-services-CL4ih5gp.js} +1 -1
  220. package/dist/assets/{reflection-probe-capture.inspector-gO0DwTZj.js → reflection-probe-capture.inspector-C9mzBLI7.js} +1 -1
  221. package/dist/assets/{registry-ofLrf5fa.js → registry-N8Uqh2X-.js} +1 -1
  222. package/dist/assets/{relative-import-specifier-B_Awfdrr.js → relative-import-specifier-cRtWQWmH.js} +1 -1
  223. package/dist/assets/{render-env-a1pPDP-U.js → render-env-xu-q_sLG.js} +1 -1
  224. package/dist/assets/{render-features-CY3KFNVc.js → render-features-BMOBYkLQ.js} +1 -1
  225. package/dist/assets/{render-settings-DgCYPHgH.js → render-settings-Cnd69vhe.js} +1 -1
  226. package/dist/assets/{resolve-three-fhgJb0Jd.js → resolve-three-C9OlnFHx.js} +3 -3
  227. package/dist/assets/{root-seam-contract-D3r4vEIL.js → root-seam-contract-BoD0NaOZ.js} +1 -1
  228. package/dist/assets/{run-selection-DVvs9B9T.js → run-selection-DL0vJV6z.js} +1 -1
  229. package/dist/assets/{scene-capture-CCy--ncb.js → scene-capture-CoTN4qOO.js} +1 -1
  230. package/dist/assets/{scene-document.service-BCliVABQ.js → scene-document.service-kgtsh1r2.js} +2 -2
  231. package/dist/assets/{scene-framing-B1butaCp.js → scene-framing-CljHc6tN.js} +1 -1
  232. package/dist/assets/{seeded-random-J_tZuhc3.js → seeded-random-BlGWBUER.js} +1 -1
  233. package/dist/assets/{setup-renderer-DroW21zu.js → setup-renderer-jOQdnmo7.js} +1 -1
  234. package/dist/assets/{source-object3d-authoring-adapter-Bansi23s.js → source-object3d-authoring-adapter-qg_NN2PX.js} +1 -1
  235. package/dist/assets/{source-persistence-backend-B7_XGPrd.js → source-persistence-backend-DoNJeJa8.js} +1 -1
  236. package/dist/assets/{stage-keyboard-Cj5wm_J_.js → stage-keyboard-jfRYkBwZ.js} +1 -1
  237. package/dist/assets/{stage-overlay-set-CddoR5WV.js → stage-overlay-set-Bo-JC6N0.js} +1 -1
  238. package/dist/assets/{stage-presence-markers-B7ikfK7I.js → stage-presence-markers-Bu9mH0m_.js} +1 -1
  239. package/dist/assets/{stage-transform-tools-C9-7W51Q.js → stage-transform-tools-CSnDpsY3.js} +1 -1
  240. package/dist/assets/{standard-viewport-dressing-BYqJ1RDj.js → standard-viewport-dressing-B8VpmbHt.js} +1 -1
  241. package/dist/assets/{state-watch.action-Ckl-KiOu.js → state-watch.action-Dhb9xQb9.js} +1 -1
  242. package/dist/assets/{state-watch.menu-Bua5sNDD.js → state-watch.menu-xf7oO-4l.js} +1 -1
  243. package/dist/assets/{state-watch.utility-LIkpnIYo.js → state-watch.utility-DnGO08TW.js} +1 -1
  244. package/dist/assets/{story-capture-DRezN8hO.js → story-capture-CyeAHem-.js} +1 -1
  245. package/dist/assets/{story-documents-QsOjjFN1.js → story-documents-DUm0LUTp.js} +1 -1
  246. package/dist/assets/{story-documents.service-BBcpnJqG.js → story-documents.service-BWBSUjBO.js} +1 -1
  247. package/dist/assets/{story-documents.service-s45WvtSH.js → story-documents.service-DOvAnwES.js} +1 -1
  248. package/dist/assets/{story-media-presence-D3jBkjoV.js → story-media-presence-7Tbl7-hO.js} +1 -1
  249. package/dist/assets/{story-pixi-preview-DR9Z3mjx.js → story-pixi-preview-DHtzdru2.js} +1 -1
  250. package/dist/assets/{story-presentation-BanrEcxs.js → story-presentation-BpfNrI6t.js} +1 -1
  251. package/dist/assets/{story-three-preview-Cc12jMw-.js → story-three-preview-pzhR44fH.js} +2 -2
  252. package/dist/assets/{studio-environment-D3HaysRE.js → studio-environment-Dw2FBct5.js} +1 -1
  253. package/dist/assets/{surface-state-DgY1sYF4.js → surface-state-NwiDDkWI.js} +1 -1
  254. package/dist/assets/{syntactic-prop-specs-CBGAFjrQ.js → syntactic-prop-specs-_Yk2QtpW.js} +1 -1
  255. package/dist/assets/{team-playtest.service-z2r_7CUE.js → team-playtest.service-DdUlOcrk.js} +1 -1
  256. package/dist/assets/{three-CqcAlmZt.js → three-2yjp9YMj.js} +1 -1
  257. package/dist/assets/{three-authoring-adapter-D-dP-DRa.js → three-authoring-adapter-B5h6dxvp.js} +1 -1
  258. package/dist/assets/three-authoring.service-CIVEDuMV.js +2 -0
  259. package/dist/assets/{three-ingest-runtime-BOYUnvJa.js → three-ingest-runtime-B9surImB.js} +1 -1
  260. package/dist/assets/{three-integration-BKGFte0g.js → three-integration-K2zwKa-Z.js} +2 -2
  261. package/dist/assets/three-integration.service-kjZ0g0er.js +1 -0
  262. package/dist/assets/{three-projection-core-CMYaSPZP.js → three-projection-core-xgnaC08N.js} +1 -1
  263. package/dist/assets/{three-state-Bs6NttX2.js → three-state-DVnNjIbQ.js} +1 -1
  264. package/dist/assets/{three-story-capture.service-CV7CaGFK.js → three-story-capture.service-DgVUrOW6.js} +2 -2
  265. package/dist/assets/{three-story-model-DMsHWVLi.js → three-story-model-B0qnMa7M.js} +1 -1
  266. package/dist/assets/{three-viewport-presentation-D8F-c141.js → three-viewport-presentation-C5wGhMgD.js} +1 -1
  267. package/dist/assets/{transform-mode-request-nAOkjL7J.js → transform-mode-request-COfeHSRX.js} +1 -1
  268. package/dist/assets/{transport-strip-Do5Y5zz_.js → transport-strip-Dvkyjqwq.js} +1 -1
  269. package/dist/assets/transport.header-CFTM9Q_n.js +1 -0
  270. package/dist/assets/{tuples-T3njUS_v.js → tuples-tlEYpiUU.js} +1 -1
  271. package/dist/assets/{ui-board-document-Dix9rYE-.js → ui-board-document-BlKR5Cyh.js} +2 -2
  272. package/dist/assets/{user-data-DcUoY-0j.js → user-data-C8dmlLGA.js} +1 -1
  273. package/dist/assets/{utility-view-state-BUR2tvAo.js → utility-view-state-8ikycS0_.js} +1 -1
  274. package/dist/assets/{viewport-door-Ct3Jwvkd.js → viewport-door-Brt6-rPp.js} +1 -1
  275. package/dist/assets/{viewport-root-presentation-CM-p4xLg.js → viewport-root-presentation-DEm3C1-i.js} +1 -1
  276. package/dist/assets/{viewport-surface-status-BlPwrnIq.js → viewport-surface-status-Dbc5Yxun.js} +1 -1
  277. package/dist/assets/{webworkerAll-BbcMGhdJ.js → webworkerAll-qWuefF-u.js} +1 -1
  278. package/dist/assets/{workspace-arrangement-D7VBwv9F.js → workspace-arrangement-BnGzBm57.js} +1 -1
  279. package/dist/assets/{world-documents-g6lvzHMh.js → world-documents-DH7drgx-.js} +1 -1
  280. package/dist/assets/{world-root-stage-binding-DugyiNfT.js → world-root-stage-binding-DIigD-mK.js} +1 -1
  281. package/dist/assets/{xstate-animation-binding-Qdxeavj_.js → xstate-animation-binding-BpYb4mXT.js} +1 -1
  282. package/dist/assets/{xstate-animation-meta-CtUROKFq.js → xstate-animation-meta-0RXvMgDk.js} +1 -1
  283. package/dist-node/cli.js +16 -16
  284. package/package.json +16 -16
  285. package/dist/assets/InspectorObjectPreview-DA4bXZQD.js +0 -1
  286. package/dist/assets/Object3DDocumentViewport-BydKspxr.js +0 -2
  287. package/dist/assets/autoplay.service-CFbSU6Np.js +0 -1
  288. package/dist/assets/blender-runtime-host-Bw37aE1K.js +0 -4
  289. package/dist/assets/blender-runtime.document-DwlgMMor.js +0 -12
  290. package/dist/assets/instances.command--PqjYvLl.js +0 -1
  291. package/dist/assets/network-observer.service-DZtz0Y5F.js +0 -1
  292. package/dist/assets/three-authoring.service-BPzGC8dd.js +0 -2
  293. package/dist/assets/three-integration.service-InYYMues.js +0 -1
  294. package/dist/assets/transport.header-BhBKpJ9P.js +0 -1
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/spark.module-Byplgb8G.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/Pass-D1MRT672.js"])))=>i.map(i=>d[i]);
2
- import{_ as g}from"./index-JjEYIC4G.js";import{s as f}from"./user-data-DcUoY-0j.js";import{D as T,K as S,M as E}from"./KTX2Loader-CaqVE6nY.js";import{GLTFLoader as L}from"./GLTFLoader-KeoruJgS.js";import{cc as M,eX as v,fo as p,co as I,K as b}from"./three.core-3arARmh6.js";import{createStandardEnvironment as x}from"./environment-Dg-YaLsA.js";let D="/";function w(t){return t.startsWith("/")||t.startsWith("http")||t.startsWith("data:")||t.startsWith("blob:")?t:D+t}const r=new M;r.setURLModifier(w);new v(r);const h=new T(r);h.setDecoderPath("/jsm/libs/draco/gltf/");const _=new S(r);_.setTranscoderPath("/jsm/libs/basis/");const l=new L(r);l.setDRACOLoader(h);l.setKTX2Loader(_);l.setMeshoptDecoder(E);function N(t){return w(t)}const i=new Map;async function z(t,a){let e=i.get(t);!e&&a&&(e=Promise.resolve(a),i.set(t,e)),e||(e=fetch(N(t)).then(async s=>{if(!s.ok)throw new Error(`Failed to load Gaussian splat: ${t} (${s.status} ${s.statusText})`);return new Uint8Array(await s.arrayBuffer())}),i.set(t,e));try{const[{SplatMesh:s},u]=await Promise.all([g(()=>import("./spark.module-Byplgb8G.js"),__vite__mapDeps([0,1,2,3])),e]),o=new s({fileBytes:u,fileName:t,raycastable:!0});await o.initialized,f(o,"gaussianSplat",{src:t,numSplats:o.numSplats});const d=o.getBoundingBox();if(!d.isEmpty()){const m=d.getSize(new p).multiplyScalar(1.5),y=d.getCenter(new p),n=new I(new b(m.x,m.y,m.z));n.name="__volter_splat_bounds",n.position.copy(y),n.visible=!1,n.raycast=()=>{},f(n,"engineInternal",!0),o.add(n)}return o}catch(s){throw i.delete(t),s}}const O=.45,C=.25,c=new WeakMap;function K(t,a){let e=c.get(a);e||(e=x(a),c.set(a,e)),t.environment=e.texture,t.environmentIntensity=O}function V(t){const a=c.get(t);a&&(c.delete(t),a.dispose())}export{C as S,K as a,V as d,l as g,z as l,N as r};
2
+ import{_ as g}from"./index-flxMlfV4.js";import{s as f}from"./user-data-C8dmlLGA.js";import{D as T,K as S,M as E}from"./KTX2Loader-CaqVE6nY.js";import{GLTFLoader as L}from"./GLTFLoader-KeoruJgS.js";import{cc as M,eX as v,fo as p,co as I,K as b}from"./three.core-3arARmh6.js";import{createStandardEnvironment as x}from"./environment-Dg-YaLsA.js";let D="/";function w(t){return t.startsWith("/")||t.startsWith("http")||t.startsWith("data:")||t.startsWith("blob:")?t:D+t}const r=new M;r.setURLModifier(w);new v(r);const h=new T(r);h.setDecoderPath("/jsm/libs/draco/gltf/");const _=new S(r);_.setTranscoderPath("/jsm/libs/basis/");const l=new L(r);l.setDRACOLoader(h);l.setKTX2Loader(_);l.setMeshoptDecoder(E);function N(t){return w(t)}const i=new Map;async function z(t,a){let e=i.get(t);!e&&a&&(e=Promise.resolve(a),i.set(t,e)),e||(e=fetch(N(t)).then(async s=>{if(!s.ok)throw new Error(`Failed to load Gaussian splat: ${t} (${s.status} ${s.statusText})`);return new Uint8Array(await s.arrayBuffer())}),i.set(t,e));try{const[{SplatMesh:s},u]=await Promise.all([g(()=>import("./spark.module-Byplgb8G.js"),__vite__mapDeps([0,1,2,3])),e]),o=new s({fileBytes:u,fileName:t,raycastable:!0});await o.initialized,f(o,"gaussianSplat",{src:t,numSplats:o.numSplats});const d=o.getBoundingBox();if(!d.isEmpty()){const m=d.getSize(new p).multiplyScalar(1.5),y=d.getCenter(new p),n=new I(new b(m.x,m.y,m.z));n.name="__volter_splat_bounds",n.position.copy(y),n.visible=!1,n.raycast=()=>{},f(n,"engineInternal",!0),o.add(n)}return o}catch(s){throw i.delete(t),s}}const O=.45,C=.25,c=new WeakMap;function K(t,a){let e=c.get(a);e||(e=x(a),c.set(a,e)),t.environment=e.texture,t.environmentIntensity=O}function V(t){const a=c.get(t);a&&(c.delete(t),a.dispose())}export{C as S,K as a,V as d,l as g,z as l,N as r};
@@ -1,3 +1,3 @@
1
- import{a as s}from"./jsx-runtime-DPjLkJKQ.js";import"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{ex as a}from"./index-JjEYIC4G.js";function $({explanation:e,testId:t,style:o}){return e?s.jsx(a,{"data-testid":t,tone:e.tone,title:e.title,description:s.jsx("span",{style:{whiteSpace:"pre-wrap"},children:e.description}),style:{position:"absolute",inset:0,pointerEvents:"none",...o}}):null}function r(e){return e.map(t=>`“${t}”`).join(", ")}function d(e,t){const o=t.map(n=>n.worldId);return{tone:"error",title:o.length===1?`${e} root ${r(o)} failed`:`${o.length} ${e} roots failed`,description:`${t.map(n=>`${n.worldId} (${n.kind}, ${n.identity}): ${n.message}`).join(`
1
+ import{a as s}from"./jsx-runtime-DPjLkJKQ.js";import"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{ex as a}from"./index-flxMlfV4.js";function $({explanation:e,testId:t,style:o}){return e?s.jsx(a,{"data-testid":t,tone:e.tone,title:e.title,description:s.jsx("span",{style:{whiteSpace:"pre-wrap"},children:e.description}),style:{position:"absolute",inset:0,pointerEvents:"none",...o}}):null}function r(e){return e.map(t=>`“${t}”`).join(", ")}function d(e,t){const o=t.map(n=>n.worldId);return{tone:"error",title:o.length===1?`${e} root ${r(o)} failed`:`${o.length} ${e} roots failed`,description:`${t.map(n=>`${n.worldId} (${n.kind}, ${n.identity}): ${n.message}`).join(`
2
2
  `)}
3
3
  If this followed an edit, Undo (Ctrl+Z) restores the previous source and remounts.`}}function c(e,t){return{tone:"loading",title:t.length===0?`Loading ${e}`:t.length===1?`Loading ${e} root ${r(t)}`:`Loading ${t.length} ${e} roots`,description:t.length===0?"Reading the project declaration to identify the root that belongs here.":`Waiting for ${r(t)} to finish mounting.`}}function u(e,t){return t.length===0?{tone:"neutral",title:`No ${e} root`,description:"No declared root belongs to this surface."}:{tone:"neutral",title:"No renderable content",description:(t.length===1?`Root ${r(t)} mounted successfully but currently produces no renderable content.`:`Roots ${r(t)} mounted successfully but currently produce no renderable content.`)+" If this world builds its content under its game systems, press Play (▶) to run it."}}function m(e){if(e.content==="present")return null;if(e.playSuspended)return{tone:"neutral",title:"Editing paused during Play",description:`${r(e.rootIds)} is running in the Game tab. Press Stop (⏹) to edit it here.`};const t=new Set(e.rootIds),o=(e.failures??[]).filter(i=>t.has(i.worldId));if(o.length>0)return d(e.surface,o);if(e.disclosure)return{tone:"neutral",title:`No ${e.surface} editor for ${r(e.rootIds)}`,description:e.disclosure};const n=(e.readiness??[]).filter(i=>i.state==="waiting"&&t.has(i.rootId)).map(i=>i.rootId),l=n.length>0?n:e.rootIds;return e.phase==="loading"||n.length>0||e.content==="unknown"?c(e.surface,l):u(e.surface,e.rootIds)}export{$ as S,m as e};
@@ -1 +1 @@
1
- import{ay as t}from"./index-JjEYIC4G.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";function c(e){if(!e)return{type:null};switch(e.kind){case t.SyntaxKind.StringKeyword:return{type:"string"};case t.SyntaxKind.NumberKeyword:return{type:"number"};case t.SyntaxKind.BooleanKeyword:return{type:"boolean"}}if(t.isUnionTypeNode(e)){const n=[];for(const r of e.types){if(!t.isLiteralTypeNode(r))return{type:null};if(t.isStringLiteral(r.literal))n.push(r.literal.text);else if(t.isNumericLiteral(r.literal))n.push(Number(r.literal.text));else return{type:null}}return n.length>0?{type:"enum",options:n}:{type:null}}return t.isTupleTypeNode(e)&&e.elements.length===3&&e.elements.every(n=>n.kind===t.SyntaxKind.NumberKeyword)?{type:"vec3"}:{type:null}}function y(e,n,r){if(!e||!t.isTypeReferenceNode(e)||!t.isIdentifier(e.typeName)||e.typeArguments&&e.typeArguments.length>0)return e;const s=e.typeName.text,i=f(n,s);if(i)return t.isTypeAliasDeclaration(i)?i.type:e;const a=r.get(s);return a?a.type:e}function m(e,n,r,s){for(const i of e){if(!t.isPropertySignature(i))continue;const a=t.isIdentifier(i.name)||t.isStringLiteral(i.name)?i.name.text:null;a&&n.set(a,{optional:i.questionToken!==void 0,...c(y(i.type,r,s))})}}function f(e,n){for(const r of e.statements)if((t.isTypeAliasDeclaration(r)||t.isInterfaceDeclaration(r))&&r.name.text===n)return r;return null}function p(e,n,r,s,i){if(i>4)return;if(t.isTypeLiteralNode(e)){m(e.members,s,n,r);return}if(t.isIntersectionTypeNode(e)){for(const l of e.types)p(l,n,r,s,i+1);return}if(!t.isTypeReferenceNode(e)||!t.isIdentifier(e.typeName))return;const a=e.typeName.text,o=f(n,a);if(o){t.isTypeAliasDeclaration(o)?p(o.type,n,r,s,i+1):m(o.members,s,n,r);return}const u=r.get(a);u&&p(u.type,u.sf,new Map,s,i+1)}function x(e,n){const r=e.getText(n);if(t.isStringLiteral(e)||t.isNoSubstitutionTemplateLiteral(e))return{defaultText:r,defaultValue:e.text};if(t.isNumericLiteral(e))return{defaultText:r,defaultValue:Number(e.text)};if(t.isPrefixUnaryExpression(e)&&e.operator===t.SyntaxKind.MinusToken&&t.isNumericLiteral(e.operand))return{defaultText:r,defaultValue:-Number(e.operand.text)};if(e.kind===t.SyntaxKind.TrueKeyword)return{defaultText:r,defaultValue:!0};if(e.kind===t.SyntaxKind.FalseKeyword)return{defaultText:r,defaultValue:!1};if(t.isArrayLiteralExpression(e)){const s=[];for(const i of e.elements)if(t.isNumericLiteral(i))s.push(Number(i.text));else if(t.isPrefixUnaryExpression(i)&&i.operator===t.SyntaxKind.MinusToken&&t.isNumericLiteral(i.operand))s.push(-Number(i.operand.text));else return{defaultText:r};return{defaultText:r,defaultValue:s}}return{defaultText:r}}function N(e){return t.isFunctionDeclaration(e)&&e.name&&e.parameters[0]?{name:e.name.text,parameter:e.parameters[0]}:t.isVariableDeclaration(e)&&t.isIdentifier(e.name)&&e.initializer&&(t.isArrowFunction(e.initializer)||t.isFunctionExpression(e.initializer))&&e.initializer.parameters[0]?{name:e.name.text,parameter:e.initializer.parameters[0]}:null}function V(e,n){const r=new Map,s=i=>{const a=N(i);if(a&&/^[A-Z]/.test(a.name)&&!r.has(a.name)){const o=b(a.parameter,e,n);o.length>0&&r.set(a.name,o)}(t.isSourceFile(i)||t.isVariableStatement(i)||t.isVariableDeclarationList(i))&&t.forEachChild(i,s)};return s(e),r}function b(e,n,r){const s=new Map;if(t.isObjectBindingPattern(e.name))for(const a of e.name.elements){if(a.dotDotDotToken)continue;const o=a.propertyName??a.name;!t.isIdentifier(o)||!a.initializer||s.set(o.text,x(a.initializer,n))}const i=new Map;if(e.type&&p(e.type,n,r,i,0),i.size>0){const a=[];for(const[o,u]of i){const l=s.get(o);a.push({name:o,type:u.type,...u.options?{options:u.options}:{},optional:u.optional||l!==void 0,...l??{}})}return a}return[...s].map(([a,o])=>({name:a,type:null,optional:!0,...o}))}export{V as localComponentPropSpecs};
1
+ import{ay as t}from"./index-flxMlfV4.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";function c(e){if(!e)return{type:null};switch(e.kind){case t.SyntaxKind.StringKeyword:return{type:"string"};case t.SyntaxKind.NumberKeyword:return{type:"number"};case t.SyntaxKind.BooleanKeyword:return{type:"boolean"}}if(t.isUnionTypeNode(e)){const n=[];for(const r of e.types){if(!t.isLiteralTypeNode(r))return{type:null};if(t.isStringLiteral(r.literal))n.push(r.literal.text);else if(t.isNumericLiteral(r.literal))n.push(Number(r.literal.text));else return{type:null}}return n.length>0?{type:"enum",options:n}:{type:null}}return t.isTupleTypeNode(e)&&e.elements.length===3&&e.elements.every(n=>n.kind===t.SyntaxKind.NumberKeyword)?{type:"vec3"}:{type:null}}function y(e,n,r){if(!e||!t.isTypeReferenceNode(e)||!t.isIdentifier(e.typeName)||e.typeArguments&&e.typeArguments.length>0)return e;const s=e.typeName.text,i=f(n,s);if(i)return t.isTypeAliasDeclaration(i)?i.type:e;const a=r.get(s);return a?a.type:e}function m(e,n,r,s){for(const i of e){if(!t.isPropertySignature(i))continue;const a=t.isIdentifier(i.name)||t.isStringLiteral(i.name)?i.name.text:null;a&&n.set(a,{optional:i.questionToken!==void 0,...c(y(i.type,r,s))})}}function f(e,n){for(const r of e.statements)if((t.isTypeAliasDeclaration(r)||t.isInterfaceDeclaration(r))&&r.name.text===n)return r;return null}function p(e,n,r,s,i){if(i>4)return;if(t.isTypeLiteralNode(e)){m(e.members,s,n,r);return}if(t.isIntersectionTypeNode(e)){for(const l of e.types)p(l,n,r,s,i+1);return}if(!t.isTypeReferenceNode(e)||!t.isIdentifier(e.typeName))return;const a=e.typeName.text,o=f(n,a);if(o){t.isTypeAliasDeclaration(o)?p(o.type,n,r,s,i+1):m(o.members,s,n,r);return}const u=r.get(a);u&&p(u.type,u.sf,new Map,s,i+1)}function x(e,n){const r=e.getText(n);if(t.isStringLiteral(e)||t.isNoSubstitutionTemplateLiteral(e))return{defaultText:r,defaultValue:e.text};if(t.isNumericLiteral(e))return{defaultText:r,defaultValue:Number(e.text)};if(t.isPrefixUnaryExpression(e)&&e.operator===t.SyntaxKind.MinusToken&&t.isNumericLiteral(e.operand))return{defaultText:r,defaultValue:-Number(e.operand.text)};if(e.kind===t.SyntaxKind.TrueKeyword)return{defaultText:r,defaultValue:!0};if(e.kind===t.SyntaxKind.FalseKeyword)return{defaultText:r,defaultValue:!1};if(t.isArrayLiteralExpression(e)){const s=[];for(const i of e.elements)if(t.isNumericLiteral(i))s.push(Number(i.text));else if(t.isPrefixUnaryExpression(i)&&i.operator===t.SyntaxKind.MinusToken&&t.isNumericLiteral(i.operand))s.push(-Number(i.operand.text));else return{defaultText:r};return{defaultText:r,defaultValue:s}}return{defaultText:r}}function N(e){return t.isFunctionDeclaration(e)&&e.name&&e.parameters[0]?{name:e.name.text,parameter:e.parameters[0]}:t.isVariableDeclaration(e)&&t.isIdentifier(e.name)&&e.initializer&&(t.isArrowFunction(e.initializer)||t.isFunctionExpression(e.initializer))&&e.initializer.parameters[0]?{name:e.name.text,parameter:e.initializer.parameters[0]}:null}function V(e,n){const r=new Map,s=i=>{const a=N(i);if(a&&/^[A-Z]/.test(a.name)&&!r.has(a.name)){const o=b(a.parameter,e,n);o.length>0&&r.set(a.name,o)}(t.isSourceFile(i)||t.isVariableStatement(i)||t.isVariableDeclarationList(i))&&t.forEachChild(i,s)};return s(e),r}function b(e,n,r){const s=new Map;if(t.isObjectBindingPattern(e.name))for(const a of e.name.elements){if(a.dotDotDotToken)continue;const o=a.propertyName??a.name;!t.isIdentifier(o)||!a.initializer||s.set(o.text,x(a.initializer,n))}const i=new Map;if(e.type&&p(e.type,n,r,i,0),i.size>0){const a=[];for(const[o,u]of i){const l=s.get(o);a.push({name:o,type:u.type,...u.options?{options:u.options}:{},optional:u.optional||l!==void 0,...l??{}})}return a}return[...s].map(([a,o])=>({name:a,type:null,optional:!0,...o}))}export{V as localComponentPropSpecs};
@@ -1 +1 @@
1
- import{ah as d,ai as w,aj as b,ak as N}from"./index-JjEYIC4G.js";import{r as m}from"./collaboration-presence-CP5gEnxY.js";import{e as v,j as P,m as I}from"./game-network-Bs_aLrfo.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"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-ojTkP52T.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-DlrL6r1z.js";import"./contract-system-adapters-Dv5mUMr_.js";import"./game-contract-seams-D4x_QFfy.js";import"./seeded-random-J_tZuhc3.js";import"./game-audio-BeCyd0Ha.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-CIlCfET4.js";import"./capability-coverage-B0oT2N3Z.js";import"./edit-mode-authoring-RAf4S6PI.js";import"./json-history-resource-B0kkSep8.js";import"./binding-resolver-iMKdp_Dm.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-DUEIrJNn.js";import"./canvas-entry-runtime-BVnhMBaW.js";import"./three-ingest-runtime-BOYUnvJa.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-CqJH4G9t.js";import"./active-ingest-DIgBJBWV.js";import"./ingest-source-persistence-B52PvpPx.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-CM-p4xLg.js";import"./mounted-authoring-BRmJcses.js";import"./entity-object-DBXB7ABG.js";import"./user-data-DcUoY-0j.js";import"./workspace-arrangement-D7VBwv9F.js";import"./three-contract-Dkt6PmWY.js";import"./three-CqcAlmZt.js";import"./editor-layers-C47WUNtv.js";import"./component-instance-root-BpMFxtbQ.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-D-dP-DRa.js";import"./source-persistence-backend-B7_XGPrd.js";import"./three-projection-core-CMYaSPZP.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./r3f-physics-binding-D41qQnHD.js";import"./deferred-ingest-play-tx7qVcg3.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-CKQ-MAMv.js";import"./board-guides-BvzDdD2y.js";import"./relative-import-specifier-B_Awfdrr.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-KwcXV5-u.js";import"./inference-diagnostics-kHRsQw1P.js";import"./writer-tw6EcuVO.js";import"./three-state-Bs6NttX2.js";import"./editor-shell-store-B-64vpgA.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-Ct3Jwvkd.js";import"./game-surface-defaults-D8S4cRxi.js";const Yt="workspace.service";function Zt(){let i=null;const p=new Set;let e=null,n=null,a=d();const l=()=>{e?.(),e=null,n?.(),n=null,a=null},y=w(u=>{const k=u.participants.find(r=>r.participantId===b)?.capabilities.includes("test")??!1,t=u.activePlaytest,s=I();if(!k||!t){i=null,l(),m({playtest:null}),s?.mode==="team"&&P(),t||p.clear();return}s?.mode==="team"&&s.id===t.id||i!==t.id&&(p.has(t.id)||(i=t.id,m({playtest:{id:t.id,play:"starting",networking:"connecting",roomName:null,problem:null}}),v(t.seed,{mode:"team",id:t.id,roomKey:t.roomKey,revision:t.revision,participantId:b}).then(()=>{if(i!==t.id)return;l();const r=()=>{const o=d(),c=o?.getConnectionState?.(),f=o?.getRoomInfo?.();m({playtest:{id:t.id,play:"ready",networking:o?c==="connected"&&f?"ready":c==="error"?"error":"connecting":"not-declared",roomName:f?.roomName??null,problem:c==="error"?"The game networking adapter reported an error.":null}})},g=()=>{const o=d();o!==a&&(e?.(),a=o,e=o?.subscribe(r)??null),r()};n=N(g),g()}).catch(r=>{i===t.id&&(i=null,p.add(t.id),m({playtest:{id:t.id,play:"error",networking:"error",roomName:null,problem:r instanceof Error?r.message:String(r)}}))})))});return()=>{l(),y()}}export{Yt as point,Zt as start};
1
+ import{ah as d,ai as w,aj as b,ak as N}from"./index-flxMlfV4.js";import{r as m}from"./collaboration-presence-WWC9ZQsq.js";import{e as v,j as P,m as I}from"./game-network-DtzKFtge.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"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-lR1oG4Vd.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-BW5cue8V.js";import"./contract-system-adapters-0Odxcy6d.js";import"./game-contract-seams-GoIZaA0s.js";import"./seeded-random-BlGWBUER.js";import"./game-audio-BeCyd0Ha.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-nmQ1saHI.js";import"./capability-coverage-BqCZSu0R.js";import"./edit-mode-authoring-CVKwIPOy.js";import"./json-history-resource-DTUpacfx.js";import"./binding-resolver-TD7-fKuX.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-CL4ih5gp.js";import"./canvas-entry-runtime-Do5zL9dN.js";import"./three-ingest-runtime-B9surImB.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-CqJH4G9t.js";import"./active-ingest-BuNeO4Mb.js";import"./ingest-source-persistence-CJGE5-AU.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-DEm3C1-i.js";import"./mounted-authoring-BHpx-z2Y.js";import"./entity-object-C374JqRs.js";import"./user-data-C8dmlLGA.js";import"./workspace-arrangement-BnGzBm57.js";import"./three-contract-Dkt6PmWY.js";import"./three-2yjp9YMj.js";import"./editor-layers-DI1Wkr8F.js";import"./component-instance-root-pq7uyyej.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-B5h6dxvp.js";import"./source-persistence-backend-DoNJeJa8.js";import"./three-projection-core-xgnaC08N.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./r3f-physics-binding-D6DKTgwF.js";import"./deferred-ingest-play-C6qytzjB.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-DVNps-az.js";import"./board-guides-ClHJXXuu.js";import"./relative-import-specifier-cRtWQWmH.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-Dl5bH02T.js";import"./inference-diagnostics-MWqnRUsN.js";import"./writer-tw6EcuVO.js";import"./three-state-DVnNjIbQ.js";import"./editor-shell-store-DlGykD-E.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-Brt6-rPp.js";import"./game-surface-defaults-D8S4cRxi.js";const Yt="workspace.service";function Zt(){let i=null;const p=new Set;let e=null,n=null,a=d();const l=()=>{e?.(),e=null,n?.(),n=null,a=null},y=w(u=>{const k=u.participants.find(r=>r.participantId===b)?.capabilities.includes("test")??!1,t=u.activePlaytest,s=I();if(!k||!t){i=null,l(),m({playtest:null}),s?.mode==="team"&&P(),t||p.clear();return}s?.mode==="team"&&s.id===t.id||i!==t.id&&(p.has(t.id)||(i=t.id,m({playtest:{id:t.id,play:"starting",networking:"connecting",roomName:null,problem:null}}),v(t.seed,{mode:"team",id:t.id,roomKey:t.roomKey,revision:t.revision,participantId:b}).then(()=>{if(i!==t.id)return;l();const r=()=>{const o=d(),c=o?.getConnectionState?.(),f=o?.getRoomInfo?.();m({playtest:{id:t.id,play:"ready",networking:o?c==="connected"&&f?"ready":c==="error"?"error":"connecting":"not-declared",roomName:f?.roomName??null,problem:c==="error"?"The game networking adapter reported an error.":null}})},g=()=>{const o=d();o!==a&&(e?.(),a=o,e=o?.subscribe(r)??null),r()};n=N(g),g()}).catch(r=>{i===t.id&&(i=null,p.add(t.id),m({playtest:{id:t.id,play:"error",networking:"error",roomName:null,problem:r instanceof Error?r.message:String(r)}}))})))});return()=>{l(),y()}}export{Yt as point,Zt as start};
@@ -1 +1 @@
1
- import{isInEditorOwnedSubtree as V,isEditorOwnedObject as P}from"./editor-layers-C47WUNtv.js";import{g as k}from"./user-data-DcUoY-0j.js";import{b as E,c as S}from"./component-instance-root-BpMFxtbQ.js";import{n as K,e as $,s as A}from"./entity-object-DBXB7ABG.js";import{s as W}from"./viewport-editor-controls-BYaAZ_Ku.js";import{fd as z,e6 as G,B as U}from"./three.core-3arARmh6.js";function q(n){const t=k(n,"constraints");return Array.isArray(t)?t.filter(e=>!!e&&typeof e=="object"&&typeof e.getSnapshot=="function"&&!!e.config):[]}const M="ingest:camera",J=1<<31;function Q(n){return(n.layers.mask&J)!==0}function Y(n,t){const e=new Map;let r=0,s=0,f=0;const u=(i,c)=>{const o=`ingest:${c}:${i.type}:${i.name||""}`;e.set(o,i),r++,i.isLight?f++:i.isMesh&&s++,d(i,c)},d=(i,c)=>{let o=0;for(const h of i.children)Q(h)||(u(h,c?`${c}/${o}`:`${o}`),o++)};return d(n,""),t&&(e.set(M,t),r++),{byId:e,count:r,meshes:s,lights:f}}function Z(n){const t=k(n,"authoringSubject");return t&&typeof t.label=="string"&&typeof t.kind=="string"?t:null}function X(n){const t=k(n,"reflectionProbe");if(!t||typeof t!="object")return null;const e=t;return e.config&&typeof e.recapture=="function"&&typeof e.getSnapshot=="function"?t:null}let D=null;function ht(n){D=n,W(n?.editorControls??null)}function tt(){return D}function C(n){return n.depthWrite===!1&&n.side===U}function et(n){const t=n.material;return t?Array.isArray(t)?t.length>0&&t.every(C):C(t):!1}function L(n,t,e,r=()=>!1,s){const f=tt();if(!f)return[];const u=f.canvas.getBoundingClientRect();if(u.width<=0||u.height<=0||!Number.isFinite(t)||!Number.isFinite(e)||t<u.left||e<u.top||t>=u.left+u.width||e>=u.top+u.height)return[];const d=new z((t-u.left)/u.width*2-1,-((e-u.top)/u.height)*2+1),i=new G;i.layers.enableAll(),i.setFromCamera(d,f.camera);const c=new Set(s?.objects??n.objectMap.values()),o=[...c].filter(b=>{for(let I=b.parent;I;I=I.parent)if(c.has(I))return!1;return!0});for(const b of o)b.traverse(I=>{const m=I;m.isSkinnedMesh&&(m.boundingBox=null,m.boundingSphere=null)});const h=i.intersectObjects(o,!0),p=[],v=new Set;for(const b of h){if(V(b.object)||et(b.object))continue;let I=b.object,m=null;if(s)for(;I&&m===null;)m=s.idForObject3D(I),I=I.parent;else{const a=K(I);m=a?$(a)??null:null}m!==null&&!r(m)&&!v.has(m)&&(v.add(m),p.push(m))}return nt(p,o,h.length,t,e),p}function nt(n,t,e,r,s){n.length>0||r===0&&s===0||console.info(`[viewport-pick] click selected nothing (candidates ${t.length}, rayHits ${e}, resolvedIds 0)`)}function st(n,t,e,r=()=>!1,s){return L(n,t,e,r,s)[0]??null}const R={count:0,meshes:0,lights:0,instancedMeshes:0,instances:0};let x=0;function H(n){let t=0,e=0;for(const r of n.values()){const s=r.object;s.isInstancedMesh&&(t++,e+=typeof s.count=="number"?s.count:0)}return{instancedMeshes:t,instances:e}}function F(n){let t=0,e=0;for(const r of n.values()){const s=r.object;s.isLight?e++:s.isMesh&&t++}return{count:n.size,meshes:t,lights:e,...H(n)}}function T(n,t){const e=new Map,r=[],s=t.skip??P;t.begin?.(n);const f=(u,d,i,c)=>{if(s(u))return;const o=t.identify(u,{path:d,ownerId:i,ownedByAncestor:c});o!==null&&(A(u,o),e.set(o,{object:u,id:o,parentId:i,childIds:[]}),i===null?r.push(o):e.get(i)?.childIds.push(o));const h=c||o!==null;u.children.forEach((p,v)=>{f(p,[...d,v],o??i,h)}),t.leave?.(u,o)};return n.children.forEach((u,d)=>{f(u,[d],null,!1)}),{nodes:e,rootIds:r,stats:F(e)}}const it="r3f:";function O(n,t){return`${it}${n}:${t}`}function rt(n){const t=new Map,e=new Map,r=(d,i)=>d===i||d.startsWith(`${i}#`)&&/^\d+$/u.test(d.slice(i.length+1)),s=d=>{e.clear();const i=c=>{if(P(c))return;const o=E(c),h=$(c);if(o!==void 0&&h!==void 0){const p=O(n,o);r(h,p)&&!e.has(h)&&e.set(h,c)}for(const p of c.children)i(p)};for(const c of d.children)i(c)},f=(d,i)=>{const c=$(d);if(c===void 0||i===void 0)return c;const o=O(n,i);return r(c,o)?e.get(c)===d?c:void 0:c},u=(d,i)=>{const c=O(n,i);let o=t.get(i)??0,h=S(c,o);for(;e.has(h);)o+=1,h=S(c,o);return t.set(i,o+1),e.set(h,d),h};return{begin:d=>{t.clear(),s(d)},identify:(d,i)=>{const c=E(d),o=f(d,c);if(o!==void 0)return o;const h=c===void 0?void 0:u(d,c);return h!==void 0||!i.ownedByAncestor||k(d,"authoringRoot")===!0?h??`live:${n}:${x++}`:null}}}function N(n,t){return T(n,rt(t))}function pt(n,t){const{nodes:e}=N(n,t),r=new Map;for(const[s,f]of e)r.set(s,f.object);return r}function yt(n,t={}){const e=t.camera;return{incremental:{kind:"live-oid",worldId:n},project:r=>{const s=N(r,n);return!e||[...s.nodes.values()].some(f=>f.object===e)?s:(A(e,M),s.nodes.set(M,{object:e,id:M,parentId:null,childIds:[]}),s.rootIds.push(M),{...s,stats:{...s.stats,count:s.nodes.size}})}}}function gt(n={}){const t=n.camera;return{project:e=>{const r=Y(e,t),s=new Map;for(const[d,i]of r.byId)s.set(i,d);const f=new Map,u=[];for(const[d,i]of r.byId){const c=i.parent,o=(c&&c!==e?s.get(c):void 0)??null,h=i.children.map(p=>s.get(p)).filter(p=>p!==void 0);f.set(d,{object:i,id:d,parentId:o,childIds:h}),o===null&&u.push(d)}return{nodes:f,rootIds:u,stats:{count:r.count,meshes:r.meshes,lights:r.lights,...H(f)}}}}}function It(n){let t=new Map,e=new Map;return{get instanceRoots(){return t},get representatives(){return e},project:r=>{const s=new Map,f=new Map,u=new Map,d=new Set,i=new Map,c=T(r,{identify:(o,h)=>{const p=E(o);if(p===void 0)return O(n,`@${h.path.join(".")}`);const v=s.get(p)??0;return s.set(p,v+1),v===0&&u.set(p,o),d.has(p)||(f.set(p,(f.get(p)??0)+1),d.add(p),i.set(o,p)),S(O(n,p),v)},leave:o=>{const h=i.get(o);h!==void 0&&(d.delete(h),i.delete(o))}});return t=f,e=u,c}}}function mt(n){return{project:t=>T(t,{skip:e=>!!k(e,"editorHelper")||e.isSkeletonHelper===!0,identify:(e,r)=>`source-object:${n}:${r.path.join(".")}`})}}function vt(n){const t=Z(n);return t?t.kind:q(n).length>0?"constraint-owner":X(n)?"reflection-probe":n.isSkinnedMesh?"skinned-mesh":n.isBone?"bone":n.isLight?"light":n.isCamera?"camera":n.type==="Audio"||n.type==="PositionalAudio"||n.type==="AudioListener"?"audio":n.isMesh?"mesh":n.children.length>0?"group":"object"}function ot(n,t){for(let e=n.parent;e!==null;e=e.parent)if(e===t)return!0;return!1}function _(n,t){if(n===t)return!0;for(let e=n.parent;e!==null;e=e.parent)if(e===t)return!0;return!1}class wt{constructor(t,e={}){this.identity=t,this.options=e}nodesById=new Map;objectsById=new Map;idsByObjectIndex=new Map;roots=[];walkStats=R;project(t){if(!t)return this.nodesById=new Map,this.objectsById=new Map,this.idsByObjectIndex=new Map,this.roots=[],this.walkStats=R,this.walkStats;const{nodes:e,rootIds:r,stats:s}=this.identity.project(t);return this.nodesById=e,this.objectsById=new Map([...e].map(([f,u])=>[f,u.object])),this.idsByObjectIndex=new Map([...e].map(([f,u])=>[u.object,f])),this.roots=r,this.walkStats=s,s}projectSubtrees(t,e){const r=this.identity.incremental;if(t===null||r?.kind!=="live-oid")return null;const s=e.filter((a,l)=>e.indexOf(a)===l&&!e.some(y=>y!==a&&ot(a,y))),f=this.roots,u=new Set,d=new Set,i=new Set;for(const a of s)a.traverse(l=>{const y=this.idsByObjectIndex.get(l);if(y===void 0)return;const g=this.nodesById.get(y);g?.parentId!==null&&g?.parentId!==void 0&&i.add(g.parentId),u.add(y),this.nodesById.delete(y),this.objectsById.delete(y),this.idsByObjectIndex.delete(l)});const c=P,o=(a,l)=>{const y=this.objectsById.get(a);return y===void 0||y===l},h=(a,l)=>{const y=$(a);if(y!==void 0&&o(y,a))return y;const g=E(a);if(g!==void 0){const w=O(r.worldId,g);let B=0,j=S(w,B);for(;!o(j,a);)j=S(w,++B);return j}if(!l||k(a,"authoringRoot")===!0){let w=`live:${r.worldId}:${x++}`;for(;!o(w,a);)w=`live:${r.worldId}:${x++}`;return w}return null},p=(a,l,y)=>{if(c(a))return;const g=h(a,y);g!==null&&(A(a,g),this.nodesById.set(g,{object:a,id:g,parentId:l,childIds:[]}),this.objectsById.set(g,a),this.idsByObjectIndex.set(a,g),d.add(g),l!==null&&i.add(l));const w=g??l,B=y||g!==null;for(const j of a.children)p(j,w,B)};for(const a of s){if(!_(a,t))continue;let l=a.parent,y=null;for(;l!==null&&l!==t;){const g=this.idsByObjectIndex.get(l);if(g!==void 0){y=g;break}l=l.parent}p(a,y,y!==null)}const v=a=>{const l=[],y=g=>{if(c(g))return;const w=this.idsByObjectIndex.get(g);if(w!==void 0){l.push(w);return}for(const B of g.children)y(B)};for(const g of a.children)y(g);return l};for(const a of i){const l=this.nodesById.get(a);l!==void 0&&l.childIds.splice(0,l.childIds.length,...v(l.object))}for(const a of d){const l=this.nodesById.get(a);l!==void 0&&l.childIds.splice(0,l.childIds.length,...v(l.object))}const b=v(t),I=this.roots.filter(a=>{const l=this.objectsById.get(a);return l!==void 0&&!_(l,t)&&!u.has(a)});this.roots=[...b,...I],this.walkStats=F(this.nodesById);const m=f.length!==this.roots.length||f.some((a,l)=>a!==this.roots[l]);return{removedIds:u,addedIds:d,changedParentIds:i,rootsChanged:m}}get nodes(){return this.nodesById}get objects(){return this.objectsById}get idsByObject(){return this.idsByObjectIndex}get rootIds(){return this.roots}get stats(){return this.walkStats}node(t){return this.nodesById.get(t)??null}rootNodes(){return this.roots.map(t=>this.nodesById.get(t)).filter(t=>t!==void 0)}objectOf(t){return this.objectsById.get(t)??null}idOf(t){return this.idsByObjectIndex.get(t)??null}childIdsOf(t){const e=[];for(const r of t){const s=this.idsByObjectIndex.get(r);s!==void 0&&e.push(s)}return e}objectMapSnapshot(){return new Map(this.objectsById)}pick(t,e,r,s){return st(t,e,r,s,this.pickProjection())}candidates(t,e,r,s){return L(t,e,r,s,this.pickProjection())}pickProjection(){if(this.options.pickScope!=="store-object-map")return{objects:this.objectsById.values(),idForObject3D:t=>this.idOf(t)}}}export{wt as T,yt as a,gt as b,It as c,mt as d,q as e,ht as f,vt as n,Z as o,X as r,pt as s};
1
+ import{isInEditorOwnedSubtree as V,isEditorOwnedObject as P}from"./editor-layers-DI1Wkr8F.js";import{g as k}from"./user-data-C8dmlLGA.js";import{b as E,c as S}from"./component-instance-root-pq7uyyej.js";import{n as K,e as $,s as A}from"./entity-object-C374JqRs.js";import{s as W}from"./viewport-editor-controls-BYaAZ_Ku.js";import{fd as z,e6 as G,B as U}from"./three.core-3arARmh6.js";function q(n){const t=k(n,"constraints");return Array.isArray(t)?t.filter(e=>!!e&&typeof e=="object"&&typeof e.getSnapshot=="function"&&!!e.config):[]}const M="ingest:camera",J=1<<31;function Q(n){return(n.layers.mask&J)!==0}function Y(n,t){const e=new Map;let r=0,s=0,f=0;const u=(i,c)=>{const o=`ingest:${c}:${i.type}:${i.name||""}`;e.set(o,i),r++,i.isLight?f++:i.isMesh&&s++,d(i,c)},d=(i,c)=>{let o=0;for(const h of i.children)Q(h)||(u(h,c?`${c}/${o}`:`${o}`),o++)};return d(n,""),t&&(e.set(M,t),r++),{byId:e,count:r,meshes:s,lights:f}}function Z(n){const t=k(n,"authoringSubject");return t&&typeof t.label=="string"&&typeof t.kind=="string"?t:null}function X(n){const t=k(n,"reflectionProbe");if(!t||typeof t!="object")return null;const e=t;return e.config&&typeof e.recapture=="function"&&typeof e.getSnapshot=="function"?t:null}let D=null;function ht(n){D=n,W(n?.editorControls??null)}function tt(){return D}function C(n){return n.depthWrite===!1&&n.side===U}function et(n){const t=n.material;return t?Array.isArray(t)?t.length>0&&t.every(C):C(t):!1}function L(n,t,e,r=()=>!1,s){const f=tt();if(!f)return[];const u=f.canvas.getBoundingClientRect();if(u.width<=0||u.height<=0||!Number.isFinite(t)||!Number.isFinite(e)||t<u.left||e<u.top||t>=u.left+u.width||e>=u.top+u.height)return[];const d=new z((t-u.left)/u.width*2-1,-((e-u.top)/u.height)*2+1),i=new G;i.layers.enableAll(),i.setFromCamera(d,f.camera);const c=new Set(s?.objects??n.objectMap.values()),o=[...c].filter(b=>{for(let I=b.parent;I;I=I.parent)if(c.has(I))return!1;return!0});for(const b of o)b.traverse(I=>{const m=I;m.isSkinnedMesh&&(m.boundingBox=null,m.boundingSphere=null)});const h=i.intersectObjects(o,!0),p=[],v=new Set;for(const b of h){if(V(b.object)||et(b.object))continue;let I=b.object,m=null;if(s)for(;I&&m===null;)m=s.idForObject3D(I),I=I.parent;else{const a=K(I);m=a?$(a)??null:null}m!==null&&!r(m)&&!v.has(m)&&(v.add(m),p.push(m))}return nt(p,o,h.length,t,e),p}function nt(n,t,e,r,s){n.length>0||r===0&&s===0||console.info(`[viewport-pick] click selected nothing (candidates ${t.length}, rayHits ${e}, resolvedIds 0)`)}function st(n,t,e,r=()=>!1,s){return L(n,t,e,r,s)[0]??null}const R={count:0,meshes:0,lights:0,instancedMeshes:0,instances:0};let x=0;function H(n){let t=0,e=0;for(const r of n.values()){const s=r.object;s.isInstancedMesh&&(t++,e+=typeof s.count=="number"?s.count:0)}return{instancedMeshes:t,instances:e}}function F(n){let t=0,e=0;for(const r of n.values()){const s=r.object;s.isLight?e++:s.isMesh&&t++}return{count:n.size,meshes:t,lights:e,...H(n)}}function T(n,t){const e=new Map,r=[],s=t.skip??P;t.begin?.(n);const f=(u,d,i,c)=>{if(s(u))return;const o=t.identify(u,{path:d,ownerId:i,ownedByAncestor:c});o!==null&&(A(u,o),e.set(o,{object:u,id:o,parentId:i,childIds:[]}),i===null?r.push(o):e.get(i)?.childIds.push(o));const h=c||o!==null;u.children.forEach((p,v)=>{f(p,[...d,v],o??i,h)}),t.leave?.(u,o)};return n.children.forEach((u,d)=>{f(u,[d],null,!1)}),{nodes:e,rootIds:r,stats:F(e)}}const it="r3f:";function O(n,t){return`${it}${n}:${t}`}function rt(n){const t=new Map,e=new Map,r=(d,i)=>d===i||d.startsWith(`${i}#`)&&/^\d+$/u.test(d.slice(i.length+1)),s=d=>{e.clear();const i=c=>{if(P(c))return;const o=E(c),h=$(c);if(o!==void 0&&h!==void 0){const p=O(n,o);r(h,p)&&!e.has(h)&&e.set(h,c)}for(const p of c.children)i(p)};for(const c of d.children)i(c)},f=(d,i)=>{const c=$(d);if(c===void 0||i===void 0)return c;const o=O(n,i);return r(c,o)?e.get(c)===d?c:void 0:c},u=(d,i)=>{const c=O(n,i);let o=t.get(i)??0,h=S(c,o);for(;e.has(h);)o+=1,h=S(c,o);return t.set(i,o+1),e.set(h,d),h};return{begin:d=>{t.clear(),s(d)},identify:(d,i)=>{const c=E(d),o=f(d,c);if(o!==void 0)return o;const h=c===void 0?void 0:u(d,c);return h!==void 0||!i.ownedByAncestor||k(d,"authoringRoot")===!0?h??`live:${n}:${x++}`:null}}}function N(n,t){return T(n,rt(t))}function pt(n,t){const{nodes:e}=N(n,t),r=new Map;for(const[s,f]of e)r.set(s,f.object);return r}function yt(n,t={}){const e=t.camera;return{incremental:{kind:"live-oid",worldId:n},project:r=>{const s=N(r,n);return!e||[...s.nodes.values()].some(f=>f.object===e)?s:(A(e,M),s.nodes.set(M,{object:e,id:M,parentId:null,childIds:[]}),s.rootIds.push(M),{...s,stats:{...s.stats,count:s.nodes.size}})}}}function gt(n={}){const t=n.camera;return{project:e=>{const r=Y(e,t),s=new Map;for(const[d,i]of r.byId)s.set(i,d);const f=new Map,u=[];for(const[d,i]of r.byId){const c=i.parent,o=(c&&c!==e?s.get(c):void 0)??null,h=i.children.map(p=>s.get(p)).filter(p=>p!==void 0);f.set(d,{object:i,id:d,parentId:o,childIds:h}),o===null&&u.push(d)}return{nodes:f,rootIds:u,stats:{count:r.count,meshes:r.meshes,lights:r.lights,...H(f)}}}}}function It(n){let t=new Map,e=new Map;return{get instanceRoots(){return t},get representatives(){return e},project:r=>{const s=new Map,f=new Map,u=new Map,d=new Set,i=new Map,c=T(r,{identify:(o,h)=>{const p=E(o);if(p===void 0)return O(n,`@${h.path.join(".")}`);const v=s.get(p)??0;return s.set(p,v+1),v===0&&u.set(p,o),d.has(p)||(f.set(p,(f.get(p)??0)+1),d.add(p),i.set(o,p)),S(O(n,p),v)},leave:o=>{const h=i.get(o);h!==void 0&&(d.delete(h),i.delete(o))}});return t=f,e=u,c}}}function mt(n){return{project:t=>T(t,{skip:e=>!!k(e,"editorHelper")||e.isSkeletonHelper===!0,identify:(e,r)=>`source-object:${n}:${r.path.join(".")}`})}}function vt(n){const t=Z(n);return t?t.kind:q(n).length>0?"constraint-owner":X(n)?"reflection-probe":n.isSkinnedMesh?"skinned-mesh":n.isBone?"bone":n.isLight?"light":n.isCamera?"camera":n.type==="Audio"||n.type==="PositionalAudio"||n.type==="AudioListener"?"audio":n.isMesh?"mesh":n.children.length>0?"group":"object"}function ot(n,t){for(let e=n.parent;e!==null;e=e.parent)if(e===t)return!0;return!1}function _(n,t){if(n===t)return!0;for(let e=n.parent;e!==null;e=e.parent)if(e===t)return!0;return!1}class wt{constructor(t,e={}){this.identity=t,this.options=e}nodesById=new Map;objectsById=new Map;idsByObjectIndex=new Map;roots=[];walkStats=R;project(t){if(!t)return this.nodesById=new Map,this.objectsById=new Map,this.idsByObjectIndex=new Map,this.roots=[],this.walkStats=R,this.walkStats;const{nodes:e,rootIds:r,stats:s}=this.identity.project(t);return this.nodesById=e,this.objectsById=new Map([...e].map(([f,u])=>[f,u.object])),this.idsByObjectIndex=new Map([...e].map(([f,u])=>[u.object,f])),this.roots=r,this.walkStats=s,s}projectSubtrees(t,e){const r=this.identity.incremental;if(t===null||r?.kind!=="live-oid")return null;const s=e.filter((a,l)=>e.indexOf(a)===l&&!e.some(y=>y!==a&&ot(a,y))),f=this.roots,u=new Set,d=new Set,i=new Set;for(const a of s)a.traverse(l=>{const y=this.idsByObjectIndex.get(l);if(y===void 0)return;const g=this.nodesById.get(y);g?.parentId!==null&&g?.parentId!==void 0&&i.add(g.parentId),u.add(y),this.nodesById.delete(y),this.objectsById.delete(y),this.idsByObjectIndex.delete(l)});const c=P,o=(a,l)=>{const y=this.objectsById.get(a);return y===void 0||y===l},h=(a,l)=>{const y=$(a);if(y!==void 0&&o(y,a))return y;const g=E(a);if(g!==void 0){const w=O(r.worldId,g);let B=0,j=S(w,B);for(;!o(j,a);)j=S(w,++B);return j}if(!l||k(a,"authoringRoot")===!0){let w=`live:${r.worldId}:${x++}`;for(;!o(w,a);)w=`live:${r.worldId}:${x++}`;return w}return null},p=(a,l,y)=>{if(c(a))return;const g=h(a,y);g!==null&&(A(a,g),this.nodesById.set(g,{object:a,id:g,parentId:l,childIds:[]}),this.objectsById.set(g,a),this.idsByObjectIndex.set(a,g),d.add(g),l!==null&&i.add(l));const w=g??l,B=y||g!==null;for(const j of a.children)p(j,w,B)};for(const a of s){if(!_(a,t))continue;let l=a.parent,y=null;for(;l!==null&&l!==t;){const g=this.idsByObjectIndex.get(l);if(g!==void 0){y=g;break}l=l.parent}p(a,y,y!==null)}const v=a=>{const l=[],y=g=>{if(c(g))return;const w=this.idsByObjectIndex.get(g);if(w!==void 0){l.push(w);return}for(const B of g.children)y(B)};for(const g of a.children)y(g);return l};for(const a of i){const l=this.nodesById.get(a);l!==void 0&&l.childIds.splice(0,l.childIds.length,...v(l.object))}for(const a of d){const l=this.nodesById.get(a);l!==void 0&&l.childIds.splice(0,l.childIds.length,...v(l.object))}const b=v(t),I=this.roots.filter(a=>{const l=this.objectsById.get(a);return l!==void 0&&!_(l,t)&&!u.has(a)});this.roots=[...b,...I],this.walkStats=F(this.nodesById);const m=f.length!==this.roots.length||f.some((a,l)=>a!==this.roots[l]);return{removedIds:u,addedIds:d,changedParentIds:i,rootsChanged:m}}get nodes(){return this.nodesById}get objects(){return this.objectsById}get idsByObject(){return this.idsByObjectIndex}get rootIds(){return this.roots}get stats(){return this.walkStats}node(t){return this.nodesById.get(t)??null}rootNodes(){return this.roots.map(t=>this.nodesById.get(t)).filter(t=>t!==void 0)}objectOf(t){return this.objectsById.get(t)??null}idOf(t){return this.idsByObjectIndex.get(t)??null}childIdsOf(t){const e=[];for(const r of t){const s=this.idsByObjectIndex.get(r);s!==void 0&&e.push(s)}return e}objectMapSnapshot(){return new Map(this.objectsById)}pick(t,e,r,s){return st(t,e,r,s,this.pickProjection())}candidates(t,e,r,s){return L(t,e,r,s,this.pickProjection())}pickProjection(){if(this.options.pickScope!=="store-object-map")return{objects:this.objectsById.values(),idForObject3D:t=>this.idOf(t)}}}export{wt as T,yt as a,gt as b,It as c,mt as d,q as e,ht as f,vt as n,Z as o,X as r,pt as s};
@@ -1 +1 @@
1
- import{d6 as k,ec as _,O as v,as as A,aw as X,e7 as O,gz as W,gA as R,q as P,bm as U,gB as G,ah as N,bn as L,bk as Q,bl as Y,k as Z,bo as q}from"./index-JjEYIC4G.js";import{a as ee,o as te,b as C}from"./component-instance-root-BpMFxtbQ.js";import{c as re,p as x,m as se,a as oe}from"./source-persistence-backend-B7_XGPrd.js";import{J as ie,c as ne}from"./json-history-resource-B0kkSep8.js";import{r as f,d as ae,a as ce}from"./ingest-source-persistence-B52PvpPx.js";import{r as le}from"./three-projection-core-CMYaSPZP.js";import{a as D,T as he,n as ue,b as de}from"./three-CqcAlmZt.js";import{isEditorOwnedObject as T}from"./editor-layers-C47WUNtv.js";import{bodyOwningNode as F}from"./body-marks-C1LxJtQb.js";import{colorMaterialOf as y}from"./structural-ids-BOo2BRoY.js";import{object3DAuthoringSubjectOf as H}from"./object3d-authoring-subject-XccsO0xG.js";import{createRapierBodyEditing as fe}from"./rapier-physics-adapter-CaZqWLu0.js";import{getUserData as m}from"./user-data-CODoGZqA.js";import{b as me,c as pe}from"./r3f-physics-binding-D41qQnHD.js";const be={position:{owner:"self",member:"position",kind:"vector3"},rotation:{owner:"self",member:"rotation",kind:"euler"},scale:{owner:"self",member:"scale",kind:"vector3"},visible:{owner:"self",member:"visible",kind:"boolean"},name:{owner:"self",member:"name",kind:"string"},"material.color":{owner:"material",member:"color",kind:"color"},"light.color":{owner:"self",member:"color",kind:"color"},"light.intensity":{owner:"self",member:"intensity",kind:"number"},"light.distance":{owner:"self",member:"distance",kind:"number"},"camera.fov":{owner:"self",member:"fov",kind:"number"},"camera.near":{owner:"self",member:"near",kind:"number"},"camera.far":{owner:"self",member:"far",kind:"number"},"shadow.cast":{owner:"self",member:"castShadow",kind:"boolean"},"shadow.receive":{owner:"self",member:"receiveShadow",kind:"boolean"}},ye={position:{owner:"self",member:"position",kind:"vector2",componentMembers:["x","y"]},rotation:{owner:"self",member:"rotation",kind:"number"},scale:{owner:"self",member:"scale",kind:"vector2"},visible:{owner:"self",member:"visible",kind:"boolean"},name:{owner:"self",member:"label",kind:"string"},alpha:{owner:"self",member:"alpha",kind:"number"},tint:{owner:"self",member:"tint",kind:"color"}},ge={position:{owner:"self",member:"position",kind:"vector3"},rotation:{owner:"self",member:"rotation",kind:"euler"},scale:{owner:"self",member:"scaling",kind:"vector3"},name:{owner:"self",member:"name",kind:"string"},visible:{owner:"self",member:"isVisible",kind:"boolean"},visibility:{owner:"self",member:"visibility",kind:"number"}};function J(l,t="three"){return(t==="pixi"?ye:t==="babylon"?ge:be)[l]??null}const K="the game's own JSX source (source-stamp write-back)",S={position:"position",rotation:"rotation",scale:"scale",visible:"visible",name:"name","material.color":"color","light.color":"color","light.intensity":"intensity","light.distance":"distance","camera.fov":"fov","camera.near":"near","camera.far":"far","shadow.cast":"castShadow","shadow.receive":"receiveShadow"};function M(l){const t=Math.round(l*1e4)/1e4;return Object.is(t,-0)?"0":String(t)}function V(l,t){const e=J(l)?.kind;return e==="vector3"||e==="euler"?!Array.isArray(t)||t.length!==3||!t.every(r=>typeof r=="number"&&Number.isFinite(r))?null:`[${t.map(M).join(", ")}]`:e==="number"?typeof t=="number"&&Number.isFinite(t)?M(t):null:e==="boolean"?typeof t=="boolean"?String(t):null:(e==="color"||e==="string")&&typeof t=="string"?t.replace(/["\\]/g,""):null}function z(l,t){const e=me(l??void 0,t);if(e)return e;const r=l?.r3fAuthoring;if(!r||t!=="position"&&t!=="rotation"&&t!=="scale")return null;const s=`<${l?.tag??"this component"}>`;return r.simulationOwnedTransform===!0?`${s} drives its own ${t} every frame — this instance is placed by the simulation, not by the editor`:r.transformProps.includes(t)?null:`${s} does not forward ${t} to its native root`}function I(l){const t=l.file.replaceAll("\\","/"),e=X()?.rootPath.replaceAll("\\","/").replace(/\/$/,""),r=e&&t.startsWith(`${e}/`)?t.slice(e.length+1):t;return{anchored:!0,kind:"source",file:r,line:l.line,col:l.col,display:`${r}:${l.line}`}}async function De(l){try{const e=await(l??k("Live source locations"))?.index?.();return r=>{const s=e?.[r];return s?I(s):null}}catch{return()=>null}}async function ve(l,t,e){const r=l.writeProp;if(!r)throw new Error("the gesture-scoped source writer cannot write JSX props");let s=0;for(const{property:o,text:i}of e){const a=await r(t,o,i,{addIfMissing:!0,allowShapeUpgrade:!0});if(a.dynamic)throw new Error(`${o} is bound to a JSX expression, not an authored literal`);if(!a.changed&&a.error)throw new Error(a.error);a.changed&&s++}return s}function we(l){const t=l.backend??k("The Play→source transform committer"),e=_(t,l.history),r=o=>o?!e?.runGesture||!e.writeProp||!e.index?{available:!1,reason:"This editor session cannot open a checksum-guarded project-source gesture."}:{available:!0}:{available:!1,reason:"This live node has no OID source stamp, so no authored literal owns its pose."},s=o=>(v.warn(`[play] Commit live transform to source refused: ${o}`,"play-mode"),{destination:A,persisted:!1});return{availability:r,async commit(o,i){const a=r(o);if(!a.available||!o||!e?.runGesture||!e.index)return s(a.reason??"the source writer is unavailable");const c=(await e.index())[o]??null;if(!c)return s(`the current source index has no entry for OID "${o}"`);const h=["position","rotation","scale"].map(d=>{const j=z(c,d);if(j)throw new Error(j);const w=i[d],$=w===void 0?null:V(d,w);if($===null)throw new Error(`${d} is not a finite transform literal`);return{property:d,text:$}});let u;try{u=await e.runGesture("Commit Play Transform to Source",d=>ve(d,o,h))}catch(d){return s(d instanceof Error?d.message:String(d))}return u===0?(v.log("[play] Source already matches the selected live transform.","play-mode"),{destination:"source already matched the live transform",persisted:!1}):(v.log(`[play] Committed ${u} live transform literal(s) to ${c.file}:${c.line}.`,"play-mode"),{destination:K,persisted:!0})}}}function Se(l){let t=null,e=new Map,r=!1;const s=async()=>{const n=t?.index;if(n)try{e=new Map(Object.entries(await n.call(t))),r=!0}catch{}},o=n=>n?e.get(n)??null:null,i=n=>{const c=o(n);return c?I(c).display:null},a=(n,c)=>{if(!n)return{ok:!1,reason:"this object carries no source stamp — the game built it at runtime rather than writing it as an element of its own source"};if(!t?.writeProp)return{ok:!1,reason:"this editor tier cannot write project source"};const h=S[c];if(!h)return{ok:!1,reason:`${c} has no JSX attribute this seam can write`};const u=z(o(n),h);if(u)return{ok:!1,reason:u};if(!O()){const d=i(n);return{ok:!1,reason:`${d?`written at ${d}`:"source-stamped"}, but this game is playing — hold it to author`}}return{ok:!0}};return{attach(){const n=l.backend??k("This world’s OID source persistence")??null;t=n?_(n,l.history)??n:null,s()},anchor(n){const c=e.get(n);return c?I(c):null},physicsPlaced(n,c){return pe(o(n)??void 0,S[c]??c)},describe({sourceOid:n,property:c}){const h=a(n,c);if(!h.ok)return`Live-only edit — ${h.reason}.`;const u=i(n);return u?`Persisting to ${u}.`:`Persisting to this element's own JSX${r?"":" (source index still loading)"}.`},gate({sourceOid:n,property:c}){return a(n,c)},armed:()=>t?.writeProp!==void 0&&O(),report:(n,c)=>f(n,c),async write(n){const c=a(n.sourceOid,n.property);if(!c.ok)return f(n.label,c.reason),!1;const h=S[n.property],u=V(n.property,n.next);if(u===null)return f(n.label,`the new ${n.property} is not a value this seam can spell as a JSX literal`),!1;try{const d=await t.writeProp(n.sourceOid,h,u,{addIfMissing:!0,allowShapeUpgrade:!0});return d.dynamic?(f(n.label,`${h} at ${i(n.sourceOid)??"this element"} is bound to a JSX expression, not a literal`),!1):d.changed?(v.log(`[ingest] ${n.label} written to the game's own source — ${h} → ${i(n.sourceOid)??n.sourceOid}`),s(),!0):(f(n.label,d.error??"the source writer made no change"),!1)}catch(d){return f(n.label,`the write failed: ${d instanceof Error?d.message:String(d)}`),!1}},removal:{available({sourceOid:n,property:c}){return t?.removeProp?a(n,c).ok:!1},async perform(n){const c=a(n.sourceOid,n.property);if(!c.ok||!t?.removeProp)return f(n.label,c.ok?"this editor tier cannot remove project source":c.reason),!1;const h=S[n.property];try{const u=await t.removeProp(n.sourceOid,h);return u.dynamic?(f(n.label,`${h} at ${i(n.sourceOid)??"this element"} is bound to a JSX expression — removing it would delete the game's own wiring, not an override`),!1):u.changed?(v.log(`[ingest] ${n.label} — ${h} dropped from the game's own source at ${i(n.sourceOid)??n.sourceOid}`),s(),!0):(f(n.label,u.error??`${i(n.sourceOid)??"this element"} authors no ${h} attribute, so there was nothing to drop`),!1)}catch(u){return f(n.label,`the removal failed: ${u instanceof Error?u.message:String(u)}`),!1}}},destination(){return t?.writeProp&&O()?K:A},dispose(){t=null,e=new Map,r=!1}}}const je={source:"live",label:"live",detail:"Running objects adopted from the live scene. Edits affect this session only and are discarded when play stops."},Oe="Applied to the running world; code that drives this transform each frame may overwrite it.",Ce={source:"foreign",label:"live-only",detail:"Unmodified ingested game — edits apply to the running game for this session only and are never saved."},Ie={source:"foreign",label:"game source",detail:"Ingested game whose own source carries the editor's authoring stamps — a literal JSX prop writes back to the game’s own file (expression-bound props stay read-only)."};function p(l){return l.isLight?l:null}function g(l){const t=l;return t.isPointLight||t.isSpotLight?t:null}function ke(l){const t=l;return t.isDirectionalLight||t.isPointLight||t.isSpotLight?t:null}function b(l){const t=l;return t.isPerspectiveCamera?t:null}function B(l){const t=l;return t.isMesh&&t.geometry?t.geometry:null}class E{constructor(t,e,r){if(this.store=t,this.options=r,this.sceneRef=e,this.identity=r.identity,this.projector=new he(this.identity,{pickScope:"projection"}),this.persist=r.persistence??null,this.loop=r.loop,this.frameControl=r.frameControl??"adapter",this.provenance=r.provenance??je,r.sourceCommit){const i={availability:a=>r.sourceCommit.availability(C(this.objectOf(a))),commit:async a=>{const n=this.objectOf(a),c=this.captureChannelBaseline(a)??{},h=await r.sourceCommit.commit(C(n),c);return h.persisted&&this.store.shell.notifyIngestEdit(),h}};Object.assign(this.transforms,{sourceCommit:i})}r.sourceDeclaresStories&&(this.stories=W("three",t.shell,i=>{const a=this.hierarchy.node(i);return a?.role!=="component"?null:{name:a.typeLabel??a.label}})),this.refresh(),this.watchStructure();const s=t.shell.projectHistory;this.historyResource=this.persist&&s?new ie({history:s,kind:"session-state",scope:"session",subject:{...r.journal,id:`${r.journal.id}/live-three-edits`},displayName:"Live edits",capture:()=>this.captureHistoryState(),conflictIdentity:i=>i.edits,restore:async i=>{this.restoreHistoryState(i)}}):null;const o=this.persist;o&&(o.attach({read:(i,a)=>this.readChannel(i,a),apply:(i,a,n)=>this.applyChannel(i,a,n)}),this.persistence={...ne(),get destination(){return o.destination()}},o.readSiteLiterals&&(this.instances=this.creationSiteInstances(o)))}sceneRef;projector;watchedForStructure=new Set;changedStructureRoots=new Set;structureRefreshQueued=!1;disposed=!1;crossSurfaceStructureRevision=0;hasCrossSurfaceStructure=!1;identity;persist;loop;frameControl;instanceLiterals=new Map;instanceLiteralRequests=new Map;markedBodies=fe(t=>{const e=this.objectOf(t);if(!e)return{kind:"unresolved"};const r=F(e);return r?{kind:"body",body:r}:{kind:"no-body"}});bodyOwnershipByObject=new WeakMap;physicsFor(t){const e=R();return e&&P(e,t)!=="unresolved"?e:null}edits={};historyResource;editStartState;editBaseline;capabilities={transform:!0,inspectorFields:!0,persist:!1};stories;instances;provenance;persistence;get scene(){return typeof this.sceneRef=="function"?this.sceneRef():this.sceneRef}refresh(){const t=this.projector.project(this.scene);return this.refreshCrossSurfacePresence(),this.crossSurfaceStructureRevision++,t}crossSurfaceStructureSignature(){return this.hasCrossSurfaceStructure?String(this.crossSurfaceStructureRevision):null}objectCarriesCrossSurfaceStructure(t){return m(t,"authoringHierarchyId")!==void 0||m(t,"authoringHierarchyParentId")!==void 0||m(t,"authoringHierarchyOrder")!==void 0}subtreeCarriesCrossSurfaceStructure(t){let e=!1;return t.traverse(r=>{this.objectCarriesCrossSurfaceStructure(r)&&(e=!0)}),e}refreshCrossSurfacePresence(){this.hasCrossSurfaceStructure=!1;for(const t of this.projector.nodes.values())if(this.objectCarriesCrossSurfaceStructure(t.object)){this.hasCrossSurfaceStructure=!0;return}}onStructureChanged=t=>{T(t.child)||this.disposed||(this.changedStructureRoots.add(t.child),!this.structureRefreshQueued&&(this.structureRefreshQueued=!0,queueMicrotask(()=>{if(this.structureRefreshQueued=!1,this.disposed)return;const e=[...this.changedStructureRoots];this.changedStructureRoots.clear();const r=e.some(o=>this.subtreeCarriesCrossSurfaceStructure(o));for(const o of e)this.unwatchStructureSubtree(o);const s=this.projector.projectSubtrees(this.scene,e);if(s===null)this.refresh(),this.watchStructure();else for(const o of e)this.structureRootIsAttached(o)&&this.watchStructureSubtree(o);r&&(this.refreshCrossSurfacePresence(),this.crossSurfaceStructureRevision++),this.syncAdoptedObjectMap(s??void 0),this.store.notifyIngestObjectMapEdit(s===null?void 0:{changedParentIds:s.changedParentIds,rootsChanged:s.rootsChanged,addedIds:s.addedIds,removedIds:s.removedIds})})))};watchStructure(){for(const e of this.watchedForStructure)e.removeEventListener("childadded",this.onStructureChanged),e.removeEventListener("childremoved",this.onStructureChanged);this.watchedForStructure.clear();const t=this.scene;t&&this.watchStructureSubtree(t)}watchStructureSubtree(t){const e=r=>{if(!(T(r)||this.watchedForStructure.has(r))){r.addEventListener("childadded",this.onStructureChanged),r.addEventListener("childremoved",this.onStructureChanged),this.watchedForStructure.add(r);for(const s of r.children)e(s)}};e(t)}structureRootIsAttached(t){const e=this.scene;if(e===null)return!1;for(let r=t;r!==null;r=r.parent)if(r===e)return!0;return!1}unwatchStructureSubtree(t){t.traverse(e=>{this.watchedForStructure.delete(e)&&(e.removeEventListener("childadded",this.onStructureChanged),e.removeEventListener("childremoved",this.onStructureChanged))})}syncAdoptedObjectMap(t){const e=this.scene;if(!e||this.store.scene!==e)return;const r=this.store.objectMap;if(t===void 0){r.clear();for(const[o,i]of this.projector.objectMapSnapshot())r.set(o,i)}else{for(const o of t.removedIds)r.delete(o);for(const o of t.addedIds){const i=this.projector.objectOf(o);i!==null&&r.set(o,i)}}const s=[...this.store.shell.selectedEntityIds].filter(o=>r.has(o));s.length!==this.store.shell.selectedEntityIds.size&&this.store.shell.selectMultiple(s)}invalidate(){this.refresh()}adoptScene(t){this.sceneRef=t,this.refresh(),this.watchStructure(),this.syncAdoptedObjectMap()}objectOf(t){return this.projector.objectOf(t)}objectMapSnapshot(){return this.projector.objectMapSnapshot()}record(t,e){this.edits[t]={...this.edits[t],...e}}toEditorNode(t){const e=t.object,r=m(e,"authoringHierarchyId"),s=m(e,"authoringHierarchyParentId"),o=m(e,"authoringHierarchyOrder"),i=ee(e)&&m(e,"authoringRoot")!==!0,a=m(e,"authoringComponent"),n=(i?m(e,"authoringLabel"):void 0)||e.name||e.type;return{id:t.id,label:n,role:i?"component":"entity",kind:ue(e),typeLabel:i?a||n:e.type,parentId:t.parentId,childIds:[...t.childIds],...r===void 0?{}:{crossSurfaceId:r},...s===void 0?{}:{crossSurfaceParentId:s},...o===void 0?{}:{crossSurfaceOrder:o}}}hierarchy={crossSurfaceStructureSignature:()=>this.crossSurfaceStructureSignature(),roots:()=>this.projector.rootNodes().map(t=>this.toEditorNode(t)),node:t=>{const e=this.projector.node(t);return e?this.toEditorNode(e):null},object3D:t=>this.objectOf(t),idForObject3D:t=>this.projector.idOf(t)};selection={get:()=>[...this.store.shell.selectedEntityIds],set:t=>this.store.shell.selectMultiple(t),resolve:(t,e)=>{const r=this.hierarchy.node(t);if(!r)return null;const s=[];let o=r,i=0;for(;o&&i++<1e3;)(o.role==="component"||o.role==="instance")&&s.push(o),o=o.parentId?this.hierarchy.node(o.parentId):null;const a=s.reverse();if(a.length===0)return{id:t};const n=e?.scopeId?a.findIndex(u=>u.id===e.scopeId):-1,c=n>=0?Math.min(n+1,a.length-1):0,h=e?.intent==="deep"?Math.min(c+1,a.length-1):c;return{id:a[h].id}}};pickable={pick:(t,e)=>(this.refresh(),this.projector.pick(this.store,t,e)),candidates:(t,e)=>(this.refresh(),this.projector.candidates(this.store,t,e))};truth={resolve:(t,e)=>{const r=this.anchorFor(t,e);return{site:r.anchor,writeAnchorKind:r.anchorKind}}};related=re(t=>this.truth.resolve(t,"position").site);transforms={get:t=>le(this.objectOf(t)),editability:(t,e)=>{if(!this.objectOf(t))return{writable:!1,reason:G};const r=N();return r?.networkId(t)&&!r.editable(t)?{writable:!1,reason:"This transform is controlled by remote or server network authority."}:this.bodyOwns(t)?{writable:!0,reason:"Moves the physics body that owns this node.",...this.removableFlag(t,e)}:this.frameControl==="host"&&this.store.shell.playState==="playing"?{writable:!0,reason:Oe,...this.removableFlag(t,e)}:this.persist?{writable:!0,reason:this.persist.describe(this.anchorFor(t,e)),...this.removableFlag(t,e)}:{writable:!0}},beginEdit:t=>{this.historyResource?.assertCanMutate(),!(!this.objectOf(t)||!this.editableByNetwork(t))&&(this.loop?.pause(),this.physicsFor(t)?.freeze(t),this.markedBodies.freeze(t),this.editStartState=this.persist?this.captureHistoryState():void 0,this.editBaseline=void 0)},apply:(t,e)=>{!this.objectOf(t)||!this.editableByNetwork(t)||(this.persist&&!this.editBaseline&&(this.editBaseline=this.captureChannelBaseline(t)),this.writeTransform(t,e),this.physicsFor(t)?.commit(t,e),this.markedBodies.commit(t,e),this.store.shell.notifyIngestEdit())},endEdit:t=>{this.loop?.resume();const e=this.objectOf(t),r=`Transform ${e?.name||"Object"}`,s=this.editStartState,o=this.editBaseline;return this.editStartState=void 0,this.editBaseline=void 0,e&&(this.physicsFor(t)?.unfreeze(t),this.markedBodies.unfreeze(t),this.store.shell.notifyIngestEdit()),this.persist?this.persistOrJournal(t,r,s,o):void 0},remove:(t,e)=>{if(this.persist?.removal)return U(this.pipedRemove(t,e))}};removableFlag(t,e){const r=this.persist?.removal;return r?r.available(this.anchorFor(t,e))?{removable:!0}:{}:{}}pipedRemove(t,e){const r=this.persist,s=r.removal,o=`Remove ${this.objectOf(t)?.name||"Object"} ${e}`;return{resolve:()=>{const i=this.anchorFor(t,e);return s.available(i)?i.anchorKind==="live-only"?L(r.describe(i)):{reaches:"writer",anchorKind:i.anchorKind,destination:r.destination(),write:()=>s.perform({...i,label:o})}:L(r.describe(i))},record:()=>{},report:i=>{r.armed()&&r.report(o,i)}}}bodyOwns(t){const e=this.objectOf(t);if(!e)return!1;const r=this.bodyOwnershipByObject.get(e);if(r!==void 0)return r;const s=R(),o=s?P(s,t):void 0;if(o==="physics")return this.bodyOwnershipByObject.set(e,!0),!0;const i=F(e)!==void 0;return(i||o==="editor")&&this.bodyOwnershipByObject.set(e,i),i}editableByNetwork(t){const e=N();return e?e.editable(t):!0}inspector={properties:t=>{const e=this.objectOf(t);if(!e)return[];const r=[{path:"name",label:"Name",type:"string"},{path:"visible",label:"Visible",type:"boolean"},{path:"object.type",label:"Native type",type:"string",readonly:!0}],s=H(e);return s?.fields&&r.push(...s.fields().filter(i=>!["name","visible"].includes(i.path)).map(({value:i,...a})=>a)),y(e)&&r.push({path:"material.color",label:"Color",type:"color",group:"Material"}),p(e)&&(r.push({path:"light.intensity",label:"Intensity",type:"number"}),r.push({path:"light.color",label:"Light Color",type:"color"}),g(e)&&r.push({path:"light.distance",label:"Distance",type:"number"}),ke(e)&&r.push({path:"shadow.cast",label:"Cast Shadow",type:"boolean"})),b(e)&&(r.push({path:"camera.fov",label:"FOV",type:"number"}),r.push({path:"camera.near",label:"Near",type:"number"}),r.push({path:"camera.far",label:"Far",type:"number"})),B(e)&&(r.push({path:"mesh.vertices",label:"Vertices",type:"number",readonly:!0}),r.push({path:"shadow.cast",label:"Cast Shadow",type:"boolean"}),r.push({path:"shadow.receive",label:"Receive Shadow",type:"boolean"})),r},get:(t,e)=>{const r=this.objectOf(t);if(!r)return;if(e==="name")return r.name;if(e==="visible")return r.visible;if(e==="object.type")return r.type;const s=H(r)?.fields?.().find(o=>o.path===e);if(s)return s.value();if(e==="material.color"){const o=y(r);return o?`#${o.color.getHexString()}`:void 0}if(e==="light.intensity")return p(r)?.intensity;if(e==="light.distance")return g(r)?.distance;if(e==="light.color"){const o=p(r);return o?`#${o.color.getHexString()}`:void 0}if(e==="camera.fov")return b(r)?.fov;if(e==="camera.near")return b(r)?.near;if(e==="camera.far")return b(r)?.far;if(e==="mesh.vertices"){const o=B(r);return o?o.getAttribute("position")?.count??0:void 0}if(e==="shadow.cast")return r.castShadow;if(e==="shadow.receive")return r.receiveShadow},set:(t,e,r)=>{if(this.historyResource?.assertCanMutate(),!this.persist){this.writeProp(t,e,r);return}const s=this.captureHistoryState(),o=this.readChannel(t,e);this.writeProp(t,e,r);const i=`Set ${this.objectOf(t)?.name||"Object"} ${e}`,a=this.readChannel(t,e);if(!(o!==void 0&&a!==void 0&&JSON.stringify(o)!==JSON.stringify(a))){this.recordHistory(i,s);return}return x({backend:this.persist,subject:()=>this.anchorFor(t,e),baseline:o,next:a,label:i,journal:()=>this.recordHistory(i,s)})}};subscribe(t){return this.store.shell.subscribe(t)}dispose(){this.disposed=!0;for(const t of this.watchedForStructure)t.removeEventListener("childadded",this.onStructureChanged),t.removeEventListener("childremoved",this.onStructureChanged);this.watchedForStructure.clear(),this.changedStructureRoots.clear(),this.historyResource?.dispose(),this.persist?.dispose()}readChannel(t,e){const r=this.objectOf(t);if(r)return e==="position"?r.position.toArray():e==="rotation"?[r.rotation.x,r.rotation.y,r.rotation.z]:e==="scale"?r.scale.toArray():this.inspector.get(t,e)}applyChannel(t,e,r){const s=this.objectOf(t);if(s){if(e==="position"&&Array.isArray(r))s.position.fromArray(r);else if(e==="rotation"&&Array.isArray(r)){const[o,i,a]=r;s.rotation.set(o??0,i??0,a??0)}else if(e==="scale"&&Array.isArray(r))s.scale.fromArray(r);else{this.writeProp(t,e,r);return}this.store.shell.notifyIngestEdit()}}writeTransform(t,e){this.historyResource?.assertCanMutate();const r=this.objectOf(t);r&&(r.position.set(e.position[0],e.position[1],e.position[2]),r.quaternion.set(e.rotation[0],e.rotation[1],e.rotation[2],e.rotation[3]),r.scale.set(e.scale[0],e.scale[1],e.scale[2]),this.record(t,{position:e.position,rotation:e.rotation,scale:e.scale}))}writeProp(t,e,r){const s=this.objectOf(t);if(s){if(e==="name")s.name=String(r);else if(e==="visible")s.visible=!!r,this.record(t,{visible:s.visible});else if(e==="material.color"){const o=y(s);o&&(o.color.set(String(r)),this.record(t,{color:`#${o.color.getHexString()}`}))}else if(e==="light.intensity"){const o=p(s);o&&(o.intensity=Number(r))}else if(e==="light.distance"){const o=g(s);o&&(o.distance=Number(r))}else if(e==="light.color")p(s)?.color.set(String(r));else if(e==="camera.fov"||e==="camera.near"||e==="camera.far"){const o=b(s);o&&(o[e.split(".")[1]]=Number(r),o.updateProjectionMatrix())}else e==="shadow.cast"?s.castShadow=!!r:e==="shadow.receive"&&(s.receiveShadow=!!r);this.store.shell.notifyIngestEdit()}}anchorFor(t,e){const r=this.objectOf(t),s=J(e),o=r&&s?.owner==="material"?y(r):r,i=s?.owner==="material"?te(o):C(o),a=i?this.persist?.anchor?.(i):null;if(a){const h=i?this.persist?.physicsPlaced?.(i,e):!1;return{entityId:t,property:e,anchor:a,anchorKind:h?"physics-binding":"source-prop",instances:1,sourceOid:i}}const n=ae(o);if(n!==null)return{entityId:t,property:e,anchor:ce(n),anchorKind:"data-record",instances:1,...i?{sourceOid:i}:{}};const c=i?this.options.sourceAnchor?.(i)??{anchored:!1,reason:"The source index has not resolved this object’s OID."}:Q(o??null);return{entityId:t,property:e,anchor:c,anchorKind:i?this.persist?.anchor?"source-prop":"live-only":c.anchored?"construction-literal":"live-only",instances:c.anchored&&c.kind==="source"?i?1:Y(c):0,...i?{sourceOid:i}:{}}}measureWriteReach(){this.refresh();let t=0;const e=Z();for(const r of this.projector.nodes.keys()){const s=this.anchorFor(r,"position");e[s.anchorKind]++,s.anchor.anchored&&t++}return{addressable:t,total:this.projector.nodes.size,destination:this.persist?.destination()??A,byKind:e}}captureChannelBaseline(t){const e=this.objectOf(t);if(e)return{position:e.position.toArray(),rotation:[e.rotation.x,e.rotation.y,e.rotation.z],scale:e.scale.toArray()}}persistOrJournal(t,e,r,s){const o=this.persist;if(!o)return;const i=s?this.captureChannelBaseline(t):void 0,a=s&&i?Object.keys(s).filter(c=>JSON.stringify(s[c])!==JSON.stringify(i[c])):[];a.length>1&&o.report(e,se(a));const n=a.length===1?a[0]:null;if(n===null){this.recordHistory(e,r);return}return x({backend:o,subject:()=>this.anchorFor(t,n),baseline:s[n],next:i[n],label:e,journal:()=>this.recordHistory(e,r)})}creationSiteKey(t){const e=t.anchor;return e.anchored&&e.kind==="source"?`${e.file}:${e.line}:${e.col}`:null}instancePropertyPaths(t,e){const r=["position","rotation","scale",...this.inspector.properties(t).filter(s=>!s.readonly).map(s=>s.path)];return[...new Set(r)].filter(s=>this.creationSiteKey(this.anchorFor(t,s))===e)}loadInstanceLiterals(t,e,r,s){const o=this.instanceLiteralRequests.get(s);if(o)return o;const i=this.instancePropertyPaths(e,s).map(n=>({property:n,live:this.readChannel(e,n)})).filter(n=>n.live!==void 0),a=t.readSiteLiterals({anchor:r.anchor,instances:r.instances,writeScope:"creation-site",properties:i}).then(n=>(this.instanceLiterals.set(s,n),this.store.shell.notifyIngestEdit(),n));return this.instanceLiteralRequests.set(s,a),a}sameInstanceValue(t,e){return Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((r,s)=>this.sameInstanceValue(r,e[s])):typeof t=="number"&&typeof e=="number"?Math.abs(t-e)<=1e-6:t===e}instanceComponentName(t){return t.constructor.name||t.type}instanceCountLabel(t){return`${t} ${t===1?"instance":"instances"}`}instanceOverride(t,e,r,s,o){const i=s[r],a=this.readChannel(e,r);if(!i||i.literal===null||a===void 0||this.sameInstanceValue(i.literal,a))return null;const n=t.gate({...this.anchorFor(e,r),writeScope:"creation-site"}),c=i.writable?n.ok?void 0:n.reason:i.reason,h=this.inspector.properties(e).find(u=>u.path===r)?.label??r;return{path:r,label:h,value:a,...i.text?{defaultText:i.text}:{},canApplyToComponent:c===void 0,...c?{applyUnavailableReason:c}:{},affectedInstanceCount:o.instances}}async applyInstanceDefault(t,e,r,s){const o={...this.anchorFor(r,s),writeScope:"creation-site"},i=this.creationSiteKey(o);if(!i)return{changed:!1,message:"This object has no source site."};const a=this.objectOf(r);if(!a)return{changed:!1,message:"This object is no longer in the live world."};const n=(await e(r,o,i))[s];if(!n)return{changed:!1,message:`The construction site names no ${s}.`};if(n.literal===null)return{changed:!1,message:`The construction site names no ${s} default.`};const c=this.readChannel(r,s);if(c===void 0)return{changed:!1,message:`${s} has no live value.`};if(!n.writable)return{changed:!1,message:n.reason??`${s} cannot be rewritten.`};const h=t.gate(o);if(!h.ok)return{changed:!1,message:h.reason};const u=o.instances,d=`Apply ${s} to ${this.instanceComponentName(a)} default (${this.instanceCountLabel(u)})`;if(!await t.write({...o,baseline:n.literal,next:c,label:d}))return{changed:!1,message:`${d} did not land; the console names why.`};this.instanceLiterals.delete(i),this.instanceLiteralRequests.delete(i),this.store.shell.notifyIngestEdit();const w=o.anchor.anchored?o.anchor.display:"this source site";return{changed:!0,message:`${s} now applies to all ${this.instanceCountLabel(u)} from ${w}.`,write:{destination:w,persisted:!0}}}creationSiteInstances(t){const e=async(r,s,o)=>this.instanceLiterals.get(o)??this.loadInstanceLiterals(t,r,s,o);return{describe:r=>{const s=this.anchorFor(r,"position"),o=this.creationSiteKey(s),i=this.objectOf(r);if(!o||!i)return null;const a=this.instanceLiterals.get(o);if(!a)return this.loadInstanceLiterals(t,r,s,o),null;if(Object.keys(a).length===0)return null;const n=this.instancePropertyPaths(r,o).map(c=>this.instanceOverride(t,r,c,a,s)).filter(c=>c!==null);return{componentName:this.instanceComponentName(i),...s.anchor.anchored?{sourcePath:s.anchor.display}:{},overrides:n}},revert:async(r,s)=>{const o=this.anchorFor(r,"position"),i=this.creationSiteKey(o);if(!i)return;const a=await e(r,o,i),n=this.captureHistoryState();let c=0;for(const h of s){const u=a[h]?.literal;u!=null&&(this.applyChannel(r,h,u),c++)}return c>0&&this.recordHistory(`Revert ${c} instance override(s)`,n),c>0?q:void 0},applyToComponent:(r,s)=>this.applyInstanceDefault(t,e,r,s)}}recordHistory(t,e){!this.historyResource||!e||this.historyResource.record(t,e,this.captureHistoryState()).catch(r=>{v.error(`[ingest] failed to journal "${t}" into project history — the edit is applied but has no history entry (it cannot be undone): ${r instanceof Error?r.message:String(r)}`)})}captureHistoryState(){const t={};for(const[e,r]of this.projector.nodes){const s=r.object,o=y(s),i=p(s),a=b(s);t[e]={name:s.name,visible:s.visible,transform:this.transforms.get(e),...o?{color:`#${o.color.getHexString()}`}:{},...i?{lightIntensity:i.intensity,lightColor:`#${i.color.getHexString()}`,...g(s)?{lightDistance:g(s).distance}:{}}:{},...a?{camera:{fov:a.fov,near:a.near,far:a.far}}:{},castShadow:s.castShadow,receiveShadow:s.receiveShadow}}return{edits:structuredClone(this.edits),objects:t}}restoreHistoryState(t){for(const[e,r]of Object.entries(t.objects)){const s=this.objectOf(e);if(!s)continue;s.name=r.name,s.visible=r.visible,s.position.fromArray(r.transform.position),s.quaternion.fromArray(r.transform.rotation),s.scale.fromArray(r.transform.scale),this.physicsFor(e)?.commit(e,r.transform),this.markedBodies.commit(e,r.transform),r.color&&y(s)?.color.set(r.color);const o=p(s);if(o&&(r.lightIntensity!==void 0&&(o.intensity=r.lightIntensity),r.lightColor&&o.color.set(r.lightColor),r.lightDistance!==void 0)){const a=g(s);a&&(a.distance=r.lightDistance)}const i=b(s);i&&r.camera&&(i.fov=r.camera.fov,i.near=r.camera.near,i.far=r.camera.far,i.updateProjectionMatrix()),s.castShadow=r.castShadow,s.receiveShadow=r.receiveShadow}this.edits=structuredClone(t.edits),this.store.shell.notifyIngestEdit()}}function Je(l,t,e){return new E(l,t,{identity:de({camera:e.camera}),journal:e.journal,persistence:oe({history:l.shell.projectHistory,writer:e.sourceWriter}),loop:e.loop,...e.frameControl?{frameControl:e.frameControl}:{},provenance:Ce})}function Ke(l,t,e){return new E(l,t,{identity:D(e.worldId,{camera:e.camera}),journal:e.journal,persistence:Se({history:l.shell.projectHistory,backend:e.backend}),loop:e.loop,...e.frameControl?{frameControl:e.frameControl}:{},provenance:Ie,sourceDeclaresStories:!0})}function Ve(l,t,e,r,s={}){return new E(l,t,{identity:D(e),journal:r,frameControl:"host",sourceAnchor:s.sourceAnchor,...s.explicitSourceCommit?{sourceCommit:we({history:l.shell.projectHistory,...s.backend?{backend:s.backend}:{}})}:{}})}export{Ke as a,Ve as o,De as r,Je as s};
1
+ import{d6 as k,ec as _,O as v,as as A,aw as X,e7 as O,gz as W,gA as R,q as P,bm as U,gB as G,ah as N,bn as L,bk as Q,bl as Y,k as Z,bo as q}from"./index-flxMlfV4.js";import{a as ee,o as te,b as C}from"./component-instance-root-pq7uyyej.js";import{c as re,p as x,m as se,a as oe}from"./source-persistence-backend-DoNJeJa8.js";import{J as ie,c as ne}from"./json-history-resource-DTUpacfx.js";import{r as f,d as ae,a as ce}from"./ingest-source-persistence-CJGE5-AU.js";import{r as le}from"./three-projection-core-xgnaC08N.js";import{a as D,T as he,n as ue,b as de}from"./three-2yjp9YMj.js";import{isEditorOwnedObject as T}from"./editor-layers-DI1Wkr8F.js";import{bodyOwningNode as F}from"./body-marks-C1LxJtQb.js";import{colorMaterialOf as y}from"./structural-ids-BOo2BRoY.js";import{object3DAuthoringSubjectOf as H}from"./object3d-authoring-subject-XccsO0xG.js";import{createRapierBodyEditing as fe}from"./rapier-physics-adapter-CaZqWLu0.js";import{getUserData as m}from"./user-data-CODoGZqA.js";import{b as me,c as pe}from"./r3f-physics-binding-D6DKTgwF.js";const be={position:{owner:"self",member:"position",kind:"vector3"},rotation:{owner:"self",member:"rotation",kind:"euler"},scale:{owner:"self",member:"scale",kind:"vector3"},visible:{owner:"self",member:"visible",kind:"boolean"},name:{owner:"self",member:"name",kind:"string"},"material.color":{owner:"material",member:"color",kind:"color"},"light.color":{owner:"self",member:"color",kind:"color"},"light.intensity":{owner:"self",member:"intensity",kind:"number"},"light.distance":{owner:"self",member:"distance",kind:"number"},"camera.fov":{owner:"self",member:"fov",kind:"number"},"camera.near":{owner:"self",member:"near",kind:"number"},"camera.far":{owner:"self",member:"far",kind:"number"},"shadow.cast":{owner:"self",member:"castShadow",kind:"boolean"},"shadow.receive":{owner:"self",member:"receiveShadow",kind:"boolean"}},ye={position:{owner:"self",member:"position",kind:"vector2",componentMembers:["x","y"]},rotation:{owner:"self",member:"rotation",kind:"number"},scale:{owner:"self",member:"scale",kind:"vector2"},visible:{owner:"self",member:"visible",kind:"boolean"},name:{owner:"self",member:"label",kind:"string"},alpha:{owner:"self",member:"alpha",kind:"number"},tint:{owner:"self",member:"tint",kind:"color"}},ge={position:{owner:"self",member:"position",kind:"vector3"},rotation:{owner:"self",member:"rotation",kind:"euler"},scale:{owner:"self",member:"scaling",kind:"vector3"},name:{owner:"self",member:"name",kind:"string"},visible:{owner:"self",member:"isVisible",kind:"boolean"},visibility:{owner:"self",member:"visibility",kind:"number"}};function J(l,t="three"){return(t==="pixi"?ye:t==="babylon"?ge:be)[l]??null}const K="the game's own JSX source (source-stamp write-back)",S={position:"position",rotation:"rotation",scale:"scale",visible:"visible",name:"name","material.color":"color","light.color":"color","light.intensity":"intensity","light.distance":"distance","camera.fov":"fov","camera.near":"near","camera.far":"far","shadow.cast":"castShadow","shadow.receive":"receiveShadow"};function M(l){const t=Math.round(l*1e4)/1e4;return Object.is(t,-0)?"0":String(t)}function V(l,t){const e=J(l)?.kind;return e==="vector3"||e==="euler"?!Array.isArray(t)||t.length!==3||!t.every(r=>typeof r=="number"&&Number.isFinite(r))?null:`[${t.map(M).join(", ")}]`:e==="number"?typeof t=="number"&&Number.isFinite(t)?M(t):null:e==="boolean"?typeof t=="boolean"?String(t):null:(e==="color"||e==="string")&&typeof t=="string"?t.replace(/["\\]/g,""):null}function z(l,t){const e=me(l??void 0,t);if(e)return e;const r=l?.r3fAuthoring;if(!r||t!=="position"&&t!=="rotation"&&t!=="scale")return null;const s=`<${l?.tag??"this component"}>`;return r.simulationOwnedTransform===!0?`${s} drives its own ${t} every frame — this instance is placed by the simulation, not by the editor`:r.transformProps.includes(t)?null:`${s} does not forward ${t} to its native root`}function I(l){const t=l.file.replaceAll("\\","/"),e=X()?.rootPath.replaceAll("\\","/").replace(/\/$/,""),r=e&&t.startsWith(`${e}/`)?t.slice(e.length+1):t;return{anchored:!0,kind:"source",file:r,line:l.line,col:l.col,display:`${r}:${l.line}`}}async function De(l){try{const e=await(l??k("Live source locations"))?.index?.();return r=>{const s=e?.[r];return s?I(s):null}}catch{return()=>null}}async function ve(l,t,e){const r=l.writeProp;if(!r)throw new Error("the gesture-scoped source writer cannot write JSX props");let s=0;for(const{property:o,text:i}of e){const a=await r(t,o,i,{addIfMissing:!0,allowShapeUpgrade:!0});if(a.dynamic)throw new Error(`${o} is bound to a JSX expression, not an authored literal`);if(!a.changed&&a.error)throw new Error(a.error);a.changed&&s++}return s}function we(l){const t=l.backend??k("The Play→source transform committer"),e=_(t,l.history),r=o=>o?!e?.runGesture||!e.writeProp||!e.index?{available:!1,reason:"This editor session cannot open a checksum-guarded project-source gesture."}:{available:!0}:{available:!1,reason:"This live node has no OID source stamp, so no authored literal owns its pose."},s=o=>(v.warn(`[play] Commit live transform to source refused: ${o}`,"play-mode"),{destination:A,persisted:!1});return{availability:r,async commit(o,i){const a=r(o);if(!a.available||!o||!e?.runGesture||!e.index)return s(a.reason??"the source writer is unavailable");const c=(await e.index())[o]??null;if(!c)return s(`the current source index has no entry for OID "${o}"`);const h=["position","rotation","scale"].map(d=>{const j=z(c,d);if(j)throw new Error(j);const w=i[d],$=w===void 0?null:V(d,w);if($===null)throw new Error(`${d} is not a finite transform literal`);return{property:d,text:$}});let u;try{u=await e.runGesture("Commit Play Transform to Source",d=>ve(d,o,h))}catch(d){return s(d instanceof Error?d.message:String(d))}return u===0?(v.log("[play] Source already matches the selected live transform.","play-mode"),{destination:"source already matched the live transform",persisted:!1}):(v.log(`[play] Committed ${u} live transform literal(s) to ${c.file}:${c.line}.`,"play-mode"),{destination:K,persisted:!0})}}}function Se(l){let t=null,e=new Map,r=!1;const s=async()=>{const n=t?.index;if(n)try{e=new Map(Object.entries(await n.call(t))),r=!0}catch{}},o=n=>n?e.get(n)??null:null,i=n=>{const c=o(n);return c?I(c).display:null},a=(n,c)=>{if(!n)return{ok:!1,reason:"this object carries no source stamp — the game built it at runtime rather than writing it as an element of its own source"};if(!t?.writeProp)return{ok:!1,reason:"this editor tier cannot write project source"};const h=S[c];if(!h)return{ok:!1,reason:`${c} has no JSX attribute this seam can write`};const u=z(o(n),h);if(u)return{ok:!1,reason:u};if(!O()){const d=i(n);return{ok:!1,reason:`${d?`written at ${d}`:"source-stamped"}, but this game is playing — hold it to author`}}return{ok:!0}};return{attach(){const n=l.backend??k("This world’s OID source persistence")??null;t=n?_(n,l.history)??n:null,s()},anchor(n){const c=e.get(n);return c?I(c):null},physicsPlaced(n,c){return pe(o(n)??void 0,S[c]??c)},describe({sourceOid:n,property:c}){const h=a(n,c);if(!h.ok)return`Live-only edit — ${h.reason}.`;const u=i(n);return u?`Persisting to ${u}.`:`Persisting to this element's own JSX${r?"":" (source index still loading)"}.`},gate({sourceOid:n,property:c}){return a(n,c)},armed:()=>t?.writeProp!==void 0&&O(),report:(n,c)=>f(n,c),async write(n){const c=a(n.sourceOid,n.property);if(!c.ok)return f(n.label,c.reason),!1;const h=S[n.property],u=V(n.property,n.next);if(u===null)return f(n.label,`the new ${n.property} is not a value this seam can spell as a JSX literal`),!1;try{const d=await t.writeProp(n.sourceOid,h,u,{addIfMissing:!0,allowShapeUpgrade:!0});return d.dynamic?(f(n.label,`${h} at ${i(n.sourceOid)??"this element"} is bound to a JSX expression, not a literal`),!1):d.changed?(v.log(`[ingest] ${n.label} written to the game's own source — ${h} → ${i(n.sourceOid)??n.sourceOid}`),s(),!0):(f(n.label,d.error??"the source writer made no change"),!1)}catch(d){return f(n.label,`the write failed: ${d instanceof Error?d.message:String(d)}`),!1}},removal:{available({sourceOid:n,property:c}){return t?.removeProp?a(n,c).ok:!1},async perform(n){const c=a(n.sourceOid,n.property);if(!c.ok||!t?.removeProp)return f(n.label,c.ok?"this editor tier cannot remove project source":c.reason),!1;const h=S[n.property];try{const u=await t.removeProp(n.sourceOid,h);return u.dynamic?(f(n.label,`${h} at ${i(n.sourceOid)??"this element"} is bound to a JSX expression — removing it would delete the game's own wiring, not an override`),!1):u.changed?(v.log(`[ingest] ${n.label} — ${h} dropped from the game's own source at ${i(n.sourceOid)??n.sourceOid}`),s(),!0):(f(n.label,u.error??`${i(n.sourceOid)??"this element"} authors no ${h} attribute, so there was nothing to drop`),!1)}catch(u){return f(n.label,`the removal failed: ${u instanceof Error?u.message:String(u)}`),!1}}},destination(){return t?.writeProp&&O()?K:A},dispose(){t=null,e=new Map,r=!1}}}const je={source:"live",label:"live",detail:"Running objects adopted from the live scene. Edits affect this session only and are discarded when play stops."},Oe="Applied to the running world; code that drives this transform each frame may overwrite it.",Ce={source:"foreign",label:"live-only",detail:"Unmodified ingested game — edits apply to the running game for this session only and are never saved."},Ie={source:"foreign",label:"game source",detail:"Ingested game whose own source carries the editor's authoring stamps — a literal JSX prop writes back to the game’s own file (expression-bound props stay read-only)."};function p(l){return l.isLight?l:null}function g(l){const t=l;return t.isPointLight||t.isSpotLight?t:null}function ke(l){const t=l;return t.isDirectionalLight||t.isPointLight||t.isSpotLight?t:null}function b(l){const t=l;return t.isPerspectiveCamera?t:null}function B(l){const t=l;return t.isMesh&&t.geometry?t.geometry:null}class E{constructor(t,e,r){if(this.store=t,this.options=r,this.sceneRef=e,this.identity=r.identity,this.projector=new he(this.identity,{pickScope:"projection"}),this.persist=r.persistence??null,this.loop=r.loop,this.frameControl=r.frameControl??"adapter",this.provenance=r.provenance??je,r.sourceCommit){const i={availability:a=>r.sourceCommit.availability(C(this.objectOf(a))),commit:async a=>{const n=this.objectOf(a),c=this.captureChannelBaseline(a)??{},h=await r.sourceCommit.commit(C(n),c);return h.persisted&&this.store.shell.notifyIngestEdit(),h}};Object.assign(this.transforms,{sourceCommit:i})}r.sourceDeclaresStories&&(this.stories=W("three",t.shell,i=>{const a=this.hierarchy.node(i);return a?.role!=="component"?null:{name:a.typeLabel??a.label}})),this.refresh(),this.watchStructure();const s=t.shell.projectHistory;this.historyResource=this.persist&&s?new ie({history:s,kind:"session-state",scope:"session",subject:{...r.journal,id:`${r.journal.id}/live-three-edits`},displayName:"Live edits",capture:()=>this.captureHistoryState(),conflictIdentity:i=>i.edits,restore:async i=>{this.restoreHistoryState(i)}}):null;const o=this.persist;o&&(o.attach({read:(i,a)=>this.readChannel(i,a),apply:(i,a,n)=>this.applyChannel(i,a,n)}),this.persistence={...ne(),get destination(){return o.destination()}},o.readSiteLiterals&&(this.instances=this.creationSiteInstances(o)))}sceneRef;projector;watchedForStructure=new Set;changedStructureRoots=new Set;structureRefreshQueued=!1;disposed=!1;crossSurfaceStructureRevision=0;hasCrossSurfaceStructure=!1;identity;persist;loop;frameControl;instanceLiterals=new Map;instanceLiteralRequests=new Map;markedBodies=fe(t=>{const e=this.objectOf(t);if(!e)return{kind:"unresolved"};const r=F(e);return r?{kind:"body",body:r}:{kind:"no-body"}});bodyOwnershipByObject=new WeakMap;physicsFor(t){const e=R();return e&&P(e,t)!=="unresolved"?e:null}edits={};historyResource;editStartState;editBaseline;capabilities={transform:!0,inspectorFields:!0,persist:!1};stories;instances;provenance;persistence;get scene(){return typeof this.sceneRef=="function"?this.sceneRef():this.sceneRef}refresh(){const t=this.projector.project(this.scene);return this.refreshCrossSurfacePresence(),this.crossSurfaceStructureRevision++,t}crossSurfaceStructureSignature(){return this.hasCrossSurfaceStructure?String(this.crossSurfaceStructureRevision):null}objectCarriesCrossSurfaceStructure(t){return m(t,"authoringHierarchyId")!==void 0||m(t,"authoringHierarchyParentId")!==void 0||m(t,"authoringHierarchyOrder")!==void 0}subtreeCarriesCrossSurfaceStructure(t){let e=!1;return t.traverse(r=>{this.objectCarriesCrossSurfaceStructure(r)&&(e=!0)}),e}refreshCrossSurfacePresence(){this.hasCrossSurfaceStructure=!1;for(const t of this.projector.nodes.values())if(this.objectCarriesCrossSurfaceStructure(t.object)){this.hasCrossSurfaceStructure=!0;return}}onStructureChanged=t=>{T(t.child)||this.disposed||(this.changedStructureRoots.add(t.child),!this.structureRefreshQueued&&(this.structureRefreshQueued=!0,queueMicrotask(()=>{if(this.structureRefreshQueued=!1,this.disposed)return;const e=[...this.changedStructureRoots];this.changedStructureRoots.clear();const r=e.some(o=>this.subtreeCarriesCrossSurfaceStructure(o));for(const o of e)this.unwatchStructureSubtree(o);const s=this.projector.projectSubtrees(this.scene,e);if(s===null)this.refresh(),this.watchStructure();else for(const o of e)this.structureRootIsAttached(o)&&this.watchStructureSubtree(o);r&&(this.refreshCrossSurfacePresence(),this.crossSurfaceStructureRevision++),this.syncAdoptedObjectMap(s??void 0),this.store.notifyIngestObjectMapEdit(s===null?void 0:{changedParentIds:s.changedParentIds,rootsChanged:s.rootsChanged,addedIds:s.addedIds,removedIds:s.removedIds})})))};watchStructure(){for(const e of this.watchedForStructure)e.removeEventListener("childadded",this.onStructureChanged),e.removeEventListener("childremoved",this.onStructureChanged);this.watchedForStructure.clear();const t=this.scene;t&&this.watchStructureSubtree(t)}watchStructureSubtree(t){const e=r=>{if(!(T(r)||this.watchedForStructure.has(r))){r.addEventListener("childadded",this.onStructureChanged),r.addEventListener("childremoved",this.onStructureChanged),this.watchedForStructure.add(r);for(const s of r.children)e(s)}};e(t)}structureRootIsAttached(t){const e=this.scene;if(e===null)return!1;for(let r=t;r!==null;r=r.parent)if(r===e)return!0;return!1}unwatchStructureSubtree(t){t.traverse(e=>{this.watchedForStructure.delete(e)&&(e.removeEventListener("childadded",this.onStructureChanged),e.removeEventListener("childremoved",this.onStructureChanged))})}syncAdoptedObjectMap(t){const e=this.scene;if(!e||this.store.scene!==e)return;const r=this.store.objectMap;if(t===void 0){r.clear();for(const[o,i]of this.projector.objectMapSnapshot())r.set(o,i)}else{for(const o of t.removedIds)r.delete(o);for(const o of t.addedIds){const i=this.projector.objectOf(o);i!==null&&r.set(o,i)}}const s=[...this.store.shell.selectedEntityIds].filter(o=>r.has(o));s.length!==this.store.shell.selectedEntityIds.size&&this.store.shell.selectMultiple(s)}invalidate(){this.refresh()}adoptScene(t){this.sceneRef=t,this.refresh(),this.watchStructure(),this.syncAdoptedObjectMap()}objectOf(t){return this.projector.objectOf(t)}objectMapSnapshot(){return this.projector.objectMapSnapshot()}record(t,e){this.edits[t]={...this.edits[t],...e}}toEditorNode(t){const e=t.object,r=m(e,"authoringHierarchyId"),s=m(e,"authoringHierarchyParentId"),o=m(e,"authoringHierarchyOrder"),i=ee(e)&&m(e,"authoringRoot")!==!0,a=m(e,"authoringComponent"),n=(i?m(e,"authoringLabel"):void 0)||e.name||e.type;return{id:t.id,label:n,role:i?"component":"entity",kind:ue(e),typeLabel:i?a||n:e.type,parentId:t.parentId,childIds:[...t.childIds],...r===void 0?{}:{crossSurfaceId:r},...s===void 0?{}:{crossSurfaceParentId:s},...o===void 0?{}:{crossSurfaceOrder:o}}}hierarchy={crossSurfaceStructureSignature:()=>this.crossSurfaceStructureSignature(),roots:()=>this.projector.rootNodes().map(t=>this.toEditorNode(t)),node:t=>{const e=this.projector.node(t);return e?this.toEditorNode(e):null},object3D:t=>this.objectOf(t),idForObject3D:t=>this.projector.idOf(t)};selection={get:()=>[...this.store.shell.selectedEntityIds],set:t=>this.store.shell.selectMultiple(t),resolve:(t,e)=>{const r=this.hierarchy.node(t);if(!r)return null;const s=[];let o=r,i=0;for(;o&&i++<1e3;)(o.role==="component"||o.role==="instance")&&s.push(o),o=o.parentId?this.hierarchy.node(o.parentId):null;const a=s.reverse();if(a.length===0)return{id:t};const n=e?.scopeId?a.findIndex(u=>u.id===e.scopeId):-1,c=n>=0?Math.min(n+1,a.length-1):0,h=e?.intent==="deep"?Math.min(c+1,a.length-1):c;return{id:a[h].id}}};pickable={pick:(t,e)=>(this.refresh(),this.projector.pick(this.store,t,e)),candidates:(t,e)=>(this.refresh(),this.projector.candidates(this.store,t,e))};truth={resolve:(t,e)=>{const r=this.anchorFor(t,e);return{site:r.anchor,writeAnchorKind:r.anchorKind}}};related=re(t=>this.truth.resolve(t,"position").site);transforms={get:t=>le(this.objectOf(t)),editability:(t,e)=>{if(!this.objectOf(t))return{writable:!1,reason:G};const r=N();return r?.networkId(t)&&!r.editable(t)?{writable:!1,reason:"This transform is controlled by remote or server network authority."}:this.bodyOwns(t)?{writable:!0,reason:"Moves the physics body that owns this node.",...this.removableFlag(t,e)}:this.frameControl==="host"&&this.store.shell.playState==="playing"?{writable:!0,reason:Oe,...this.removableFlag(t,e)}:this.persist?{writable:!0,reason:this.persist.describe(this.anchorFor(t,e)),...this.removableFlag(t,e)}:{writable:!0}},beginEdit:t=>{this.historyResource?.assertCanMutate(),!(!this.objectOf(t)||!this.editableByNetwork(t))&&(this.loop?.pause(),this.physicsFor(t)?.freeze(t),this.markedBodies.freeze(t),this.editStartState=this.persist?this.captureHistoryState():void 0,this.editBaseline=void 0)},apply:(t,e)=>{!this.objectOf(t)||!this.editableByNetwork(t)||(this.persist&&!this.editBaseline&&(this.editBaseline=this.captureChannelBaseline(t)),this.writeTransform(t,e),this.physicsFor(t)?.commit(t,e),this.markedBodies.commit(t,e),this.store.shell.notifyIngestEdit())},endEdit:t=>{this.loop?.resume();const e=this.objectOf(t),r=`Transform ${e?.name||"Object"}`,s=this.editStartState,o=this.editBaseline;return this.editStartState=void 0,this.editBaseline=void 0,e&&(this.physicsFor(t)?.unfreeze(t),this.markedBodies.unfreeze(t),this.store.shell.notifyIngestEdit()),this.persist?this.persistOrJournal(t,r,s,o):void 0},remove:(t,e)=>{if(this.persist?.removal)return U(this.pipedRemove(t,e))}};removableFlag(t,e){const r=this.persist?.removal;return r?r.available(this.anchorFor(t,e))?{removable:!0}:{}:{}}pipedRemove(t,e){const r=this.persist,s=r.removal,o=`Remove ${this.objectOf(t)?.name||"Object"} ${e}`;return{resolve:()=>{const i=this.anchorFor(t,e);return s.available(i)?i.anchorKind==="live-only"?L(r.describe(i)):{reaches:"writer",anchorKind:i.anchorKind,destination:r.destination(),write:()=>s.perform({...i,label:o})}:L(r.describe(i))},record:()=>{},report:i=>{r.armed()&&r.report(o,i)}}}bodyOwns(t){const e=this.objectOf(t);if(!e)return!1;const r=this.bodyOwnershipByObject.get(e);if(r!==void 0)return r;const s=R(),o=s?P(s,t):void 0;if(o==="physics")return this.bodyOwnershipByObject.set(e,!0),!0;const i=F(e)!==void 0;return(i||o==="editor")&&this.bodyOwnershipByObject.set(e,i),i}editableByNetwork(t){const e=N();return e?e.editable(t):!0}inspector={properties:t=>{const e=this.objectOf(t);if(!e)return[];const r=[{path:"name",label:"Name",type:"string"},{path:"visible",label:"Visible",type:"boolean"},{path:"object.type",label:"Native type",type:"string",readonly:!0}],s=H(e);return s?.fields&&r.push(...s.fields().filter(i=>!["name","visible"].includes(i.path)).map(({value:i,...a})=>a)),y(e)&&r.push({path:"material.color",label:"Color",type:"color",group:"Material"}),p(e)&&(r.push({path:"light.intensity",label:"Intensity",type:"number"}),r.push({path:"light.color",label:"Light Color",type:"color"}),g(e)&&r.push({path:"light.distance",label:"Distance",type:"number"}),ke(e)&&r.push({path:"shadow.cast",label:"Cast Shadow",type:"boolean"})),b(e)&&(r.push({path:"camera.fov",label:"FOV",type:"number"}),r.push({path:"camera.near",label:"Near",type:"number"}),r.push({path:"camera.far",label:"Far",type:"number"})),B(e)&&(r.push({path:"mesh.vertices",label:"Vertices",type:"number",readonly:!0}),r.push({path:"shadow.cast",label:"Cast Shadow",type:"boolean"}),r.push({path:"shadow.receive",label:"Receive Shadow",type:"boolean"})),r},get:(t,e)=>{const r=this.objectOf(t);if(!r)return;if(e==="name")return r.name;if(e==="visible")return r.visible;if(e==="object.type")return r.type;const s=H(r)?.fields?.().find(o=>o.path===e);if(s)return s.value();if(e==="material.color"){const o=y(r);return o?`#${o.color.getHexString()}`:void 0}if(e==="light.intensity")return p(r)?.intensity;if(e==="light.distance")return g(r)?.distance;if(e==="light.color"){const o=p(r);return o?`#${o.color.getHexString()}`:void 0}if(e==="camera.fov")return b(r)?.fov;if(e==="camera.near")return b(r)?.near;if(e==="camera.far")return b(r)?.far;if(e==="mesh.vertices"){const o=B(r);return o?o.getAttribute("position")?.count??0:void 0}if(e==="shadow.cast")return r.castShadow;if(e==="shadow.receive")return r.receiveShadow},set:(t,e,r)=>{if(this.historyResource?.assertCanMutate(),!this.persist){this.writeProp(t,e,r);return}const s=this.captureHistoryState(),o=this.readChannel(t,e);this.writeProp(t,e,r);const i=`Set ${this.objectOf(t)?.name||"Object"} ${e}`,a=this.readChannel(t,e);if(!(o!==void 0&&a!==void 0&&JSON.stringify(o)!==JSON.stringify(a))){this.recordHistory(i,s);return}return x({backend:this.persist,subject:()=>this.anchorFor(t,e),baseline:o,next:a,label:i,journal:()=>this.recordHistory(i,s)})}};subscribe(t){return this.store.shell.subscribe(t)}dispose(){this.disposed=!0;for(const t of this.watchedForStructure)t.removeEventListener("childadded",this.onStructureChanged),t.removeEventListener("childremoved",this.onStructureChanged);this.watchedForStructure.clear(),this.changedStructureRoots.clear(),this.historyResource?.dispose(),this.persist?.dispose()}readChannel(t,e){const r=this.objectOf(t);if(r)return e==="position"?r.position.toArray():e==="rotation"?[r.rotation.x,r.rotation.y,r.rotation.z]:e==="scale"?r.scale.toArray():this.inspector.get(t,e)}applyChannel(t,e,r){const s=this.objectOf(t);if(s){if(e==="position"&&Array.isArray(r))s.position.fromArray(r);else if(e==="rotation"&&Array.isArray(r)){const[o,i,a]=r;s.rotation.set(o??0,i??0,a??0)}else if(e==="scale"&&Array.isArray(r))s.scale.fromArray(r);else{this.writeProp(t,e,r);return}this.store.shell.notifyIngestEdit()}}writeTransform(t,e){this.historyResource?.assertCanMutate();const r=this.objectOf(t);r&&(r.position.set(e.position[0],e.position[1],e.position[2]),r.quaternion.set(e.rotation[0],e.rotation[1],e.rotation[2],e.rotation[3]),r.scale.set(e.scale[0],e.scale[1],e.scale[2]),this.record(t,{position:e.position,rotation:e.rotation,scale:e.scale}))}writeProp(t,e,r){const s=this.objectOf(t);if(s){if(e==="name")s.name=String(r);else if(e==="visible")s.visible=!!r,this.record(t,{visible:s.visible});else if(e==="material.color"){const o=y(s);o&&(o.color.set(String(r)),this.record(t,{color:`#${o.color.getHexString()}`}))}else if(e==="light.intensity"){const o=p(s);o&&(o.intensity=Number(r))}else if(e==="light.distance"){const o=g(s);o&&(o.distance=Number(r))}else if(e==="light.color")p(s)?.color.set(String(r));else if(e==="camera.fov"||e==="camera.near"||e==="camera.far"){const o=b(s);o&&(o[e.split(".")[1]]=Number(r),o.updateProjectionMatrix())}else e==="shadow.cast"?s.castShadow=!!r:e==="shadow.receive"&&(s.receiveShadow=!!r);this.store.shell.notifyIngestEdit()}}anchorFor(t,e){const r=this.objectOf(t),s=J(e),o=r&&s?.owner==="material"?y(r):r,i=s?.owner==="material"?te(o):C(o),a=i?this.persist?.anchor?.(i):null;if(a){const h=i?this.persist?.physicsPlaced?.(i,e):!1;return{entityId:t,property:e,anchor:a,anchorKind:h?"physics-binding":"source-prop",instances:1,sourceOid:i}}const n=ae(o);if(n!==null)return{entityId:t,property:e,anchor:ce(n),anchorKind:"data-record",instances:1,...i?{sourceOid:i}:{}};const c=i?this.options.sourceAnchor?.(i)??{anchored:!1,reason:"The source index has not resolved this object’s OID."}:Q(o??null);return{entityId:t,property:e,anchor:c,anchorKind:i?this.persist?.anchor?"source-prop":"live-only":c.anchored?"construction-literal":"live-only",instances:c.anchored&&c.kind==="source"?i?1:Y(c):0,...i?{sourceOid:i}:{}}}measureWriteReach(){this.refresh();let t=0;const e=Z();for(const r of this.projector.nodes.keys()){const s=this.anchorFor(r,"position");e[s.anchorKind]++,s.anchor.anchored&&t++}return{addressable:t,total:this.projector.nodes.size,destination:this.persist?.destination()??A,byKind:e}}captureChannelBaseline(t){const e=this.objectOf(t);if(e)return{position:e.position.toArray(),rotation:[e.rotation.x,e.rotation.y,e.rotation.z],scale:e.scale.toArray()}}persistOrJournal(t,e,r,s){const o=this.persist;if(!o)return;const i=s?this.captureChannelBaseline(t):void 0,a=s&&i?Object.keys(s).filter(c=>JSON.stringify(s[c])!==JSON.stringify(i[c])):[];a.length>1&&o.report(e,se(a));const n=a.length===1?a[0]:null;if(n===null){this.recordHistory(e,r);return}return x({backend:o,subject:()=>this.anchorFor(t,n),baseline:s[n],next:i[n],label:e,journal:()=>this.recordHistory(e,r)})}creationSiteKey(t){const e=t.anchor;return e.anchored&&e.kind==="source"?`${e.file}:${e.line}:${e.col}`:null}instancePropertyPaths(t,e){const r=["position","rotation","scale",...this.inspector.properties(t).filter(s=>!s.readonly).map(s=>s.path)];return[...new Set(r)].filter(s=>this.creationSiteKey(this.anchorFor(t,s))===e)}loadInstanceLiterals(t,e,r,s){const o=this.instanceLiteralRequests.get(s);if(o)return o;const i=this.instancePropertyPaths(e,s).map(n=>({property:n,live:this.readChannel(e,n)})).filter(n=>n.live!==void 0),a=t.readSiteLiterals({anchor:r.anchor,instances:r.instances,writeScope:"creation-site",properties:i}).then(n=>(this.instanceLiterals.set(s,n),this.store.shell.notifyIngestEdit(),n));return this.instanceLiteralRequests.set(s,a),a}sameInstanceValue(t,e){return Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((r,s)=>this.sameInstanceValue(r,e[s])):typeof t=="number"&&typeof e=="number"?Math.abs(t-e)<=1e-6:t===e}instanceComponentName(t){return t.constructor.name||t.type}instanceCountLabel(t){return`${t} ${t===1?"instance":"instances"}`}instanceOverride(t,e,r,s,o){const i=s[r],a=this.readChannel(e,r);if(!i||i.literal===null||a===void 0||this.sameInstanceValue(i.literal,a))return null;const n=t.gate({...this.anchorFor(e,r),writeScope:"creation-site"}),c=i.writable?n.ok?void 0:n.reason:i.reason,h=this.inspector.properties(e).find(u=>u.path===r)?.label??r;return{path:r,label:h,value:a,...i.text?{defaultText:i.text}:{},canApplyToComponent:c===void 0,...c?{applyUnavailableReason:c}:{},affectedInstanceCount:o.instances}}async applyInstanceDefault(t,e,r,s){const o={...this.anchorFor(r,s),writeScope:"creation-site"},i=this.creationSiteKey(o);if(!i)return{changed:!1,message:"This object has no source site."};const a=this.objectOf(r);if(!a)return{changed:!1,message:"This object is no longer in the live world."};const n=(await e(r,o,i))[s];if(!n)return{changed:!1,message:`The construction site names no ${s}.`};if(n.literal===null)return{changed:!1,message:`The construction site names no ${s} default.`};const c=this.readChannel(r,s);if(c===void 0)return{changed:!1,message:`${s} has no live value.`};if(!n.writable)return{changed:!1,message:n.reason??`${s} cannot be rewritten.`};const h=t.gate(o);if(!h.ok)return{changed:!1,message:h.reason};const u=o.instances,d=`Apply ${s} to ${this.instanceComponentName(a)} default (${this.instanceCountLabel(u)})`;if(!await t.write({...o,baseline:n.literal,next:c,label:d}))return{changed:!1,message:`${d} did not land; the console names why.`};this.instanceLiterals.delete(i),this.instanceLiteralRequests.delete(i),this.store.shell.notifyIngestEdit();const w=o.anchor.anchored?o.anchor.display:"this source site";return{changed:!0,message:`${s} now applies to all ${this.instanceCountLabel(u)} from ${w}.`,write:{destination:w,persisted:!0}}}creationSiteInstances(t){const e=async(r,s,o)=>this.instanceLiterals.get(o)??this.loadInstanceLiterals(t,r,s,o);return{describe:r=>{const s=this.anchorFor(r,"position"),o=this.creationSiteKey(s),i=this.objectOf(r);if(!o||!i)return null;const a=this.instanceLiterals.get(o);if(!a)return this.loadInstanceLiterals(t,r,s,o),null;if(Object.keys(a).length===0)return null;const n=this.instancePropertyPaths(r,o).map(c=>this.instanceOverride(t,r,c,a,s)).filter(c=>c!==null);return{componentName:this.instanceComponentName(i),...s.anchor.anchored?{sourcePath:s.anchor.display}:{},overrides:n}},revert:async(r,s)=>{const o=this.anchorFor(r,"position"),i=this.creationSiteKey(o);if(!i)return;const a=await e(r,o,i),n=this.captureHistoryState();let c=0;for(const h of s){const u=a[h]?.literal;u!=null&&(this.applyChannel(r,h,u),c++)}return c>0&&this.recordHistory(`Revert ${c} instance override(s)`,n),c>0?q:void 0},applyToComponent:(r,s)=>this.applyInstanceDefault(t,e,r,s)}}recordHistory(t,e){!this.historyResource||!e||this.historyResource.record(t,e,this.captureHistoryState()).catch(r=>{v.error(`[ingest] failed to journal "${t}" into project history — the edit is applied but has no history entry (it cannot be undone): ${r instanceof Error?r.message:String(r)}`)})}captureHistoryState(){const t={};for(const[e,r]of this.projector.nodes){const s=r.object,o=y(s),i=p(s),a=b(s);t[e]={name:s.name,visible:s.visible,transform:this.transforms.get(e),...o?{color:`#${o.color.getHexString()}`}:{},...i?{lightIntensity:i.intensity,lightColor:`#${i.color.getHexString()}`,...g(s)?{lightDistance:g(s).distance}:{}}:{},...a?{camera:{fov:a.fov,near:a.near,far:a.far}}:{},castShadow:s.castShadow,receiveShadow:s.receiveShadow}}return{edits:structuredClone(this.edits),objects:t}}restoreHistoryState(t){for(const[e,r]of Object.entries(t.objects)){const s=this.objectOf(e);if(!s)continue;s.name=r.name,s.visible=r.visible,s.position.fromArray(r.transform.position),s.quaternion.fromArray(r.transform.rotation),s.scale.fromArray(r.transform.scale),this.physicsFor(e)?.commit(e,r.transform),this.markedBodies.commit(e,r.transform),r.color&&y(s)?.color.set(r.color);const o=p(s);if(o&&(r.lightIntensity!==void 0&&(o.intensity=r.lightIntensity),r.lightColor&&o.color.set(r.lightColor),r.lightDistance!==void 0)){const a=g(s);a&&(a.distance=r.lightDistance)}const i=b(s);i&&r.camera&&(i.fov=r.camera.fov,i.near=r.camera.near,i.far=r.camera.far,i.updateProjectionMatrix()),s.castShadow=r.castShadow,s.receiveShadow=r.receiveShadow}this.edits=structuredClone(t.edits),this.store.shell.notifyIngestEdit()}}function Je(l,t,e){return new E(l,t,{identity:de({camera:e.camera}),journal:e.journal,persistence:oe({history:l.shell.projectHistory,writer:e.sourceWriter}),loop:e.loop,...e.frameControl?{frameControl:e.frameControl}:{},provenance:Ce})}function Ke(l,t,e){return new E(l,t,{identity:D(e.worldId,{camera:e.camera}),journal:e.journal,persistence:Se({history:l.shell.projectHistory,backend:e.backend}),loop:e.loop,...e.frameControl?{frameControl:e.frameControl}:{},provenance:Ie,sourceDeclaresStories:!0})}function Ve(l,t,e,r,s={}){return new E(l,t,{identity:D(e),journal:r,frameControl:"host",sourceAnchor:s.sourceAnchor,...s.explicitSourceCommit?{sourceCommit:we({history:l.shell.projectHistory,...s.backend?{backend:s.backend}:{}})}:{}})}export{Ke as a,Ve as o,De as r,Je as s};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/r3f-design-session-Dwqxg13i.js","assets/index-flxMlfV4.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-CPiRKiDC.css","assets/edit-mode-authoring-CVKwIPOy.js","assets/game-network-DtzKFtge.js","assets/index-OZVqp6xS.js","assets/index-Da9JhEvW.js","assets/native-debug-module-lR1oG4Vd.js","assets/native-entry-surface-BE8LJNdu.js","assets/debug-registry-BW5cue8V.js","assets/contract-system-adapters-0Odxcy6d.js","assets/game-contract-seams-GoIZaA0s.js","assets/seeded-random-BlGWBUER.js","assets/game-audio-BeCyd0Ha.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-nmQ1saHI.js","assets/capability-coverage-BqCZSu0R.js","assets/json-history-resource-DTUpacfx.js","assets/binding-resolver-TD7-fKuX.js","assets/adapter-surface-Y37Nzcyw.js","assets/structural-signature-Dc7skRiy.js","assets/webgl-frame-capture-DdJkM2mi.js","assets/realm-services-CL4ih5gp.js","assets/canvas-entry-runtime-Do5zL9dN.js","assets/three-ingest-runtime-B9surImB.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-CqJH4G9t.js","assets/active-ingest-BuNeO4Mb.js","assets/ingest-source-persistence-CJGE5-AU.js","assets/pixi-story-model-DNkfnWUV.js","assets/surface-content-Dg9Kkazf.js","assets/viewport-root-presentation-DEm3C1-i.js","assets/mounted-authoring-BHpx-z2Y.js","assets/entity-object-C374JqRs.js","assets/user-data-C8dmlLGA.js","assets/workspace-arrangement-BnGzBm57.js","assets/three-contract-Dkt6PmWY.js","assets/three-2yjp9YMj.js","assets/editor-layers-DI1Wkr8F.js","assets/component-instance-root-pq7uyyej.js","assets/viewport-editor-controls-BYaAZ_Ku.js","assets/three-authoring-adapter-B5h6dxvp.js","assets/source-persistence-backend-DoNJeJa8.js","assets/three-projection-core-xgnaC08N.js","assets/body-marks-C1LxJtQb.js","assets/user-data-CODoGZqA.js","assets/object-marks-BnvSuCTt.js","assets/structural-ids-BOo2BRoY.js","assets/object3d-authoring-subject-XccsO0xG.js","assets/r3f-physics-binding-D6DKTgwF.js","assets/deferred-ingest-play-C6qytzjB.js","assets/rrweb-Cd2ifIRP.js","assets/react-world-authoring-adapter-DVNps-az.js","assets/board-guides-ClHJXXuu.js","assets/relative-import-specifier-cRtWQWmH.js","assets/story-arg-descriptors-Ek86ExX7.js","assets/inspect-Dl5bH02T.js","assets/inference-diagnostics-MWqnRUsN.js","assets/writer-tw6EcuVO.js","assets/three-state-DVnNjIbQ.js","assets/editor-shell-store-DlGykD-E.js","assets/output-pass-HurwNl0G.js","assets/viewport-door-Brt6-rPp.js","assets/game-surface-defaults-D8S4cRxi.js","assets/scene-framing-CljHc6tN.js","assets/assets-BcrMQHRv.js","assets/loader-BTUKnX5Q.js","assets/KTX2Loader-CaqVE6nY.js","assets/GLTFLoader-KeoruJgS.js","assets/BufferGeometryUtils-B22h7jo4.js","assets/create-runtime-BhdSylT1.js","assets/binding-Bmxqznjk.js","assets/root-stacking-BEd9ZvxC.js","assets/setup-renderer-jOQdnmo7.js","assets/index-DHhMOs_s.js","assets/defaults-DKiBJCPN.js","assets/render-settings-Cnd69vhe.js","assets/render-features-BMOBYkLQ.js","assets/loop-gate-report-N52EWFGD.js","assets/system-slot-E2mEdiih.js","assets/performance-profiler-CMbwGBuk.js","assets/live-gesture-lock-DJbrjOqf.js"])))=>i.map(i=>d[i]);
2
+ import{_ as s,az as n}from"./index-flxMlfV4.js";import{r as a}from"./design-time-mount-registry-DUpXCg1U.js";import{q as c}from"./edit-mode-authoring-CVKwIPOy.js";import{a as u}from"./json-history-resource-DTUpacfx.js";import{o as h}from"./three-authoring-adapter-B5h6dxvp.js";import{t as i}from"./editor-shell-store-DlGykD-E.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"./component-instance-root-pq7uyyej.js";import"./user-data-C8dmlLGA.js";import"./workspace-arrangement-BnGzBm57.js";import"./source-persistence-backend-DoNJeJa8.js";import"./ingest-source-persistence-CJGE5-AU.js";import"./three-projection-core-xgnaC08N.js";import"./editor-layers-DI1Wkr8F.js";import"./three-2yjp9YMj.js";import"./entity-object-C374JqRs.js";import"./three-contract-Dkt6PmWY.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three.core-3arARmh6.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./r3f-physics-binding-D6DKTgwF.js";import"./output-pass-HurwNl0G.js";import"./three.module-BLhyNg0e.js";import"./Pass-D1MRT672.js";const U="workspace.service";function X(){const r=s(()=>import("./r3f-design-session-Dwqxg13i.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99]));r.catch(()=>{});const m=n("three",(t,o)=>h(i(t),()=>i(t).scene,o,u(o))),e=a({kind:"three",owner:"@volter/editor-game/three/three-authoring",async mountWorldRootSession(t){const o=t,{mountR3FDesignSession:p}=await r;return p(o.store,o.composite,o.renderer)}});return c(),()=>{e(),m()}}export{U as point,X as start};
@@ -1 +1 @@
1
- import{T as n}from"./three.module-BLhyNg0e.js";import{EffectComposer as i}from"./EffectComposer-BEAt0PtQ.js";import{CSS3DRenderer as s}from"./CSS3DRenderer-BsAqfavI.js";import{M as m,T as c}from"./index-JjEYIC4G.js";const a={three:n,EffectComposer:i,CSS3DRenderer:s};let r=null;async function f(){const e=await import(c),t=["projectThree","EffectComposer","CSS3DRenderer"].filter(o=>e[o]===void 0||e[o]===null);if(t.length>0)throw new Error(`The packaged runtime's synthetic three-ingest module did not export ${t.join(", ")} — see vite-plugin-module-doorways.ts.`);return{three:e.projectThree,EffectComposer:e.EffectComposer,CSS3DRenderer:e.CSS3DRenderer}}async function h(){return await m()?(r||(r=f()),r):a}export{h as r};
1
+ import{T as n}from"./three.module-BLhyNg0e.js";import{EffectComposer as i}from"./EffectComposer-BEAt0PtQ.js";import{CSS3DRenderer as s}from"./CSS3DRenderer-BsAqfavI.js";import{M as m,T as c}from"./index-flxMlfV4.js";const a={three:n,EffectComposer:i,CSS3DRenderer:s};let r=null;async function f(){const e=await import(c),t=["projectThree","EffectComposer","CSS3DRenderer"].filter(o=>e[o]===void 0||e[o]===null);if(t.length>0)throw new Error(`The packaged runtime's synthetic three-ingest module did not export ${t.join(", ")} — see vite-plugin-module-doorways.ts.`);return{three:e.projectThree,EffectComposer:e.EffectComposer,CSS3DRenderer:e.CSS3DRenderer}}async function h(){return await m()?(r||(r=f()),r):a}export{h as r};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ToolObject3DPreview-COEdg5Yk.js","assets/jsx-runtime-DPjLkJKQ.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/Object3DPreview-BlzCte35.js","assets/index-JjEYIC4G.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-CPiRKiDC.css","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/OrbitControls-B13MKuwC.js","assets/asset-preview-J56EM7ai.js","assets/editor-layers-C47WUNtv.js","assets/workspace-arrangement-D7VBwv9F.js","assets/renderer-ownership-BovSEcLv.js","assets/hierarchy-marks-DDRF3quV.js","assets/studio-environment-D3HaysRE.js","assets/user-data-DcUoY-0j.js","assets/KTX2Loader-CaqVE6nY.js","assets/GLTFLoader-KeoruJgS.js","assets/BufferGeometryUtils-B22h7jo4.js","assets/environment-Dg-YaLsA.js","assets/RoomEnvironment-BkknvS_I.js","assets/EXRLoader-CITMBvGd.js","assets/HDRLoader-BTGuGhVo.js","assets/bitmap-label-Ct4k6ehY.js","assets/editor-presentation-activity-CqJH4G9t.js","assets/model-thumbnail-ICdHSiW1.js","assets/StageHost-BToQY05P.js","assets/three-state-Bs6NttX2.js","assets/editor-shell-store-B-64vpgA.js","assets/output-pass-HurwNl0G.js","assets/Pass-D1MRT672.js","assets/entity-object-DBXB7ABG.js","assets/three-contract-Dkt6PmWY.js","assets/standard-viewport-dressing-BYqJ1RDj.js","assets/content-bounds-BM2BJV41.js","assets/preview-renderer-BrYNFV1p.js","assets/live-mixers-B-bwLZ7c.js","assets/live-gesture-lock-DJbrjOqf.js","assets/model-inspection-BMy0MuzJ.js","assets/three-viewport-presentation-D8F-c141.js","assets/clip-planes-CnAI6DZn.js","assets/three-CqcAlmZt.js","assets/component-instance-root-BpMFxtbQ.js","assets/viewport-editor-controls-BYaAZ_Ku.js","assets/LineSegments2-DN9pUfWA.js","assets/three.quarks.esm-C_HmSKXo.js","assets/scene-framing-B1butaCp.js","assets/object3d-document-session-registry-CIdYrDwO.js","assets/source-object3d-authoring-adapter-Bansi23s.js","assets/three-projection-core-CMYaSPZP.js","assets/viewport-door-Ct3Jwvkd.js","assets/transport-strip-Do5Y5zz_.js","assets/viewport-surface-status-BlPwrnIq.js","assets/ModelAssetDocument-Bf5JZ8TF.js","assets/host-hierarchy-objects-BV3WqU2w.js","assets/layered-pick-ClYksj6v.js","assets/root-stacking-BEd9ZvxC.js","assets/EntityModelDocument-BGtt8kn8.js","assets/EnvironmentAssetDocument-Cv_9BvF0.js","assets/asset-editor-persistence-FoI6VqbB.js","assets/LutAssetDocument-BV6N2-qQ.js","assets/index-DHhMOs_s.js","assets/ShaderAssetDocument-BCAyVHUs.js","assets/ColorInput-CsU6nBCb.js","assets/LiveModuleDocument-CqN29siR.js","assets/Object3DDocumentViewport-BydKspxr.js","assets/QuarksAssetDocument-DcjHKYru.js","assets/project-provenance-BGnJXJwa.js","assets/InspectorObjectPreview-DA4bXZQD.js"])))=>i.map(i=>d[i]);
2
- import{aB as De,kN as Me,kM as X,aA as Te,ll as xe,g2 as Re,d2 as je,ax as Ve,_ as y,ae as Ne,lm as Le,ln as ze,lo as Fe,lp as Be,lq as He,lr as qe,ls as Ue,lt as We,lu as Ge,hj as Qe,lv as $e,bs as Je,lw as Ye,lx as Ke,ly as he,kP as z,aH as Z,aI as Xe,x as B,dR as Ze,lz as et,r as ve,B as tt,aJ as rt,lA as ot,lB as nt,lC as W,J as at,ct as st,kE as it}from"./index-JjEYIC4G.js";import{r as ct}from"./host-hierarchy-objects-BV3WqU2w.js";import{m as ge,l as ut}from"./renderer-ownership-BovSEcLv.js";import{W as we}from"./three.module-BLhyNg0e.js";import{cP as ye,ej as lt,_ as be,I as dt,fo as P,V as Se,dp as J,cp as ft,el as pt,bh as ee,d5 as mt}from"./three.core-3arARmh6.js";import{i as ht}from"./preview-renderer-BrYNFV1p.js";import{a as vt}from"./layered-pick-ClYksj6v.js";import{g as H}from"./user-data-DcUoY-0j.js";import{a as h}from"./jsx-runtime-DPjLkJKQ.js";import{r as f}from"./index-nmcBqr7Y.js";import{r as gt}from"./model-thumbnail-ICdHSiW1.js";import{b as wt,a as Pe}from"./object3d-document-session-registry-CIdYrDwO.js";import{t as k}from"./three-state-Bs6NttX2.js";import{a as q}from"./entity-object-DBXB7ABG.js";import{i as _e,c as yt}from"./hierarchy-marks-DDRF3quV.js";import{a as bt}from"./component-instance-root-BpMFxtbQ.js";import{a as St}from"./three-contract-Dkt6PmWY.js";import{t as I}from"./editor-shell-store-B-64vpgA.js";import{c as Pt,a as U}from"./viewport-door-Ct3Jwvkd.js";import{a as _t}from"./content-bounds-BM2BJV41.js";import{h as Et,d as Ee,p as Ct,j as te,r as re,s as At,k as oe,A as Ot,n as kt,o as It,c as Dt,q as Mt,m as Tt,t as xt,b as Rt,C as jt,u as ne,v as Vt,w as G,x as Nt,y as Lt,z as zt,B as Ft,D as Bt,E as Ht,F as qt,e as Ut,f as Wt}from"./asset-preview-J56EM7ai.js";const Gt=1,C=[];function $(t){const e=C.indexOf(t);e>=0&&C.splice(e,1),t.renderer.dispose(),t.renderer.forceContextLoss(),t.canvas.remove()}function Qt(t,e){const r=document.createElement("canvas");r.style.width="100%",r.style.height="100%",r.style.display="block",r.width=Math.max(1,t),r.height=Math.max(1,e);const o={canvas:r,renderer:ge(new we({canvas:r,antialias:!0,alpha:!0})),leased:!0,lost:!1,onContextLost:null};return r.addEventListener("webglcontextlost",()=>{o.lost=!0,o.onContextLost?.();const n=C.indexOf(o);n>=0&&C.splice(n,1),o.leased||$(o)}),C.push(o),o}function $t(t){const{renderer:e}=t;e.setRenderTarget(null),e.setScissorTest(!1),e.setViewport(0,0,Math.max(1,t.canvas.width),Math.max(1,t.canvas.height)),e.setScissor(0,0,Math.max(1,t.canvas.width),Math.max(1,t.canvas.height)),e.autoClear=!0,e.autoClearColor=!0,e.autoClearDepth=!0,e.autoClearStencil=!0,e.sortObjects=!0,e.localClippingEnabled=!1,e.clippingPlanes=[],e.shadowMap.enabled=!1,e.shadowMap.autoUpdate=!0,e.toneMapping=ye,e.toneMappingExposure=1,e.outputColorSpace=lt,e.xr.enabled=!1,e.setAnimationLoop(null),e.setClearColor(0,0),e.clear(!0,!0,!0),e.info.reset()}function uo(t,e,r){let o=C.find(s=>!s.leased&&!s.lost);o||(o=Qt(t,e)),o.leased=!0,o.onContextLost=r??null;const n=o;let a=!1;return{canvas:n.canvas,renderer:n.renderer,release(){if(a)return;if(a=!0,n.leased=!1,n.onContextLost=null,n.canvas.remove(),n.lost){$(n);return}$t(n);const s=C.filter(c=>!c.leased&&!c.lost);for(const c of s.slice(Gt))$(c)}}}function Jt(){return{active:C.filter(t=>t.leased&&!t.lost).length,idle:C.filter(t=>!t.leased&&!t.lost).length}}function Yt(t,e){if(e!==null&&De(e))for(const o of t.values())o.visible=!1}const Kt=new be("#aaaaaa");function Xt(t){t.background=Kt,t.fog=null,t.environment=null,t.traverse(e=>{H(e,"envObject")&&(e.visible=!1)})}const Zt={activeAuthoring:t=>Ve(t),panelAuthoring:t=>je(t).adapter,pick:(t,e,r,o)=>vt(t,e,r,{intent:o}),toolOwner:(t,e)=>Re(t,e),toolOwnerPainted:(t,e)=>X(t)&&xe(t,e),threeSurfaceShowing:(t,e)=>X(t)&&(e instanceof Te?e.childAdapters().some(r=>r.kind==="three"):!e.rects&&typeof e.hierarchy.object3D=="function"),threeViewportRootId:t=>Me(t),applyRootHiddenVisibility:Yt,suppressRootEnvironment:Xt},er=f.lazy(async()=>({default:(await y(async()=>{const{ToolObject3DPreview:t}=await import("./ToolObject3DPreview-COEdg5Yk.js");return{ToolObject3DPreview:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]))).ToolObject3DPreview})),tr=f.lazy(async()=>({default:(await y(async()=>{const{ToolObject3DAuthoring:t}=await import("./StageHost-BToQY05P.js").then(e=>e.S);return{ToolObject3DAuthoring:t}},__vite__mapDeps([32,4,5,2,6,1,7,8,9,10,11,33,34,35,12,13,36,16,17,21,37,38,39,40,19,25,26,27,28,41,18,42,43,44,45,46,47,48,49,31,20,22,23,24,14,50,51,52,53,54,55,30,56,57,58]))).ToolObject3DAuthoring}));function rr(t){return h.jsx(f.Suspense,{fallback:h.jsx("div",{style:{minHeight:240},children:"Loading 3D preview…"}),children:h.jsx(er,{...t})})}function or(t){return f.useEffect(()=>Ne(t.documentId),[t.documentId]),h.jsx(f.Suspense,{fallback:h.jsx("div",{style:{minHeight:240},children:"Loading 3D authoring surface…"}),children:h.jsx(tr,{...t})})}const ae={model:f.lazy(async()=>{const{ModelAssetDocument:t}=await y(async()=>{const{ModelAssetDocument:e}=await import("./ModelAssetDocument-Bf5JZ8TF.js");return{ModelAssetDocument:e}},__vite__mapDeps([59,1,2,5,6,7,8,4,9,10,11,15,16,17,18,19,20,21,22,12,13,23,24,25,26,27,28,29,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,14,50,51,52,53,54,55,30,56,57,58,60,61,62]));return{default:e=>h.jsx(t,{documentId:e.documentId,assetPath:e.assetPath,displayName:e.displayName,active:e.active})}}),"entity-model":f.lazy(async()=>{const{EntityModelDocument:t}=await y(async()=>{const{EntityModelDocument:e}=await import("./EntityModelDocument-BGtt8kn8.js");return{EntityModelDocument:e}},__vite__mapDeps([63,1,2,34,35,12,13,36,16,17,4,5,6,7,8,9,10,11,21,37,38,42,15,18,19,20,22,23,24,25,26,27,28,29,32,33,39,40,41,43,44,45,46,47,48,49,31,14,50,51,52,53,54,55,30,56,57,58,60,61,62]));return{default:e=>h.jsx(t,{documentId:e.documentId,entityId:e.entityId??"",displayName:e.displayName,active:e.active})}}),environment:f.lazy(async()=>{const{EnvironmentAssetDocument:t}=await y(async()=>{const{EnvironmentAssetDocument:e}=await import("./EnvironmentAssetDocument-Cv_9BvF0.js");return{EnvironmentAssetDocument:e}},__vite__mapDeps([64,1,2,4,5,6,7,8,9,10,11,12,13,14,27,28,65]));return{default:e=>h.jsx(t,{documentId:e.documentId,assetPath:e.assetPath,active:e.active})}}),lut:f.lazy(async()=>{const{LutAssetDocument:t}=await y(async()=>{const{LutAssetDocument:e}=await import("./LutAssetDocument-BV6N2-qQ.js");return{LutAssetDocument:e}},__vite__mapDeps([66,1,2,4,5,6,7,8,9,10,11,67,12,13,65]));return{default:e=>h.jsx(t,{documentId:e.documentId,assetPath:e.assetPath,active:e.active})}}),shader:f.lazy(async()=>{const{ShaderAssetDocument:t}=await y(async()=>{const{ShaderAssetDocument:e}=await import("./ShaderAssetDocument-BCAyVHUs.js");return{ShaderAssetDocument:e}},__vite__mapDeps([68,1,2,4,5,6,7,8,9,10,11,69,12,13,65]));return{default:e=>h.jsx(t,{documentId:e.documentId,assetPath:e.assetPath,active:e.active})}}),"model-preview":f.lazy(async()=>{const{Object3DPreview:t}=await y(async()=>{const{Object3DPreview:e}=await import("./Object3DPreview-BlzCte35.js");return{Object3DPreview:e}},__vite__mapDeps([3,4,5,2,6,1,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]));return{default:e=>h.jsx(t,{assetPath:e.assetPath,...e.materialPath?{materialPath:e.materialPath}:{},displayName:e.displayName})}}),module:f.lazy(async()=>{const{LiveModuleDocument:t}=await y(async()=>{const{LiveModuleDocument:e}=await import("./LiveModuleDocument-CqN29siR.js");return{LiveModuleDocument:e}},__vite__mapDeps([70,1,2,4,5,6,7,8,9,10,11,15,16,17,18,19,20,21,22,12,13,23,24,25,26,27,28,29,53,71,58,39,40]));return{default:e=>e.projectRoot?h.jsx(t,{documentId:e.documentId,projectRoot:e.projectRoot,modulePath:(e.assetPath.split(/[?#]/,1)[0]??e.assetPath).replace(/^\//,""),displayName:e.displayName,active:e.active,fallback:e.fallback}):e.fallback}})},nr={recognize:async(t,e)=>(await y(async()=>{const{loadNativeQuarksJsonSource:r}=await import("./QuarksAssetDocument-DcjHKYru.js");return{loadNativeQuarksJsonSource:r}},__vite__mapDeps([72,1,2,5,6,7,8,4,9,10,11,20,21,17,22,12,13,23,24,25,26,27,28,51,73,32,33,34,35,36,16,37,38,39,40,19,41,18,42,43,44,45,46,47,48,49,31,14,50,52,53,54,55,30,56,57,58,60,61,62,15,29]))).loadNativeQuarksJsonSource(t,e),Viewer:f.lazy(async()=>{const{QuarksAssetDocument:t}=await y(async()=>{const{QuarksAssetDocument:e}=await import("./QuarksAssetDocument-DcjHKYru.js");return{QuarksAssetDocument:e}},__vite__mapDeps([72,1,2,5,6,7,8,4,9,10,11,20,21,17,22,12,13,23,24,25,26,27,28,51,73,32,33,34,35,36,16,37,38,39,40,19,41,18,42,43,44,45,46,47,48,49,31,14,50,52,53,54,55,30,56,57,58,60,61,62,15,29]));return{default:e=>h.jsx(t,{documentId:e.documentId,assetPath:e.assetPath,displayName:e.displayName,active:e.active,source:e.content})}})};function ar(){const t=[...Object.keys(ae).map(e=>Le(e,ae[e])),ze(nr)];return()=>{for(const e of t)e()}}async function se(t){const e=new Image;return e.src=t,await e.decode(),e}function sr(){return Fe((t,e)=>{const r=k();if(r&&r.viewportCanvas()===t)return(async()=>{const n=await Be(t);if(n)return n;const a=r.captureViewportImage(e);return a?se(a):null})();const o=wt().find(n=>n.renderer.domElement===t);return o?(async()=>{const n=await o.requestPresentedFrame();if(n)return n;const a=o.captureImage(e);return a?se(a):null})():null})}function ir(t){const e=yt(t);if(e||_e(t)||H(t,"authoringRoot")===!0||!bt(t))return e;const r=H(t,"authoringComponent");return typeof r=="string"&&r?r:void 0}function cr(t){if(typeof t.object3D!="function")return He;const r=new Map;return o=>{if(r.has(o))return r.get(o);const n=St(t,o),a=n?{componentRoot:ir(n),authoredEntity:H(n,"authoringRoot")===!0,builtInternal:_e(n)}:void 0;return r.set(o,a),a}}const ur=1e-4,lr="World-anchored — content is placed in world space by the game each frame; moving this container offsets future placements away from their source.";function Ce(t){if(!t)return 0;const e=t;if(e.isInstancedMesh!==!0)return 0;const r=e.count;return typeof r=="number"&&r>0?r:0}function dr(t){const e=t.elements;for(let r=0;r<16;r++){const o=r%5===0?1:0,n=e[r];if(!Number.isFinite(n)||Math.abs(n-o)>ur)return!1}return!0}const ie=new dt,ce=new P;function fr(t,e){const r=Ce(t);if(r===0)return null;const o=pr(t,e);return{units:r,detail:Ae(r),worldAnchored:o,note:o?lr:null}}function pr(t,e){if(!e||e.isEmpty()||!dr(t.matrixWorld))return!1;const r=t.geometry;return r.boundingBox===null&&r.computeBoundingBox(),r.boundingBox?(ie.copy(r.boundingBox),e.getCenter(ce),!ie.containsPoint(ce)):!1}function mr(t){const e=Ce(t);return e===0?null:Ae(e)}function Ae(t){return`${t} instanced unit${t===1?"":"s"}`}function hr(){return qe({detail:(t,e,r)=>mr(q(t,I(r).objectMap,e)),marks:t=>cr(t),structureLog:t=>{const e=I(t);return{epoch:()=>e.gizmoEpoch,parentChangesSince:r=>e.ingestObjectMapChangesSince(r)}}})}function vr(t){return Math.min(1600,Math.max(800,900+t*25))}function gr(t){return t<.5?4*t*t*t:1-(-2*t+2)**3/2}function Oe(t,e,r=new P(0,1,0)){const o=new P().subVectors(e,t),n=o.length();if(n<1e-6)return[t.clone(),t.clone(),e.clone(),e.clone()];const a=Math.min(n*.18,6),s=new P().crossVectors(o,r);s.lengthSq()>1e-9?s.normalize().multiplyScalar(Math.min(n*.08,2.5)):s.set(0,0,0);const c=r.clone().normalize().multiplyScalar(a),u=t.clone().addScaledVector(o,.3).add(c).add(s),m=e.clone().addScaledVector(o,-.3).addScaledVector(c,.6).addScaledVector(s,.5);return[t.clone(),u,m,e.clone()]}const wr=1<<31;function yr(t){return(t.layers.mask&wr)!==0||/gizmo/i.test(t.name)}function ke(t){if(yr(t))return null;if(t.isCamera)return t;for(const e of t.children){const r=ke(e);if(r)return r}return null}function br(t,e,r){const o=new P,n=new J;return e.getWorldPosition(o),e.getWorldQuaternion(n),{entityId:t,position:o.toArray(),quaternion:n.toArray(),fov:r}}function Sr(t){for(const[e,r]of t.objectMap){const o=ke(r);if(!o)continue;const n=o;return br(e,o,n.isPerspectiveCamera?n.fov:60)}return null}function Pr(t){t.curve=new Se(Oe(t.startPos,t.endPos))}let D=null;function _r(t){const e=U(),r=k()?.objectMap,o=r?Sr({objectMap:r}):null;if(!o||!e)return!1;const n=e.camera.position.clone(),a=new P().fromArray(o.position);return D={runtime:{startPos:n,startQuat:e.camera.quaternion.clone(),startFov:e.camera.fov,endPos:a,endQuat:new J().fromArray(o.quaternion),endFov:o.fov,curve:new Se(Oe(n,a)),startedAt:performance.now(),durationMs:vr(n.distanceTo(a)),landed:!1},snapshot:{position:e.camera.position.clone(),target:e.orbit.target.clone(),up:e.camera.up.clone(),fov:e.camera.fov},onLanded:t,getLiveCamera:null,driving:!0},e.orbit.enabled=!1,!0}function Er(){const t=U(),e=D;if(!e||(e.driving=!1,!t))return;const r=t.camera,o=new P(0,0,-1).applyQuaternion(r.quaternion),n=Math.max(1,e.snapshot.position.distanceTo(e.snapshot.target));t.orbit.target.copy(r.position).addScaledVector(o,n),r.up.set(0,1,0).applyQuaternion(r.quaternion),t.orbit.enabled=!0}function Cr(){const t=D;if(!t)return;D=null;const e=U();if(!e)return;const r=t.snapshot;e.camera.position.copy(r.position),e.orbit.target.copy(r.target),e.camera.up.copy(r.up),e.camera.lookAt(r.target),e.camera.fov!==r.fov&&(e.camera.fov=r.fov,e.camera.updateProjectionMatrix()),e.orbit.enabled=!0,e.orbit.update()}const Q=new P,ue=new J;Pt(Ar);function Ar(){const t=D,e=U();if(!t||!e||!t.driving)return;const r=t.runtime,o=t.getLiveCamera?.()??null,n=o?.isObject3D?o:null;if(n){n.getWorldPosition(Q),n.getWorldQuaternion(ue),Q.distanceToSquared(r.endPos)>1e-8&&(r.endPos.copy(Q),Pr(r)),r.endQuat.copy(ue);const u=n.fov;typeof u=="number"&&(r.endFov=u)}const a=e.camera;if(r.landed){a.position.copy(r.endPos),a.quaternion.copy(r.endQuat),a.fov!==r.endFov&&(a.fov=r.endFov,a.updateProjectionMatrix());return}const s=Math.min(1,(performance.now()-r.startedAt)/r.durationMs),c=gr(s);a.position.copy(r.curve.getPoint(c)),a.quaternion.slerpQuaternions(r.startQuat,r.endQuat,c),a.fov=r.startFov+(r.endFov-r.startFov)*c,a.updateProjectionMatrix(),s>=1&&(r.landed=!0,t.onLanded())}function Or(){return Ue({begin:_r,track:t=>{D&&(D.getLiveCamera=t)},settle:Er,end:Cr})}const kr=f.lazy(()=>y(()=>import("./InspectorObjectPreview-DA4bXZQD.js"),__vite__mapDeps([74,1,2,63,34,35,12,13,36,16,17,4,5,6,7,8,9,10,11,21,37,38,42,15,18,19,20,22,23,24,25,26,27,28,29,32,33,39,40,41,43,44,45,46,47,48,49,31,14,50,51,52,53,54,55,30,56,57,58,60,61,62])).then(t=>({default:t.InspectorObjectPreview})));function Ir(t,e){return{preview:t.isCamera?null:({displayName:r,previewKey:o,actions:n})=>a=>f.createElement(Ge,{picture:()=>f.createElement(kr,{previewKey:o,object:t,displayName:r,fill:!0}),previewKey:o,actions:n,...a?{mode:a}:{}}),instanced:fr(t,_t(t)),assetDocument:e}}function Dr(){return We((t,e)=>{const r=k();if(!r)return null;const o=q(t,r.objectMap,e);return o?Ir(o,r.objectMap.has(e)?{open:()=>Qe("asset-editor:entity",r.shell,{entityId:e,title:o.name||e})}:null):null})}const le=new WeakMap,Y={activeAuthoring(t){let e=le.get(t);return e||(e=Je(t,"No authoring adapter"),le.set(t,e)),e},panelAuthoring(t){return Y.activeAuthoring(t)},pick(){return null},toolOwner:$e,toolOwnerPainted(){return!0},threeSurfaceShowing(t,e){return!e.rects&&typeof e.hierarchy.object3D=="function"},threeViewportRootId(){return null},applyRootHiddenVisibility(){},suppressRootEnvironment(){}};let F=Y;function Mr(t){if(F!==t){if(F!==Y)throw new Error("A viewport authoring policy is already installed.");F=t}}function lo(){return F}const de=0,Tr=16777215,fe=10;function xr(t){return Ct(t,"Compare reference GLB")}function pe(t,e){const r=Dt(t),o=new ee;o.rotation.y=Mt(e),o.add(r);const n=new ee;n.add(o),n.updateWorldMatrix(!0,!0);const a=Tt(n,"front"),s=[a.center.x-a.size.x/2,a.center.y-a.size.y/2,a.center.z-a.size.z/2],c=[a.center.x+a.size.x/2,a.center.y+a.size.y/2,a.center.z+a.size.z/2],u=xt(s,c);return n.scale.setScalar(u.scale),n.position.set(...u.position),n.updateWorldMatrix(!0,!0),{wrapper:n,dispose:()=>Rt(r)}}function Rr(t,e){const r=jt,o=r*e,n=new mt(-o,o,r,-r,.01,fe*4),a=t==="front"?new P(0,0,1):new P(1,0,0);return n.position.set(0,ne,0).addScaledVector(a,fe),n.up.set(0,1,0),n.lookAt(0,ne,0),n.updateProjectionMatrix(),n.updateMatrixWorld(!0),n}function jr(t,e,r={}){const o=te(r.width),n=te(r.height),a=o/n,s=[];let c=null;try{const u=pe(t,re(t));s.push(u.dispose);const m=pe(e,r.refForward??re(e));s.push(m.dispose);const O=new ft({color:Tr});s.push(()=>O.dispose());const L=p=>{const i=new pt;return i.background=new be(de),i.overrideMaterial=O,i.add(p),i},v=L(u.wrapper),b=L(m.wrapper),_=ge(new we({antialias:!1,alpha:!1,preserveDrawingBuffer:!0}));c=_,_.setPixelRatio(1),_.toneMapping=ye,_.setClearColor(de,1),_.setSize(o,n,!1);const M=document.createElement("canvas");M.width=o,M.height=n;const S=M.getContext("2d");if(!S)throw new Error("Unable to create the compare readback canvas.");const A=(p,i,R,g)=>{_.render(p,i),S.clearRect(0,0,o,n),S.drawImage(_.domElement,0,0);const j=S.getImageData(0,0,o,n).data,V=At(j,o*n);if(!V.some(K=>K!==0))throw new Error(`Compare ${g} view rendered an empty ${R} silhouette — nothing to score.`);return{image:{base64:oe(M),mimeType:"image/png"},mask:V}},w=document.createElement("canvas");w.width=o,w.height=n;const T=w.getContext("2d");if(!T)throw new Error("Unable to create the compare overlay canvas.");const x=[];for(const p of Ot){const i=Rr(p,a),R=A(v,i,"asset",p),g=A(b,i,"reference",p),j=kt(R.mask,g.mask);T.putImageData(new ImageData(It(R.mask,g.mask),o,n),0,0),x.push({view:p,iou:j.iou,overlay:{base64:oe(w),mimeType:"image/png"},asset:R.image,ref:g.image})}return{width:o,height:n,views:x}}finally{c?.dispose(),c?.forceContextLoss();for(const u of s.reverse())u()}}async function Vr(t,e,r={}){const o=await Et(t);try{return await Ie(o,e,r)}finally{Ee(o)}}async function Ie(t,e,r={}){const o=await xr(e);try{return jr(t,o,r)}finally{Ee(o)}}async function Nr(t,e){const r=e.assetPath,o=e.entityId,n=e.glbBase64;if(+(typeof r=="string")+ +(typeof o=="string")+ +(typeof n=="string")!==1)return{ok:!1,error:"capture-asset-preview requires exactly one of assetPath, entityId or glbBase64."};const s=e.width,c=e.height,u=e.background,m=e.shots,O=e.shotSet,L=e.forward,v=e.compare,b=e.stage,_=e.camera,M=e.pose;if(s!==void 0&&typeof s!="number"||c!==void 0&&typeof c!="number"||u!==void 0&&u!=="neutral"&&u!=="transparent"||m!==void 0&&m!=="source")return{ok:!1,error:"Invalid asset preview dimensions, background, or shots mode."};if(b!==void 0&&b!=="lab"&&b!=="scene")return{ok:!1,error:`capture-asset-preview stage must be "lab" or "scene", got ${String(b)}.`};if(O!==void 0&&m!==void 0)return{ok:!1,error:"capture-asset-preview cannot combine a shotSet definition with a shots mode."};const S=Ye("capture-asset-preview",_);if(typeof S=="string")return{ok:!1,error:S};const A=Ke("capture-asset-preview",M);if(typeof A=="string")return{ok:!1,error:A};if((S||A)&&(m!==void 0||O!==void 0||v!==void 0||b==="scene"))return{ok:!1,error:'capture-asset-preview cannot combine camera/pose with a shots mode, a shotSet definition, compare, or stage "scene" — those legs stage their own cameras and poses.'};let w;if(O!==void 0)try{w=Vt(O)}catch(i){return{ok:!1,error:i instanceof Error?i.message:String(i)}}const T=G(L);if(m==="source"&&T===null)return{ok:!1,error:"capture-asset-preview --shots source requires a non-degenerate forward [x,y,z]."};if(v!==void 0){if(m!==void 0||w!==void 0)return{ok:!1,error:"capture-asset-preview cannot combine compare with shots."};if(typeof v!="object"||v===null||typeof v.glbBase64!="string"||v.forward!==void 0&&G(v.forward)===null)return{ok:!1,error:"capture-asset-preview compare requires { glbBase64: string, forward?: [x, y, z] } with a non-degenerate ground-plane forward."}}if(typeof n=="string"){if(m!==void 0||v!==void 0)return{ok:!1,error:"capture-asset-preview cannot combine glbBase64 with a named shots mode or compare."};if(b==="scene")return{ok:!1,error:'capture-asset-preview stage "scene" photographs a live scene entity — glbBase64 bytes stand nowhere in the scene.'}}const x=b==="scene"?t.scene:null;if(b==="scene"){if(typeof o!="string")return{ok:!1,error:'capture-asset-preview stage "scene" photographs a live scene entity — pass entityId, not assetPath.'};if(m!==void 0||w!==void 0||v!==void 0)return{ok:!1,error:'capture-asset-preview cannot combine stage "scene" with a shots mode, a shotSet definition or compare.'};if(!x)return{ok:!1,error:'capture-asset-preview stage "scene" requires a bound viewport scene; none is bound yet.'}}const p=typeof o=="string"?q(he(t.shell),t.objectMap,o):null;if(typeof o=="string"&&!p)return{ok:!1,error:`Entity not found: ${o}`};try{const i={...typeof s=="number"?{width:s}:{},...typeof c=="number"?{height:c}:{},...u?{background:u}:{},...S?{camera:S}:{},...A?{pose:A}:{}};if(v!==void 0){const g=v,j=G(g.forward),V={...typeof s=="number"?{width:s}:{},...typeof c=="number"?{height:c}:{},...j?{refForward:j}:{}};return{ok:!0,data:{...typeof r=="string"?await Vr(r,g.glbBase64,V):await Ie(p,g.glbBase64,V)}}}return w!==void 0?{ok:!0,data:{...typeof n=="string"?await Nt(n,w,i):typeof r=="string"?await Lt(r,w,i):zt(p,w,i)}}:m==="source"?{ok:!0,data:{...typeof r=="string"?await Ft(r,T,i):Bt(p,T,i)}}:x?{ok:!0,data:{...Ht(p,x,i)}}:typeof n=="string"?{ok:!0,data:{...await qt(n,i)}}:{ok:!0,data:{...typeof r=="string"?await Ut(r,i):Wt(p,i)}}}catch(i){return{ok:!1,error:i instanceof Error?i.message:String(i)}}}function E(){const t=B();return t?Pe(t):null}function l(t,e,r="none"){return{...e===void 0?{}:{timeoutMs:e},derivedRefresh:r,handle:o=>{const n=k();return n?t(n,o):{ok:!1,error:`${o.type} needs an editor session; none has opened yet.`}}}}const d={ok:!0},Lr={"focus-entity":l((t,e)=>(E()?.frameIds([e.id])||t.shell.focusOnEntity(e.id),d)),"frame-entity":l((t,e)=>{const r=e.id;if(typeof r!="string"||r.length===0)return{ok:!1,error:'frame-entity requires a string "id" (the entity to frame).'};const o=E();if(o)return o.frameIds([r])?d:{ok:!1,error:`Entity not found: ${r}`,data:{code:"ENTITY_NOT_FOUND"}};const n=he(t.shell);return n.hierarchy.node(r)!==null&&n.rects||q(n,t.objectMap,r)?(t.shell.focusOnEntity(r),d):{ok:!1,error:`Entity not found: ${r}`,data:{code:"ENTITY_NOT_FOUND"}}}),"focus-selection":l(t=>(E()?.frameSelection()||t.shell.focusOnSelection(),d)),"view-preset":l((t,e)=>{const r=e.preset,o=["top","front","right","perspective"];if(typeof r!="string"||!o.includes(r))return{ok:!1,error:`view-preset requires one of ${o.join(", ")}, got ${r===void 0?"nothing":JSON.stringify(r)}.`};const n=r,a=E();return a?a.setViewPreset(n==="perspective"?"isometric":n):t.shell.setViewPreset(n),d}),"set-camera":l((t,e)=>{const r=e.position,o=e.target,n=e.fov;if(!r||!o||typeof r.x!="number"||typeof r.y!="number"||typeof r.z!="number"||typeof o.x!="number"||typeof o.y!="number"||typeof o.z!="number")return{ok:!1,error:"set-camera requires numeric {x,y,z} position and target."};const a=E();return a?a.setCameraPose(r,o,n):t.shell.setCameraPose(r,o,n),d}),"document-orbit":l((t,e)=>me(e),12e4),"document-turntable":l((t,e)=>me(e),12e4),"document-frame":l((t,e)=>{const r=E();if(!r)return{ok:!1,error:"document-frame needs an Object3D document open and active. For the Scene viewport use `frame-entity`/`focus-selection`.",data:{code:"NO_ACTIVE_OBJECT3D_DOCUMENT"}};const o=e.fit;return o!==void 0&&(typeof o!="number"||!(o>=.1&&o<=10))?{ok:!1,error:'document-frame: "fit" must be a number in 0.1..10.'}:r.frame(typeof o=="number"?o:1)?{ok:!0,data:{...r.cameraPose()}}:{ok:!1,error:"Nothing to frame: the document subject has no measurable bounds.",data:{code:"EMPTY_FRAME_BOUNDS"}}}),"capture-viewport":l(async(t,e)=>{const r=et(e);if("error"in r)return{ok:!1,error:r.error};if(t.hasAdoptedScene)try{const s=await ve().documents.captureActive(r.size);return{ok:!0,data:{base64:s.base64,mimeType:s.mimeType}}}catch(s){return{ok:!1,error:s instanceof Error?s.message:String(s)}}const o=t.captureViewportImage(r.size);if(!o)return{ok:!1,error:`This door photographs the editor's own three.js Scene viewport, and nothing has bound one (no renderer/scene/camera). A canvas-surface world (a first-party canvas root, or a PixiJS/Phaser/Babylon ingest) never binds it — it draws on its own canvas in the Game document. Capture that through \`capture-active-document\` (\`editor.captureActiveDocument()\`) or the running game through \`bridge-screenshot\` (${tt("screenshot")}).`};const n=o.indexOf(",");return{ok:!0,data:{base64:n>=0?o.slice(n+1):o,mimeType:"image/png"}}},void 0,"if-content-changed"),"capture-asset-preview":l((t,e)=>Nr(t,e),3e4,"if-content-changed"),"set-grid":l((t,e)=>{const r=B();return!r||!Z(r)?{ok:!1,error:"set-grid: the active document draws no grid."}:(Ze(r,e.enabled),d)}),"set-helpers":l((t,e)=>{const r=z(t.shell);return r.showHelpers!==e.enabled&&r.toggleHelpers(),d}),"set-stats":l((t,e)=>{const r=z(t.shell);return I(r).showStats!==e.enabled&&I(r).toggleStats(),d}),"set-shading-mode":l((t,e)=>{const r=E(),o=e.mode;if(o==="preview"||o==="rendered"){const n=B(),a=n?Z(n)?.stageKind:void 0;if(!r||!a||Xe(a)?.modes?.[o]?.lighting===void 0)return{ok:!1,error:`Shading mode "${o}" is lit as a stage says, and the active document's stage says nothing for it.`}}return r?r.setMode(e.mode):t.setShadingMode(e.mode),d}),"set-helper-type":l((t,e)=>{const r=z(t.shell),o=e.helperType,n=E();return n&&o==="bounds"?(n.setBounds(e.enabled),d):n&&o==="skeletons"?(n.setSkeleton(e.enabled),d):(r.helperVisibility[o]!==e.enabled&&r.toggleHelperType(o),d)}),"set-transform-mode":l((t,e)=>(t.shell.setTransformMode(e.mode),d)),"set-transform-space":l((t,e)=>(t.shell.setTransformSpace(e.space),d)),"set-snap":l((t,e)=>(t.shell.snapEnabled!==e.enabled&&t.shell.toggleSnap(),d))};async function me(t){const e=E();if(!e)return{ok:!1,error:`${t.type} needs an Object3D document open and active (a model, a live module, an entity model). Open one with \`editor.openAsset(<path>)\` first.`,data:{code:"NO_ACTIVE_OBJECT3D_DOCUMENT"}};const r=t.type==="document-orbit"?t.duration:t.seconds;return r!==void 0&&(typeof r!="number"||!(r>=0&&r<=60))?{ok:!1,error:`${t.type}: the move's length must be a number of seconds in 0..60.`}:{ok:!0,data:{...t.type==="document-orbit"?await e.orbit({...typeof t.azimuth=="number"?{azimuth:t.azimuth}:{},...typeof t.elevation=="number"?{elevation:t.elevation}:{},...typeof r=="number"?{duration:r}:{}}):await e.turntable({...typeof r=="number"?{seconds:r}:{},...typeof t.revolutions=="number"?{revolutions:t.revolutions}:{}})}}}function zr(){return ve().session.reportFacet(()=>{const t=k();if(!t)return{};const e=z(t.shell),r=B(),o=r?Pe(r)?.presentation():void 0,n=I(e).cameraPose;return{showGrid:r?rt(r):!0,showHelpers:e.showHelpers,showStats:I(e).showStats,shadingMode:o?.mode??t.shadingMode,helperVisibility:{...e.helperVisibility,...o?{bounds:o.bounds,skeletons:o.skeleton}:{}},transformMode:e.transformMode,transformSpace:t.shell.transformSpace,snapEnabled:t.shell.snapEnabled,...n?{camera:{position:{x:n.position.x,y:n.position.y,z:n.position.z},target:{x:n.target.x,y:n.target.y,z:n.target.z},fov:n.fov}}:{}}})}const Fr={save:t=>it("view",t),saveThumbnail:st},Br=new Map;let N=null;function fo(){if(N)return N;const t=[ot({Object3DPreview:rr,Object3DAuthoring:or}),nt("three-viewport",Lr),ar(),Dr(),gt(),zr(),sr(),hr(),Or(),ct({object:e=>k()?.objectMap.get(e)??null,objects:()=>k()?.objectMap??Br}),W("hostLive",ut),W("interactive",Jt),W("inspectorPreview",ht),at(e=>I(e).attachStatePersistence(Fr))];return Mr(Zt),N=()=>{for(const e of t.reverse())e();N=null},N}export{uo as a,fr as d,fo as e,Ce as i,lo as v};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ToolObject3DPreview-C52QCJAO.js","assets/jsx-runtime-DPjLkJKQ.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/Object3DPreview-DI7aoPKe.js","assets/index-flxMlfV4.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-CPiRKiDC.css","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/OrbitControls-B13MKuwC.js","assets/asset-preview-C36PaXvM.js","assets/editor-layers-DI1Wkr8F.js","assets/workspace-arrangement-BnGzBm57.js","assets/renderer-ownership-BovSEcLv.js","assets/hierarchy-marks-EEQa08In.js","assets/studio-environment-Dw2FBct5.js","assets/user-data-C8dmlLGA.js","assets/KTX2Loader-CaqVE6nY.js","assets/GLTFLoader-KeoruJgS.js","assets/BufferGeometryUtils-B22h7jo4.js","assets/environment-Dg-YaLsA.js","assets/RoomEnvironment-BkknvS_I.js","assets/EXRLoader-CITMBvGd.js","assets/HDRLoader-BTGuGhVo.js","assets/bitmap-label-Ct4k6ehY.js","assets/editor-presentation-activity-CqJH4G9t.js","assets/model-thumbnail-WJb6B3qQ.js","assets/StageHost-CSw286Im.js","assets/three-state-DVnNjIbQ.js","assets/editor-shell-store-DlGykD-E.js","assets/output-pass-HurwNl0G.js","assets/Pass-D1MRT672.js","assets/entity-object-C374JqRs.js","assets/three-contract-Dkt6PmWY.js","assets/standard-viewport-dressing-B8VpmbHt.js","assets/content-bounds-Ax7CFkXJ.js","assets/preview-renderer-BrYNFV1p.js","assets/live-mixers-B-bwLZ7c.js","assets/live-gesture-lock-DJbrjOqf.js","assets/model-inspection-BS3uYvYU.js","assets/three-viewport-presentation-C5wGhMgD.js","assets/clip-planes-CnAI6DZn.js","assets/three-2yjp9YMj.js","assets/component-instance-root-pq7uyyej.js","assets/viewport-editor-controls-BYaAZ_Ku.js","assets/LineSegments2-DN9pUfWA.js","assets/three.quarks.esm-C_HmSKXo.js","assets/scene-framing-CljHc6tN.js","assets/object3d-document-session-registry-DI9WfJDy.js","assets/source-object3d-authoring-adapter-qg_NN2PX.js","assets/three-projection-core-xgnaC08N.js","assets/viewport-door-Brt6-rPp.js","assets/transport-strip-Dvkyjqwq.js","assets/viewport-surface-status-Dbc5Yxun.js","assets/ModelAssetDocument-DKyxph4r.js","assets/host-hierarchy-objects-BV3WqU2w.js","assets/layered-pick-DKNj5L29.js","assets/root-stacking-BEd9ZvxC.js","assets/EntityModelDocument-BkRbfE7C.js","assets/EnvironmentAssetDocument-BbWPrmTc.js","assets/asset-editor-persistence-DttxUta0.js","assets/LutAssetDocument-C_QGvjj7.js","assets/index-DHhMOs_s.js","assets/ShaderAssetDocument-ysUJR4Np.js","assets/ColorInput-B-GRGKwB.js","assets/LiveModuleDocument-CCpe63vw.js","assets/Object3DDocumentViewport-C81c8PFJ.js","assets/QuarksAssetDocument-DEcSmewA.js","assets/project-provenance-BGnJXJwa.js","assets/InspectorObjectPreview-BooanIbq.js"])))=>i.map(i=>d[i]);
2
+ import{aB as De,kN as Me,kM as X,aA as Te,ll as xe,g2 as Re,d2 as je,ax as Ve,_ as y,ae as Ne,lm as Le,ln as ze,lo as Fe,lp as Be,lq as He,lr as qe,ls as Ue,lt as We,lu as Ge,hh as Qe,lv as $e,bs as Je,lw as Ye,lx as Ke,ly as he,kP as z,aH as Z,aI as Xe,x as B,dR as Ze,lz as et,r as ve,B as tt,aJ as rt,lA as ot,lB as nt,lC as W,J as at,ct as st,kE as it}from"./index-flxMlfV4.js";import{r as ct}from"./host-hierarchy-objects-BV3WqU2w.js";import{m as ge,l as ut}from"./renderer-ownership-BovSEcLv.js";import{W as we}from"./three.module-BLhyNg0e.js";import{cP as ye,ej as lt,_ as be,I as dt,fo as P,V as Se,dp as J,cp as ft,el as pt,bh as ee,d5 as mt}from"./three.core-3arARmh6.js";import{i as ht}from"./preview-renderer-BrYNFV1p.js";import{a as vt}from"./layered-pick-DKNj5L29.js";import{g as H}from"./user-data-C8dmlLGA.js";import{a as h}from"./jsx-runtime-DPjLkJKQ.js";import{r as f}from"./index-nmcBqr7Y.js";import{r as gt}from"./model-thumbnail-WJb6B3qQ.js";import{b as wt,a as Pe}from"./object3d-document-session-registry-DI9WfJDy.js";import{t as k}from"./three-state-DVnNjIbQ.js";import{a as q}from"./entity-object-C374JqRs.js";import{i as _e,c as yt}from"./hierarchy-marks-EEQa08In.js";import{a as bt}from"./component-instance-root-pq7uyyej.js";import{a as St}from"./three-contract-Dkt6PmWY.js";import{t as I}from"./editor-shell-store-DlGykD-E.js";import{c as Pt,a as U}from"./viewport-door-Brt6-rPp.js";import{a as _t}from"./content-bounds-Ax7CFkXJ.js";import{h as Et,d as Ee,p as Ct,j as te,r as re,s as At,k as oe,A as Ot,n as kt,o as It,c as Dt,q as Mt,m as Tt,t as xt,b as Rt,C as jt,u as ne,v as Vt,w as G,x as Nt,y as Lt,z as zt,B as Ft,D as Bt,E as Ht,F as qt,e as Ut,f as Wt}from"./asset-preview-C36PaXvM.js";const Gt=1,C=[];function $(t){const e=C.indexOf(t);e>=0&&C.splice(e,1),t.renderer.dispose(),t.renderer.forceContextLoss(),t.canvas.remove()}function Qt(t,e){const r=document.createElement("canvas");r.style.width="100%",r.style.height="100%",r.style.display="block",r.width=Math.max(1,t),r.height=Math.max(1,e);const o={canvas:r,renderer:ge(new we({canvas:r,antialias:!0,alpha:!0})),leased:!0,lost:!1,onContextLost:null};return r.addEventListener("webglcontextlost",()=>{o.lost=!0,o.onContextLost?.();const n=C.indexOf(o);n>=0&&C.splice(n,1),o.leased||$(o)}),C.push(o),o}function $t(t){const{renderer:e}=t;e.setRenderTarget(null),e.setScissorTest(!1),e.setViewport(0,0,Math.max(1,t.canvas.width),Math.max(1,t.canvas.height)),e.setScissor(0,0,Math.max(1,t.canvas.width),Math.max(1,t.canvas.height)),e.autoClear=!0,e.autoClearColor=!0,e.autoClearDepth=!0,e.autoClearStencil=!0,e.sortObjects=!0,e.localClippingEnabled=!1,e.clippingPlanes=[],e.shadowMap.enabled=!1,e.shadowMap.autoUpdate=!0,e.toneMapping=ye,e.toneMappingExposure=1,e.outputColorSpace=lt,e.xr.enabled=!1,e.setAnimationLoop(null),e.setClearColor(0,0),e.clear(!0,!0,!0),e.info.reset()}function uo(t,e,r){let o=C.find(s=>!s.leased&&!s.lost);o||(o=Qt(t,e)),o.leased=!0,o.onContextLost=r??null;const n=o;let a=!1;return{canvas:n.canvas,renderer:n.renderer,release(){if(a)return;if(a=!0,n.leased=!1,n.onContextLost=null,n.canvas.remove(),n.lost){$(n);return}$t(n);const s=C.filter(c=>!c.leased&&!c.lost);for(const c of s.slice(Gt))$(c)}}}function Jt(){return{active:C.filter(t=>t.leased&&!t.lost).length,idle:C.filter(t=>!t.leased&&!t.lost).length}}function Yt(t,e){if(e!==null&&De(e))for(const o of t.values())o.visible=!1}const Kt=new be("#aaaaaa");function Xt(t){t.background=Kt,t.fog=null,t.environment=null,t.traverse(e=>{H(e,"envObject")&&(e.visible=!1)})}const Zt={activeAuthoring:t=>Ve(t),panelAuthoring:t=>je(t).adapter,pick:(t,e,r,o)=>vt(t,e,r,{intent:o}),toolOwner:(t,e)=>Re(t,e),toolOwnerPainted:(t,e)=>X(t)&&xe(t,e),threeSurfaceShowing:(t,e)=>X(t)&&(e instanceof Te?e.childAdapters().some(r=>r.kind==="three"):!e.rects&&typeof e.hierarchy.object3D=="function"),threeViewportRootId:t=>Me(t),applyRootHiddenVisibility:Yt,suppressRootEnvironment:Xt},er=f.lazy(async()=>({default:(await y(async()=>{const{ToolObject3DPreview:t}=await import("./ToolObject3DPreview-C52QCJAO.js");return{ToolObject3DPreview:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]))).ToolObject3DPreview})),tr=f.lazy(async()=>({default:(await y(async()=>{const{ToolObject3DAuthoring:t}=await import("./StageHost-CSw286Im.js").then(e=>e.S);return{ToolObject3DAuthoring:t}},__vite__mapDeps([32,4,5,2,6,1,7,8,9,10,11,33,34,35,12,13,36,16,17,21,37,38,39,40,19,25,26,27,28,41,18,42,43,44,45,46,47,48,49,31,20,22,23,24,14,50,51,52,53,54,55,30,56,57,58]))).ToolObject3DAuthoring}));function rr(t){return h.jsx(f.Suspense,{fallback:h.jsx("div",{style:{minHeight:240},children:"Loading 3D preview…"}),children:h.jsx(er,{...t})})}function or(t){return f.useEffect(()=>Ne(t.documentId),[t.documentId]),h.jsx(f.Suspense,{fallback:h.jsx("div",{style:{minHeight:240},children:"Loading 3D authoring surface…"}),children:h.jsx(tr,{...t})})}const ae={model:f.lazy(async()=>{const{ModelAssetDocument:t}=await y(async()=>{const{ModelAssetDocument:e}=await import("./ModelAssetDocument-DKyxph4r.js");return{ModelAssetDocument:e}},__vite__mapDeps([59,1,2,5,6,7,8,4,9,10,11,15,16,17,18,19,20,21,22,12,13,23,24,25,26,27,28,29,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,14,50,51,52,53,54,55,30,56,57,58,60,61,62]));return{default:e=>h.jsx(t,{documentId:e.documentId,assetPath:e.assetPath,displayName:e.displayName,active:e.active})}}),"entity-model":f.lazy(async()=>{const{EntityModelDocument:t}=await y(async()=>{const{EntityModelDocument:e}=await import("./EntityModelDocument-BkRbfE7C.js");return{EntityModelDocument:e}},__vite__mapDeps([63,1,2,34,35,12,13,36,16,17,4,5,6,7,8,9,10,11,21,37,38,42,15,18,19,20,22,23,24,25,26,27,28,29,32,33,39,40,41,43,44,45,46,47,48,49,31,14,50,51,52,53,54,55,30,56,57,58,60,61,62]));return{default:e=>h.jsx(t,{documentId:e.documentId,entityId:e.entityId??"",displayName:e.displayName,active:e.active})}}),environment:f.lazy(async()=>{const{EnvironmentAssetDocument:t}=await y(async()=>{const{EnvironmentAssetDocument:e}=await import("./EnvironmentAssetDocument-BbWPrmTc.js");return{EnvironmentAssetDocument:e}},__vite__mapDeps([64,1,2,4,5,6,7,8,9,10,11,12,13,14,27,28,65]));return{default:e=>h.jsx(t,{documentId:e.documentId,assetPath:e.assetPath,active:e.active})}}),lut:f.lazy(async()=>{const{LutAssetDocument:t}=await y(async()=>{const{LutAssetDocument:e}=await import("./LutAssetDocument-C_QGvjj7.js");return{LutAssetDocument:e}},__vite__mapDeps([66,1,2,4,5,6,7,8,9,10,11,67,12,13,65]));return{default:e=>h.jsx(t,{documentId:e.documentId,assetPath:e.assetPath,active:e.active})}}),shader:f.lazy(async()=>{const{ShaderAssetDocument:t}=await y(async()=>{const{ShaderAssetDocument:e}=await import("./ShaderAssetDocument-ysUJR4Np.js");return{ShaderAssetDocument:e}},__vite__mapDeps([68,1,2,4,5,6,7,8,9,10,11,69,12,13,65]));return{default:e=>h.jsx(t,{documentId:e.documentId,assetPath:e.assetPath,active:e.active})}}),"model-preview":f.lazy(async()=>{const{Object3DPreview:t}=await y(async()=>{const{Object3DPreview:e}=await import("./Object3DPreview-DI7aoPKe.js");return{Object3DPreview:e}},__vite__mapDeps([3,4,5,2,6,1,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]));return{default:e=>h.jsx(t,{assetPath:e.assetPath,...e.materialPath?{materialPath:e.materialPath}:{},displayName:e.displayName})}}),module:f.lazy(async()=>{const{LiveModuleDocument:t}=await y(async()=>{const{LiveModuleDocument:e}=await import("./LiveModuleDocument-CCpe63vw.js");return{LiveModuleDocument:e}},__vite__mapDeps([70,1,2,4,5,6,7,8,9,10,11,15,16,17,18,19,20,21,22,12,13,23,24,25,26,27,28,29,53,71,58,39,40]));return{default:e=>e.projectRoot?h.jsx(t,{documentId:e.documentId,projectRoot:e.projectRoot,modulePath:(e.assetPath.split(/[?#]/,1)[0]??e.assetPath).replace(/^\//,""),displayName:e.displayName,active:e.active,fallback:e.fallback}):e.fallback}})},nr={recognize:async(t,e)=>(await y(async()=>{const{loadNativeQuarksJsonSource:r}=await import("./QuarksAssetDocument-DEcSmewA.js");return{loadNativeQuarksJsonSource:r}},__vite__mapDeps([72,1,2,5,6,7,8,4,9,10,11,20,21,17,22,12,13,23,24,25,26,27,28,51,73,32,33,34,35,36,16,37,38,39,40,19,41,18,42,43,44,45,46,47,48,49,31,14,50,52,53,54,55,30,56,57,58,60,61,62,15,29]))).loadNativeQuarksJsonSource(t,e),Viewer:f.lazy(async()=>{const{QuarksAssetDocument:t}=await y(async()=>{const{QuarksAssetDocument:e}=await import("./QuarksAssetDocument-DEcSmewA.js");return{QuarksAssetDocument:e}},__vite__mapDeps([72,1,2,5,6,7,8,4,9,10,11,20,21,17,22,12,13,23,24,25,26,27,28,51,73,32,33,34,35,36,16,37,38,39,40,19,41,18,42,43,44,45,46,47,48,49,31,14,50,52,53,54,55,30,56,57,58,60,61,62,15,29]));return{default:e=>h.jsx(t,{documentId:e.documentId,assetPath:e.assetPath,displayName:e.displayName,active:e.active,source:e.content})}})};function ar(){const t=[...Object.keys(ae).map(e=>Le(e,ae[e])),ze(nr)];return()=>{for(const e of t)e()}}async function se(t){const e=new Image;return e.src=t,await e.decode(),e}function sr(){return Fe((t,e)=>{const r=k();if(r&&r.viewportCanvas()===t)return(async()=>{const n=await Be(t);if(n)return n;const a=r.captureViewportImage(e);return a?se(a):null})();const o=wt().find(n=>n.renderer.domElement===t);return o?(async()=>{const n=await o.requestPresentedFrame();if(n)return n;const a=o.captureImage(e);return a?se(a):null})():null})}function ir(t){const e=yt(t);if(e||_e(t)||H(t,"authoringRoot")===!0||!bt(t))return e;const r=H(t,"authoringComponent");return typeof r=="string"&&r?r:void 0}function cr(t){if(typeof t.object3D!="function")return He;const r=new Map;return o=>{if(r.has(o))return r.get(o);const n=St(t,o),a=n?{componentRoot:ir(n),authoredEntity:H(n,"authoringRoot")===!0,builtInternal:_e(n)}:void 0;return r.set(o,a),a}}const ur=1e-4,lr="World-anchored — content is placed in world space by the game each frame; moving this container offsets future placements away from their source.";function Ce(t){if(!t)return 0;const e=t;if(e.isInstancedMesh!==!0)return 0;const r=e.count;return typeof r=="number"&&r>0?r:0}function dr(t){const e=t.elements;for(let r=0;r<16;r++){const o=r%5===0?1:0,n=e[r];if(!Number.isFinite(n)||Math.abs(n-o)>ur)return!1}return!0}const ie=new dt,ce=new P;function fr(t,e){const r=Ce(t);if(r===0)return null;const o=pr(t,e);return{units:r,detail:Ae(r),worldAnchored:o,note:o?lr:null}}function pr(t,e){if(!e||e.isEmpty()||!dr(t.matrixWorld))return!1;const r=t.geometry;return r.boundingBox===null&&r.computeBoundingBox(),r.boundingBox?(ie.copy(r.boundingBox),e.getCenter(ce),!ie.containsPoint(ce)):!1}function mr(t){const e=Ce(t);return e===0?null:Ae(e)}function Ae(t){return`${t} instanced unit${t===1?"":"s"}`}function hr(){return qe({detail:(t,e,r)=>mr(q(t,I(r).objectMap,e)),marks:t=>cr(t),structureLog:t=>{const e=I(t);return{epoch:()=>e.gizmoEpoch,parentChangesSince:r=>e.ingestObjectMapChangesSince(r)}}})}function vr(t){return Math.min(1600,Math.max(800,900+t*25))}function gr(t){return t<.5?4*t*t*t:1-(-2*t+2)**3/2}function Oe(t,e,r=new P(0,1,0)){const o=new P().subVectors(e,t),n=o.length();if(n<1e-6)return[t.clone(),t.clone(),e.clone(),e.clone()];const a=Math.min(n*.18,6),s=new P().crossVectors(o,r);s.lengthSq()>1e-9?s.normalize().multiplyScalar(Math.min(n*.08,2.5)):s.set(0,0,0);const c=r.clone().normalize().multiplyScalar(a),u=t.clone().addScaledVector(o,.3).add(c).add(s),m=e.clone().addScaledVector(o,-.3).addScaledVector(c,.6).addScaledVector(s,.5);return[t.clone(),u,m,e.clone()]}const wr=1<<31;function yr(t){return(t.layers.mask&wr)!==0||/gizmo/i.test(t.name)}function ke(t){if(yr(t))return null;if(t.isCamera)return t;for(const e of t.children){const r=ke(e);if(r)return r}return null}function br(t,e,r){const o=new P,n=new J;return e.getWorldPosition(o),e.getWorldQuaternion(n),{entityId:t,position:o.toArray(),quaternion:n.toArray(),fov:r}}function Sr(t){for(const[e,r]of t.objectMap){const o=ke(r);if(!o)continue;const n=o;return br(e,o,n.isPerspectiveCamera?n.fov:60)}return null}function Pr(t){t.curve=new Se(Oe(t.startPos,t.endPos))}let D=null;function _r(t){const e=U(),r=k()?.objectMap,o=r?Sr({objectMap:r}):null;if(!o||!e)return!1;const n=e.camera.position.clone(),a=new P().fromArray(o.position);return D={runtime:{startPos:n,startQuat:e.camera.quaternion.clone(),startFov:e.camera.fov,endPos:a,endQuat:new J().fromArray(o.quaternion),endFov:o.fov,curve:new Se(Oe(n,a)),startedAt:performance.now(),durationMs:vr(n.distanceTo(a)),landed:!1},snapshot:{position:e.camera.position.clone(),target:e.orbit.target.clone(),up:e.camera.up.clone(),fov:e.camera.fov},onLanded:t,getLiveCamera:null,driving:!0},e.orbit.enabled=!1,!0}function Er(){const t=U(),e=D;if(!e||(e.driving=!1,!t))return;const r=t.camera,o=new P(0,0,-1).applyQuaternion(r.quaternion),n=Math.max(1,e.snapshot.position.distanceTo(e.snapshot.target));t.orbit.target.copy(r.position).addScaledVector(o,n),r.up.set(0,1,0).applyQuaternion(r.quaternion),t.orbit.enabled=!0}function Cr(){const t=D;if(!t)return;D=null;const e=U();if(!e)return;const r=t.snapshot;e.camera.position.copy(r.position),e.orbit.target.copy(r.target),e.camera.up.copy(r.up),e.camera.lookAt(r.target),e.camera.fov!==r.fov&&(e.camera.fov=r.fov,e.camera.updateProjectionMatrix()),e.orbit.enabled=!0,e.orbit.update()}const Q=new P,ue=new J;Pt(Ar);function Ar(){const t=D,e=U();if(!t||!e||!t.driving)return;const r=t.runtime,o=t.getLiveCamera?.()??null,n=o?.isObject3D?o:null;if(n){n.getWorldPosition(Q),n.getWorldQuaternion(ue),Q.distanceToSquared(r.endPos)>1e-8&&(r.endPos.copy(Q),Pr(r)),r.endQuat.copy(ue);const u=n.fov;typeof u=="number"&&(r.endFov=u)}const a=e.camera;if(r.landed){a.position.copy(r.endPos),a.quaternion.copy(r.endQuat),a.fov!==r.endFov&&(a.fov=r.endFov,a.updateProjectionMatrix());return}const s=Math.min(1,(performance.now()-r.startedAt)/r.durationMs),c=gr(s);a.position.copy(r.curve.getPoint(c)),a.quaternion.slerpQuaternions(r.startQuat,r.endQuat,c),a.fov=r.startFov+(r.endFov-r.startFov)*c,a.updateProjectionMatrix(),s>=1&&(r.landed=!0,t.onLanded())}function Or(){return Ue({begin:_r,track:t=>{D&&(D.getLiveCamera=t)},settle:Er,end:Cr})}const kr=f.lazy(()=>y(()=>import("./InspectorObjectPreview-BooanIbq.js"),__vite__mapDeps([74,1,2,63,34,35,12,13,36,16,17,4,5,6,7,8,9,10,11,21,37,38,42,15,18,19,20,22,23,24,25,26,27,28,29,32,33,39,40,41,43,44,45,46,47,48,49,31,14,50,51,52,53,54,55,30,56,57,58,60,61,62])).then(t=>({default:t.InspectorObjectPreview})));function Ir(t,e){return{preview:t.isCamera?null:({displayName:r,previewKey:o,actions:n})=>a=>f.createElement(Ge,{picture:()=>f.createElement(kr,{previewKey:o,object:t,displayName:r,fill:!0}),previewKey:o,actions:n,...a?{mode:a}:{}}),instanced:fr(t,_t(t)),assetDocument:e}}function Dr(){return We((t,e)=>{const r=k();if(!r)return null;const o=q(t,r.objectMap,e);return o?Ir(o,r.objectMap.has(e)?{open:()=>Qe("asset-editor:entity",r.shell,{entityId:e,title:o.name||e})}:null):null})}const le=new WeakMap,Y={activeAuthoring(t){let e=le.get(t);return e||(e=Je(t,"No authoring adapter"),le.set(t,e)),e},panelAuthoring(t){return Y.activeAuthoring(t)},pick(){return null},toolOwner:$e,toolOwnerPainted(){return!0},threeSurfaceShowing(t,e){return!e.rects&&typeof e.hierarchy.object3D=="function"},threeViewportRootId(){return null},applyRootHiddenVisibility(){},suppressRootEnvironment(){}};let F=Y;function Mr(t){if(F!==t){if(F!==Y)throw new Error("A viewport authoring policy is already installed.");F=t}}function lo(){return F}const de=0,Tr=16777215,fe=10;function xr(t){return Ct(t,"Compare reference GLB")}function pe(t,e){const r=Dt(t),o=new ee;o.rotation.y=Mt(e),o.add(r);const n=new ee;n.add(o),n.updateWorldMatrix(!0,!0);const a=Tt(n,"front"),s=[a.center.x-a.size.x/2,a.center.y-a.size.y/2,a.center.z-a.size.z/2],c=[a.center.x+a.size.x/2,a.center.y+a.size.y/2,a.center.z+a.size.z/2],u=xt(s,c);return n.scale.setScalar(u.scale),n.position.set(...u.position),n.updateWorldMatrix(!0,!0),{wrapper:n,dispose:()=>Rt(r)}}function Rr(t,e){const r=jt,o=r*e,n=new mt(-o,o,r,-r,.01,fe*4),a=t==="front"?new P(0,0,1):new P(1,0,0);return n.position.set(0,ne,0).addScaledVector(a,fe),n.up.set(0,1,0),n.lookAt(0,ne,0),n.updateProjectionMatrix(),n.updateMatrixWorld(!0),n}function jr(t,e,r={}){const o=te(r.width),n=te(r.height),a=o/n,s=[];let c=null;try{const u=pe(t,re(t));s.push(u.dispose);const m=pe(e,r.refForward??re(e));s.push(m.dispose);const O=new ft({color:Tr});s.push(()=>O.dispose());const L=p=>{const i=new pt;return i.background=new be(de),i.overrideMaterial=O,i.add(p),i},v=L(u.wrapper),b=L(m.wrapper),_=ge(new we({antialias:!1,alpha:!1,preserveDrawingBuffer:!0}));c=_,_.setPixelRatio(1),_.toneMapping=ye,_.setClearColor(de,1),_.setSize(o,n,!1);const M=document.createElement("canvas");M.width=o,M.height=n;const S=M.getContext("2d");if(!S)throw new Error("Unable to create the compare readback canvas.");const A=(p,i,R,g)=>{_.render(p,i),S.clearRect(0,0,o,n),S.drawImage(_.domElement,0,0);const j=S.getImageData(0,0,o,n).data,V=At(j,o*n);if(!V.some(K=>K!==0))throw new Error(`Compare ${g} view rendered an empty ${R} silhouette — nothing to score.`);return{image:{base64:oe(M),mimeType:"image/png"},mask:V}},w=document.createElement("canvas");w.width=o,w.height=n;const T=w.getContext("2d");if(!T)throw new Error("Unable to create the compare overlay canvas.");const x=[];for(const p of Ot){const i=Rr(p,a),R=A(v,i,"asset",p),g=A(b,i,"reference",p),j=kt(R.mask,g.mask);T.putImageData(new ImageData(It(R.mask,g.mask),o,n),0,0),x.push({view:p,iou:j.iou,overlay:{base64:oe(w),mimeType:"image/png"},asset:R.image,ref:g.image})}return{width:o,height:n,views:x}}finally{c?.dispose(),c?.forceContextLoss();for(const u of s.reverse())u()}}async function Vr(t,e,r={}){const o=await Et(t);try{return await Ie(o,e,r)}finally{Ee(o)}}async function Ie(t,e,r={}){const o=await xr(e);try{return jr(t,o,r)}finally{Ee(o)}}async function Nr(t,e){const r=e.assetPath,o=e.entityId,n=e.glbBase64;if(+(typeof r=="string")+ +(typeof o=="string")+ +(typeof n=="string")!==1)return{ok:!1,error:"capture-asset-preview requires exactly one of assetPath, entityId or glbBase64."};const s=e.width,c=e.height,u=e.background,m=e.shots,O=e.shotSet,L=e.forward,v=e.compare,b=e.stage,_=e.camera,M=e.pose;if(s!==void 0&&typeof s!="number"||c!==void 0&&typeof c!="number"||u!==void 0&&u!=="neutral"&&u!=="transparent"||m!==void 0&&m!=="source")return{ok:!1,error:"Invalid asset preview dimensions, background, or shots mode."};if(b!==void 0&&b!=="lab"&&b!=="scene")return{ok:!1,error:`capture-asset-preview stage must be "lab" or "scene", got ${String(b)}.`};if(O!==void 0&&m!==void 0)return{ok:!1,error:"capture-asset-preview cannot combine a shotSet definition with a shots mode."};const S=Ye("capture-asset-preview",_);if(typeof S=="string")return{ok:!1,error:S};const A=Ke("capture-asset-preview",M);if(typeof A=="string")return{ok:!1,error:A};if((S||A)&&(m!==void 0||O!==void 0||v!==void 0||b==="scene"))return{ok:!1,error:'capture-asset-preview cannot combine camera/pose with a shots mode, a shotSet definition, compare, or stage "scene" — those legs stage their own cameras and poses.'};let w;if(O!==void 0)try{w=Vt(O)}catch(i){return{ok:!1,error:i instanceof Error?i.message:String(i)}}const T=G(L);if(m==="source"&&T===null)return{ok:!1,error:"capture-asset-preview --shots source requires a non-degenerate forward [x,y,z]."};if(v!==void 0){if(m!==void 0||w!==void 0)return{ok:!1,error:"capture-asset-preview cannot combine compare with shots."};if(typeof v!="object"||v===null||typeof v.glbBase64!="string"||v.forward!==void 0&&G(v.forward)===null)return{ok:!1,error:"capture-asset-preview compare requires { glbBase64: string, forward?: [x, y, z] } with a non-degenerate ground-plane forward."}}if(typeof n=="string"){if(m!==void 0||v!==void 0)return{ok:!1,error:"capture-asset-preview cannot combine glbBase64 with a named shots mode or compare."};if(b==="scene")return{ok:!1,error:'capture-asset-preview stage "scene" photographs a live scene entity — glbBase64 bytes stand nowhere in the scene.'}}const x=b==="scene"?t.scene:null;if(b==="scene"){if(typeof o!="string")return{ok:!1,error:'capture-asset-preview stage "scene" photographs a live scene entity — pass entityId, not assetPath.'};if(m!==void 0||w!==void 0||v!==void 0)return{ok:!1,error:'capture-asset-preview cannot combine stage "scene" with a shots mode, a shotSet definition or compare.'};if(!x)return{ok:!1,error:'capture-asset-preview stage "scene" requires a bound viewport scene; none is bound yet.'}}const p=typeof o=="string"?q(he(t.shell),t.objectMap,o):null;if(typeof o=="string"&&!p)return{ok:!1,error:`Entity not found: ${o}`};try{const i={...typeof s=="number"?{width:s}:{},...typeof c=="number"?{height:c}:{},...u?{background:u}:{},...S?{camera:S}:{},...A?{pose:A}:{}};if(v!==void 0){const g=v,j=G(g.forward),V={...typeof s=="number"?{width:s}:{},...typeof c=="number"?{height:c}:{},...j?{refForward:j}:{}};return{ok:!0,data:{...typeof r=="string"?await Vr(r,g.glbBase64,V):await Ie(p,g.glbBase64,V)}}}return w!==void 0?{ok:!0,data:{...typeof n=="string"?await Nt(n,w,i):typeof r=="string"?await Lt(r,w,i):zt(p,w,i)}}:m==="source"?{ok:!0,data:{...typeof r=="string"?await Ft(r,T,i):Bt(p,T,i)}}:x?{ok:!0,data:{...Ht(p,x,i)}}:typeof n=="string"?{ok:!0,data:{...await qt(n,i)}}:{ok:!0,data:{...typeof r=="string"?await Ut(r,i):Wt(p,i)}}}catch(i){return{ok:!1,error:i instanceof Error?i.message:String(i)}}}function E(){const t=B();return t?Pe(t):null}function l(t,e,r="none"){return{...e===void 0?{}:{timeoutMs:e},derivedRefresh:r,handle:o=>{const n=k();return n?t(n,o):{ok:!1,error:`${o.type} needs an editor session; none has opened yet.`}}}}const d={ok:!0},Lr={"focus-entity":l((t,e)=>(E()?.frameIds([e.id])||t.shell.focusOnEntity(e.id),d)),"frame-entity":l((t,e)=>{const r=e.id;if(typeof r!="string"||r.length===0)return{ok:!1,error:'frame-entity requires a string "id" (the entity to frame).'};const o=E();if(o)return o.frameIds([r])?d:{ok:!1,error:`Entity not found: ${r}`,data:{code:"ENTITY_NOT_FOUND"}};const n=he(t.shell);return n.hierarchy.node(r)!==null&&n.rects||q(n,t.objectMap,r)?(t.shell.focusOnEntity(r),d):{ok:!1,error:`Entity not found: ${r}`,data:{code:"ENTITY_NOT_FOUND"}}}),"focus-selection":l(t=>(E()?.frameSelection()||t.shell.focusOnSelection(),d)),"view-preset":l((t,e)=>{const r=e.preset,o=["top","front","right","perspective"];if(typeof r!="string"||!o.includes(r))return{ok:!1,error:`view-preset requires one of ${o.join(", ")}, got ${r===void 0?"nothing":JSON.stringify(r)}.`};const n=r,a=E();return a?a.setViewPreset(n==="perspective"?"isometric":n):t.shell.setViewPreset(n),d}),"set-camera":l((t,e)=>{const r=e.position,o=e.target,n=e.fov;if(!r||!o||typeof r.x!="number"||typeof r.y!="number"||typeof r.z!="number"||typeof o.x!="number"||typeof o.y!="number"||typeof o.z!="number")return{ok:!1,error:"set-camera requires numeric {x,y,z} position and target."};const a=E();return a?a.setCameraPose(r,o,n):t.shell.setCameraPose(r,o,n),d}),"document-orbit":l((t,e)=>me(e),12e4),"document-turntable":l((t,e)=>me(e),12e4),"document-frame":l((t,e)=>{const r=E();if(!r)return{ok:!1,error:"document-frame needs an Object3D document open and active. For the Scene viewport use `frame-entity`/`focus-selection`.",data:{code:"NO_ACTIVE_OBJECT3D_DOCUMENT"}};const o=e.fit;return o!==void 0&&(typeof o!="number"||!(o>=.1&&o<=10))?{ok:!1,error:'document-frame: "fit" must be a number in 0.1..10.'}:r.frame(typeof o=="number"?o:1)?{ok:!0,data:{...r.cameraPose()}}:{ok:!1,error:"Nothing to frame: the document subject has no measurable bounds.",data:{code:"EMPTY_FRAME_BOUNDS"}}}),"capture-viewport":l(async(t,e)=>{const r=et(e);if("error"in r)return{ok:!1,error:r.error};if(t.hasAdoptedScene)try{const s=await ve().documents.captureActive(r.size);return{ok:!0,data:{base64:s.base64,mimeType:s.mimeType}}}catch(s){return{ok:!1,error:s instanceof Error?s.message:String(s)}}const o=t.captureViewportImage(r.size);if(!o)return{ok:!1,error:`This door photographs the editor's own three.js Scene viewport, and nothing has bound one (no renderer/scene/camera). A canvas-surface world (a first-party canvas root, or a PixiJS/Phaser/Babylon ingest) never binds it — it draws on its own canvas in the Game document. Capture that through \`capture-active-document\` (\`editor.captureActiveDocument()\`) or the running game through \`bridge-screenshot\` (${tt("screenshot")}).`};const n=o.indexOf(",");return{ok:!0,data:{base64:n>=0?o.slice(n+1):o,mimeType:"image/png"}}},void 0,"if-content-changed"),"capture-asset-preview":l((t,e)=>Nr(t,e),3e4,"if-content-changed"),"set-grid":l((t,e)=>{const r=B();return!r||!Z(r)?{ok:!1,error:"set-grid: the active document draws no grid."}:(Ze(r,e.enabled),d)}),"set-helpers":l((t,e)=>{const r=z(t.shell);return r.showHelpers!==e.enabled&&r.toggleHelpers(),d}),"set-stats":l((t,e)=>{const r=z(t.shell);return I(r).showStats!==e.enabled&&I(r).toggleStats(),d}),"set-shading-mode":l((t,e)=>{const r=E(),o=e.mode;if(o==="preview"||o==="rendered"){const n=B(),a=n?Z(n)?.stageKind:void 0;if(!r||!a||Xe(a)?.modes?.[o]?.lighting===void 0)return{ok:!1,error:`Shading mode "${o}" is lit as a stage says, and the active document's stage says nothing for it.`}}return r?r.setMode(e.mode):t.setShadingMode(e.mode),d}),"set-helper-type":l((t,e)=>{const r=z(t.shell),o=e.helperType,n=E();return n&&o==="bounds"?(n.setBounds(e.enabled),d):n&&o==="skeletons"?(n.setSkeleton(e.enabled),d):(r.helperVisibility[o]!==e.enabled&&r.toggleHelperType(o),d)}),"set-transform-mode":l((t,e)=>(t.shell.setTransformMode(e.mode),d)),"set-transform-space":l((t,e)=>(t.shell.setTransformSpace(e.space),d)),"set-snap":l((t,e)=>(t.shell.snapEnabled!==e.enabled&&t.shell.toggleSnap(),d))};async function me(t){const e=E();if(!e)return{ok:!1,error:`${t.type} needs an Object3D document open and active (a model, a live module, an entity model). Open one with \`editor.openAsset(<path>)\` first.`,data:{code:"NO_ACTIVE_OBJECT3D_DOCUMENT"}};const r=t.type==="document-orbit"?t.duration:t.seconds;return r!==void 0&&(typeof r!="number"||!(r>=0&&r<=60))?{ok:!1,error:`${t.type}: the move's length must be a number of seconds in 0..60.`}:{ok:!0,data:{...t.type==="document-orbit"?await e.orbit({...typeof t.azimuth=="number"?{azimuth:t.azimuth}:{},...typeof t.elevation=="number"?{elevation:t.elevation}:{},...typeof r=="number"?{duration:r}:{}}):await e.turntable({...typeof r=="number"?{seconds:r}:{},...typeof t.revolutions=="number"?{revolutions:t.revolutions}:{}})}}}function zr(){return ve().session.reportFacet(()=>{const t=k();if(!t)return{};const e=z(t.shell),r=B(),o=r?Pe(r)?.presentation():void 0,n=I(e).cameraPose;return{showGrid:r?rt(r):!0,showHelpers:e.showHelpers,showStats:I(e).showStats,shadingMode:o?.mode??t.shadingMode,helperVisibility:{...e.helperVisibility,...o?{bounds:o.bounds,skeletons:o.skeleton}:{}},transformMode:e.transformMode,transformSpace:t.shell.transformSpace,snapEnabled:t.shell.snapEnabled,...n?{camera:{position:{x:n.position.x,y:n.position.y,z:n.position.z},target:{x:n.target.x,y:n.target.y,z:n.target.z},fov:n.fov}}:{}}})}const Fr={save:t=>it("view",t),saveThumbnail:st},Br=new Map;let N=null;function fo(){if(N)return N;const t=[ot({Object3DPreview:rr,Object3DAuthoring:or}),nt("three-viewport",Lr),ar(),Dr(),gt(),zr(),sr(),hr(),Or(),ct({object:e=>k()?.objectMap.get(e)??null,objects:()=>k()?.objectMap??Br}),W("hostLive",ut),W("interactive",Jt),W("inspectorPreview",ht),at(e=>I(e).attachStatePersistence(Fr))];return Mr(Zt),N=()=>{for(const e of t.reverse())e();N=null},N}export{uo as a,fr as d,fo as e,Ce as i,lo as v};
@@ -0,0 +1 @@
1
+ import{e as r}from"./three-integration-K2zwKa-Z.js";import"./index-flxMlfV4.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"./host-hierarchy-objects-BV3WqU2w.js";import"./renderer-ownership-BovSEcLv.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./preview-renderer-BrYNFV1p.js";import"./environment-Dg-YaLsA.js";import"./RoomEnvironment-BkknvS_I.js";import"./EXRLoader-CITMBvGd.js";import"./HDRLoader-BTGuGhVo.js";import"./layered-pick-DKNj5L29.js";import"./root-stacking-BEd9ZvxC.js";import"./user-data-C8dmlLGA.js";import"./workspace-arrangement-BnGzBm57.js";import"./model-thumbnail-WJb6B3qQ.js";import"./studio-environment-Dw2FBct5.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./object3d-document-session-registry-DI9WfJDy.js";import"./three-state-DVnNjIbQ.js";import"./editor-shell-store-DlGykD-E.js";import"./output-pass-HurwNl0G.js";import"./Pass-D1MRT672.js";import"./editor-layers-DI1Wkr8F.js";import"./entity-object-C374JqRs.js";import"./three-contract-Dkt6PmWY.js";import"./hierarchy-marks-EEQa08In.js";import"./component-instance-root-pq7uyyej.js";import"./viewport-door-Brt6-rPp.js";import"./content-bounds-Ax7CFkXJ.js";import"./asset-preview-C36PaXvM.js";import"./bitmap-label-Ct4k6ehY.js";const Q="workspace.service";function R(){return r()}export{Q as point,R as start};
@@ -1 +1 @@
1
- import{isEditorOwnedObject as f}from"./editor-layers-C47WUNtv.js";import{o as h,n as I}from"./three-CqcAlmZt.js";import{g as n}from"./user-data-DcUoY-0j.js";import{fo as u,dp as O}from"./three.core-3arARmh6.js";const l=new u,p=new O,c=new u;function m(e){return e.matrixAutoUpdate===!1?(e.matrix.decompose(l,p,c),{position:l.toArray(),quaternion:p.toArray(),scale:c.toArray()}):{position:e.position.toArray(),quaternion:e.quaternion.toArray(),scale:e.scale.toArray()}}function y(e,t){return e.length===t.length&&e.every((o,s)=>o===t[s])}class v{constructor(t){this.options=t,this.selected=[...t.initial]}adopted=[];selected;current(){const t=[...this.options.store.selectedEntityIds].filter(this.options.owns);return y(t,this.adopted)||(this.adopted=t,this.selected=t,this.options.onChange?.(t)),[...this.selected]}publish(t){this.selected=[...t];const o=this.selected.filter(this.options.owns);this.adopted=o,this.options.onChange?.(o),this.options.store.selectMultiple(o)}}function q(e){if(!e)return{position:[0,0,0],rotation:[0,0,0,1],scale:[1,1,1]};const t=m(e);return{position:t.position,rotation:t.quaternion,scale:t.scale}}function a(e){return e.type==="Object3D"&&e.name===""&&h(e)===null&&e.userData.oid===void 0&&n(e,"authoringInstance")===void 0&&n(e,"authoringRoot")!==!0&&n(e,"volterComponentRoot")===void 0}class C{constructor(t){this.options=t,this.rootIdSet=new Set(t.rootIds)}rootIdSet;childObjects(t){return t.children.flatMap(o=>f(o)?[]:a(o)?this.childObjects(o):[o])}childIds(t){return this.options.projector.childIdsOf(this.childObjects(t))}rootObjects(){return this.options.rootIds.flatMap(t=>{const o=this.options.projector.objectOf(t);return o?a(o)?this.childObjects(o):[o]:[]})}rootIds(){return this.options.projector.childIdsOf(this.rootObjects())}parentId(t){const{projector:o,scene:s,documentNodeId:i}=this.options,d=o.idOf(t);if(d!==null&&this.rootIdSet.has(d))return i;let r=t.parent;for(;r&&r!==s&&a(r);)r=r.parent;return r&&r!==s?o.idOf(r)??i:i}node(t){const o=h(t);return{id:this.options.projector.idOf(t),label:o?.label||t.name||t.type||"Object3D",role:"entity",kind:I(t),...o?.typeLabel?{typeLabel:o.typeLabel}:{},parentId:this.parentId(t),childIds:this.childIds(t)}}}export{C,v as S,q as r};
1
+ import{isEditorOwnedObject as f}from"./editor-layers-DI1Wkr8F.js";import{o as h,n as I}from"./three-2yjp9YMj.js";import{g as n}from"./user-data-C8dmlLGA.js";import{fo as u,dp as O}from"./three.core-3arARmh6.js";const l=new u,p=new O,c=new u;function m(e){return e.matrixAutoUpdate===!1?(e.matrix.decompose(l,p,c),{position:l.toArray(),quaternion:p.toArray(),scale:c.toArray()}):{position:e.position.toArray(),quaternion:e.quaternion.toArray(),scale:e.scale.toArray()}}function y(e,t){return e.length===t.length&&e.every((o,s)=>o===t[s])}class v{constructor(t){this.options=t,this.selected=[...t.initial]}adopted=[];selected;current(){const t=[...this.options.store.selectedEntityIds].filter(this.options.owns);return y(t,this.adopted)||(this.adopted=t,this.selected=t,this.options.onChange?.(t)),[...this.selected]}publish(t){this.selected=[...t];const o=this.selected.filter(this.options.owns);this.adopted=o,this.options.onChange?.(o),this.options.store.selectMultiple(o)}}function q(e){if(!e)return{position:[0,0,0],rotation:[0,0,0,1],scale:[1,1,1]};const t=m(e);return{position:t.position,rotation:t.quaternion,scale:t.scale}}function a(e){return e.type==="Object3D"&&e.name===""&&h(e)===null&&e.userData.oid===void 0&&n(e,"authoringInstance")===void 0&&n(e,"authoringRoot")!==!0&&n(e,"volterComponentRoot")===void 0}class C{constructor(t){this.options=t,this.rootIdSet=new Set(t.rootIds)}rootIdSet;childObjects(t){return t.children.flatMap(o=>f(o)?[]:a(o)?this.childObjects(o):[o])}childIds(t){return this.options.projector.childIdsOf(this.childObjects(t))}rootObjects(){return this.options.rootIds.flatMap(t=>{const o=this.options.projector.objectOf(t);return o?a(o)?this.childObjects(o):[o]:[]})}rootIds(){return this.options.projector.childIdsOf(this.rootObjects())}parentId(t){const{projector:o,scene:s,documentNodeId:i}=this.options,d=o.idOf(t);if(d!==null&&this.rootIdSet.has(d))return i;let r=t.parent;for(;r&&r!==s&&a(r);)r=r.parent;return r&&r!==s?o.idOf(r)??i:i}node(t){const o=h(t);return{id:this.options.projector.idOf(t),label:o?.label||t.name||t.type||"Object3D",role:"entity",kind:I(t),...o?.typeLabel?{typeLabel:o.typeLabel}:{},parentId:this.parentId(t),childIds:this.childIds(t)}}}export{C,v as S,q as r};
@@ -1 +1 @@
1
- import{t as r}from"./editor-shell-store-B-64vpgA.js";import{J as o,K as n,L as u}from"./index-JjEYIC4G.js";function a(t){return t===null?null:r(t)}function l(){return r(n())}function S(){return a(u())}function f(t){return o(e=>t(r(e)))}export{a,f as o,S as t,l as u};
1
+ import{t as r}from"./editor-shell-store-DlGykD-E.js";import{J as o,K as n,L as u}from"./index-flxMlfV4.js";function a(t){return t===null?null:r(t)}function l(){return r(n())}function S(){return a(u())}function f(t){return o(e=>t(r(e)))}export{a,f as o,S as t,l as u};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/story-three-preview-Cc12jMw-.js","assets/index-JjEYIC4G.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-CPiRKiDC.css","assets/asset-preview-J56EM7ai.js","assets/editor-layers-C47WUNtv.js","assets/workspace-arrangement-D7VBwv9F.js","assets/renderer-ownership-BovSEcLv.js","assets/hierarchy-marks-DDRF3quV.js","assets/studio-environment-D3HaysRE.js","assets/user-data-DcUoY-0j.js","assets/KTX2Loader-CaqVE6nY.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/GLTFLoader-KeoruJgS.js","assets/BufferGeometryUtils-B22h7jo4.js","assets/environment-Dg-YaLsA.js","assets/RoomEnvironment-BkknvS_I.js","assets/EXRLoader-CITMBvGd.js","assets/HDRLoader-BTGuGhVo.js","assets/bitmap-label-Ct4k6ehY.js","assets/crash-null-boundary-v3a0uEgw.js","assets/events-156d8d12.esm-CYeuVCYr.js","assets/index-bQE2NA0D.js","assets/story-mount-turn-DFRTj5hi.js"])))=>i.map(i=>d[i]);
2
- import{fo as i,_ as n,fp as a}from"./index-JjEYIC4G.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";function s(){return typeof WebGLRenderingContext<"u"&&typeof navigator<"u"&&!navigator.userAgent.toLowerCase().includes("jsdom")}function p(){return s()?i("three",async(e,o)=>{const t=await n(()=>import("./story-three-preview-Cc12jMw-.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]));try{return await t.captureStoryComponentThumbnail(e,o)}catch(r){throw t.isStoryThreeClassificationRefusal(r)?new a("This story is not a three.js story."):r}}):()=>{}}const C="workspace.service";function T(){return p()}export{C as point,T as start};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/story-three-preview-pzhR44fH.js","assets/index-flxMlfV4.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-CPiRKiDC.css","assets/asset-preview-C36PaXvM.js","assets/editor-layers-DI1Wkr8F.js","assets/workspace-arrangement-BnGzBm57.js","assets/renderer-ownership-BovSEcLv.js","assets/hierarchy-marks-EEQa08In.js","assets/studio-environment-Dw2FBct5.js","assets/user-data-C8dmlLGA.js","assets/KTX2Loader-CaqVE6nY.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/GLTFLoader-KeoruJgS.js","assets/BufferGeometryUtils-B22h7jo4.js","assets/environment-Dg-YaLsA.js","assets/RoomEnvironment-BkknvS_I.js","assets/EXRLoader-CITMBvGd.js","assets/HDRLoader-BTGuGhVo.js","assets/bitmap-label-Ct4k6ehY.js","assets/crash-null-boundary-v3a0uEgw.js","assets/events-156d8d12.esm-CYeuVCYr.js","assets/index-bQE2NA0D.js","assets/story-mount-turn-DFRTj5hi.js"])))=>i.map(i=>d[i]);
2
+ import{fo as i,_ as n,fp as a}from"./index-flxMlfV4.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";function s(){return typeof WebGLRenderingContext<"u"&&typeof navigator<"u"&&!navigator.userAgent.toLowerCase().includes("jsdom")}function p(){return s()?i("three",async(e,o)=>{const t=await n(()=>import("./story-three-preview-pzhR44fH.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]));try{return await t.captureStoryComponentThumbnail(e,o)}catch(r){throw t.isStoryThreeClassificationRefusal(r)?new a("This story is not a three.js story."):r}}):()=>{}}const C="workspace.service";function T(){return p()}export{C as point,T as start};
@@ -1 +1 @@
1
- import{ao as d,aq as a,ap as m}from"./index-JjEYIC4G.js";function u(o){return o.children.length>0}function c(o){const n=m(),t=[];for(const e of o){const r=d({modulePath:e.modulePath,regions:n});if(r.medium==="dom"){t.push(e);continue}r.via==="undeclared"&&e.modulePath&&a(e.modulePath,r.reason)}return t}export{c as d,u as m};
1
+ import{ao as d,aq as a,ap as m}from"./index-flxMlfV4.js";function u(o){return o.children.length>0}function c(o){const n=m(),t=[];for(const e of o){const r=d({modulePath:e.modulePath,regions:n});if(r.medium==="dom"){t.push(e);continue}r.via==="undeclared"&&e.modulePath&&a(e.modulePath,r.reason)}return t}export{c as d,u as m};