@volter/game-editor 0.5.99 → 0.5.100

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 (299) 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 +2146 -2146
  5. package/dist/assets/{AssetBudgetPanel-CthKzi_f.js → AssetBudgetPanel-BguLG6Oj.js} +3 -3
  6. package/dist/assets/{AudioViewer-BZZyeUuv.js → AudioViewer-C33_IIBb.js} +1 -1
  7. package/dist/assets/{CanvasBoardDocument-DsOmtEv_.js → CanvasBoardDocument-DEgaKoON.js} +1 -1
  8. package/dist/assets/{CanvasSceneViewport-CJdc6428.js → CanvasSceneViewport-Dq8xQSFa.js} +1 -1
  9. package/dist/assets/{ColorInput-CjG1OnhE.js → ColorInput-CJHsBNTm.js} +1 -1
  10. package/dist/assets/{ColorPicker-D_HLZ-fK.js → ColorPicker-C6JNO582.js} +1 -1
  11. package/dist/assets/{EntityModelDocument-ihLmZ24x.js → EntityModelDocument-Bx3GUJhv.js} +1 -1
  12. package/dist/assets/{EnvironmentAssetDocument-D_Bzffyf.js → EnvironmentAssetDocument-BBfbWQr2.js} +1 -1
  13. package/dist/assets/{GameplaySessionTimeline-BR_MkPph.js → GameplaySessionTimeline-DD6rKdJV.js} +1 -1
  14. package/dist/assets/{ImageViewer-D6MXEkV3.js → ImageViewer-CqkTiGjd.js} +1 -1
  15. package/dist/assets/InspectorObjectPreview-DQaBNg6J.js +1 -0
  16. package/dist/assets/{JsonAssetDocument-CH_BKqf0.js → JsonAssetDocument-KlWnLtng.js} +1 -1
  17. package/dist/assets/{LiveModuleDocument-ocL5mdBG.js → LiveModuleDocument-Cmfq2xIq.js} +1 -1
  18. package/dist/assets/{LutAssetDocument-BP62BLXq.js → LutAssetDocument-DCk_lEtd.js} +1 -1
  19. package/dist/assets/{ModelAssetDocument-Ckz3Rcef.js → ModelAssetDocument-DUU3kEb8.js} +1 -1
  20. package/dist/assets/{NonThreeAuthoringBootstrap-n1OV7f1Q.js → NonThreeAuthoringBootstrap-DMsyvfjH.js} +1 -1
  21. package/dist/assets/{Object3DDocumentToolbar-BU5h7jhX.js → Object3DDocumentToolbar-B4t9FHBS.js} +1 -1
  22. package/dist/assets/Object3DDocumentViewport-DFY6bZ5u.js +2 -0
  23. package/dist/assets/{Object3DPreview-C4k5T1-3.js → Object3DPreview-BbX49lPS.js} +1 -1
  24. package/dist/assets/{OnlineAssetDetail-bodZxlM3.js → OnlineAssetDetail-CY4hh_-n.js} +1 -1
  25. package/dist/assets/{PlayBar-D-SgnHBi.js → PlayBar-Dc_JivRe.js} +1 -1
  26. package/dist/assets/{QuarksAssetDocument-B2Wrpxi-.js → QuarksAssetDocument-D_v5bFgu.js} +1 -1
  27. package/dist/assets/{ReactCanvasControls-BXjlNIcc.js → ReactCanvasControls-DykKDxI1.js} +1 -1
  28. package/dist/assets/{RootSelectionOverlay-BETMJphO.js → RootSelectionOverlay-CeiH9oQ4.js} +1 -1
  29. package/dist/assets/{ShaderAssetDocument-C3FvHS-L.js → ShaderAssetDocument-BKBJgyum.js} +1 -1
  30. package/dist/assets/{ShadowEditor-CmWSVBKW.js → ShadowEditor-D43GSPw2.js} +1 -1
  31. package/dist/assets/{SourceAssetViewer-syIRglSD.js → SourceAssetViewer-Dk6H8HJK.js} +1 -1
  32. package/dist/assets/{StageHost-BqIe86Q5.js → StageHost-gcKoNeF1.js} +2 -2
  33. package/dist/assets/{StoryPreviewMount-SXtYJsNy.js → StoryPreviewMount-C6hUEEGF.js} +1 -1
  34. package/dist/assets/{ThreeBoardDocument-BP554gCu.js → ThreeBoardDocument-ELA9MChh.js} +2 -2
  35. package/dist/assets/{ThreeIsolationSceneContent-75-LDtL9.js → ThreeIsolationSceneContent-C_WArbjR.js} +1 -1
  36. package/dist/assets/{ToolObject3DPreview-DLinAx-k.js → ToolObject3DPreview-BlY_X0Mb.js} +1 -1
  37. package/dist/assets/{Toolbar-CextQHWh.js → Toolbar-CJ7ysST0.js} +1 -1
  38. package/dist/assets/{TransientHint-gxsw0fPN.js → TransientHint-DWHgvGOM.js} +1 -1
  39. package/dist/assets/{VideoViewer-Cqzfzdfp.js → VideoViewer-DCVaweNw.js} +1 -1
  40. package/dist/assets/{ViewportShadingMenu--caGAzBB.js → ViewportShadingMenu-D-VZLIca.js} +1 -1
  41. package/dist/assets/{active-ingest-h6X9yZNA.js → active-ingest-CG9F01F-.js} +2 -2
  42. package/dist/assets/{animation-clock-Btrvho_Y.js → animation-clock-C7C5Zhph.js} +1 -1
  43. package/dist/assets/{animation-mixers.service-DQGz57nx.js → animation-mixers.service-DfP0R08z.js} +1 -1
  44. package/dist/assets/{animation-timeline.utility-rdAc4tsU.js → animation-timeline.utility-BMXjjOuk.js} +1 -1
  45. package/dist/assets/{asset-budget-asset.menu-CpuPF12Q.js → asset-budget-asset.menu-fF6vLUmQ.js} +1 -1
  46. package/dist/assets/{asset-budget.action-mwOpjij5.js → asset-budget.action-R0twtx2J.js} +1 -1
  47. package/dist/assets/{asset-budget.document-D8rrDeVQ.js → asset-budget.document-8F8mW3N1.js} +1 -1
  48. package/dist/assets/{asset-budget.menu-BilRjTLw.js → asset-budget.menu-B1gOB7SA.js} +1 -1
  49. package/dist/assets/{asset-editor-persistence-B40nssGV.js → asset-editor-persistence-CA-XT1f1.js} +1 -1
  50. package/dist/assets/{asset-loaders-BWWEqlVb.js → asset-loaders-D9gOmh3H.js} +1 -1
  51. package/dist/assets/{asset-preview-DyRWJUUG.js → asset-preview-BIk4f-i_.js} +1 -1
  52. package/dist/assets/{audio-unlock.service-WemVBvpc.js → audio-unlock.service-DNMPkDf-.js} +1 -1
  53. package/dist/assets/{audio.utility-VDcYPSfS.js → audio.utility-AWv9iYxx.js} +1 -1
  54. package/dist/assets/autoplay.service-qg8gW94F.js +1 -0
  55. package/dist/assets/{babylon-authoring-adapter-BkvAcVX0.js → babylon-authoring-adapter-D5kXSc63.js} +1 -1
  56. package/dist/assets/{binding-resolver-BWRRdIaX.js → binding-resolver-BYD9JsMG.js} +2 -2
  57. package/dist/assets/{blender-emscripten-engine-DnpXL9Lg.js → blender-emscripten-engine-DMm-6gss.js} +1 -1
  58. package/dist/assets/{blender-node-editor.document-CAYFyrk5.js → blender-node-editor.document-Che5xG38.js} +1 -1
  59. package/dist/assets/{blender-properties-tab-XAVNmU6S.js → blender-properties-tab-l34kNp8g.js} +1 -1
  60. package/dist/assets/{blender-runtime-host-Byw4o_u0.js → blender-runtime-host-Hwwyewvk.js} +3 -3
  61. package/dist/assets/{blender-runtime-skin-Cw3ptNmu.js → blender-runtime-skin-DNdlUHPL.js} +1 -1
  62. package/dist/assets/{blender-runtime.document-CKAnLpO6.js → blender-runtime.document-CKA63ezC.js} +1 -1
  63. package/dist/assets/{blender-screenshot.menu-CKSZoP6R.js → blender-screenshot.menu-Bl5lZOL6.js} +1 -1
  64. package/dist/assets/{blender-timeline.document-BKDpuGev.js → blender-timeline.document-CKfQ9nLu.js} +1 -1
  65. package/dist/assets/{blender-uv-editor.document-V9Aevjga.js → blender-uv-editor.document-efujrgJG.js} +1 -1
  66. package/dist/assets/{blender-version.status-_RwyILn-.js → blender-version.status-DQ9NvEKn.js} +1 -1
  67. package/dist/assets/{blender-wali-engine-CAscERoY.js → blender-wali-engine-BQnc_4bT.js} +1 -1
  68. package/dist/assets/{blender.command-DJR8Bj0V.js → blender.command-T9Mb6BH4.js} +1 -1
  69. package/dist/assets/{board-guides-CC1g9px4.js → board-guides-CIbWp-Ni.js} +1 -1
  70. package/dist/assets/{bridge.command-D66l3OeA.js → bridge.command-ugnE788e.js} +3 -3
  71. package/dist/assets/{browserAll-vy6h2mrl.js → browserAll-BQLBJnE9.js} +1 -1
  72. package/dist/assets/{build-player.document-CLTpej_N.js → build-player.document-CE74z6I2.js} +1 -1
  73. package/dist/assets/{build-profiles.document-Ct6vaGZ3.js → build-profiles.document-Car48RZc.js} +1 -1
  74. package/dist/assets/{build-progress.status-BDtP48NR.js → build-progress.status-BFQrSzfx.js} +1 -1
  75. package/dist/assets/{build-session-CPbAgpR7.js → build-session-DBy9o4C9.js} +1 -1
  76. package/dist/assets/{build.action-Cksw2yXV.js → build.action-Bm2cWZqQ.js} +1 -1
  77. package/dist/assets/{build.command-DJD84TEp.js → build.command-L3nm-9IX.js} +1 -1
  78. package/dist/assets/{build.header-Cm2Anxw1.js → build.header-ClwTTHsc.js} +1 -1
  79. package/dist/assets/{build.menu-DuHTf3oU.js → build.menu-DAYGKFLX.js} +1 -1
  80. package/dist/assets/{build.service-C7Yy66yy.js → build.service-CLLTQVWP.js} +1 -1
  81. package/dist/assets/{camera-B1iisdjC.js → camera-Coj0LFaM.js} +1 -1
  82. package/dist/assets/{camera-runtime.inspector-Dtblf3c7.js → camera-runtime.inspector-3wiggBFZ.js} +1 -1
  83. package/dist/assets/{canvas-design-mount-pHgkSjhG.js → canvas-design-mount-CR4y86pc.js} +3 -3
  84. package/dist/assets/{canvas-entry-runtime-CRWe-Gxi.js → canvas-entry-runtime-Coi9k_ix.js} +2 -2
  85. package/dist/assets/{canvas-preview-frames-CJtaubgV.js → canvas-preview-frames-Bz65SXJB.js} +1 -1
  86. package/dist/assets/{canvas-story-capture.service-BKibUqPU.js → canvas-story-capture.service-CTnISsQZ.js} +2 -2
  87. package/dist/assets/{capability-coverage-CRb3vmWs.js → capability-coverage-sdwhSa37.js} +1 -1
  88. package/dist/assets/{collaboration-presence-C3pKLb3J.js → collaboration-presence-BCzunCc9.js} +1 -1
  89. package/dist/assets/{collider-BsrUCJlt.js → collider-B6f_3TvH.js} +1 -1
  90. package/dist/assets/{component-board.service-DcLu6a6a.js → component-board.service-CSvY-80-.js} +2 -2
  91. package/dist/assets/{component-board.service-BkOA1vLP.js → component-board.service-DNe0KNqn.js} +2 -2
  92. package/dist/assets/{component-board.service-Dgg20que.js → component-board.service-aBs2c6TM.js} +2 -2
  93. package/dist/assets/{component-contracts.service-LvrwyMpk.js → component-contracts.service-vFXN9Qjk.js} +1 -1
  94. package/dist/assets/{component-instance-root-BaRyIQ5L.js → component-instance-root-DlhjL6uO.js} +1 -1
  95. package/dist/assets/{component-verbs.command-stK20FK5.js → component-verbs.command-9THu41KW.js} +1 -1
  96. package/dist/assets/{component-verbs.service-DKnWNncI.js → component-verbs.service-8DaiPRmV.js} +1 -1
  97. package/dist/assets/{config-Oi6wS579.js → config-CD9HXujK.js} +2 -2
  98. package/dist/assets/{configurations-Dr0vG1VD.js → configurations-Dxp-AEFQ.js} +1 -1
  99. package/dist/assets/{connection.status-BusVsqEQ.js → connection.status-CXugGTE4.js} +1 -1
  100. package/dist/assets/{constraints.inspector-CtClCM7N.js → constraints.inspector-C2CyP0Ve.js} +1 -1
  101. package/dist/assets/{content-bounds-CSAlBN5N.js → content-bounds-CKdpRhSJ.js} +1 -1
  102. package/dist/assets/{contract-system-adapters-BuU4GKY2.js → contract-system-adapters-Cn3xdskp.js} +1 -1
  103. package/dist/assets/{coverage.service-BAip9f-s.js → coverage.service-D3eufHdn.js} +1 -1
  104. package/dist/assets/{create-runtime-D7OGGNf7.js → create-runtime-Dt3Q9wUe.js} +1 -1
  105. package/dist/assets/{curve-DoTlJl0S.js → curve-DDwVHEbZ.js} +1 -1
  106. package/dist/assets/{data-asset-CHJT7Vn8.js → data-asset-BhPWSIxx.js} +1 -1
  107. package/dist/assets/{data-ref-DrCMI-nl.js → data-ref-BbDy_25O.js} +1 -1
  108. package/dist/assets/{debug-bridge-CAOTUmkq.js → debug-bridge-jNc__B4a.js} +1 -1
  109. package/dist/assets/{debug-registry-B-T_4soJ.js → debug-registry-DUibofOm.js} +1 -1
  110. package/dist/assets/{deferred-ingest-play-BhS77VgZ.js → deferred-ingest-play-Bnmm84IV.js} +2 -2
  111. package/dist/assets/{design-time-canvas-mount-CvPR0mQ0.js → design-time-canvas-mount-T3fCbDbD.js} +2 -2
  112. package/dist/assets/{design-time-layers-BePiGKet.js → design-time-layers-BwAonuG8.js} +1 -1
  113. package/dist/assets/{design-time-mount.service-Ck3FvIte.js → design-time-mount.service-BEyZtQWB.js} +2 -2
  114. package/dist/assets/{design-time-mount.service-CCjJjAki.js → design-time-mount.service-DataG13i.js} +2 -2
  115. package/dist/assets/{design-time-react-mount-DN9CnR9f.js → design-time-react-mount-B_sveXas.js} +1 -1
  116. package/dist/assets/{document-preview-three-CZp-b29j.js → document-preview-three-BLxXIWVK.js} +1 -1
  117. package/dist/assets/{dom-authoring-adapter-Cd8kfaSd.js → dom-authoring-adapter-B1_ARBYy.js} +1 -1
  118. package/dist/assets/{draco3d-4p7oaG69.js → draco3d-CPTSQ0YZ.js} +1 -1
  119. package/dist/assets/{edit-mode-audio.service-3hR1ciDO.js → edit-mode-audio.service-Dw8GM_6s.js} +1 -1
  120. package/dist/assets/{edit-mode-authoring-euM9VW6K.js → edit-mode-authoring-D5X403pt.js} +1 -1
  121. package/dist/assets/{edit-mode-networking.service-BDdYK8Ig.js → edit-mode-networking.service-CAC9t9SF.js} +1 -1
  122. package/dist/assets/{editor-api-BtXmMNSR.js → editor-api-D-xdZjl_.js} +1 -1
  123. package/dist/assets/{editor-layers-BadrAIuA.js → editor-layers-B2JzjbZA.js} +1 -1
  124. package/dist/assets/{editor-shell-store-BRi8Vv17.js → editor-shell-store-DljZJLam.js} +1 -1
  125. package/dist/assets/{entity-object-DgmLa7_T.js → entity-object-DXoxKycf.js} +1 -1
  126. package/dist/assets/{extend-n0wDgaI-.js → extend-fNqQTlPR.js} +1 -1
  127. package/dist/assets/{fork-menu-DWzwL7ae.js → fork-menu-D6m8f8nv.js} +1 -1
  128. package/dist/assets/{frame-debugger-store-YlccB0mY.js → frame-debugger-store-DVU9Ay9-.js} +1 -1
  129. package/dist/assets/{game-contract-seams-l_8ZaYZ3.js → game-contract-seams-B-AOrfmJ.js} +1 -1
  130. package/dist/assets/{game-css-scope-transform-MiqomK8_.js → game-css-scope-transform-17lvGDbj.js} +1 -1
  131. package/dist/assets/{game-document.service-D5HOvWgk.js → game-document.service-Ht9IF0g9.js} +1 -1
  132. package/dist/assets/{game-eval.command-DA-QR5L4.js → game-eval.command-BRWS6fpC.js} +1 -1
  133. package/dist/assets/{game-module-access-CttGzVCj.js → game-module-access-DfrgiZsG.js} +1 -1
  134. package/dist/assets/{game-network-BexquSG7.js → game-network-D_niobFl.js} +3 -3
  135. package/dist/assets/{gameplay-export-A2_wxmzQ.js → gameplay-export-BeqmbzQ4.js} +1 -1
  136. package/dist/assets/{gameplay-replay-C01NK7_R.js → gameplay-replay-DlQ1KfJ5.js} +1 -1
  137. package/dist/assets/{gameplay.command-53pBlywA.js → gameplay.command-BM9qKtor.js} +1 -1
  138. package/dist/assets/{generation-jobs-BZ1uNuym.js → generation-jobs-CNT4AL_p.js} +1 -1
  139. package/dist/assets/{generation.service-fiLdgX9K.js → generation.service-Bnv1uQ5C.js} +1 -1
  140. package/dist/assets/{generations-Cs4ZEXOW.js → generations-D1klayMe.js} +1 -1
  141. package/dist/assets/{generations.status-DVhipG_g.js → generations.status-HIrqqrlU.js} +1 -1
  142. package/dist/assets/{hierarchy-marks-Bz6FH5xl.js → hierarchy-marks-B_qmrhDO.js} +1 -1
  143. package/dist/assets/{hosted-asset-materialization-CLh_Fkf5.js → hosted-asset-materialization-C6AJeUPp.js} +1 -1
  144. package/dist/assets/{index-Cxz8Qysl.js → index-BOHbdxBV.js} +1 -1
  145. package/dist/assets/{index-ucHKPhjL.js → index-BfcuJH-x.js} +1 -1
  146. package/dist/assets/{index-Bz10-Rzi.js → index-CHK1t9Gu.js} +1 -1
  147. package/dist/assets/{index-BXp6J271.js → index-Cpe424Eh.js} +1 -1
  148. package/dist/assets/{index-DKlVAXbF.js → index-D6VYIDu6.js} +1 -1
  149. package/dist/assets/{index-Dji-5Ngh.js → index-D8qHS95_.js} +7 -7
  150. package/dist/assets/{index-CGWnVcy5.js → index-DxTv7jrz.js} +1 -1
  151. package/dist/assets/{index-yEWxcp4Z.js → index-XAzI_8EW.js} +1 -1
  152. package/dist/assets/{index-CnQxsRjG.js → index-nkbk3WyY.js} +2 -2
  153. package/dist/assets/{inference-diagnostics-BJUcoifD.js → inference-diagnostics-x4u4h3Ui.js} +1 -1
  154. package/dist/assets/{ingest-boot-viewport-B2KxD-oi.js → ingest-boot-viewport-_zmIqPtc.js} +1 -1
  155. package/dist/assets/{ingest-siblings-DHwK8q_i.js → ingest-siblings-CkFgDSTn.js} +1 -1
  156. package/dist/assets/{ingest-source-persistence-BQ3VwPMh.js → ingest-source-persistence-Dn2nn_dq.js} +1 -1
  157. package/dist/assets/{ingest.service-Dr2uWmcO.js → ingest.service-CnIPOMqa.js} +1 -1
  158. package/dist/assets/{inspect-DZInhjtn.js → inspect-z_EuQ5W3.js} +1 -1
  159. package/dist/assets/instances.command-BhZ9C8ga.js +1 -0
  160. package/dist/assets/{json-history-resource-CIxXZ9Kl.js → json-history-resource-45dFXO7k.js} +1 -1
  161. package/dist/assets/{layered-pick-DfTP1-Cr.js → layered-pick-QfPeC-94.js} +1 -1
  162. package/dist/assets/{light-B6J4lQur.js → light-D059ZVy_.js} +1 -1
  163. package/dist/assets/{live-project-verbs-D4cO2mDW.js → live-project-verbs-Dz3uaDSH.js} +1 -1
  164. package/dist/assets/{machine.document-DziDBmsa.js → machine.document-B9YCyPJO.js} +1 -1
  165. package/dist/assets/{machines.finder-BzSmJC05.js → machines.finder-Bd_Gtzlj.js} +1 -1
  166. package/dist/assets/{material-BYffxFoI.js → material-CN7pM5g6.js} +1 -1
  167. package/dist/assets/{material-factory-C8x9nW40.js → material-factory-BYjCaMqj.js} +1 -1
  168. package/dist/assets/{mesh-OD-8cCPF.js → mesh-BeHe5X41.js} +1 -1
  169. package/dist/assets/{model-asset-sections.service-D2XhLBki.js → model-asset-sections.service-MYJICwJh.js} +1 -1
  170. package/dist/assets/{model-inspection-CPrGFWhU.js → model-inspection-CYbbfzzy.js} +1 -1
  171. package/dist/assets/{model-thumbnail-DrHjLgzh.js → model-thumbnail-C2nGqGGo.js} +1 -1
  172. package/dist/assets/{models.finder-kOiLPr6p.js → models.finder-DMoHOq7E.js} +1 -1
  173. package/dist/assets/{module-mode-COpZ8HPQ.js → module-mode-zG9SFcD-.js} +2 -2
  174. package/dist/assets/{mount-canvas-ingest-root-Dn8zfXCs.js → mount-canvas-ingest-root-BMQbWPia.js} +2 -2
  175. package/dist/assets/{mount-dom-ingest-root-Q69QIXJU.js → mount-dom-ingest-root-DAGePmpK.js} +2 -2
  176. package/dist/assets/{mount-ingest-root-tvezSUW2.js → mount-ingest-root-C0gWpIi5.js} +2 -2
  177. package/dist/assets/{mount-manifest-B6nhuOOp.js → mount-manifest-DFPsrVVl.js} +1 -1
  178. package/dist/assets/{mount-three-ingest-root-B7CbPqYg.js → mount-three-ingest-root-D3Ch35na.js} +1 -1
  179. package/dist/assets/{mounted-authoring-DBEo6Vnv.js → mounted-authoring-B-A2cU05.js} +1 -1
  180. package/dist/assets/{mounted-story-viewport-source-CVbawnaF.js → mounted-story-viewport-source-Bk19l1Z9.js} +1 -1
  181. package/dist/assets/{native-debug-module-D2m1zyhH.js → native-debug-module-T4Q1sEx0.js} +1 -1
  182. package/dist/assets/{navigation-BVNWk7NC.js → navigation-iCrJRCQP.js} +1 -1
  183. package/dist/assets/{navmesh.menu-BSqsnclN.js → navmesh.menu-BJlFQtT1.js} +1 -1
  184. package/dist/assets/{navmesh.service-Bd8zoGEc.js → navmesh.service-CFfkvbSQ.js} +1 -1
  185. package/dist/assets/network-observer.service-D9hp5jSg.js +1 -0
  186. package/dist/assets/{network.utility-B_g_GTxH.js → network.utility-CjPy733x.js} +1 -1
  187. package/dist/assets/{object3d-document-session-registry-CatZ54tz.js → object3d-document-session-registry-B9xf6IXJ.js} +2 -2
  188. package/dist/assets/{oid-transform-BDgEBytJ.js → oid-transform-BfItftA-.js} +1 -1
  189. package/dist/assets/{particles-DR6A_2v6.js → particles-CPwKmGuH.js} +1 -1
  190. package/dist/assets/{pixi-authoring-adapter-B60Kh9IK.js → pixi-authoring-adapter-0EWZElvF.js} +1 -1
  191. package/dist/assets/{pixi-live-write-target-DJUjy31J.js → pixi-live-write-target-OuYwii0Y.js} +1 -1
  192. package/dist/assets/{play.command-Erf3N5VD.js → play.command-D9oNEgZ0.js} +2 -2
  193. package/dist/assets/{presentation-BxwfX5Wf.js → presentation-Dy4eumBf.js} +1 -1
  194. package/dist/assets/{product-DVszYDSF.js → product-C8y44I8V.js} +1 -1
  195. package/dist/assets/{profiler.action-CiZCcZ-R.js → profiler.action-DDJ1W-sV.js} +1 -1
  196. package/dist/assets/{profiler.menu-T0cOPUfK.js → profiler.menu-B9kz9Q68.js} +1 -1
  197. package/dist/assets/{profiler.utility-Dq4GRV6G.js → profiler.utility-Dj7cC4Z1.js} +1 -1
  198. package/dist/assets/{project-authoring-session-1_gSjCtF.js → project-authoring-session-BiPozvTW.js} +2 -2
  199. package/dist/assets/{properties-bone-constraints.inspector-CNSbpQ-3.js → properties-bone-constraints.inspector-D7JBDMu1.js} +1 -1
  200. package/dist/assets/{properties-bone.inspector-MrF2CQuv.js → properties-bone.inspector-Dk1ZtSNR.js} +1 -1
  201. package/dist/assets/{properties-collection.inspector-BVPyC4UE.js → properties-collection.inspector-DoK5rfdf.js} +1 -1
  202. package/dist/assets/{properties-constraints.inspector-CA8RTE35.js → properties-constraints.inspector-BLlJHeNZ.js} +1 -1
  203. package/dist/assets/{properties-data.inspector-wiB8xicC.js → properties-data.inspector-A4_fGhb3.js} +1 -1
  204. package/dist/assets/{properties-material.inspector-Bf_ji3wn.js → properties-material.inspector-CIpfFnam.js} +1 -1
  205. package/dist/assets/{properties-modifiers.inspector-6FFdw9AY.js → properties-modifiers.inspector-WQPkd4Rh.js} +1 -1
  206. package/dist/assets/{properties-object.inspector-DE3pesUS.js → properties-object.inspector-D0ShdJu5.js} +1 -1
  207. package/dist/assets/{properties-output.inspector-Be-knw0k.js → properties-output.inspector-kfsRy3QB.js} +1 -1
  208. package/dist/assets/{properties-particles.inspector-DlqHoQAV.js → properties-particles.inspector-B6KXQsfW.js} +1 -1
  209. package/dist/assets/{properties-physics.inspector-BG0VrR6B.js → properties-physics.inspector-DJXKd8kR.js} +1 -1
  210. package/dist/assets/{properties-render.inspector-CU9OT414.js → properties-render.inspector-DzWIBovZ.js} +1 -1
  211. package/dist/assets/{properties-scene.inspector-C42oTts_.js → properties-scene.inspector-Bfl8nbri.js} +1 -1
  212. package/dist/assets/{properties-texture.inspector-DKDV0xVi.js → properties-texture.inspector-DvWdSzY9.js} +1 -1
  213. package/dist/assets/{properties-view-layer.inspector-F-09o7Wu.js → properties-view-layer.inspector-BWnkn8Vk.js} +1 -1
  214. package/dist/assets/{properties-world.inspector-CDUzzoDL.js → properties-world.inspector-DMibRN9k.js} +1 -1
  215. package/dist/assets/{r3f-design-session-B7g85Ubb.js → r3f-design-session-iEACkph-.js} +2 -2
  216. package/dist/assets/{r3f-physics-binding-Cnq-NbcK.js → r3f-physics-binding-DT9gU6QS.js} +1 -1
  217. package/dist/assets/{r3f-source-authoring-adapter-CyPyqkM2.js → r3f-source-authoring-adapter-gw1XzvxX.js} +1 -1
  218. package/dist/assets/{react-canvas-navigation-DmOr9odR.js → react-canvas-navigation-BKi9JC83.js} +1 -1
  219. package/dist/assets/{react-inspector.service-DwcaF9IG.js → react-inspector.service-W33XKeIq.js} +1 -1
  220. package/dist/assets/{react-story-board-CV_xdGh1.js → react-story-board-krhBm535.js} +1 -1
  221. package/dist/assets/{react-three-rapier.esm-DQRNQwIJ.js → react-three-rapier.esm-CJKGUwLd.js} +1 -1
  222. package/dist/assets/{react-world-authoring-adapter-BxVhWmgw.js → react-world-authoring-adapter-D3eoX0JS.js} +1 -1
  223. package/dist/assets/{realm-services-Cg17rNWu.js → realm-services-KWdKLvPE.js} +1 -1
  224. package/dist/assets/{reflection-probe-capture.inspector-CSe75rUr.js → reflection-probe-capture.inspector-C_R9ag5V.js} +1 -1
  225. package/dist/assets/{registry-DkuVtOoX.js → registry-DrzqTjSK.js} +1 -1
  226. package/dist/assets/{relative-import-specifier-KuoBpIGI.js → relative-import-specifier-CAx_veDO.js} +1 -1
  227. package/dist/assets/{render-env-DdgiL0G1.js → render-env-Dp0VKZNy.js} +1 -1
  228. package/dist/assets/{render-features-BNRGwsS3.js → render-features-i9Si28Ov.js} +1 -1
  229. package/dist/assets/{render-settings-Cvt-UEn5.js → render-settings-B6kFzF9n.js} +1 -1
  230. package/dist/assets/{resolve-three-B_SlmwYz.js → resolve-three-CSKQh9lw.js} +3 -3
  231. package/dist/assets/{root-seam-contract-CBnI5fSF.js → root-seam-contract-CQCfH2-C.js} +1 -1
  232. package/dist/assets/{run-selection-D8BpmvGy.js → run-selection-BjcjVjry.js} +1 -1
  233. package/dist/assets/{scene-capture-Cj_ovCK0.js → scene-capture-43-NoPLm.js} +1 -1
  234. package/dist/assets/{scene-document.service-Kpmmzat3.js → scene-document.service-DWTbL5Hn.js} +2 -2
  235. package/dist/assets/{scene-framing-C5vUXepb.js → scene-framing-CvvxxYt4.js} +1 -1
  236. package/dist/assets/{seeded-random-B_ZVFnMw.js → seeded-random-CKA5Uokz.js} +1 -1
  237. package/dist/assets/{session-Diu2gkDJ.js → session-BELerU8a.js} +42 -1
  238. package/dist/assets/{setup-renderer-CeDRVovn.js → setup-renderer-UpKVuGTi.js} +1 -1
  239. package/dist/assets/{source-object3d-authoring-adapter-CkrMfTNh.js → source-object3d-authoring-adapter-C0FyKqwI.js} +1 -1
  240. package/dist/assets/{source-persistence-backend-Dxv1DyQP.js → source-persistence-backend-DpYsFl_H.js} +1 -1
  241. package/dist/assets/{stage-keyboard-DYIzheZc.js → stage-keyboard-Cit3lFIB.js} +1 -1
  242. package/dist/assets/{stage-overlay-set-CGSRG4Aj.js → stage-overlay-set-CvzGB9vl.js} +1 -1
  243. package/dist/assets/{stage-presence-markers-BJz57Ct3.js → stage-presence-markers-D-WXTthQ.js} +1 -1
  244. package/dist/assets/{stage-transform-tools-C8-lHfXY.js → stage-transform-tools-CP6bVB2R.js} +1 -1
  245. package/dist/assets/{standard-viewport-dressing-BVichQxX.js → standard-viewport-dressing-DPYcmzrH.js} +1 -1
  246. package/dist/assets/{state-watch.action-DKzRIy3J.js → state-watch.action-RjNvHRyp.js} +1 -1
  247. package/dist/assets/{state-watch.menu-CXJ9I-HV.js → state-watch.menu-CsMJ1hWG.js} +1 -1
  248. package/dist/assets/{state-watch.utility-DiB9QOcK.js → state-watch.utility-CmAcPzca.js} +1 -1
  249. package/dist/assets/{story-capture-P6zeIG5J.js → story-capture-BexJr7Md.js} +1 -1
  250. package/dist/assets/{story-documents-DfvomvsX.js → story-documents-DZfNJc2_.js} +1 -1
  251. package/dist/assets/{story-documents.service-DR9ets4q.js → story-documents.service-BsEuTY96.js} +1 -1
  252. package/dist/assets/{story-documents.service-ink5SQ1C.js → story-documents.service-CIhk284Q.js} +1 -1
  253. package/dist/assets/{story-media-presence-DRy56PNr.js → story-media-presence-LD5rrKij.js} +1 -1
  254. package/dist/assets/{story-pixi-preview-D56zGWQH.js → story-pixi-preview-BCtfkebp.js} +1 -1
  255. package/dist/assets/{story-presentation-Buq-pvYC.js → story-presentation-d0TTaboy.js} +1 -1
  256. package/dist/assets/{story-three-preview-8i3UHSR1.js → story-three-preview-DbW5A2E9.js} +2 -2
  257. package/dist/assets/{studio-environment-D6JkSE7Q.js → studio-environment-BZ0cGXh6.js} +1 -1
  258. package/dist/assets/{surface-state-CPApGJAw.js → surface-state-CKQjhgTW.js} +1 -1
  259. package/dist/assets/{syntactic-prop-specs-kZ8ukBIu.js → syntactic-prop-specs-CHefUwor.js} +1 -1
  260. package/dist/assets/{team-playtest.service-CGxQ8XaR.js → team-playtest.service-DJZVNmDz.js} +1 -1
  261. package/dist/assets/{three-BeNC5ULQ.js → three-BzNJcrnJ.js} +1 -1
  262. package/dist/assets/{three-authoring-adapter-BC0M_LjK.js → three-authoring-adapter-u8CNMO88.js} +1 -1
  263. package/dist/assets/three-authoring.service-B5XG2RqB.js +2 -0
  264. package/dist/assets/{three-ingest-runtime-QR_mSA3s.js → three-ingest-runtime-QIgw-qG5.js} +1 -1
  265. package/dist/assets/{three-integration-B0Pips-D.js → three-integration-B3Nu_wKt.js} +2 -2
  266. package/dist/assets/three-integration.service-BIHxhhEQ.js +1 -0
  267. package/dist/assets/{three-projection-core-CktgE3qZ.js → three-projection-core-Bhn7ACDh.js} +1 -1
  268. package/dist/assets/{three-state-Jjh8RKmv.js → three-state-jUYZSnrd.js} +1 -1
  269. package/dist/assets/{three-story-capture.service-D4GsyMao.js → three-story-capture.service-DDyjWxh9.js} +2 -2
  270. package/dist/assets/{three-story-model-CcSkyEHD.js → three-story-model-BFTEESmE.js} +1 -1
  271. package/dist/assets/{three-viewport-presentation-DMl9pRzL.js → three-viewport-presentation-Dq7YhHm4.js} +1 -1
  272. package/dist/assets/{transform-mode-request-BrnHasM9.js → transform-mode-request-DXoMQVlu.js} +1 -1
  273. package/dist/assets/{transport-strip-B_-5H4dc.js → transport-strip-DDgtStui.js} +1 -1
  274. package/dist/assets/transport.header-DNyTR34F.js +1 -0
  275. package/dist/assets/{tuples-DT5W38h7.js → tuples-DsOEI7JD.js} +1 -1
  276. package/dist/assets/{ui-board-document-DWKA2ffR.js → ui-board-document-DpyZG4Az.js} +2 -2
  277. package/dist/assets/{user-data-BIoZkgOJ.js → user-data-DKk6eQvn.js} +1 -1
  278. package/dist/assets/{utility-view-state-CVfqfr1o.js → utility-view-state-CqOjgzgj.js} +1 -1
  279. package/dist/assets/{viewport-door-DkrIQ3Lf.js → viewport-door-CLWBI2de.js} +1 -1
  280. package/dist/assets/{viewport-root-presentation-CBBdlbEP.js → viewport-root-presentation-CVftQRQR.js} +1 -1
  281. package/dist/assets/{viewport-surface-status-DD1DHTG4.js → viewport-surface-status-Dil3jYDY.js} +1 -1
  282. package/dist/assets/{webworkerAll-Dz3U-k_j.js → webworkerAll-CvvkbZ3I.js} +1 -1
  283. package/dist/assets/worker-Dh5yFNjH.js +2 -0
  284. package/dist/assets/{workspace-arrangement-BrA73ntW.js → workspace-arrangement-rd1Zi7ge.js} +1 -1
  285. package/dist/assets/{world-documents-D0S4TvKh.js → world-documents-Bs88AV0b.js} +1 -1
  286. package/dist/assets/{world-root-stage-binding-Da5R7yq2.js → world-root-stage-binding-BZWGVFZh.js} +1 -1
  287. package/dist/assets/{xstate-animation-binding-yMMgYROj.js → xstate-animation-binding-CBtnOnY3.js} +1 -1
  288. package/dist/assets/{xstate-animation-meta-DVb9it2u.js → xstate-animation-meta-BszyPNdl.js} +1 -1
  289. package/dist-node/cli.js +16 -16
  290. package/package.json +16 -16
  291. package/dist/assets/InspectorObjectPreview-DniTSdEo.js +0 -1
  292. package/dist/assets/Object3DDocumentViewport-Dr7XBnEa.js +0 -2
  293. package/dist/assets/autoplay.service-BvEb13A3.js +0 -1
  294. package/dist/assets/instances.command-B9SndOqS.js +0 -1
  295. package/dist/assets/network-observer.service-COlyC1Vn.js +0 -1
  296. package/dist/assets/three-authoring.service-DRxwcnXA.js +0 -2
  297. package/dist/assets/three-integration.service-sYOQoXd6.js +0 -1
  298. package/dist/assets/transport.header-Dvkippp-.js +0 -1
  299. package/dist/assets/worker-Df5OJQKy.js +0 -2
@@ -0,0 +1,2 @@
1
+ const f="/work/.volter-session",fe=`${f}/session.py`,ue=[`${f}/in`,`${f}/reply`],M="/__editor/blender-wasm";function we(e){return e.startsWith("@@VOLTER-ERROR")?"error":e.startsWith("@@VOLTER-WARN")?"warn":"log"}function U(e){return new URL(`${M}/${e}`,import.meta.url).href}async function z(){const e=await fetch(U("status"));return e.ok?await e.json():{available:!1,skew:null,dir:null,sizes:{},encoded:{},missing:[`${M}/status answered ${e.status}`]}}async function V(e){const n=await z();if(!n.available)throw new Error(`The headless Blender WebAssembly build is not served by this editor: ${n.missing.join("; ")}`);if(n.skew==="wali"){const{startWaliBlenderEngine:t}=await import("./blender-wali-engine-BQnc_4bT.js");return t(e,n)}const{startEmscriptenBlenderEngine:r}=await import("./blender-emscripten-engine-DMm-6gss.js");return r(e,n)}function H(e){return e<200?1:e<5e3?5:25}const G=e=>new Promise(n=>setTimeout(n,e)),I=new TextDecoder;function he(e,n,r){let t=0,s=0;const o=new Set;async function i(d){for(const l of o)d.has(`${l}.done`)||(await e.unlink(`${f}/reply/${l}.json`),await e.unlink(`${f}/reply/${l}.done`),o.delete(l))}async function c(){let d;try{d=await e.readdir(`${f}/ask`)}catch{return}const l=new Set(d.filter(p=>p.endsWith(".done")));await i(l);for(const p of l){const w=p.slice(0,-5);if(Number(w)<=s)continue;s=Number(w);const y=JSON.parse(I.decode(await e.readFile(`${f}/ask/${w}.json`)));let h;try{h=await n.ask(y)}catch(b){h={error:b instanceof Error?b.message:String(b)}}await Promise.all([e.writeFile(`${f}/reply/${w}.json`,JSON.stringify(h??null)),e.writeFile(`${f}/reply/${w}.done`,"1")]),o.add(w)}}async function a(d){const l=String(++t);await Promise.all([e.writeFile(`${f}/in/${l}.json`,JSON.stringify(d)),e.writeFile(`${f}/in/${l}.done`,"1")]);const p=performance.now();for(;;){if(await c(),await e.stat(`${f}/out/${l}.done`)){const h=JSON.parse(I.decode(await e.readFile(`${f}/out/${l}.json`)));if(await e.unlink(`${f}/in/${l}.json`),await e.unlink(`${f}/in/${l}.done`),h.error)throw new Error(h.error);return h.result}const w=r?.();if(w)throw new Error(`Blender is gone, so this call will never be answered: ${w}. The session keeps its directory and its cached banner, so every later call would wait on the same missing answer; start a new program with \`blender-start {fresh: true}\` (\`VOLTER_BLENDER_FRESH_SESSION=1\` for the battery harness).`);const y=H(performance.now()-p);await(e.changed?e.changed(y):G(y))}}return{request:a}}const T=e=>typeof e=="object"&&e!==null&&typeof e.offset=="number"&&typeof e.length=="number"&&typeof e.dtype=="string"&&typeof e.count=="number"&&typeof e.stride=="number",K={f32:e=>new Float32Array(e.buffer,e.byteOffset,e.byteLength>>2),f64:e=>new Float64Array(e.buffer,e.byteOffset,e.byteLength>>3),u32:e=>new Uint32Array(e.buffer,e.byteOffset,e.byteLength>>2),i32:e=>new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),u16:e=>new Uint16Array(e.buffer,e.byteOffset,e.byteLength>>1),i16:e=>new Int16Array(e.buffer,e.byteOffset,e.byteLength>>1),u8:e=>e,i8:e=>new Int8Array(e.buffer,e.byteOffset,e.byteLength)};function Q(e,n,r){const t=K[r.dtype];if(!t)throw new Error(`Blender frame column ${n}: unknown dtype ${r.dtype}`);const{offset:s,length:o}=r;if(s<0||o<0||s+o>e.byteLength)throw new Error(`Blender frame column ${n}: bytes ${s}..${s+o} lie outside the ${e.byteLength}-byte export arena`);const i=e.subarray(s,s+o).slice(),c=t(i),a=r.count*r.stride;if(c.length!==a)throw new Error(`Blender frame column ${n}: ${c.length} values, ${a} declared (${r.count} x ${r.stride})`);return c}function k(e,n){const r=(t,s)=>{if(T(t)){const o=Q(e,s,t);return s==="co"?Float64Array.from(o):o}if(Array.isArray(t))return t.map(o=>r(o,s));if(typeof t=="object"&&t!==null){const o={};for(const[i,c]of Object.entries(t))o[i]=r(c,i);return o}return t};return r(n,"")}async function v(e,n){const r=async(t,s)=>{if(T(t)){const{offset:o,length:i,dtype:c}=t;if(o<0||i<0||o+i>e.byteLength)throw new Error(`Blender frame column ${s}: bytes ${o}..${o+i} lie outside the ${e.byteLength}-byte export arena`);const a=e.subarray(o,o+i).slice(),d=await crypto.subtle.digest("SHA-256",a),l=[...new Uint8Array(d)].map(p=>p.toString(16).padStart(2,"0")).join("");return{dtype:c,length:i,sha256:l}}if(Array.isArray(t))return Promise.all(t.map(o=>r(o,s)));if(typeof t=="object"&&t!==null){const o={};for(const[i,c]of Object.entries(t))o[i]=await r(c,i);return o}return t};return r(n,"")}const E=e=>self.postMessage(e),R=(e,n)=>E({op:"log",level:e,text:n});let $=null,B=null,X=0;const A=new Map;function Y(e,n,r){const t=++X,s=[],o=e;for(const i of[o?.meshes??{},o?.images??{}])for(const c of Object.values(i))for(const a of Object.values(c))ArrayBuffer.isView(a)&&a.buffer instanceof ArrayBuffer&&!s.includes(a.buffer)&&s.push(a.buffer);return new Promise((i,c)=>{A.set(t,{resolve:i,reject:c}),self.postMessage({op:"present",id:t,frame:e,description:n,...r?{capture:r}:{}},s)})}let u=null,O=null,L=!1,N=Promise.resolve();function Z(e){const n=N.then(e);return N=n.catch(()=>{}),n}let g=null;async function q(e,n){const r=new Map,t=async(s,o)=>{if(T(s)){r.set(s.offset,{typed:k(e,{[o]:s})[o],description:await v(e,s)});return}if(Array.isArray(s))for(const i of s)await t(i,o);else if(typeof s=="object"&&s!==null)for(const[i,c]of Object.entries(s))await t(c,i)};return await t(n,""),r}function ee(e,n){const r=t=>{const s=(o,i)=>{if(T(o)){const a=e.columns.get(o.offset);if(!a)throw new Error(`Blender frame column ${i.join(".")}: not in the held frame`);return a[t]}if(Array.isArray(o))return o.map(a=>s(a,i));if(typeof o!="object"||o===null)return o;if(o.deferred===!0){const[a,d]=i.slice(-2),l=(a==="meshes"?e.meshes:e.images).get(d);if(!l)throw new Error(`Blender frame ${a} ${d}: deferred and never pulled`);return l[t]}const c={};for(const[a,d]of Object.entries(o))c[a]=s(d,[...i,a]);return c};return s(n,[])};return{typed:r("typed"),description:r("description")}}function D(e){L=e,E({op:"document-dirty",dirty:e})}async function C(){if(!u||O===null)return;const e=O;let n;try{n=await u.request({op:"save-document"})}catch(t){throw new Error(`The Blender document ${e} could not be saved: ${S(t)}`)}if(!n?.saved||typeof n.path!="string")throw new Error(`Blender did not save the document ${e}`);let r;try{r=await u.files.readFile(n.path)}catch(t){throw new Error(`The Blender document ${e} could not be read back out of the engine: ${S(t)}`)}m.delete(n.path);try{const t=await fetch(`/__editor/blender-document?path=${encodeURIComponent(e)}`,{method:"POST",headers:{"content-type":"application/octet-stream"},body:new Blob([r])});if(!t.ok){const s=await t.text().catch(()=>"");throw new Error(`HTTP ${t.status} ${s}`)}}catch(t){throw new Error(`The Blender document ${e} was not written to the project: ${S(t)}`)}D(!1),R("log",`@@VOLTER-DOCUMENT ${JSON.stringify({path:e,bytes:r.length})}`)}async function te(e,n){const r={engine:null},t=await V({project:e,log:R,ask:async({frame:o,hold:i,mesh:c,image:a,piece:d,present:l,capture:p,saveDue:w})=>{if(!r.engine)throw new Error("The Blender session presented before it started");w&&O!==null&&D(!0);const y=await r.engine.readArena();if(i!==void 0)return g={columns:await q(y,i),meshes:new Map,images:new Map},{};if(c!==void 0||a!==void 0){if(!g)throw new Error(`The Blender session sent ${c??a} before its frame`);const P={typed:k(y,d),description:await v(y,d)};return c!==void 0?g.meshes.set(c,P):g.images.set(a,P),{}}let h,b;if(l){if(!g)throw new Error("The Blender session presented a frame it never sent");({typed:h,description:b}=ee(g,o)),g=null}else h=k(y,o),b=await v(y,o);const j=await Y(h,b,p);return{...typeof j.capture=="object"&&j.capture!==null?j.capture:{},..."held"in j?{held:j.held}:{}}}});r.engine=t,u=t,n&&await W(t.files,e);const s=await t.request({op:"start",project:e,...n?{document:n}:{}});return n&&(O=n),$={start:async()=>s,execute:async o=>{const i=await t.request({op:"execute",code:o});return i.error?`Error executing code: ${i.error}`:`Code executed successfully: ${i.result}`},sceneInfo:async()=>JSON.stringify(await t.request({op:"scene-info"}),null,2),objectInfo:async o=>JSON.stringify(await t.request({op:"object-info",name:o}),null,2),screenshotView:async o=>(await t.request({op:"present",capture:{size:o}}),JSON.stringify({view:{size:o}}))},{...s,engine:"blender-wasm",skew:t.skew,bootMs:Math.round(t.bootMs),releasedPayloadMB:t.releasedPayloadBytes===null?null:Math.round(t.releasedPayloadBytes/1048576)}}async function ne(){try{const e=await fetch("/__editor/blender-wasm/status");return e.ok?await e.json():{available:!1,missing:[`status answered ${e.status}`]}}catch(e){return{available:!1,missing:[String(e)]}}}async function re(e,n){if($)throw new Error("The Blender session is already started");if(!e.startsWith("/"))throw new Error("The Blender session needs the project's absolute path");if(n!==void 0&&!oe(n))throw new Error(`The Blender document must be a project-relative .blend path with no traversal (models/model.blend); got ${JSON.stringify(n)}`);const r=await ne();if(!r.available)throw new Error(`Headless Blender is not served by this editor, so there is no modeling engine: ${r.missing.join("; ")}. The engine is Blender compiled to WebAssembly (packages/blender-engine/wasm, or the directory VOLTER_BLENDER_WASM_DIR names); nothing stands in for it.`);return B=e,te(e,n)}function oe(e){return!e.endsWith(".blend")||e.startsWith("/")||e.includes("\\")?!1:e.split("/").every(r=>r!==""&&r!=="."&&r!=="..")}const _=new Set;function x(e){_.has(e)||(_.add(e),R("error",e))}async function se(e){const n=i=>(x(`The project's files are not readable from Python: ${i}`),null);let r;try{r=await fetch("/__editor/blender-project-index")}catch(i){return n(String(i))}if(!r.ok)return n(`/__editor/blender-project-index answered ${r.status}`);let t;try{if(t=await r.json(),typeof t?.root!="string"||!Array.isArray(t.files))return n("invalid project index")}catch(i){return n(String(i))}const{root:s,files:o}=t;return s!==e&&x(`The editor serving this tab has ${s} open, not ${e}; its files are mounted at ${e}, which is where Python is looking.`),o}const m=new Map;async function ie(e,n){const r=await e.stat(n);return r?`${r.size}:${r.mtimeMs}`:""}async function W(e,n){const r=await se(n);if(!r)return;const t=new Set(r.map(s=>`${n}/${s.path}`));for(const s of[...m.keys()])if(!t.has(s)){try{await e.unlink(s)}catch{}m.delete(s)}for(const s of r){const o=`${n}/${s.path}`,i=`${s.size}:${s.mtime}`;if(m.get(o)?.host===i||!m.has(o)&&await e.stat(o)!==null)continue;const c=await fetch(`/__editor/blender-project-file?path=${encodeURIComponent(s.path)}`);if(!c.ok){x(`${s.path}: HTTP ${c.status}`);continue}const a=o.slice(0,o.lastIndexOf("/"));a&&await e.mkdirTree(a),await e.writeFile(o,new Uint8Array(await c.arrayBuffer())),m.set(o,{host:i,engine:await ie(e,o)})}}async function ae(e,n){const r=[],t=async s=>{let o;try{o=await e.readdir(s)}catch{return}for(const i of o){if(i==="."||i==="..")continue;const c=`${s.replace(/\/$/,"")}/${i}`,a=await e.stat(c);if(a){if((a.mode&61440)===16384){await t(c);continue}m.get(c)?.engine!==`${a.size}:${a.mtimeMs}`&&r.push({path:c,size:a.size,mtime:a.mtimeMs})}}};return await t(n),r}async function J(e){switch(e.op){case"start":return re(e.project,e.document);case"present-result":{const t=A.get(e.id);A.delete(e.id),t&&(e.error?t.reject(new Error(e.error)):t.resolve({...e.capture===void 0?{}:{capture:e.capture},..."held"in e?{held:e.held}:{}}));return}}if(!$||!B||!u)throw new Error("The Blender session has not started");const n=u.files,r=u.request.bind(u);switch(e.op){case"flush-document":return L?(await C(),{saved:!0}):{saved:!1};case"history-begin":case"history-end":return r({op:e.op});case"history-step":return r({op:"history-step",token:e.token,direction:e.direction});case"execute":await W(n,B);{const t=await r({op:"execute",code:e.code,history:e.history??!0,label:e.label??"Blender Python"});return t.error?`Error executing code: ${t.error}`:`Code executed successfully: ${t.result}`}case"present":return r({op:"present"});case"scene-info":return $.sceneInfo();case"object-info":return $.objectInfo(e.name);case"rna":return r({op:"rna",path:e.path,...e.names===void 0?{}:{names:e.names}});case"rna-context":return r({op:"rna-context",...e.object===void 0?{}:{object:e.object},...e.collection===void 0?{}:{collection:e.collection}});case"view-shading":return r({op:"view-shading",shading:e.shading});case"rna-set":return r({op:"rna-set",history:e.history!==!1,path:e.path,property:e.property,value:e.value,...e.index===void 0?{}:{index:e.index}});case"outliner":return r({op:"outliner",...e.selected===void 0?{}:{selected:[...e.selected]}});case"node-tree":return r({op:"node-tree",...e.path===void 0?{}:{path:e.path},...e.material===void 0?{}:{material:e.material}});case"uv-layout":return r({op:"uv-layout",...e.object===void 0?{}:{object:e.object},...e.uvLayer===void 0?{}:{uvLayer:e.uvLayer}});case"rig":return r({op:"rig",...e.object===void 0?{}:{object:e.object}});case"action-clip":return r({op:"action-clip",...e.object===void 0?{}:{object:e.object},...e.bake===void 0?{}:{bake:e.bake}});case"outliner-set":return r({op:"outliner-set",path:e.path,column:e.column,value:e.value});case"screenshot-view":return JSON.parse(await $.screenshotView(e.maxSize));case"read-file":return n.readFile(e.path);case"write-file":{const t=e.path.slice(0,e.path.lastIndexOf("/"));t&&await n.mkdirTree(t),await n.writeFile(e.path,e.bytes),m.delete(e.path);return}case"list-files":return ae(n,e.path)}throw new Error(`Unknown Blender worker request ${e.op}`)}function S(e){if(e instanceof Error)return e.stack??`${e.name}: ${e.message}`;if(typeof e=="object"&&e!==null){const n=e;if(typeof n.message=="string")return typeof n.name=="string"?`${n.name}: ${n.message}`:n.message;try{return JSON.stringify(e)??Object.prototype.toString.call(e)}catch{return Object.prototype.toString.call(e)}}return String(e)}function ce(){if(!u)return;const e=u.memoryBytes();e!==null&&E({op:"memory",bytes:e})}self.onmessage=e=>{const n=e.data;if(n.op==="present-result"){J(n);return}Z(()=>le(n))};async function le(e){try{const n=await J(e);L&&await C(),await F(),E({id:e.id,result:n})}catch(n){let r=S(n);try{await F()}catch(t){r+=`
2
+ Unable to deliver Blender history: ${S(t)}`}E({id:e.id,error:r})}ce()}async function F(){if(!u||!$)return;const e=await u.request({op:"history-events"});e.length&&E({op:"history",entries:e})}export{M as A,ue as P,f as S,U as a,fe as b,we as c,he as o,G as s};
@@ -1 +1 @@
1
- import{ty as n,tz as l,tA as a,tB as _,tC as i,tD as s,tE as d,tF as u,tG as c,tH as b,tI as p}from"./index-Dji-5Ngh.js";const f=Object.freeze(Object.defineProperty({__proto__:null,EDITOR_VIEW_BUILT_IN_UTILITY_IDS:n,EDITOR_VIEW_DOCUMENT_KINDS:l,EDITOR_VIEW_KEYS:a,EDITOR_VIEW_TOOL_UTILITY_PREFIX:_,EDITOR_VIEW_WORKSPACE_DOCUMENT_IDS:i,EditorClient:s,EditorCommandError:d,editorViewFromUrl:u,editorViewUrl:c,isEditorViewDocumentKind:b,isEditorViewUtility:p},Symbol.toStringTag,{value:"Module"})),o={editorHelperType:"editorHelperType",skeletonVisible:"skeletonVisible",skeletonEnabled:"skeletonEnabled",engineInternal:"engineInternal",editorHelper:"editorHelper",volterComponentRoot:"volterComponentRoot",volterBuiltInternal:"volterBuiltInternal"};function y(e,t){return e?e.userData[o[t]]:void 0}function g(e,t,r){e.userData[o[t]]=r}const S=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),j=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),T=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),m=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),I=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),E=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),M=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),v=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),P=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),z=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),D=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),R=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),C=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));export{o as O,m as a,P as b,E as c,S as d,j as e,T as f,y as g,I as h,f as i,z as j,D as k,M as p,v as r,g as s,R as t,C as w};
1
+ import{ty as n,tz as l,tA as a,tB as _,tC as i,tD as s,tE as d,tF as u,tG as c,tH as b,tI as p}from"./index-D8qHS95_.js";const f=Object.freeze(Object.defineProperty({__proto__:null,EDITOR_VIEW_BUILT_IN_UTILITY_IDS:n,EDITOR_VIEW_DOCUMENT_KINDS:l,EDITOR_VIEW_KEYS:a,EDITOR_VIEW_TOOL_UTILITY_PREFIX:_,EDITOR_VIEW_WORKSPACE_DOCUMENT_IDS:i,EditorClient:s,EditorCommandError:d,editorViewFromUrl:u,editorViewUrl:c,isEditorViewDocumentKind:b,isEditorViewUtility:p},Symbol.toStringTag,{value:"Module"})),o={editorHelperType:"editorHelperType",skeletonVisible:"skeletonVisible",skeletonEnabled:"skeletonEnabled",engineInternal:"engineInternal",editorHelper:"editorHelper",volterComponentRoot:"volterComponentRoot",volterBuiltInternal:"volterBuiltInternal"};function y(e,t){return e?e.userData[o[t]]:void 0}function g(e,t,r){e.userData[o[t]]=r}const S=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),j=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),T=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),m=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),I=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),E=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),M=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),v=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),P=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),z=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),D=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),R=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),C=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));export{o as O,m as a,P as b,E as c,S as d,j as e,T as f,y as g,I as h,f as i,z as j,D as k,M as p,v as r,g as s,R as t,C as w};
@@ -1 +1 @@
1
- import{a as c}from"./jsx-runtime-DPjLkJKQ.js";import{dB as W,dC as K,e4 as j,fo as H,aK as E,f_ as $,f$ as Y,d3 as A,g0 as q,d4 as M,eF as N,dK as Q,y as J,g1 as Z,aQ as ee,g2 as te,g3 as oe,g4 as ne,g5 as re,g6 as se,g7 as ae,fX as ie,d6 as ce,g8 as le,aD as de,g9 as P,ga as ue,dI as pe}from"./index-Dji-5Ngh.js";import{r as p}from"./index-nmcBqr7Y.js";import{d as fe,m as me}from"./design-time-layers-BePiGKet.js";import{I as be,B as xe}from"./edit-mode-authoring-euM9VW6K.js";import{b as he,i as ge}from"./react-canvas-navigation-DmOr9odR.js";import{R as z,i as ve}from"./react-story-board-CV_xdGh1.js";import{s as ye,c as we,a as Se,b as ke}from"./component-board-registry-DrIa2csL.js";import{e as Re,S as Ie}from"./surface-state-CPApGJAw.js";import"./index-CtzuWnCS.js";import{c as Ce,d as Ee,r as F,e as G,f as Ae,m as O,b as De,a as je,s as Be}from"./board-guides-CC1g9px4.js";import{C as V,a as $e,b as Me}from"./CanvasSceneViewport-CJdc6428.js";import{R as _e}from"./ReactCanvasControls-BXjlNIcc.js";import{R as ze}from"./RootSelectionOverlay-BETMJphO.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./root-stacking-BEd9ZvxC.js";import"./design-time-mount-registry-DUpXCg1U.js";import"./game-surface-defaults-D8S4cRxi.js";import"./Toolbar-CextQHWh.js";import"./transform-mode-request-BrnHasM9.js";import"./TransientHint-gxsw0fPN.js";import"./layered-pick-DfTP1-Cr.js";import"./eyedropper-session-bjPXnfeX.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./inspect-DZInhjtn.js";import"./inference-diagnostics-BJUcoifD.js";const y=16,_="rgba(255, 82, 82, 0.9)",U="rgba(18, 22, 26, 0.92)",D="rgba(255, 255, 255, 0.28)";function Te(s){return[10,25,50,100,250,500,1e3,2500,5e3].find(n=>n*s>=60)??1e4}function L(s){return Math.abs(s)>=1e3?`${s/1e3}k`:String(s)}function Ne({docId:s,containerRef:l}){const n=p.useSyncExternalStore(W,K),x=p.useSyncExternalStore(Ce,()=>Ee(s)),[r,d]=p.useState(null),v=p.useRef(null);p.useEffect(()=>{const t=l.current;if(!t)return;const o=t.getBoundingClientRect();return F(s,{originX:o.left,originY:o.top,panX:n.x,panY:n.y,zoom:n.zoom}),()=>F(s,null)},[s,l,n.x,n.y,n.zoom]);const f=(t,o)=>Math.round((t-(o==="x"?n.x:n.y))/n.zoom),u=(t,o)=>(o==="x"?n.x:n.y)+t*n.zoom,m=t=>{const o=l.current?.getBoundingClientRect();return o?{x:t.clientX-o.left,y:t.clientY-o.top}:{x:0,y:0}},k=t=>o=>{o.preventDefault(),o.currentTarget.setPointerCapture(o.pointerId);const e=m(o);d({kind:"place",axis:t,id:null,at:t==="x"?e.x:e.y})},S=t=>o=>{o.preventDefault(),o.stopPropagation(),o.currentTarget.setPointerCapture(o.pointerId);const e=m(o);d({kind:"move",axis:t.axis,id:t.id,at:t.axis==="x"?e.x:e.y})},R=t=>{if(!r)return;const o=m(t),e=r.axis==="x"?o.x:o.y;d({...r,at:e}),r.kind==="move"&&r.id&&O(s,r.id,f(e,r.axis))},I=t=>{if(!r)return;const o=m(t),e=r.axis==="x"?o.x:o.y,i=e<=y;r.kind==="place"?i||Ae(s,r.axis,f(e,r.axis)):r.id&&(i?G(s,r.id):O(s,r.id,f(e,r.axis))),d(null)},a=t=>{const o=l.current,e=o?t==="x"?o.clientWidth:o.clientHeight:0,i=Te(n.zoom),g=Math.ceil(f(y,t)/i)*i,w=f(e,t),b=[];for(let C=g;C<=w&&b.length<200;C+=i)b.push(C);return b},h={position:"absolute",background:U,zIndex:61,userSelect:"none",touchAction:"none",overflow:"hidden"};return c.jsxs("div",{ref:v,"data-testid":"board-rulers",style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:60},onPointerMove:R,onPointerUp:I,children:[x.map(t=>{const o=u(t.value,t.axis),e=t.axis==="x";return c.jsx("div",{"data-testid":`board-guide-${t.axis}-${t.value}`,title:`${t.axis} = ${t.value} — drag to move, drop on the ruler or double-click to remove`,onPointerDown:S(t),onPointerMove:R,onPointerUp:I,onDoubleClick:()=>G(s,t.id),style:{position:"absolute",pointerEvents:"auto",cursor:e?"col-resize":"row-resize",zIndex:60,...e?{left:o-2,top:0,bottom:0,width:5}:{top:o-2,left:0,right:0,height:5}},children:c.jsx("div",{style:{position:"absolute",background:_,...e?{left:2,top:0,bottom:0,width:1}:{top:2,left:0,right:0,height:1}}})},t.id)}),r&&c.jsx("div",{style:{position:"absolute",background:_,zIndex:62,...r.axis==="x"?{left:r.at,top:0,bottom:0,width:1}:{top:r.at,left:0,right:0,height:1}},children:c.jsx("span",{style:{position:"absolute",...r.axis==="x"?{top:y+4,left:4}:{left:y+4,top:4},fontSize:9,fontFamily:"ui-monospace, monospace",color:_,background:U,padding:"1px 3px",borderRadius:3,whiteSpace:"nowrap"},children:f(r.at,r.axis)})}),c.jsx("div",{"data-testid":"board-ruler-top",onPointerDown:k("y"),style:{...h,top:0,left:y,right:0,height:y,cursor:"row-resize",pointerEvents:"auto"},children:a("x").map(t=>c.jsx("span",{style:{position:"absolute",left:u(t,"x"),bottom:0,borderLeft:`1px solid ${D}`,height:5},children:c.jsx("span",{style:{position:"absolute",left:2,bottom:3,fontSize:8,color:D,fontFamily:"ui-monospace, monospace"},children:L(t)})},t))}),c.jsx("div",{"data-testid":"board-ruler-left",onPointerDown:k("x"),style:{...h,top:y,left:0,bottom:0,width:y,cursor:"col-resize",pointerEvents:"auto"},children:a("y").map(t=>c.jsx("span",{style:{position:"absolute",top:u(t,"y"),right:0,borderTop:`1px solid ${D}`,width:5},children:c.jsx("span",{style:{position:"absolute",top:1,right:3,fontSize:8,color:D,fontFamily:"ui-monospace, monospace",writingMode:"vertical-rl"},children:L(t)})},t))}),c.jsx(Pe,{}),c.jsx("div",{style:{...h,top:0,left:0,width:y,height:y,borderRight:`1px solid ${j.border}`,borderBottom:`1px solid ${j.border}`}})]})}function Pe(){const s=p.useSyncExternalStore(De,je);return s?c.jsxs("button",{type:"button","data-testid":"board-breakpoint-pill",title:"Style edits are scoped to this breakpoint — click to return to Base",onClick:()=>Be(null),style:{position:"absolute",top:y+8,right:12,zIndex:62,pointerEvents:"auto",background:"rgba(18, 22, 26, 0.92)",color:j.accent,border:`1px solid ${j.accent}`,borderRadius:999,fontSize:10,padding:"3px 10px",cursor:"pointer"},children:["@ ",s," · editing this breakpoint — click to clear"]}):null}const Fe="Scene";function Ge({active:s,composite:l,descriptor:n,documentId:x,store:r}){const d=p.useRef(null),v=p.useRef(null),[f]=p.useState(oe),u=n.kind==="canvas",m=u?f:ce;p.useSyncExternalStore(r.subscribe,r.getSnapshot);const k=p.useSyncExternalStore(ne,re),S=p.useSyncExternalStore(se,ae),[R,I]=p.useState(null),a=l.childAdapters().find(b=>b.worldId===n.worldId)?.adapter??R??void 0,h=u&&a?.provenance?.label==="babylon",t=a?.hierarchy.roots()??[],o=new Set(a?.rects?.emptyContainers?.().map(b=>b.id)??[]),e=t.some(b=>!o.has(b.id)),i=Re({surface:u?"Scene":n.kind==="dom"?"UI":"World",rootIds:[n.worldId],playSuspended:r.playState!=="stopped"&&(!a||a.provenance?.source==="boundary"),phase:!a||a.provenance?.source==="boundary"?"loading":"ready",content:!a||a.provenance?.source==="boundary"?"unknown":e?"present":"empty",readiness:k,failures:S,disclosure:a instanceof xe?a.disclosure:null});p.useEffect(()=>{if(a)return ie(x,()=>({adapter:a,nodeId:[...r.selectedEntityIds].find(b=>a.hierarchy.node(b))??null}))},[l,a,x,r]),p.useEffect(()=>{const b=d.current;if(b&&!h)return u?he(b,m):ge(b,m)},[m,h,u]),p.useEffect(()=>{if(!s)return;if(!!!v.current&&d.current){v.current=me(d.current,l,r,[n],(Ve,X)=>I(X),u?{canvasSceneView:f}:void 0,x);return}let C=0,B=0;const T=()=>{if(C+=1,C<2){B=requestAnimationFrame(T);return}pe(x)};return B=requestAnimationFrame(T),()=>cancelAnimationFrame(B)},[s,f,l,n,x,u,r]),p.useEffect(()=>()=>{v.current?.(),v.current=null},[]);const g=le(de(r),r.selectedEntityIds),w=g?.worldId===n.worldId?g:a?.rects?{worldId:n.worldId,kind:"dom",adapter:a}:null;return c.jsxs("div",{ref:d,"data-testid":`world-document:${n.worldId}`,"data-volter-backdrop-color":s?h?"#111827":u?V:z:void 0,"data-volter-backdrop-policy":s?"dark-frost":void 0,onPointerDown:()=>ue("viewport"),style:{position:"absolute",inset:0,overflow:"hidden",pointerEvents:"auto",backgroundColor:h?"#111827":u?V:z,touchAction:"none"},children:[h?null:u?c.jsx($e,{view:f,documentId:x}):c.jsx(Oe,{}),c.jsx(ze,{...a?{adapter:a}:{},...u&&!h?{view:f,transformModeAware:!0,presentationId:x}:{}},`selection:${P(a)}`),c.jsx(Ie,{explanation:i,testId:`world-surface-status:${n.worldId}`,style:{zIndex:20}}),h?null:u?c.jsx(Me,{active:s,...a?{adapter:a}:{},containerRef:d,view:f,documentId:x},`controls:${P(a)}`):c.jsxs(c.Fragment,{children:[c.jsx(Ne,{docId:n.worldId,containerRef:d}),c.jsx(_e,{containerRef:d,context:w})]})]})}function Oe(){const s=p.useSyncExternalStore(W,K),l=Math.max(8,24*s.zoom),n=Math.max(.7,Math.min(1.4,s.zoom));return c.jsx("div",{"data-testid":"react-design-canvas-backdrop","aria-hidden":"true",style:{position:"absolute",inset:0,pointerEvents:"none",backgroundColor:z,backgroundImage:`radial-gradient(circle, ${ve} ${n}px, transparent ${n}px)`,backgroundPosition:`${s.x}px ${s.y}px`,backgroundSize:`${l}px ${l}px`}})}function vt(s,l){const n=J(),x=l.childAdapters().some(e=>e.role==="world"&&e.kind==="three"),r=l.childAdapters().some(e=>e.kind===be);!x&&!r&&H(E,{discardDirty:!0});const d=new Set,v=[];let f=!1;for(const e of l.childAdapters())e.role==="world"&&e.kind==="three"&&v.push($(e.worldId,E));const u=fe(l),m=u.find(e=>e.kind==="canvas");m&&v.push($(m.worldId,A));const k=new Set([...l.childAdapters().filter(e=>e.role==="world"&&e.kind==="three"),...m?[m]:[]].map(e=>e.worldId)),S=new Map;function R(){for(const e of u){if(k.has(e.worldId)||S.has(e.worldId))continue;const i=Se(e.kind);if(!i)continue;const g=$(e.worldId,i.documentId),w=Z(e.worldId,()=>i.presence()==="absent"?`Root "${e.worldId}" has no document of its own: its design surface is the project's ${i.title} board (${i.documentId}). ${i.absentReason()}`:null);S.set(e.worldId,()=>{w(),g()})}}v.push(Y(e=>{const i=ee();if(i.some(w=>w.descriptor.id===e))return null;const g=ke(e);return g?g.presence()==="absent"?g.absentReason():null:`No workspace document is named "${e}". Open in this session: ${i.map(w=>w.descriptor.id).join(", ")||"(none)"}. A component board is present only when the package that owns its medium says this project has one, so a board id can be absent for this project and present for another.`}));function I(e){const i=g=>c.jsx(Ge,{...g,composite:l,descriptor:e,store:s});Q({id:A,title:Fe,kind:"world",workspaceRole:"authored-subject",provenance:{rootId:e.worldId,...e.path?{sourcePath:e.path}:{}},Content:i,presentation:()=>({kind:"world",id:e.worldId})},{category:"scene",default:!x,rootId:e.worldId})}function a(e){d.add(e.documentId);const i=()=>{d.delete(e.documentId)};try{Promise.resolve(e.install({store:s,composite:l})).catch(i)}catch{i()}}function h(){if(!f){R();for(const e of we()){const i=e.presence();if(i===null)continue;const g=d.has(e.documentId);i==="present"!==g&&(i==="present"?a(e):(N(e.documentId),d.delete(e.documentId)))}}}m&&(I(m),d.add(A)),h();const t=ye(h),o=m?A:[...d][0];return te()||(!x&&o!==void 0&&(n===null||n===E||n===q)?M(o):n?M(n):x&&M(E)),()=>{f=!0,t();for(const e of v)e();for(const e of S.values())e();S.clear();for(const e of d)N(e)}}export{Ge as RootDocumentContent,vt as installRootDocuments};
1
+ import{a as c}from"./jsx-runtime-DPjLkJKQ.js";import{dB as W,dC as K,e4 as j,fo as H,aK as E,f_ as $,f$ as Y,d3 as A,g0 as q,d4 as M,eF as N,dK as Q,y as J,g1 as Z,aQ as ee,g2 as te,g3 as oe,g4 as ne,g5 as re,g6 as se,g7 as ae,fX as ie,d6 as ce,g8 as le,aD as de,g9 as P,ga as ue,dI as pe}from"./index-D8qHS95_.js";import{r as p}from"./index-nmcBqr7Y.js";import{d as fe,m as me}from"./design-time-layers-BwAonuG8.js";import{I as be,B as xe}from"./edit-mode-authoring-D5X403pt.js";import{b as he,i as ge}from"./react-canvas-navigation-BKi9JC83.js";import{R as z,i as ve}from"./react-story-board-krhBm535.js";import{s as ye,c as we,a as Se,b as ke}from"./component-board-registry-DrIa2csL.js";import{e as Re,S as Ie}from"./surface-state-CKQjhgTW.js";import"./index-CtzuWnCS.js";import{c as Ce,d as Ee,r as F,e as G,f as Ae,m as O,b as De,a as je,s as Be}from"./board-guides-CIbWp-Ni.js";import{C as V,a as $e,b as Me}from"./CanvasSceneViewport-Dq8xQSFa.js";import{R as _e}from"./ReactCanvasControls-DykKDxI1.js";import{R as ze}from"./RootSelectionOverlay-CeiH9oQ4.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./root-stacking-BEd9ZvxC.js";import"./design-time-mount-registry-DUpXCg1U.js";import"./game-surface-defaults-D8S4cRxi.js";import"./Toolbar-CJ7ysST0.js";import"./transform-mode-request-DXoMQVlu.js";import"./TransientHint-DWHgvGOM.js";import"./layered-pick-QfPeC-94.js";import"./eyedropper-session-bjPXnfeX.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./inspect-z_EuQ5W3.js";import"./inference-diagnostics-x4u4h3Ui.js";const y=16,_="rgba(255, 82, 82, 0.9)",U="rgba(18, 22, 26, 0.92)",D="rgba(255, 255, 255, 0.28)";function Te(s){return[10,25,50,100,250,500,1e3,2500,5e3].find(n=>n*s>=60)??1e4}function L(s){return Math.abs(s)>=1e3?`${s/1e3}k`:String(s)}function Ne({docId:s,containerRef:l}){const n=p.useSyncExternalStore(W,K),x=p.useSyncExternalStore(Ce,()=>Ee(s)),[r,d]=p.useState(null),v=p.useRef(null);p.useEffect(()=>{const t=l.current;if(!t)return;const o=t.getBoundingClientRect();return F(s,{originX:o.left,originY:o.top,panX:n.x,panY:n.y,zoom:n.zoom}),()=>F(s,null)},[s,l,n.x,n.y,n.zoom]);const f=(t,o)=>Math.round((t-(o==="x"?n.x:n.y))/n.zoom),u=(t,o)=>(o==="x"?n.x:n.y)+t*n.zoom,m=t=>{const o=l.current?.getBoundingClientRect();return o?{x:t.clientX-o.left,y:t.clientY-o.top}:{x:0,y:0}},k=t=>o=>{o.preventDefault(),o.currentTarget.setPointerCapture(o.pointerId);const e=m(o);d({kind:"place",axis:t,id:null,at:t==="x"?e.x:e.y})},S=t=>o=>{o.preventDefault(),o.stopPropagation(),o.currentTarget.setPointerCapture(o.pointerId);const e=m(o);d({kind:"move",axis:t.axis,id:t.id,at:t.axis==="x"?e.x:e.y})},R=t=>{if(!r)return;const o=m(t),e=r.axis==="x"?o.x:o.y;d({...r,at:e}),r.kind==="move"&&r.id&&O(s,r.id,f(e,r.axis))},I=t=>{if(!r)return;const o=m(t),e=r.axis==="x"?o.x:o.y,i=e<=y;r.kind==="place"?i||Ae(s,r.axis,f(e,r.axis)):r.id&&(i?G(s,r.id):O(s,r.id,f(e,r.axis))),d(null)},a=t=>{const o=l.current,e=o?t==="x"?o.clientWidth:o.clientHeight:0,i=Te(n.zoom),g=Math.ceil(f(y,t)/i)*i,w=f(e,t),b=[];for(let C=g;C<=w&&b.length<200;C+=i)b.push(C);return b},h={position:"absolute",background:U,zIndex:61,userSelect:"none",touchAction:"none",overflow:"hidden"};return c.jsxs("div",{ref:v,"data-testid":"board-rulers",style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:60},onPointerMove:R,onPointerUp:I,children:[x.map(t=>{const o=u(t.value,t.axis),e=t.axis==="x";return c.jsx("div",{"data-testid":`board-guide-${t.axis}-${t.value}`,title:`${t.axis} = ${t.value} — drag to move, drop on the ruler or double-click to remove`,onPointerDown:S(t),onPointerMove:R,onPointerUp:I,onDoubleClick:()=>G(s,t.id),style:{position:"absolute",pointerEvents:"auto",cursor:e?"col-resize":"row-resize",zIndex:60,...e?{left:o-2,top:0,bottom:0,width:5}:{top:o-2,left:0,right:0,height:5}},children:c.jsx("div",{style:{position:"absolute",background:_,...e?{left:2,top:0,bottom:0,width:1}:{top:2,left:0,right:0,height:1}}})},t.id)}),r&&c.jsx("div",{style:{position:"absolute",background:_,zIndex:62,...r.axis==="x"?{left:r.at,top:0,bottom:0,width:1}:{top:r.at,left:0,right:0,height:1}},children:c.jsx("span",{style:{position:"absolute",...r.axis==="x"?{top:y+4,left:4}:{left:y+4,top:4},fontSize:9,fontFamily:"ui-monospace, monospace",color:_,background:U,padding:"1px 3px",borderRadius:3,whiteSpace:"nowrap"},children:f(r.at,r.axis)})}),c.jsx("div",{"data-testid":"board-ruler-top",onPointerDown:k("y"),style:{...h,top:0,left:y,right:0,height:y,cursor:"row-resize",pointerEvents:"auto"},children:a("x").map(t=>c.jsx("span",{style:{position:"absolute",left:u(t,"x"),bottom:0,borderLeft:`1px solid ${D}`,height:5},children:c.jsx("span",{style:{position:"absolute",left:2,bottom:3,fontSize:8,color:D,fontFamily:"ui-monospace, monospace"},children:L(t)})},t))}),c.jsx("div",{"data-testid":"board-ruler-left",onPointerDown:k("x"),style:{...h,top:y,left:0,bottom:0,width:y,cursor:"col-resize",pointerEvents:"auto"},children:a("y").map(t=>c.jsx("span",{style:{position:"absolute",top:u(t,"y"),right:0,borderTop:`1px solid ${D}`,width:5},children:c.jsx("span",{style:{position:"absolute",top:1,right:3,fontSize:8,color:D,fontFamily:"ui-monospace, monospace",writingMode:"vertical-rl"},children:L(t)})},t))}),c.jsx(Pe,{}),c.jsx("div",{style:{...h,top:0,left:0,width:y,height:y,borderRight:`1px solid ${j.border}`,borderBottom:`1px solid ${j.border}`}})]})}function Pe(){const s=p.useSyncExternalStore(De,je);return s?c.jsxs("button",{type:"button","data-testid":"board-breakpoint-pill",title:"Style edits are scoped to this breakpoint — click to return to Base",onClick:()=>Be(null),style:{position:"absolute",top:y+8,right:12,zIndex:62,pointerEvents:"auto",background:"rgba(18, 22, 26, 0.92)",color:j.accent,border:`1px solid ${j.accent}`,borderRadius:999,fontSize:10,padding:"3px 10px",cursor:"pointer"},children:["@ ",s," · editing this breakpoint — click to clear"]}):null}const Fe="Scene";function Ge({active:s,composite:l,descriptor:n,documentId:x,store:r}){const d=p.useRef(null),v=p.useRef(null),[f]=p.useState(oe),u=n.kind==="canvas",m=u?f:ce;p.useSyncExternalStore(r.subscribe,r.getSnapshot);const k=p.useSyncExternalStore(ne,re),S=p.useSyncExternalStore(se,ae),[R,I]=p.useState(null),a=l.childAdapters().find(b=>b.worldId===n.worldId)?.adapter??R??void 0,h=u&&a?.provenance?.label==="babylon",t=a?.hierarchy.roots()??[],o=new Set(a?.rects?.emptyContainers?.().map(b=>b.id)??[]),e=t.some(b=>!o.has(b.id)),i=Re({surface:u?"Scene":n.kind==="dom"?"UI":"World",rootIds:[n.worldId],playSuspended:r.playState!=="stopped"&&(!a||a.provenance?.source==="boundary"),phase:!a||a.provenance?.source==="boundary"?"loading":"ready",content:!a||a.provenance?.source==="boundary"?"unknown":e?"present":"empty",readiness:k,failures:S,disclosure:a instanceof xe?a.disclosure:null});p.useEffect(()=>{if(a)return ie(x,()=>({adapter:a,nodeId:[...r.selectedEntityIds].find(b=>a.hierarchy.node(b))??null}))},[l,a,x,r]),p.useEffect(()=>{const b=d.current;if(b&&!h)return u?he(b,m):ge(b,m)},[m,h,u]),p.useEffect(()=>{if(!s)return;if(!!!v.current&&d.current){v.current=me(d.current,l,r,[n],(Ve,X)=>I(X),u?{canvasSceneView:f}:void 0,x);return}let C=0,B=0;const T=()=>{if(C+=1,C<2){B=requestAnimationFrame(T);return}pe(x)};return B=requestAnimationFrame(T),()=>cancelAnimationFrame(B)},[s,f,l,n,x,u,r]),p.useEffect(()=>()=>{v.current?.(),v.current=null},[]);const g=le(de(r),r.selectedEntityIds),w=g?.worldId===n.worldId?g:a?.rects?{worldId:n.worldId,kind:"dom",adapter:a}:null;return c.jsxs("div",{ref:d,"data-testid":`world-document:${n.worldId}`,"data-volter-backdrop-color":s?h?"#111827":u?V:z:void 0,"data-volter-backdrop-policy":s?"dark-frost":void 0,onPointerDown:()=>ue("viewport"),style:{position:"absolute",inset:0,overflow:"hidden",pointerEvents:"auto",backgroundColor:h?"#111827":u?V:z,touchAction:"none"},children:[h?null:u?c.jsx($e,{view:f,documentId:x}):c.jsx(Oe,{}),c.jsx(ze,{...a?{adapter:a}:{},...u&&!h?{view:f,transformModeAware:!0,presentationId:x}:{}},`selection:${P(a)}`),c.jsx(Ie,{explanation:i,testId:`world-surface-status:${n.worldId}`,style:{zIndex:20}}),h?null:u?c.jsx(Me,{active:s,...a?{adapter:a}:{},containerRef:d,view:f,documentId:x},`controls:${P(a)}`):c.jsxs(c.Fragment,{children:[c.jsx(Ne,{docId:n.worldId,containerRef:d}),c.jsx(_e,{containerRef:d,context:w})]})]})}function Oe(){const s=p.useSyncExternalStore(W,K),l=Math.max(8,24*s.zoom),n=Math.max(.7,Math.min(1.4,s.zoom));return c.jsx("div",{"data-testid":"react-design-canvas-backdrop","aria-hidden":"true",style:{position:"absolute",inset:0,pointerEvents:"none",backgroundColor:z,backgroundImage:`radial-gradient(circle, ${ve} ${n}px, transparent ${n}px)`,backgroundPosition:`${s.x}px ${s.y}px`,backgroundSize:`${l}px ${l}px`}})}function vt(s,l){const n=J(),x=l.childAdapters().some(e=>e.role==="world"&&e.kind==="three"),r=l.childAdapters().some(e=>e.kind===be);!x&&!r&&H(E,{discardDirty:!0});const d=new Set,v=[];let f=!1;for(const e of l.childAdapters())e.role==="world"&&e.kind==="three"&&v.push($(e.worldId,E));const u=fe(l),m=u.find(e=>e.kind==="canvas");m&&v.push($(m.worldId,A));const k=new Set([...l.childAdapters().filter(e=>e.role==="world"&&e.kind==="three"),...m?[m]:[]].map(e=>e.worldId)),S=new Map;function R(){for(const e of u){if(k.has(e.worldId)||S.has(e.worldId))continue;const i=Se(e.kind);if(!i)continue;const g=$(e.worldId,i.documentId),w=Z(e.worldId,()=>i.presence()==="absent"?`Root "${e.worldId}" has no document of its own: its design surface is the project's ${i.title} board (${i.documentId}). ${i.absentReason()}`:null);S.set(e.worldId,()=>{w(),g()})}}v.push(Y(e=>{const i=ee();if(i.some(w=>w.descriptor.id===e))return null;const g=ke(e);return g?g.presence()==="absent"?g.absentReason():null:`No workspace document is named "${e}". Open in this session: ${i.map(w=>w.descriptor.id).join(", ")||"(none)"}. A component board is present only when the package that owns its medium says this project has one, so a board id can be absent for this project and present for another.`}));function I(e){const i=g=>c.jsx(Ge,{...g,composite:l,descriptor:e,store:s});Q({id:A,title:Fe,kind:"world",workspaceRole:"authored-subject",provenance:{rootId:e.worldId,...e.path?{sourcePath:e.path}:{}},Content:i,presentation:()=>({kind:"world",id:e.worldId})},{category:"scene",default:!x,rootId:e.worldId})}function a(e){d.add(e.documentId);const i=()=>{d.delete(e.documentId)};try{Promise.resolve(e.install({store:s,composite:l})).catch(i)}catch{i()}}function h(){if(!f){R();for(const e of we()){const i=e.presence();if(i===null)continue;const g=d.has(e.documentId);i==="present"!==g&&(i==="present"?a(e):(N(e.documentId),d.delete(e.documentId)))}}}m&&(I(m),d.add(A)),h();const t=ye(h),o=m?A:[...d][0];return te()||(!x&&o!==void 0&&(n===null||n===E||n===q)?M(o):n?M(n):x&&M(E)),()=>{f=!0,t();for(const e of v)e();for(const e of S.values())e();S.clear();for(const e of d)N(e)}}export{Ge as RootDocumentContent,vt as installRootDocuments};
@@ -1 +1 @@
1
- import{a as i}from"./jsx-runtime-DPjLkJKQ.js";import{EDITOR_LAYER as Ke}from"./editor-layers-BadrAIuA.js";import{df as Oe,a7 as V,bN as Ye,aL as te,bw as $,aM as G,kJ as Je,bM as Ze,bP as et,a6 as Q,h1 as tt,hF as rt,j_ as nt,kK as ot,Z as j,K as st,ci as at,kL as Se,cx as it,kM as ct,kN as lt,kO as ut,kP as Ce,kQ as xe,aD as x,cU as dt,kR as mt,cq as pt,cv as ft,kS as Pe,kT as Ee,kU as je,kV as ht,al as gt,kW as bt,kX as ke,dI as vt,kY as wt,kZ as yt,j3 as St,iV as Ct,iW as xt,gM as Pt,gN as Et,j1 as jt,g4 as kt,g5 as Tt,g6 as At,g7 as Rt}from"./index-Dji-5Ngh.js";import{s as Mt,o as Vt}from"./object3d-document-session-registry-CatZ54tz.js";import{R as Ot}from"./RootSelectionOverlay-BETMJphO.js";import{e as Lt,S as Ft}from"./surface-state-CPApGJAw.js";import{r as f}from"./index-nmcBqr7Y.js";import{t as It}from"./surface-content-Dg9Kkazf.js";import"./index-CtzuWnCS.js";import{s as zt,d as Te,c as U,t as Wt,p as Le,v as Ae,b as Nt,e as _t,l as Dt,i as Qt}from"./camera-authoring-DYjhU5Zp.js";import{c as $t}from"./performance-profiler-CMbwGBuk.js";import{m as Gt}from"./renderer-ownership-BovSEcLv.js";import{applyWorldRendererConfig as Ut}from"./renderer-config-CaPR4dB_.js";import{getUserData as Fe}from"./user-data-CODoGZqA.js";import{detectKtx2Support as Bt}from"./loader-BTUKnX5Q.js";import{resolveRenderSettings as Ht}from"./render-settings-Cvt-UEn5.js";import{createSoftParticleDepthPass as qt}from"./soft-particle-depth-DNGwWJ8c.js";import{ViewportShadingRenderer as Xt}from"./viewport-shading-D9BMDb1N.js";import{applyRendererSettings as Kt,applySceneRenderPipeline as Yt}from"./setup-renderer-CeDRVovn.js";import{EffectComposer as Jt,EffectPass as Zt,BlendFunction as er,KernelSize as tr,OutlineEffect as rr}from"./index-DHhMOs_s.js";import{W as nr,T as or}from"./three.module-BLhyNg0e.js";import{d as sr}from"./design-time-mount-registry-DUpXCg1U.js";import{a as ar}from"./project-authoring-session-1_gSjCtF.js";import"./three-integration-B0Pips-D.js";import{registerPresentedCanvasFrame as ir}from"./canvas-preview-frames-CJtaubgV.js";import{i as cr}from"./editor-presentation-activity-CqJH4G9t.js";import{E as lr,s as ur,a as dr,t as mr,b as pr,c as fr,d as hr,r as gr,i as br}from"./three-viewport-presentation-DMl9pRzL.js";import{a as Z}from"./entity-object-DgmLa7_T.js";import{w as vr}from"./editor-shell-store-BRi8Vv17.js";import{p as wr}from"./viewport-root-presentation-CBBdlbEP.js";import{d as yr}from"./asset-editor-persistence-B40nssGV.js";import{bindStagePresenceMarkers as Sr}from"./stage-presence-markers-BJz57Ct3.js";import{el as Cr,_ as ee,fo as D,d7 as xr,dp as Re}from"./three.core-3arARmh6.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./workspace-arrangement-BrA73ntW.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./eyedropper-session-bjPXnfeX.js";import"./layered-pick-DfTP1-Cr.js";import"./root-stacking-BEd9ZvxC.js";import"./react-story-board-CV_xdGh1.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./inspect-DZInhjtn.js";import"./inference-diagnostics-BJUcoifD.js";import"./object-marks-BnvSuCTt.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./render-features-BNRGwsS3.js";import"./matcap-texture-Dm2c-VQa.js";import"./defaults-DKiBJCPN.js";import"./edit-mode-authoring-euM9VW6K.js";import"./host-hierarchy-objects-BV3WqU2w.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"./user-data-BIoZkgOJ.js";import"./model-thumbnail-DrHjLgzh.js";import"./studio-environment-D6JkSE7Q.js";import"./three-state-Jjh8RKmv.js";import"./hierarchy-marks-Bz6FH5xl.js";import"./component-instance-root-BaRyIQ5L.js";import"./three-contract-Dkt6PmWY.js";import"./viewport-door-DkrIQ3Lf.js";import"./content-bounds-CSAlBN5N.js";import"./asset-preview-DyRWJUUG.js";import"./bitmap-label-Ct4k6ehY.js";import"./index-CnQxsRjG.js";import"./standard-viewport-dressing-BVichQxX.js";import"./clip-planes-CnAI6DZn.js";import"./three-BeNC5ULQ.js";import"./model-inspection-CPrGFWhU.js";import"./OrbitControls-B13MKuwC.js";import"./LineSegments2-DN9pUfWA.js";import"./three.quarks.esm-C_HmSKXo.js";import"./live-gesture-lock-DJbrjOqf.js";import"./scene-framing-C5vUXepb.js";import"./live-mixers-B-bwLZ7c.js";import"./output-pass-HurwNl0G.js";import"./Pass-D1MRT672.js";import"./mounted-authoring-DBEo6Vnv.js";import"./collaboration-presence-C3pKLb3J.js";function Pr({previewRef:r}){const{preview:e,previewPinned:s}=U(),[o,c]=f.useState(!1),a=f.useRef(null);if(f.useEffect(()=>{if(!o)return;const u=E=>{a.current?.contains(E.target)||c(!1)};return document.addEventListener("pointerdown",u),()=>document.removeEventListener("pointerdown",u)},[o]),!e)return null;const m=e.camera.isPerspectiveCamera&&Number.isFinite(e.camera.aspect)?e.camera.aspect:16/9;return i.jsxs("div",{className:"volter-camera-preview","data-testid":"camera-preview",children:[i.jsxs(Oe,{className:"volter-camera-preview-header",gap:4,align:"center",children:[i.jsx(V,{icon:Ye,size:"sm"}),i.jsx(te,{variant:"label",truncate:!0,className:"volter-camera-preview-title",title:`${e.name} · ${e.lens}`,children:e.name}),i.jsx($,{text:s?"Unpin camera preview":"Pin camera preview",children:i.jsx(G,{"aria-label":s?"Unpin camera preview":"Pin camera preview","aria-pressed":s,size:"compact",onClick:Wt,children:i.jsx(V,{icon:Je,size:"sm"})})}),i.jsxs("div",{ref:a,className:"volter-camera-preview-menu-anchor",children:[i.jsx($,{text:"Camera actions",children:i.jsx(G,{"aria-label":"Camera actions","aria-expanded":o,size:"compact",onClick:()=>c(u=>!u),children:i.jsx(V,{icon:Ze,size:"sm"})})}),o?i.jsxs(et,{className:"volter-camera-preview-menu",children:[i.jsx(Q,{variant:"ghost",size:"compact",disabled:!e.canAuthorPose,title:e.poseRefusal,onClick:()=>{c(!1),Le(e)},children:"Pilot Camera"}),i.jsx(Q,{variant:"ghost",size:"compact",onClick:()=>{c(!1),Ae(e)},children:"View Through Camera"}),i.jsx(Q,{variant:"ghost",size:"compact",disabled:!e.canAuthorPose,title:e.poseRefusal,onClick:()=>{c(!1),Nt(e)},children:"Align Camera to Current View"})]}):null]})]}),i.jsx("div",{ref:r,className:"volter-camera-preview-image",style:{aspectRatio:String(Math.max(.5,Math.min(3,m)))},role:"img","aria-label":`Live view through ${e.name}`,onDoubleClick:()=>Ae(e)})]})}function Er(){return i.jsxs("div",{className:"volter-camera-guides","aria-hidden":"true",children:[i.jsx("div",{className:"volter-camera-guide volter-camera-guide-v1"}),i.jsx("div",{className:"volter-camera-guide volter-camera-guide-v2"}),i.jsx("div",{className:"volter-camera-guide volter-camera-guide-h1"}),i.jsx("div",{className:"volter-camera-guide volter-camera-guide-h2"}),i.jsx("div",{className:"volter-camera-safe-frame"}),i.jsx("div",{className:"volter-camera-center-mark"})]})}function jr(){const{view:r,guidesVisible:e}=U();if(!r)return null;const s=r.mode==="pilot";return i.jsxs(i.Fragment,{children:[e?i.jsx(Er,{}):null,i.jsx(tt,{variant:"overlay",border:!0,className:"volter-camera-view-banner volter-chrome-island volter-glass-island","data-testid":"camera-view-banner",children:i.jsxs(Oe,{gap:6,align:"center",children:[i.jsx(rt,{children:s?"PILOTING":"CAMERA VIEW"}),i.jsx(te,{variant:"label",children:r.subject.name}),i.jsx(te,{variant:"caption",tone:"muted",children:"Exact camera view"}),i.jsx($,{text:e?"Hide composition guides":"Show composition guides",children:i.jsx(G,{"aria-label":e?"Hide composition guides":"Show composition guides","aria-pressed":e,size:"compact",onClick:_t,children:i.jsx(V,{icon:nt,size:"sm"})})}),s?null:i.jsx(Q,{size:"compact",variant:"primary",disabled:!r.subject.canAuthorPose,title:r.subject.poseRefusal,onClick:()=>Le(r.subject),children:"Pilot"}),i.jsx($,{text:"Exit camera view",children:i.jsx(G,{"aria-label":"Exit camera view",size:"compact",onClick:Dt,children:i.jsx(V,{icon:ot,size:"sm"})})})]})})]})}function kr({previewRef:r}){return f.useSyncExternalStore(zt,Te,Te),i.jsxs(i.Fragment,{children:[i.jsx(Pr,{previewRef:r}),i.jsx(jr,{})]})}function Tr(r){const e=r,s=e.getExtension("EXT_disjoint_timer_query_webgl2"),o=s!==null&&typeof e.createQuery=="function",c=[];let a=null,m=null;return{begin(){!o||a||(a=e.createQuery(),a&&e.beginQuery(s.TIME_ELAPSED_EXT,a))},end(){!o||!a||(e.endQuery(s.TIME_ELAPSED_EXT),c.push(a),a=null)},poll(){if(!o)return null;if(e.getParameter(s.GPU_DISJOINT_EXT)){for(const u of c.splice(0))e.deleteQuery(u);return null}for(;c.length>0;){const u=c[0];if(!e.getQueryParameter(u,e.QUERY_RESULT_AVAILABLE))break;c.shift(),m=e.getQueryParameter(u,e.QUERY_RESULT)/1e6,e.deleteQuery(u)}return m},dispose(){a&&(e.endQuery(s.TIME_ELAPSED_EXT),e.deleteQuery(a),a=null);for(const u of c.splice(0))e.deleteQuery(u)}}}const Ar=2e4,Rr=250,Mr=5e3;class Vr{#e=0;#t=0;#r=0;#n;constructor(e){this.#n=e}get pending(){return this.#e>0||this.#t>0}begin(e,s){this.#e=e+Ar,this.#t=s?e+Mr:0,this.#r=0,this.tick(e)}tick(e){if(!(!this.pending||e<this.#r)){if(this.#r=e+Rr,this.#t>0&&this.#n.seedFromGameCamera()){this.cancel();return}this.#e>0&&this.#n.frameContent()&&(this.#e=0),e>=this.#e&&(this.#e=0),e>=this.#t&&(this.#t=0)}}cancel(){this.#e=0,this.#t=0}}const Me=new WeakMap;function Or(r,e){if(!r)return e(),!0;if(Me.has(r))return!1;try{return e(),!0}catch(s){const o=s instanceof Error?s.message:String(s);return Me.set(r,o),j.warn(`The Scene view cannot draw this world with the editor's own renderer, and has stopped trying: ${o}. This world was built by a copy of three the editor did not make (a vendored bundle pins its own revision), and the editor draws it with ITS three — across a wide enough revision gap the two disagree about the renderer/material contract. The game itself is unaffected and still drawing: its own canvas is what the Game tab and ${st("screenshot")} show, and hierarchy, selection and inspection all still read the live world. It closes when the game resolves \`three\` to the host's instance — a bare, un-rewritten \`import 'three'\` in its own source.`,"ingest"),!1}}function Lr(){const r=at();r.addEventListener("server-log",s=>{try{Se(JSON.parse(s.data))}catch{}});let e=!1;return(async()=>{try{const s=await it();if(e)return;for(const o of s)Se(o)}catch{}})(),()=>{e=!0,r.close()}}const Ie="viewportPose";function Fr(){const r=ct(Ie);return r&&Array.isArray(r.position)&&r.position.length===3&&r.position.every(Number.isFinite)&&Array.isArray(r.target)&&r.target.length===3&&r.target.every(Number.isFinite)?r:null}function Ir(r,e){lt(Ie,{position:[r.position.x,r.position.y,r.position.z],target:[e.x,e.y,e.z]})}const Ve={id:"world",title:"World",lights:[{color:"#ffffff",intensity:1,direction:[-10,-20,-10],space:"world"}],ambient:{color:"#ffffff",intensity:.5},environmentIntensity:0};yt(Ve),St("world",{all:{lighting:{source:"studio",studioPreset:Ve.id,auto:{takeover:["light"],overridable:!0}}}});function zr(r,e,s){const o=document.createElement("canvas");o.setAttribute("aria-label",`${s} authoring viewport`),o.setAttribute("data-testid","editor-canvas"),o.setAttribute("aria-hidden","true"),o.tabIndex=-1,o.style.width="100%",o.style.height="100%",o.style.display="block",o.style.pointerEvents="auto",r.appendChild(o);const c=Math.max(1,e.clientWidth),a=Math.max(1,e.clientHeight),m=Math.min(window.devicePixelRatio||1,2);o.width=Math.ceil(c*m),o.height=Math.ceil(a*m);const u=Gt(new nr({canvas:o,antialias:!!Ht(void 0).antialias,powerPreference:"high-performance"}));return Kt(u,void 0,m),u.setSize(c,a),u.shadowMap.type=xr,u.info.autoReset=!1,Bt(u),{canvas:o,renderer:u,lease:null}}async function Wr(r){const e=pt(r.source,r.id);if(e)return e;let s=r.url,o=r.format??"gltf",c=r.includes;if(!s){const u=(await ft(r.source,r.id))[0];if(!u)return j.error(`No downloadable files for ${r.name}.`,"asset"),null;s=u.url,o=u.format,c=u.includes}const a={source:r.source,id:r.id,name:r.name,url:s,format:o};c&&(a.includes=c);const m=await yr(a);return m.ok&&m.path?`/${m.path}`:(j.error(`Could not download ${r.name}.`,"asset"),null)}function Nr(r){if(r.isCamera)return r;const e=Fe(r,"_camera");return e?.isCamera?e:null}function _r(r){const e=r;if(e.isPerspectiveCamera)return`${e.fov.toFixed(0)}° perspective`;const s=r;return s.isOrthographicCamera?`Orthographic · ${s.zoom.toFixed(2)}×`:r.type}function Dr(r,e){const s=r.transforms;if(!s)return{canAuthorPose:!1,poseRefusal:"This camera has no transform authoring path."};const o=s.editability?.(e,"position")??{writable:!0},c=s.editability?.(e,"rotation")??{writable:!0};return o.writable&&c.writable?{canAuthorPose:!0}:{canAuthorPose:!1,poseRefusal:o.reason??c.reason??"This camera pose is read-only."}}function Qr(r,e,s){const o=e.get(s)??null;if(!o)return null;const c=Nr(o);return c?{id:s,name:o.name||c.name||"Camera",camera:c,lens:_r(c),...Dr(r,s)}:null}function $r(r){const e=new Map;for(const[s,o]of r.objectMap){const c=Fe(o,"tags");Array.isArray(c)&&c.length>0&&e.set(s,c)}return e}function Gr(r){const{store:e,documentId:s,container:o,canvas:c,renderer:a,stats:m}=r,u=new Jt(a),E=qt(),O=new Xt,g=$t(),L=Tr(a.getContext()),ze=t=>{g.enabled&&L.begin();try{t()}finally{L.end()}},We=()=>g.enabled?L.poll():null,Ne=ut({id:s,label:"Scene viewport",kind:"scene",profiler:g}),b=new Cr,re=11184810;let B=Ce(c).background??re;b.background=new ee(B);const _e=xe(c,()=>{const t=Ce(c).background??re,l=b.background;l instanceof ee&&l.getHex()===B&&(b.background=new ee(t)),B=t});e.bindScene(b,a);const n=new lr(c,b,e,o,{renderer:a,onlineAssetResolver:Wr,onProjectionChange:ur}),De=n.bindPresentation(s,"world");e.bindScene(b,a,n.batchedRenderer,n.camera),e.setOrbitTarget(n.orbitControls.target);const H=new D,F=new D,ne=new D,oe=()=>{const t=n.renderCamera;t.getWorldPosition(H),n.cameraViewMode==="pilot"?F.copy(n.orbitControls.target):n.cameraViewMode?(t.getWorldDirection(ne),F.copy(H).add(ne.multiplyScalar(10))):F.copy(n.orbitControls.target);const l=t.fov;return{position:H,target:F,fov:typeof l=="number"?l:0}},k=Sr({scene:b,store:e,documentId:s,container:o,canvas:c,viewport:n,readVisibleCameraPose:oe});let se="",q=null,h=null,S=null,I=null;const ae=()=>{h&&fr(h,ke(a.domElement))},Qe=xe(a.domElement,ae),ie=()=>{if(!h)return;const t=x(e.shell),l=[...e.shell.selectedEntityIds].filter(d=>t.hierarchy.node(d)!==null).map(d=>Z(t,e.objectMap,d)).filter(d=>d!==null);hr(h,l);const p=h.selection.size>0;S&&(S.enabled=p,S.renderToScreen=p),I&&(I.renderToScreen=!p)};function T(){bt(e.shell),q?.(),q=null,h&&gr(a,h,S),h=null,S=null,I=null,Yt(u,a,e.scene??b,n.renderCamera,void 0,{basePixelRatio:Math.min(window.devicePixelRatio||1,2),objectMap:e.objectMap,entityTags:$r(e)}),h=pr({BlendFunction:er,KernelSize:tr,OutlineEffect:rr},a,e.scene??b,n.renderCamera,ke(a.domElement)),ae(),I=u.passes.at(-1)??null,S=new Zt(n.renderCamera,h),S.enabled=!1,u.addPass(S),ie();const t=e.adoptedImageConfig;t&&(q=Ut(or,a,t))}const ce=()=>{n.setProjection(mr().projection),e.setViewportCamera(n.freeCamera),T()},$e=dr(ce);ce();const X=t=>Qr(x(e.shell),e.objectMap,t);let v=null;const A=()=>{v&&(je(x(e.shell),v),v=null)},le=()=>{const t=U().view;t?.mode!=="pilot"||!t.subject.canAuthorPose||(v=t.subject.id,Pe(x(e.shell),v))},ue=()=>{if(!v||n.cameraViewMode!=="pilot")return;const t=X(v),l=x(e.shell),p=l.transforms;if(!t||!p)return;let d;try{d=p.get(v)}catch(w){j.error(w instanceof Error?w.message:String(w),"camera-authoring"),A();return}Ee(l,v,{position:t.camera.position.toArray(),rotation:t.camera.quaternion.toArray(),scale:d.scale}),e.shell.notifyIngestEdit()};n.orbitControls.addEventListener("start",le),n.orbitControls.addEventListener("change",ue),n.orbitControls.addEventListener("end",A);const Ge=Qt({active:()=>e.shell.playState==="stopped"&&e.shell.activeViewportTab==="edit",selected:()=>{const t=e.shell.selectedEntityId;return t?X(t):null},resolve:X,showView:(t,l)=>{A(),n.setCameraView(t.camera,l),T(),k.reportCamera()},leaveView:()=>{A(),n.clearCameraView(),T(),k.reportCamera()},alignToViewport:t=>{const l=x(e.shell),p=l.transforms;if(!p||!t.canAuthorPose)return;const d=e.objectMap.get(t.id)??null;if(!d)return;const w=n.camera.getWorldPosition(new D),C=n.camera.getWorldQuaternion(new Re),y=w.clone(),R=C.clone();if(d.parent){d.parent.updateWorldMatrix(!0,!1),d.parent.worldToLocal(y);const M=d.parent.getWorldQuaternion(new Re);R.premultiply(M.invert())}let ye;try{ye=p.get(t.id)}catch(M){j.error(M instanceof Error?M.message:String(M),"camera-authoring");return}Pe(l,t.id),Ee(l,t.id,{position:y.toArray(),rotation:R.toArray(),scale:ye.scale}),e.shell.notifyIngestEdit(),je(l,t.id)},subscribe:e.shell.subscribe});let de=null;const me=()=>{const t=ht(e.shell);t!==de&&(de=t,c.style.opacity=t?"1":"0",o.style.backgroundColor=t?"":gt.surface.raised,o.style.backgroundImage=t?"":"linear-gradient(45deg, #444649 25%, transparent 25%, transparent 75%, #444649 75%), linear-gradient(45deg, #444649 25%, transparent 25%, transparent 75%, #444649 75%)",o.style.backgroundPosition=t?"":"0 0, 8px 8px",o.style.backgroundSize=t?"":"16px 16px")};me();let pe=e.composerVersion;const Ue=e.shell.subscribe(()=>{me();const t=e.scene;t&&t!==n.currentScene&&n.setScene(t),n.objectMap=e.objectMap,n.syncFromStore(),e.composerVersion!==pe?(pe=e.composerVersion,T()):ie()});let z=null;const K=new Vr({seedFromGameCamera:()=>{const t=z?.()??null;return!!t&&n.seedFromGameCamera(t)},frameContent:()=>n.focusOnScene()}),fe=()=>{K.cancel(),z=null};n.orbitControls.addEventListener("start",fe);const he=()=>Ir(n.camera,n.orbitControls.target);n.orbitControls.addEventListener("end",he);const Be=e.shell.onViewportAction(t=>{switch(t.type){case"focus-entity":{const l=Z(x(e.shell),e.objectMap,t.id);l&&n.focusOn(l);break}case"focus-scene":{{const l=Fr();if(l){n.camera.position.set(...l.position),n.orbitControls.target.set(...l.target),n.orbitControls.update();break}}z=e.sceneCameraLookup,K.begin(performance.now(),z!==null);break}case"focus-selection":{const l=x(e.shell),p=[...e.shell.selectedEntityIds].map(d=>Z(l,e.objectMap,d)).filter(d=>d!==null);n.focusOnMultiple(p);break}case"snap-selection-to-floor":n.snapSelectionToFloor();break;case"set-view-preset":n.setViewPreset(t.preset);break;case"step-view":n.stepView(t.step);break;case"frame-all":n.focusOnScene();break;case"zoom-view":n.zoomStep(t.direction);break;case"set-camera-pose":n.setPose(t.position,t.target,t.fov);break}});Lr();const ge=new ResizeObserver(()=>{const t=Math.max(1,o.clientWidth),l=Math.max(1,o.clientHeight);a.setSize(t,l),u.setSize(t,l),n.resize(t,l)});ge.observe(o);let W=performance.now(),N=!0,P=!1,be=!1;function ve(t){return Or(n.currentScene,()=>{E.render(a,n.currentScene,n.renderCamera),n.renderWithInfrastructure(()=>{vr(n.currentScene,()=>O.render(n.currentScene,e.shadingMode,()=>u.render(t),br)),n.renderViewCube(a),n.renderCameraPreview(a,U().preview?.camera??null,r.cameraPreview())})})}const He=ir(c,async()=>{if(P||!cr()||!o.checkVisibility({visibilityProperty:!0,checkVisibilityCSS:!0})||!ve(0))return null;const t=document.createElement("canvas");return t.width=c.width,t.height=c.height,t.getContext("2d").drawImage(c,0,0),t}),Y=()=>wt(e.shell)===e.shell;function qe(t,l){if(P)return;if(l&&(W=t),!o.checkVisibility({visibilityProperty:!0,checkVisibilityCSS:!0})){W=t,N=!0,n.resolvePresentation();return}g.beginFrame();const p=t-W,d=p/1e3;Y()&&(m.frameTime=p,m.fps=1e3/p),W=t,k.syncMarkers(d),K.tick(t),g.beginPhase(),n.update(d),r.runFrame(d),n.batchedRenderer.update(d),g.endPhase("editor"),g.beginPhase(),a.info.reset(),ze(()=>{ve(d)}),g.reportRender({gpuMs:We(),drawCalls:a.info.render.calls,triangles:a.info.render.triangles,geometries:a.info.memory.geometries,textures:a.info.memory.textures}),g.endPhase("render"),Y()&&(m.drawCalls=a.info.render.calls,m.triangles=a.info.render.triangles),N&&be&&(N=!1,vt(s)),g.endFrame();const w=oe(),C=w.position,y=w.target;Y()&&(m.cameraPosition.x=C.x,m.cameraPosition.y=C.y,m.cameraPosition.z=C.z,m.cameraTarget.x=y.x,m.cameraTarget.y=y.y,m.cameraTarget.z=y.z);const R=`${C.x},${C.y},${C.z},${y.x},${y.y},${y.z},${w.fov}`;R!==se&&(se=R,k.reportCamera())}n.objectMap=e.objectMap,n.syncFromStore(),T();let J,_;async function Xe(t){if(P)return;r.onMountStatus("mounting"),_?.(),_=void 0,J=t,r.onRootIds(t.childAdapters().filter(d=>d.role==="world"&&d.kind==="three").map(d=>d.worldId));const l=sr("three");if(P||J!==t)return;const p=l?await l.mountWorldRootSession({store:e,composite:t,renderer:a}):()=>{};if(P||J!==t){p();return}_=p,P||r.onMountStatus("ready")}const we=ar(e.shell,Xe);return we.ready.then(()=>dt(mt(e.shell))).catch(t=>{j.error(`Editor boot failed: ${t instanceof Error?t.message:String(t)}`,"scene"),r.onMountStatus("ready")}).finally(()=>{be=!0,N=!0}),{scene:b,viewport:n,frame:qe,present:t=>wr(e,t),setHelper:(t,l)=>n.setHelper(t,l),dispose:()=>{P=!0,Ne(),He(),ge.disconnect(),Ue(),Be(),Ge(),n.orbitControls.removeEventListener("start",le),n.orbitControls.removeEventListener("change",ue),n.orbitControls.removeEventListener("end",A),n.orbitControls.removeEventListener("start",fe),n.orbitControls.removeEventListener("end",he),we.dispose(),_?.(),k.dispose(),O.dispose(),L.dispose(),$e(),Qe(),_e(),De(),h?.selection.clear(),E.dispose(),u.dispose()}}}function Ur({store:r,rootIds:e,mountStatus:s}){f.useSyncExternalStore(r.shell.subscribe,r.shell.getSnapshot);const o=f.useSyncExternalStore(kt,Tt),c=f.useSyncExternalStore(At,Rt),a=r.scene?.background,m=a!==null&&!(a?.isColor===!0&&a.getHex()===11184810),u=f.useMemo(()=>!!(r.scene&&It(r.scene,{includeBackground:!1,ignoredLayer:Ke})),[r.scene,r.shell.contentVersion]),E=!!(r.scene&&(m||u)),O=Lt({surface:"Scene",rootIds:e,phase:s==="mounting"?"loading":"ready",content:E?"present":s==="mounting"?"unknown":"empty",readiness:o,failures:c});return i.jsx(Ft,{explanation:O,testId:"scene-viewport-status"})}function Br({store:r,documentId:e,cameraPreviewRef:s,mountStatus:o,rootIds:c}){f.useSyncExternalStore(r.shell.subscribe,r.shell.getShellSnapshot??r.shell.getSnapshot),f.useSyncExternalStore(Ct,xt),f.useSyncExternalStore(Mt,Vt),f.useSyncExternalStore(Pt,Et);const a=jt(r.shell,e,"document");return i.jsxs(i.Fragment,{children:[a.surface!==null?i.jsx(Ot,{}):null,a.surface==="three"?i.jsx(kr,{previewRef:s}):null,i.jsx(Ur,{store:r,rootIds:c,mountStatus:o})]})}const ko={mountWorldRootSurface:zr,installWorldRootStage:Gr,Overlays:Br};export{ko as worldRootStageBinding};
1
+ import{a as i}from"./jsx-runtime-DPjLkJKQ.js";import{EDITOR_LAYER as Ke}from"./editor-layers-B2JzjbZA.js";import{df as Oe,a7 as V,bN as Ye,aL as te,bw as $,aM as G,kJ as Je,bM as Ze,bP as et,a6 as Q,h1 as tt,hF as rt,j_ as nt,kK as ot,Z as j,K as st,ci as at,kL as Se,cx as it,kM as ct,kN as lt,kO as ut,kP as Ce,kQ as xe,aD as x,cU as dt,kR as mt,cq as pt,cv as ft,kS as Pe,kT as Ee,kU as je,kV as ht,al as gt,kW as bt,kX as ke,dI as vt,kY as wt,kZ as yt,j3 as St,iV as Ct,iW as xt,gM as Pt,gN as Et,j1 as jt,g4 as kt,g5 as Tt,g6 as At,g7 as Rt}from"./index-D8qHS95_.js";import{s as Mt,o as Vt}from"./object3d-document-session-registry-B9xf6IXJ.js";import{R as Ot}from"./RootSelectionOverlay-CeiH9oQ4.js";import{e as Lt,S as Ft}from"./surface-state-CKQjhgTW.js";import{r as f}from"./index-nmcBqr7Y.js";import{t as It}from"./surface-content-Dg9Kkazf.js";import"./index-CtzuWnCS.js";import{s as zt,d as Te,c as U,t as Wt,p as Le,v as Ae,b as Nt,e as _t,l as Dt,i as Qt}from"./camera-authoring-DYjhU5Zp.js";import{c as $t}from"./performance-profiler-CMbwGBuk.js";import{m as Gt}from"./renderer-ownership-BovSEcLv.js";import{applyWorldRendererConfig as Ut}from"./renderer-config-CaPR4dB_.js";import{getUserData as Fe}from"./user-data-CODoGZqA.js";import{detectKtx2Support as Bt}from"./loader-BTUKnX5Q.js";import{resolveRenderSettings as Ht}from"./render-settings-B6kFzF9n.js";import{createSoftParticleDepthPass as qt}from"./soft-particle-depth-DNGwWJ8c.js";import{ViewportShadingRenderer as Xt}from"./viewport-shading-D9BMDb1N.js";import{applyRendererSettings as Kt,applySceneRenderPipeline as Yt}from"./setup-renderer-UpKVuGTi.js";import{EffectComposer as Jt,EffectPass as Zt,BlendFunction as er,KernelSize as tr,OutlineEffect as rr}from"./index-DHhMOs_s.js";import{W as nr,T as or}from"./three.module-BLhyNg0e.js";import{d as sr}from"./design-time-mount-registry-DUpXCg1U.js";import{a as ar}from"./project-authoring-session-BiPozvTW.js";import"./three-integration-B3Nu_wKt.js";import{registerPresentedCanvasFrame as ir}from"./canvas-preview-frames-Bz65SXJB.js";import{i as cr}from"./editor-presentation-activity-CqJH4G9t.js";import{E as lr,s as ur,a as dr,t as mr,b as pr,c as fr,d as hr,r as gr,i as br}from"./three-viewport-presentation-Dq7YhHm4.js";import{a as Z}from"./entity-object-DXoxKycf.js";import{w as vr}from"./editor-shell-store-DljZJLam.js";import{p as wr}from"./viewport-root-presentation-CVftQRQR.js";import{d as yr}from"./asset-editor-persistence-CA-XT1f1.js";import{bindStagePresenceMarkers as Sr}from"./stage-presence-markers-D-WXTthQ.js";import{el as Cr,_ as ee,fo as D,d7 as xr,dp as Re}from"./three.core-3arARmh6.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./workspace-arrangement-rd1Zi7ge.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./eyedropper-session-bjPXnfeX.js";import"./layered-pick-QfPeC-94.js";import"./root-stacking-BEd9ZvxC.js";import"./react-story-board-krhBm535.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./inspect-z_EuQ5W3.js";import"./inference-diagnostics-x4u4h3Ui.js";import"./object-marks-BnvSuCTt.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./render-features-i9Si28Ov.js";import"./matcap-texture-Dm2c-VQa.js";import"./defaults-DKiBJCPN.js";import"./edit-mode-authoring-D5X403pt.js";import"./host-hierarchy-objects-BV3WqU2w.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"./user-data-DKk6eQvn.js";import"./model-thumbnail-C2nGqGGo.js";import"./studio-environment-BZ0cGXh6.js";import"./three-state-jUYZSnrd.js";import"./hierarchy-marks-B_qmrhDO.js";import"./component-instance-root-DlhjL6uO.js";import"./three-contract-Dkt6PmWY.js";import"./viewport-door-CLWBI2de.js";import"./content-bounds-CKdpRhSJ.js";import"./asset-preview-BIk4f-i_.js";import"./bitmap-label-Ct4k6ehY.js";import"./index-nkbk3WyY.js";import"./standard-viewport-dressing-DPYcmzrH.js";import"./clip-planes-CnAI6DZn.js";import"./three-BzNJcrnJ.js";import"./model-inspection-CYbbfzzy.js";import"./OrbitControls-B13MKuwC.js";import"./LineSegments2-DN9pUfWA.js";import"./three.quarks.esm-C_HmSKXo.js";import"./live-gesture-lock-DJbrjOqf.js";import"./scene-framing-CvvxxYt4.js";import"./live-mixers-B-bwLZ7c.js";import"./output-pass-HurwNl0G.js";import"./Pass-D1MRT672.js";import"./mounted-authoring-B-A2cU05.js";import"./collaboration-presence-BCzunCc9.js";function Pr({previewRef:r}){const{preview:e,previewPinned:s}=U(),[o,c]=f.useState(!1),a=f.useRef(null);if(f.useEffect(()=>{if(!o)return;const u=E=>{a.current?.contains(E.target)||c(!1)};return document.addEventListener("pointerdown",u),()=>document.removeEventListener("pointerdown",u)},[o]),!e)return null;const m=e.camera.isPerspectiveCamera&&Number.isFinite(e.camera.aspect)?e.camera.aspect:16/9;return i.jsxs("div",{className:"volter-camera-preview","data-testid":"camera-preview",children:[i.jsxs(Oe,{className:"volter-camera-preview-header",gap:4,align:"center",children:[i.jsx(V,{icon:Ye,size:"sm"}),i.jsx(te,{variant:"label",truncate:!0,className:"volter-camera-preview-title",title:`${e.name} · ${e.lens}`,children:e.name}),i.jsx($,{text:s?"Unpin camera preview":"Pin camera preview",children:i.jsx(G,{"aria-label":s?"Unpin camera preview":"Pin camera preview","aria-pressed":s,size:"compact",onClick:Wt,children:i.jsx(V,{icon:Je,size:"sm"})})}),i.jsxs("div",{ref:a,className:"volter-camera-preview-menu-anchor",children:[i.jsx($,{text:"Camera actions",children:i.jsx(G,{"aria-label":"Camera actions","aria-expanded":o,size:"compact",onClick:()=>c(u=>!u),children:i.jsx(V,{icon:Ze,size:"sm"})})}),o?i.jsxs(et,{className:"volter-camera-preview-menu",children:[i.jsx(Q,{variant:"ghost",size:"compact",disabled:!e.canAuthorPose,title:e.poseRefusal,onClick:()=>{c(!1),Le(e)},children:"Pilot Camera"}),i.jsx(Q,{variant:"ghost",size:"compact",onClick:()=>{c(!1),Ae(e)},children:"View Through Camera"}),i.jsx(Q,{variant:"ghost",size:"compact",disabled:!e.canAuthorPose,title:e.poseRefusal,onClick:()=>{c(!1),Nt(e)},children:"Align Camera to Current View"})]}):null]})]}),i.jsx("div",{ref:r,className:"volter-camera-preview-image",style:{aspectRatio:String(Math.max(.5,Math.min(3,m)))},role:"img","aria-label":`Live view through ${e.name}`,onDoubleClick:()=>Ae(e)})]})}function Er(){return i.jsxs("div",{className:"volter-camera-guides","aria-hidden":"true",children:[i.jsx("div",{className:"volter-camera-guide volter-camera-guide-v1"}),i.jsx("div",{className:"volter-camera-guide volter-camera-guide-v2"}),i.jsx("div",{className:"volter-camera-guide volter-camera-guide-h1"}),i.jsx("div",{className:"volter-camera-guide volter-camera-guide-h2"}),i.jsx("div",{className:"volter-camera-safe-frame"}),i.jsx("div",{className:"volter-camera-center-mark"})]})}function jr(){const{view:r,guidesVisible:e}=U();if(!r)return null;const s=r.mode==="pilot";return i.jsxs(i.Fragment,{children:[e?i.jsx(Er,{}):null,i.jsx(tt,{variant:"overlay",border:!0,className:"volter-camera-view-banner volter-chrome-island volter-glass-island","data-testid":"camera-view-banner",children:i.jsxs(Oe,{gap:6,align:"center",children:[i.jsx(rt,{children:s?"PILOTING":"CAMERA VIEW"}),i.jsx(te,{variant:"label",children:r.subject.name}),i.jsx(te,{variant:"caption",tone:"muted",children:"Exact camera view"}),i.jsx($,{text:e?"Hide composition guides":"Show composition guides",children:i.jsx(G,{"aria-label":e?"Hide composition guides":"Show composition guides","aria-pressed":e,size:"compact",onClick:_t,children:i.jsx(V,{icon:nt,size:"sm"})})}),s?null:i.jsx(Q,{size:"compact",variant:"primary",disabled:!r.subject.canAuthorPose,title:r.subject.poseRefusal,onClick:()=>Le(r.subject),children:"Pilot"}),i.jsx($,{text:"Exit camera view",children:i.jsx(G,{"aria-label":"Exit camera view",size:"compact",onClick:Dt,children:i.jsx(V,{icon:ot,size:"sm"})})})]})})]})}function kr({previewRef:r}){return f.useSyncExternalStore(zt,Te,Te),i.jsxs(i.Fragment,{children:[i.jsx(Pr,{previewRef:r}),i.jsx(jr,{})]})}function Tr(r){const e=r,s=e.getExtension("EXT_disjoint_timer_query_webgl2"),o=s!==null&&typeof e.createQuery=="function",c=[];let a=null,m=null;return{begin(){!o||a||(a=e.createQuery(),a&&e.beginQuery(s.TIME_ELAPSED_EXT,a))},end(){!o||!a||(e.endQuery(s.TIME_ELAPSED_EXT),c.push(a),a=null)},poll(){if(!o)return null;if(e.getParameter(s.GPU_DISJOINT_EXT)){for(const u of c.splice(0))e.deleteQuery(u);return null}for(;c.length>0;){const u=c[0];if(!e.getQueryParameter(u,e.QUERY_RESULT_AVAILABLE))break;c.shift(),m=e.getQueryParameter(u,e.QUERY_RESULT)/1e6,e.deleteQuery(u)}return m},dispose(){a&&(e.endQuery(s.TIME_ELAPSED_EXT),e.deleteQuery(a),a=null);for(const u of c.splice(0))e.deleteQuery(u)}}}const Ar=2e4,Rr=250,Mr=5e3;class Vr{#e=0;#t=0;#r=0;#n;constructor(e){this.#n=e}get pending(){return this.#e>0||this.#t>0}begin(e,s){this.#e=e+Ar,this.#t=s?e+Mr:0,this.#r=0,this.tick(e)}tick(e){if(!(!this.pending||e<this.#r)){if(this.#r=e+Rr,this.#t>0&&this.#n.seedFromGameCamera()){this.cancel();return}this.#e>0&&this.#n.frameContent()&&(this.#e=0),e>=this.#e&&(this.#e=0),e>=this.#t&&(this.#t=0)}}cancel(){this.#e=0,this.#t=0}}const Me=new WeakMap;function Or(r,e){if(!r)return e(),!0;if(Me.has(r))return!1;try{return e(),!0}catch(s){const o=s instanceof Error?s.message:String(s);return Me.set(r,o),j.warn(`The Scene view cannot draw this world with the editor's own renderer, and has stopped trying: ${o}. This world was built by a copy of three the editor did not make (a vendored bundle pins its own revision), and the editor draws it with ITS three — across a wide enough revision gap the two disagree about the renderer/material contract. The game itself is unaffected and still drawing: its own canvas is what the Game tab and ${st("screenshot")} show, and hierarchy, selection and inspection all still read the live world. It closes when the game resolves \`three\` to the host's instance — a bare, un-rewritten \`import 'three'\` in its own source.`,"ingest"),!1}}function Lr(){const r=at();r.addEventListener("server-log",s=>{try{Se(JSON.parse(s.data))}catch{}});let e=!1;return(async()=>{try{const s=await it();if(e)return;for(const o of s)Se(o)}catch{}})(),()=>{e=!0,r.close()}}const Ie="viewportPose";function Fr(){const r=ct(Ie);return r&&Array.isArray(r.position)&&r.position.length===3&&r.position.every(Number.isFinite)&&Array.isArray(r.target)&&r.target.length===3&&r.target.every(Number.isFinite)?r:null}function Ir(r,e){lt(Ie,{position:[r.position.x,r.position.y,r.position.z],target:[e.x,e.y,e.z]})}const Ve={id:"world",title:"World",lights:[{color:"#ffffff",intensity:1,direction:[-10,-20,-10],space:"world"}],ambient:{color:"#ffffff",intensity:.5},environmentIntensity:0};yt(Ve),St("world",{all:{lighting:{source:"studio",studioPreset:Ve.id,auto:{takeover:["light"],overridable:!0}}}});function zr(r,e,s){const o=document.createElement("canvas");o.setAttribute("aria-label",`${s} authoring viewport`),o.setAttribute("data-testid","editor-canvas"),o.setAttribute("aria-hidden","true"),o.tabIndex=-1,o.style.width="100%",o.style.height="100%",o.style.display="block",o.style.pointerEvents="auto",r.appendChild(o);const c=Math.max(1,e.clientWidth),a=Math.max(1,e.clientHeight),m=Math.min(window.devicePixelRatio||1,2);o.width=Math.ceil(c*m),o.height=Math.ceil(a*m);const u=Gt(new nr({canvas:o,antialias:!!Ht(void 0).antialias,powerPreference:"high-performance"}));return Kt(u,void 0,m),u.setSize(c,a),u.shadowMap.type=xr,u.info.autoReset=!1,Bt(u),{canvas:o,renderer:u,lease:null}}async function Wr(r){const e=pt(r.source,r.id);if(e)return e;let s=r.url,o=r.format??"gltf",c=r.includes;if(!s){const u=(await ft(r.source,r.id))[0];if(!u)return j.error(`No downloadable files for ${r.name}.`,"asset"),null;s=u.url,o=u.format,c=u.includes}const a={source:r.source,id:r.id,name:r.name,url:s,format:o};c&&(a.includes=c);const m=await yr(a);return m.ok&&m.path?`/${m.path}`:(j.error(`Could not download ${r.name}.`,"asset"),null)}function Nr(r){if(r.isCamera)return r;const e=Fe(r,"_camera");return e?.isCamera?e:null}function _r(r){const e=r;if(e.isPerspectiveCamera)return`${e.fov.toFixed(0)}° perspective`;const s=r;return s.isOrthographicCamera?`Orthographic · ${s.zoom.toFixed(2)}×`:r.type}function Dr(r,e){const s=r.transforms;if(!s)return{canAuthorPose:!1,poseRefusal:"This camera has no transform authoring path."};const o=s.editability?.(e,"position")??{writable:!0},c=s.editability?.(e,"rotation")??{writable:!0};return o.writable&&c.writable?{canAuthorPose:!0}:{canAuthorPose:!1,poseRefusal:o.reason??c.reason??"This camera pose is read-only."}}function Qr(r,e,s){const o=e.get(s)??null;if(!o)return null;const c=Nr(o);return c?{id:s,name:o.name||c.name||"Camera",camera:c,lens:_r(c),...Dr(r,s)}:null}function $r(r){const e=new Map;for(const[s,o]of r.objectMap){const c=Fe(o,"tags");Array.isArray(c)&&c.length>0&&e.set(s,c)}return e}function Gr(r){const{store:e,documentId:s,container:o,canvas:c,renderer:a,stats:m}=r,u=new Jt(a),E=qt(),O=new Xt,g=$t(),L=Tr(a.getContext()),ze=t=>{g.enabled&&L.begin();try{t()}finally{L.end()}},We=()=>g.enabled?L.poll():null,Ne=ut({id:s,label:"Scene viewport",kind:"scene",profiler:g}),b=new Cr,re=11184810;let B=Ce(c).background??re;b.background=new ee(B);const _e=xe(c,()=>{const t=Ce(c).background??re,l=b.background;l instanceof ee&&l.getHex()===B&&(b.background=new ee(t)),B=t});e.bindScene(b,a);const n=new lr(c,b,e,o,{renderer:a,onlineAssetResolver:Wr,onProjectionChange:ur}),De=n.bindPresentation(s,"world");e.bindScene(b,a,n.batchedRenderer,n.camera),e.setOrbitTarget(n.orbitControls.target);const H=new D,F=new D,ne=new D,oe=()=>{const t=n.renderCamera;t.getWorldPosition(H),n.cameraViewMode==="pilot"?F.copy(n.orbitControls.target):n.cameraViewMode?(t.getWorldDirection(ne),F.copy(H).add(ne.multiplyScalar(10))):F.copy(n.orbitControls.target);const l=t.fov;return{position:H,target:F,fov:typeof l=="number"?l:0}},k=Sr({scene:b,store:e,documentId:s,container:o,canvas:c,viewport:n,readVisibleCameraPose:oe});let se="",q=null,h=null,S=null,I=null;const ae=()=>{h&&fr(h,ke(a.domElement))},Qe=xe(a.domElement,ae),ie=()=>{if(!h)return;const t=x(e.shell),l=[...e.shell.selectedEntityIds].filter(d=>t.hierarchy.node(d)!==null).map(d=>Z(t,e.objectMap,d)).filter(d=>d!==null);hr(h,l);const p=h.selection.size>0;S&&(S.enabled=p,S.renderToScreen=p),I&&(I.renderToScreen=!p)};function T(){bt(e.shell),q?.(),q=null,h&&gr(a,h,S),h=null,S=null,I=null,Yt(u,a,e.scene??b,n.renderCamera,void 0,{basePixelRatio:Math.min(window.devicePixelRatio||1,2),objectMap:e.objectMap,entityTags:$r(e)}),h=pr({BlendFunction:er,KernelSize:tr,OutlineEffect:rr},a,e.scene??b,n.renderCamera,ke(a.domElement)),ae(),I=u.passes.at(-1)??null,S=new Zt(n.renderCamera,h),S.enabled=!1,u.addPass(S),ie();const t=e.adoptedImageConfig;t&&(q=Ut(or,a,t))}const ce=()=>{n.setProjection(mr().projection),e.setViewportCamera(n.freeCamera),T()},$e=dr(ce);ce();const X=t=>Qr(x(e.shell),e.objectMap,t);let v=null;const A=()=>{v&&(je(x(e.shell),v),v=null)},le=()=>{const t=U().view;t?.mode!=="pilot"||!t.subject.canAuthorPose||(v=t.subject.id,Pe(x(e.shell),v))},ue=()=>{if(!v||n.cameraViewMode!=="pilot")return;const t=X(v),l=x(e.shell),p=l.transforms;if(!t||!p)return;let d;try{d=p.get(v)}catch(w){j.error(w instanceof Error?w.message:String(w),"camera-authoring"),A();return}Ee(l,v,{position:t.camera.position.toArray(),rotation:t.camera.quaternion.toArray(),scale:d.scale}),e.shell.notifyIngestEdit()};n.orbitControls.addEventListener("start",le),n.orbitControls.addEventListener("change",ue),n.orbitControls.addEventListener("end",A);const Ge=Qt({active:()=>e.shell.playState==="stopped"&&e.shell.activeViewportTab==="edit",selected:()=>{const t=e.shell.selectedEntityId;return t?X(t):null},resolve:X,showView:(t,l)=>{A(),n.setCameraView(t.camera,l),T(),k.reportCamera()},leaveView:()=>{A(),n.clearCameraView(),T(),k.reportCamera()},alignToViewport:t=>{const l=x(e.shell),p=l.transforms;if(!p||!t.canAuthorPose)return;const d=e.objectMap.get(t.id)??null;if(!d)return;const w=n.camera.getWorldPosition(new D),C=n.camera.getWorldQuaternion(new Re),y=w.clone(),R=C.clone();if(d.parent){d.parent.updateWorldMatrix(!0,!1),d.parent.worldToLocal(y);const M=d.parent.getWorldQuaternion(new Re);R.premultiply(M.invert())}let ye;try{ye=p.get(t.id)}catch(M){j.error(M instanceof Error?M.message:String(M),"camera-authoring");return}Pe(l,t.id),Ee(l,t.id,{position:y.toArray(),rotation:R.toArray(),scale:ye.scale}),e.shell.notifyIngestEdit(),je(l,t.id)},subscribe:e.shell.subscribe});let de=null;const me=()=>{const t=ht(e.shell);t!==de&&(de=t,c.style.opacity=t?"1":"0",o.style.backgroundColor=t?"":gt.surface.raised,o.style.backgroundImage=t?"":"linear-gradient(45deg, #444649 25%, transparent 25%, transparent 75%, #444649 75%), linear-gradient(45deg, #444649 25%, transparent 25%, transparent 75%, #444649 75%)",o.style.backgroundPosition=t?"":"0 0, 8px 8px",o.style.backgroundSize=t?"":"16px 16px")};me();let pe=e.composerVersion;const Ue=e.shell.subscribe(()=>{me();const t=e.scene;t&&t!==n.currentScene&&n.setScene(t),n.objectMap=e.objectMap,n.syncFromStore(),e.composerVersion!==pe?(pe=e.composerVersion,T()):ie()});let z=null;const K=new Vr({seedFromGameCamera:()=>{const t=z?.()??null;return!!t&&n.seedFromGameCamera(t)},frameContent:()=>n.focusOnScene()}),fe=()=>{K.cancel(),z=null};n.orbitControls.addEventListener("start",fe);const he=()=>Ir(n.camera,n.orbitControls.target);n.orbitControls.addEventListener("end",he);const Be=e.shell.onViewportAction(t=>{switch(t.type){case"focus-entity":{const l=Z(x(e.shell),e.objectMap,t.id);l&&n.focusOn(l);break}case"focus-scene":{{const l=Fr();if(l){n.camera.position.set(...l.position),n.orbitControls.target.set(...l.target),n.orbitControls.update();break}}z=e.sceneCameraLookup,K.begin(performance.now(),z!==null);break}case"focus-selection":{const l=x(e.shell),p=[...e.shell.selectedEntityIds].map(d=>Z(l,e.objectMap,d)).filter(d=>d!==null);n.focusOnMultiple(p);break}case"snap-selection-to-floor":n.snapSelectionToFloor();break;case"set-view-preset":n.setViewPreset(t.preset);break;case"step-view":n.stepView(t.step);break;case"frame-all":n.focusOnScene();break;case"zoom-view":n.zoomStep(t.direction);break;case"set-camera-pose":n.setPose(t.position,t.target,t.fov);break}});Lr();const ge=new ResizeObserver(()=>{const t=Math.max(1,o.clientWidth),l=Math.max(1,o.clientHeight);a.setSize(t,l),u.setSize(t,l),n.resize(t,l)});ge.observe(o);let W=performance.now(),N=!0,P=!1,be=!1;function ve(t){return Or(n.currentScene,()=>{E.render(a,n.currentScene,n.renderCamera),n.renderWithInfrastructure(()=>{vr(n.currentScene,()=>O.render(n.currentScene,e.shadingMode,()=>u.render(t),br)),n.renderViewCube(a),n.renderCameraPreview(a,U().preview?.camera??null,r.cameraPreview())})})}const He=ir(c,async()=>{if(P||!cr()||!o.checkVisibility({visibilityProperty:!0,checkVisibilityCSS:!0})||!ve(0))return null;const t=document.createElement("canvas");return t.width=c.width,t.height=c.height,t.getContext("2d").drawImage(c,0,0),t}),Y=()=>wt(e.shell)===e.shell;function qe(t,l){if(P)return;if(l&&(W=t),!o.checkVisibility({visibilityProperty:!0,checkVisibilityCSS:!0})){W=t,N=!0,n.resolvePresentation();return}g.beginFrame();const p=t-W,d=p/1e3;Y()&&(m.frameTime=p,m.fps=1e3/p),W=t,k.syncMarkers(d),K.tick(t),g.beginPhase(),n.update(d),r.runFrame(d),n.batchedRenderer.update(d),g.endPhase("editor"),g.beginPhase(),a.info.reset(),ze(()=>{ve(d)}),g.reportRender({gpuMs:We(),drawCalls:a.info.render.calls,triangles:a.info.render.triangles,geometries:a.info.memory.geometries,textures:a.info.memory.textures}),g.endPhase("render"),Y()&&(m.drawCalls=a.info.render.calls,m.triangles=a.info.render.triangles),N&&be&&(N=!1,vt(s)),g.endFrame();const w=oe(),C=w.position,y=w.target;Y()&&(m.cameraPosition.x=C.x,m.cameraPosition.y=C.y,m.cameraPosition.z=C.z,m.cameraTarget.x=y.x,m.cameraTarget.y=y.y,m.cameraTarget.z=y.z);const R=`${C.x},${C.y},${C.z},${y.x},${y.y},${y.z},${w.fov}`;R!==se&&(se=R,k.reportCamera())}n.objectMap=e.objectMap,n.syncFromStore(),T();let J,_;async function Xe(t){if(P)return;r.onMountStatus("mounting"),_?.(),_=void 0,J=t,r.onRootIds(t.childAdapters().filter(d=>d.role==="world"&&d.kind==="three").map(d=>d.worldId));const l=sr("three");if(P||J!==t)return;const p=l?await l.mountWorldRootSession({store:e,composite:t,renderer:a}):()=>{};if(P||J!==t){p();return}_=p,P||r.onMountStatus("ready")}const we=ar(e.shell,Xe);return we.ready.then(()=>dt(mt(e.shell))).catch(t=>{j.error(`Editor boot failed: ${t instanceof Error?t.message:String(t)}`,"scene"),r.onMountStatus("ready")}).finally(()=>{be=!0,N=!0}),{scene:b,viewport:n,frame:qe,present:t=>wr(e,t),setHelper:(t,l)=>n.setHelper(t,l),dispose:()=>{P=!0,Ne(),He(),ge.disconnect(),Ue(),Be(),Ge(),n.orbitControls.removeEventListener("start",le),n.orbitControls.removeEventListener("change",ue),n.orbitControls.removeEventListener("end",A),n.orbitControls.removeEventListener("start",fe),n.orbitControls.removeEventListener("end",he),we.dispose(),_?.(),k.dispose(),O.dispose(),L.dispose(),$e(),Qe(),_e(),De(),h?.selection.clear(),E.dispose(),u.dispose()}}}function Ur({store:r,rootIds:e,mountStatus:s}){f.useSyncExternalStore(r.shell.subscribe,r.shell.getSnapshot);const o=f.useSyncExternalStore(kt,Tt),c=f.useSyncExternalStore(At,Rt),a=r.scene?.background,m=a!==null&&!(a?.isColor===!0&&a.getHex()===11184810),u=f.useMemo(()=>!!(r.scene&&It(r.scene,{includeBackground:!1,ignoredLayer:Ke})),[r.scene,r.shell.contentVersion]),E=!!(r.scene&&(m||u)),O=Lt({surface:"Scene",rootIds:e,phase:s==="mounting"?"loading":"ready",content:E?"present":s==="mounting"?"unknown":"empty",readiness:o,failures:c});return i.jsx(Ft,{explanation:O,testId:"scene-viewport-status"})}function Br({store:r,documentId:e,cameraPreviewRef:s,mountStatus:o,rootIds:c}){f.useSyncExternalStore(r.shell.subscribe,r.shell.getShellSnapshot??r.shell.getSnapshot),f.useSyncExternalStore(Ct,xt),f.useSyncExternalStore(Mt,Vt),f.useSyncExternalStore(Pt,Et);const a=jt(r.shell,e,"document");return i.jsxs(i.Fragment,{children:[a.surface!==null?i.jsx(Ot,{}):null,a.surface==="three"?i.jsx(kr,{previewRef:s}):null,i.jsx(Ur,{store:r,rootIds:c,mountStatus:o})]})}const ko={mountWorldRootSurface:zr,installWorldRootStage:Gr,Overlays:Br};export{ko as worldRootStageBinding};
@@ -1 +1 @@
1
- import{collectMachineAnimationMeta as V,clipNamesOf as L,isBlendTreeAnimationMeta as S,asBlendTreeDef as z}from"./xstate-animation-meta-DVb9it2u.js";import{cW as J,p as Z,c as _,cQ as ee,l as te,dk as ne,cf as ie,cd as oe}from"./three.core-3arARmh6.js";import"./index-Dji-5Ngh.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";class M extends Error{constructor(i,c){super(i),this.stateId=c,this.name="AnimationBindingError"}}function ae(n){const i=n.logic;if(i?.root)return i;const c=n.getSnapshot();if(c?.machine?.root)return c.machine;throw new M("[bindXStateAnimation] the actor exposes no state machine — only a state-machine actor carries the `meta.animation` this binder reads")}const W=n=>n.layer??"base",B=n=>n.weight??1,I=n=>n.blendMode??"override";function T(n){try{return ne.parseTrackName(n.name).nodeName??""}catch{const i=n.name.indexOf(".");return i<0?n.name:n.name.slice(0,i)}}function C(n,i,c){const o=new Set,l=[];for(const f of i){let u=!1;n.traverse(m=>{m.name===f&&(u=!0,m.traverse(d=>{d.name&&o.add(d.name)}))}),c.has(f)&&(u=!0,o.add(f)),u||l.push(f)}return{names:o,missing:l}}function se(n,i,c,o){const l=new Set(n.tracks.map(T)),f=i.include?C(c,i.include,l):void 0,u=i.exclude?C(c,i.exclude,l):void 0,m=[...f?.missing??[],...u?.missing??[]];if(m.length)throw new M(`[bindXStateAnimation] state "${o}" boneMask names unknown bones/objects: ${m.join(", ")}`,o);const d=n.tracks.filter(p=>{const w=T(p);return(!f||f.names.has(w))&&!u?.names.has(w)});if(d.length===0)throw new M(`[bindXStateAnimation] state "${o}" boneMask removes every track from clip "${n.name}"`,o);return new te(n.name,n.duration,d.map(p=>p.clone()))}function re(n){return n.reduce((i,c)=>c.weight>i.weight?c:i,n[0])}function Se(n,i,c,o={}){const l=i.getRoot(),f=o.root??(l instanceof J?l:void 0);if(!f)throw new M("[bindXStateAnimation] a THREE.Object3D `root` option is required when the mixer uses AnimationObjectGroup");const u=ae(n).root,m=V(u),d=new Map(m.map(t=>[t.stateId,t.meta]));for(const t of m)for(const e of L(t.meta))if(!c.has(e))throw new M(`[bindXStateAnimation] state "${t.stateId}" references clip "${e}", which is not present in the supplied clips map. Known clips: ${[...c.keys()].join(", ")||"(none)"}`,t.stateId);const p=new Map;function w(t,e,s){return W(e)!=="base"||!!e.boneMask||I(e)==="additive"?`${t}\0${s}`:s}for(const{stateId:t,meta:e}of m)for(const s of L(e)){const a=w(t,e,s);if(p.has(a))continue;const r=c.get(s);let h=e.boneMask?se(r,e.boneMask,f,t):r;(h!==r||a!==s)&&(h===r&&(h=r.clone()),h.name=`${r.name}@${W(e)}:${t}`),I(e)==="additive"?(Z.makeClipAdditive(h),h.blendMode=_):h.blendMode=ee,p.set(a,h)}const g=new Map;function K(t,e,s,a){let r=g.get(t);if(!r){const h=p.get(t);if(!h)throw new M(`[bindXStateAnimation] prepared clip "${t}" not found`);const v=i.clipAction(h);v.setEffectiveWeight(0),v.play(),r={action:v,clip:h},g.set(t,r)}return r.action.setLoop(e?ie:oe,1/0),r.action.clampWhenFinished=!e,r.action.timeScale=s,r.action.weight=a,r.action}function N(t){const e=o.selectParameters?o.selectParameters(t):t;return new Map(Object.entries(e??{}))}function D(t,e,s){return(S(e)?ce(z(e.blendTree),N(s)):[{clip:e.clip,weight:1}]).map(({clip:r,weight:h})=>({clip:r,weight:h,actionKey:w(t,e,r)}))}const y=new Map;let O=!1;function R(t,e,s){for(const a of t){if(a.actionKey===e)continue;const r=g.get(a.actionKey)?.action;r&&(s>0?r.fadeOut(s):r.setEffectiveWeight(0))}}function k(t,e){if(!S(t.meta))return;t.natural=D(t.stateId,t.meta,e);const s=B(t.meta);for(const a of t.natural)g.get(a.actionKey)?.action.setEffectiveWeight(a.weight*s)}function P(t,e,s){const a=W(e),r=y.get(a)??null,h=D(t,e,s),v=re(h),H=S(e)?!0:e.loop,Q=S(e)?1:e.speed,x=B(e);for(const b of h)K(b.actionKey,H,Q,x);const $=g.get(v.actionKey).action;$.reset().setEffectiveWeight(x);for(const b of h)b.actionKey!==v.actionKey&&g.get(b.actionKey).action.reset().setEffectiveWeight(0);const A=e.crossfade?.duration??0,U=e.crossfade?.warp??!1;if(!r)A>0&&$.fadeIn(A);else{R(r.natural,r.dominantActionKey,A);const b=g.get(r.dominantActionKey)?.action;b&&A>0?b.crossFadeTo($,A,U):(b?.setEffectiveWeight(0),$.setEffectiveWeight(x))}const j={layer:a,stateId:t,meta:e,natural:h,dominantActionKey:v.actionKey,crossfadeRemaining:A};y.set(a,j),S(e)&&A<=0&&k(j,s)}function q(t){return Object.keys(t.getMeta()).filter(e=>d.has(e))}function X(t){const e=new Map;for(const s of q(t)){const a=d.get(s),r=W(a),h=e.get(r);if(h)throw new M(`[bindXStateAnimation] animated states "${h}" and "${s}" are both active on layer "${r}". Give parallel regions distinct meta.animation.layer names.`,s);e.set(r,s)}for(const[s,a]of y)e.has(s)||(R(a.natural,void 0,0),y.delete(s));for(const[s,a]of e)y.get(s)?.stateId!==a&&P(a,d.get(a),t.context)}const F=n.getSnapshot();X(F);const G=n.subscribe(t=>{O||X(t)});function E(t){if(O)return;const e=t,s=n.getSnapshot().context;for(const a of y.values())a.crossfadeRemaining>0?(a.crossfadeRemaining=Math.max(0,a.crossfadeRemaining-e),a.crossfadeRemaining<=0&&k(a,s)):k(a,s);i.update(e)}const Y={tick:E,actor:n,getParameters:()=>N(n.getSnapshot().context),getActiveLayers:()=>[...y.values()].map(t=>({layer:t.layer,stateId:t.stateId,clips:t.natural.map(e=>e.clip),clipWeights:t.natural.map(e=>({clip:e.clip,weight:g.get(e.actionKey)?.action.getEffectiveWeight()??0})),weight:B(t.meta),blendMode:I(t.meta),...t.meta.boneMask?{boneMask:t.meta.boneMask}:{}})),dispose(){if(!O){O=!0,o.systems?.remove("animation",E),G.unsubscribe();for(const{action:t,clip:e}of g.values())t.stop(),i.uncacheAction(e,t.getRoot());g.clear(),y.clear()}}};return o.systems?.add("animation",E),Y}function ce(n,i){switch(n.type){case"1D":return le(n,i);case"2D":return fe(n,i);case"direct":return de(n);default:return n.children.map(c=>({clip:c.clip,weight:1/n.children.length}))}}function le(n,i){const c=Number(i.get(n.parameter)??0),o=[...n.children].sort((f,u)=>f.threshold-u.threshold),l=o.map(f=>({clip:f.clip,weight:0}));if(o.length===0)return l;if(o.length===1||c<=o[0].threshold)return l[0].weight=1,l;if(c>=o[o.length-1].threshold)return l[l.length-1].weight=1,l;for(let f=0;f<o.length-1;f++){const u=o[f],m=o[f+1];if(c>=u.threshold&&c<=m.threshold){const d=m.threshold-u.threshold,p=d>0?(c-u.threshold)/d:0;return l[f].weight=1-p,l[f+1].weight=p,l}}return l}function fe(n,i){const c=Number(i.get(n.parameter)??0),o=Number(i.get(n.parameterY??"")??0),l=n.children,f=l.map(d=>({clip:d.clip,weight:0}));let u=0;const m=[];for(const d of l){const p=c-d.threshold,w=o-(d.thresholdY??0),g=Math.sqrt(p*p+w*w),K=g<.001?1e3:1/g;m.push(K),u+=K}if(u>0)for(let d=0;d<f.length;d++)f[d].weight=m[d]/u;return f}function de(n){const i=n.children.map(o=>({clip:o.clip,weight:o.weight??0})),c=i.reduce((o,l)=>o+l.weight,0);if(c>0)for(const o of i)o.weight/=c;return i}export{M as AnimationBindingError,Se as bindXStateAnimation,ce as evaluateBlendTree,ae as machineOfXStateActor};
1
+ import{collectMachineAnimationMeta as V,clipNamesOf as L,isBlendTreeAnimationMeta as S,asBlendTreeDef as z}from"./xstate-animation-meta-BszyPNdl.js";import{cW as J,p as Z,c as _,cQ as ee,l as te,dk as ne,cf as ie,cd as oe}from"./three.core-3arARmh6.js";import"./index-D8qHS95_.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";class M extends Error{constructor(i,c){super(i),this.stateId=c,this.name="AnimationBindingError"}}function ae(n){const i=n.logic;if(i?.root)return i;const c=n.getSnapshot();if(c?.machine?.root)return c.machine;throw new M("[bindXStateAnimation] the actor exposes no state machine — only a state-machine actor carries the `meta.animation` this binder reads")}const W=n=>n.layer??"base",B=n=>n.weight??1,I=n=>n.blendMode??"override";function T(n){try{return ne.parseTrackName(n.name).nodeName??""}catch{const i=n.name.indexOf(".");return i<0?n.name:n.name.slice(0,i)}}function C(n,i,c){const o=new Set,l=[];for(const f of i){let u=!1;n.traverse(m=>{m.name===f&&(u=!0,m.traverse(d=>{d.name&&o.add(d.name)}))}),c.has(f)&&(u=!0,o.add(f)),u||l.push(f)}return{names:o,missing:l}}function se(n,i,c,o){const l=new Set(n.tracks.map(T)),f=i.include?C(c,i.include,l):void 0,u=i.exclude?C(c,i.exclude,l):void 0,m=[...f?.missing??[],...u?.missing??[]];if(m.length)throw new M(`[bindXStateAnimation] state "${o}" boneMask names unknown bones/objects: ${m.join(", ")}`,o);const d=n.tracks.filter(p=>{const w=T(p);return(!f||f.names.has(w))&&!u?.names.has(w)});if(d.length===0)throw new M(`[bindXStateAnimation] state "${o}" boneMask removes every track from clip "${n.name}"`,o);return new te(n.name,n.duration,d.map(p=>p.clone()))}function re(n){return n.reduce((i,c)=>c.weight>i.weight?c:i,n[0])}function Se(n,i,c,o={}){const l=i.getRoot(),f=o.root??(l instanceof J?l:void 0);if(!f)throw new M("[bindXStateAnimation] a THREE.Object3D `root` option is required when the mixer uses AnimationObjectGroup");const u=ae(n).root,m=V(u),d=new Map(m.map(t=>[t.stateId,t.meta]));for(const t of m)for(const e of L(t.meta))if(!c.has(e))throw new M(`[bindXStateAnimation] state "${t.stateId}" references clip "${e}", which is not present in the supplied clips map. Known clips: ${[...c.keys()].join(", ")||"(none)"}`,t.stateId);const p=new Map;function w(t,e,s){return W(e)!=="base"||!!e.boneMask||I(e)==="additive"?`${t}\0${s}`:s}for(const{stateId:t,meta:e}of m)for(const s of L(e)){const a=w(t,e,s);if(p.has(a))continue;const r=c.get(s);let h=e.boneMask?se(r,e.boneMask,f,t):r;(h!==r||a!==s)&&(h===r&&(h=r.clone()),h.name=`${r.name}@${W(e)}:${t}`),I(e)==="additive"?(Z.makeClipAdditive(h),h.blendMode=_):h.blendMode=ee,p.set(a,h)}const g=new Map;function K(t,e,s,a){let r=g.get(t);if(!r){const h=p.get(t);if(!h)throw new M(`[bindXStateAnimation] prepared clip "${t}" not found`);const v=i.clipAction(h);v.setEffectiveWeight(0),v.play(),r={action:v,clip:h},g.set(t,r)}return r.action.setLoop(e?ie:oe,1/0),r.action.clampWhenFinished=!e,r.action.timeScale=s,r.action.weight=a,r.action}function N(t){const e=o.selectParameters?o.selectParameters(t):t;return new Map(Object.entries(e??{}))}function D(t,e,s){return(S(e)?ce(z(e.blendTree),N(s)):[{clip:e.clip,weight:1}]).map(({clip:r,weight:h})=>({clip:r,weight:h,actionKey:w(t,e,r)}))}const y=new Map;let O=!1;function R(t,e,s){for(const a of t){if(a.actionKey===e)continue;const r=g.get(a.actionKey)?.action;r&&(s>0?r.fadeOut(s):r.setEffectiveWeight(0))}}function k(t,e){if(!S(t.meta))return;t.natural=D(t.stateId,t.meta,e);const s=B(t.meta);for(const a of t.natural)g.get(a.actionKey)?.action.setEffectiveWeight(a.weight*s)}function P(t,e,s){const a=W(e),r=y.get(a)??null,h=D(t,e,s),v=re(h),H=S(e)?!0:e.loop,Q=S(e)?1:e.speed,x=B(e);for(const b of h)K(b.actionKey,H,Q,x);const $=g.get(v.actionKey).action;$.reset().setEffectiveWeight(x);for(const b of h)b.actionKey!==v.actionKey&&g.get(b.actionKey).action.reset().setEffectiveWeight(0);const A=e.crossfade?.duration??0,U=e.crossfade?.warp??!1;if(!r)A>0&&$.fadeIn(A);else{R(r.natural,r.dominantActionKey,A);const b=g.get(r.dominantActionKey)?.action;b&&A>0?b.crossFadeTo($,A,U):(b?.setEffectiveWeight(0),$.setEffectiveWeight(x))}const j={layer:a,stateId:t,meta:e,natural:h,dominantActionKey:v.actionKey,crossfadeRemaining:A};y.set(a,j),S(e)&&A<=0&&k(j,s)}function q(t){return Object.keys(t.getMeta()).filter(e=>d.has(e))}function X(t){const e=new Map;for(const s of q(t)){const a=d.get(s),r=W(a),h=e.get(r);if(h)throw new M(`[bindXStateAnimation] animated states "${h}" and "${s}" are both active on layer "${r}". Give parallel regions distinct meta.animation.layer names.`,s);e.set(r,s)}for(const[s,a]of y)e.has(s)||(R(a.natural,void 0,0),y.delete(s));for(const[s,a]of e)y.get(s)?.stateId!==a&&P(a,d.get(a),t.context)}const F=n.getSnapshot();X(F);const G=n.subscribe(t=>{O||X(t)});function E(t){if(O)return;const e=t,s=n.getSnapshot().context;for(const a of y.values())a.crossfadeRemaining>0?(a.crossfadeRemaining=Math.max(0,a.crossfadeRemaining-e),a.crossfadeRemaining<=0&&k(a,s)):k(a,s);i.update(e)}const Y={tick:E,actor:n,getParameters:()=>N(n.getSnapshot().context),getActiveLayers:()=>[...y.values()].map(t=>({layer:t.layer,stateId:t.stateId,clips:t.natural.map(e=>e.clip),clipWeights:t.natural.map(e=>({clip:e.clip,weight:g.get(e.actionKey)?.action.getEffectiveWeight()??0})),weight:B(t.meta),blendMode:I(t.meta),...t.meta.boneMask?{boneMask:t.meta.boneMask}:{}})),dispose(){if(!O){O=!0,o.systems?.remove("animation",E),G.unsubscribe();for(const{action:t,clip:e}of g.values())t.stop(),i.uncacheAction(e,t.getRoot());g.clear(),y.clear()}}};return o.systems?.add("animation",E),Y}function ce(n,i){switch(n.type){case"1D":return le(n,i);case"2D":return fe(n,i);case"direct":return de(n);default:return n.children.map(c=>({clip:c.clip,weight:1/n.children.length}))}}function le(n,i){const c=Number(i.get(n.parameter)??0),o=[...n.children].sort((f,u)=>f.threshold-u.threshold),l=o.map(f=>({clip:f.clip,weight:0}));if(o.length===0)return l;if(o.length===1||c<=o[0].threshold)return l[0].weight=1,l;if(c>=o[o.length-1].threshold)return l[l.length-1].weight=1,l;for(let f=0;f<o.length-1;f++){const u=o[f],m=o[f+1];if(c>=u.threshold&&c<=m.threshold){const d=m.threshold-u.threshold,p=d>0?(c-u.threshold)/d:0;return l[f].weight=1-p,l[f+1].weight=p,l}}return l}function fe(n,i){const c=Number(i.get(n.parameter)??0),o=Number(i.get(n.parameterY??"")??0),l=n.children,f=l.map(d=>({clip:d.clip,weight:0}));let u=0;const m=[];for(const d of l){const p=c-d.threshold,w=o-(d.thresholdY??0),g=Math.sqrt(p*p+w*w),K=g<.001?1e3:1/g;m.push(K),u+=K}if(u>0)for(let d=0;d<f.length;d++)f[d].weight=m[d]/u;return f}function de(n){const i=n.children.map(o=>({clip:o.clip,weight:o.weight??0})),c=i.reduce((o,l)=>o+l.weight,0);if(c>0)for(const o of i)o.weight/=c;return i}export{M as AnimationBindingError,Se as bindXStateAnimation,ce as evaluateBlendTree,ae as machineOfXStateActor};
@@ -1 +1 @@
1
- import{dZ as b,d_ as u,u as o,v as c,w as n,x as l,c6 as r,c5 as m,c4 as f}from"./index-Dji-5Ngh.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";const d=o({clip:n().min(1).describe("Animation clip name this child plays"),threshold:r().describe("1D/2D blend position on the primary parameter axis"),thresholdY:r().optional().describe("2D blend position on the secondary parameter axis (2D blend trees only)"),weight:r().min(0).optional().describe('Explicit weight for "direct" blend trees (ignored by 1D/2D)')}).strict(),y=o({type:l("1D").describe("Interpolates linearly between sorted children by threshold"),parameter:n().min(1).describe("Context/selector value driving the blend"),children:c(d).min(2,"1D blend tree needs at least 2 children to interpolate between")}).strict(),v=o({type:l("2D").describe("Inverse-distance-weights children by (parameter, parameterY) position"),parameter:n().min(1).describe("Primary axis context/selector value"),parameterY:n().min(1).describe("Secondary axis context/selector value"),children:c(d.extend({thresholdY:r()})).min(1,"2D blend tree needs at least 1 child")}).strict(),g=o({type:l("direct").describe("Each child has an explicit weight, normalized to sum to 1"),parameter:n().default(""),children:c(d.extend({weight:r().min(0)})).min(1,"direct blend tree needs at least 1 child")}).strict(),A=b("type",[y,v,g]);function Y(e){return e}const p=o({duration:r().min(0).default(0).describe("Seconds to blend from the previously active clip into this state on entry, applied via native `AnimationAction.crossFadeTo`/`fadeIn` (E2). 0 = instant activation, no fade."),warp:m().default(!1).describe("Passed through to AnimationAction.crossFadeTo's `warp` param — linearly warps timeScale across the two clips during the blend so differing clip lengths line up. Default false.")}).strict().describe("Blend-in/out/crossfade timing for entering this state"),x=o({include:c(n().min(1)).min(1).optional().describe("Bone/object names whose complete descendant subtrees are retained"),exclude:c(n().min(1)).min(1).optional().describe("Bone/object names whose complete descendant subtrees are removed")}).strict().refine(e=>!!(e.include?.length||e.exclude?.length),{message:"boneMask needs at least one include or exclude bone name"}).describe("Filters animation tracks by named Object3D/Bone subtrees"),h={layer:n().min(1).optional().describe("Composition layer name; omitted means the single base layer"),weight:r().min(0).max(1).optional().describe("Layer weight multiplier from 0 to 1; defaults to 1"),blendMode:f(["override","additive"]).optional().describe("Native Three normal/override or additive action blending; defaults to override"),boneMask:x.optional().describe("Optional include/exclude filter applied to every clip track in this state")},w=o({clip:n().min(1).describe("Single clip to play while this XState state is active"),loop:m().default(!0).describe("Loop the clip (THREE.LoopRepeat) vs play once (THREE.LoopOnce, clamped on last frame)"),speed:r().positive().default(1).describe("Playback speed multiplier (AnimationAction.timeScale)"),crossfade:p.optional(),...h}).strict(),S=o({blendTree:A.describe("Multiple clips blended by a live context/selector-driven parameter"),crossfade:p.optional(),...h}).strict(),D=u([w,S]);function M(e){return"clip"in e}function $(e){return"blendTree"in e}class T extends Error{constructor(a,i,t){super(a),this.stateId=i,this.issues=t,this.name="AnimationMetaValidationError"}}function B(e,a){const i=D.safeParse(a);if(!i.success){const t=i.error.issues.map(s=>`${s.path.length?s.path.join("."):"(root)"}: ${s.message}`).join("; ");throw new T(`[xstate-animation] invalid meta.animation for state "${e}": ${t}`,e,i.error.issues)}return i.data}function R(e){const a=[],i=t=>{t.meta&&"animation"in t.meta&&t.meta.animation!==void 0&&a.push({stateId:t.id,meta:B(t.id,t.meta.animation)});for(const s of Object.values(t.states??{}))i(s)};return i(e),a}function H(e){return M(e)?[e.clip]:e.blendTree.children.map(a=>a.clip)}export{A as AnimationBlendTreeSchema,T as AnimationMetaValidationError,D as StateAnimationMetaSchema,Y as asBlendTreeDef,H as clipNamesOf,R as collectMachineAnimationMeta,$ as isBlendTreeAnimationMeta,M as isClipAnimationMeta,B as parseStateAnimationMeta};
1
+ import{dZ as b,d_ as u,u as o,v as c,w as n,x as l,c6 as r,c5 as m,c4 as f}from"./index-D8qHS95_.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";const d=o({clip:n().min(1).describe("Animation clip name this child plays"),threshold:r().describe("1D/2D blend position on the primary parameter axis"),thresholdY:r().optional().describe("2D blend position on the secondary parameter axis (2D blend trees only)"),weight:r().min(0).optional().describe('Explicit weight for "direct" blend trees (ignored by 1D/2D)')}).strict(),y=o({type:l("1D").describe("Interpolates linearly between sorted children by threshold"),parameter:n().min(1).describe("Context/selector value driving the blend"),children:c(d).min(2,"1D blend tree needs at least 2 children to interpolate between")}).strict(),v=o({type:l("2D").describe("Inverse-distance-weights children by (parameter, parameterY) position"),parameter:n().min(1).describe("Primary axis context/selector value"),parameterY:n().min(1).describe("Secondary axis context/selector value"),children:c(d.extend({thresholdY:r()})).min(1,"2D blend tree needs at least 1 child")}).strict(),g=o({type:l("direct").describe("Each child has an explicit weight, normalized to sum to 1"),parameter:n().default(""),children:c(d.extend({weight:r().min(0)})).min(1,"direct blend tree needs at least 1 child")}).strict(),A=b("type",[y,v,g]);function Y(e){return e}const p=o({duration:r().min(0).default(0).describe("Seconds to blend from the previously active clip into this state on entry, applied via native `AnimationAction.crossFadeTo`/`fadeIn` (E2). 0 = instant activation, no fade."),warp:m().default(!1).describe("Passed through to AnimationAction.crossFadeTo's `warp` param — linearly warps timeScale across the two clips during the blend so differing clip lengths line up. Default false.")}).strict().describe("Blend-in/out/crossfade timing for entering this state"),x=o({include:c(n().min(1)).min(1).optional().describe("Bone/object names whose complete descendant subtrees are retained"),exclude:c(n().min(1)).min(1).optional().describe("Bone/object names whose complete descendant subtrees are removed")}).strict().refine(e=>!!(e.include?.length||e.exclude?.length),{message:"boneMask needs at least one include or exclude bone name"}).describe("Filters animation tracks by named Object3D/Bone subtrees"),h={layer:n().min(1).optional().describe("Composition layer name; omitted means the single base layer"),weight:r().min(0).max(1).optional().describe("Layer weight multiplier from 0 to 1; defaults to 1"),blendMode:f(["override","additive"]).optional().describe("Native Three normal/override or additive action blending; defaults to override"),boneMask:x.optional().describe("Optional include/exclude filter applied to every clip track in this state")},w=o({clip:n().min(1).describe("Single clip to play while this XState state is active"),loop:m().default(!0).describe("Loop the clip (THREE.LoopRepeat) vs play once (THREE.LoopOnce, clamped on last frame)"),speed:r().positive().default(1).describe("Playback speed multiplier (AnimationAction.timeScale)"),crossfade:p.optional(),...h}).strict(),S=o({blendTree:A.describe("Multiple clips blended by a live context/selector-driven parameter"),crossfade:p.optional(),...h}).strict(),D=u([w,S]);function M(e){return"clip"in e}function $(e){return"blendTree"in e}class T extends Error{constructor(a,i,t){super(a),this.stateId=i,this.issues=t,this.name="AnimationMetaValidationError"}}function B(e,a){const i=D.safeParse(a);if(!i.success){const t=i.error.issues.map(s=>`${s.path.length?s.path.join("."):"(root)"}: ${s.message}`).join("; ");throw new T(`[xstate-animation] invalid meta.animation for state "${e}": ${t}`,e,i.error.issues)}return i.data}function R(e){const a=[],i=t=>{t.meta&&"animation"in t.meta&&t.meta.animation!==void 0&&a.push({stateId:t.id,meta:B(t.id,t.meta.animation)});for(const s of Object.values(t.states??{}))i(s)};return i(e),a}function H(e){return M(e)?[e.clip]:e.blendTree.children.map(a=>a.clip)}export{A as AnimationBlendTreeSchema,T as AnimationMetaValidationError,D as StateAnimationMetaSchema,Y as asBlendTreeDef,H as clipNamesOf,R as collectMachineAnimationMeta,$ as isBlendTreeAnimationMeta,M as isClipAnimationMeta,B as parseStateAnimationMeta};
package/dist-node/cli.js CHANGED
@@ -2317,7 +2317,7 @@ import { fileURLToPath as fileURLToPath2 } from "node:url";
2317
2317
  var package_default = {
2318
2318
  name: "@volter/game-editor",
2319
2319
  author: "Volter AI, Inc.",
2320
- version: "0.5.99",
2320
+ version: "0.5.100",
2321
2321
  publishConfig: {
2322
2322
  access: "public"
2323
2323
  },
@@ -2366,22 +2366,22 @@ var package_default = {
2366
2366
  }
2367
2367
  },
2368
2368
  dependencies: {
2369
- "@volter/editor-core": "0.5.99",
2370
- "@volter/editor-game": "0.5.99",
2371
- "@volter/editor-react": "0.5.99",
2372
- "@volter/editor-threejs": "0.5.99",
2373
- "@volter/editor-xstate": "0.5.99",
2374
- "@volter/editor-blender": "0.1.39",
2375
- "@volter/dawproject": "0.5.99",
2376
- "@volter/editor-dawproject": "0.5.99",
2377
- "@volter/blender-engine": "0.1.37",
2378
- "@volter/editor-project": "0.5.99",
2379
- "@volter/editor-sdk": "0.5.99",
2380
- "@volter/editor-live": "0.5.99",
2381
- "@volter/game-live": "0.5.99",
2369
+ "@volter/editor-core": "0.5.100",
2370
+ "@volter/editor-game": "0.5.100",
2371
+ "@volter/editor-react": "0.5.100",
2372
+ "@volter/editor-threejs": "0.5.100",
2373
+ "@volter/editor-xstate": "0.5.100",
2374
+ "@volter/editor-blender": "0.1.40",
2375
+ "@volter/dawproject": "0.5.100",
2376
+ "@volter/editor-dawproject": "0.5.100",
2377
+ "@volter/blender-engine": "0.1.38",
2378
+ "@volter/editor-project": "0.5.100",
2379
+ "@volter/editor-sdk": "0.5.100",
2380
+ "@volter/editor-live": "0.5.100",
2381
+ "@volter/game-live": "0.5.100",
2382
2382
  "@modelcontextprotocol/sdk": "1.30.0",
2383
- "@volter/game-runtime": "0.5.99",
2384
- "@volter/threejs-runtime": "0.5.99",
2383
+ "@volter/game-runtime": "0.5.100",
2384
+ "@volter/threejs-runtime": "0.5.100",
2385
2385
  undici: "7.29.1",
2386
2386
  typescript: "5.9.3",
2387
2387
  "@colyseus/schema": "^4.0.14",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@volter/game-editor",
3
3
  "author": "Volter AI, Inc.",
4
- "version": "0.5.99",
4
+ "version": "0.5.100",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -50,22 +50,22 @@
50
50
  }
51
51
  },
52
52
  "dependencies": {
53
- "@volter/editor-core": "0.5.99",
54
- "@volter/editor-game": "0.5.99",
55
- "@volter/editor-react": "0.5.99",
56
- "@volter/editor-threejs": "0.5.99",
57
- "@volter/editor-xstate": "0.5.99",
58
- "@volter/editor-blender": "0.1.39",
59
- "@volter/dawproject": "0.5.99",
60
- "@volter/editor-dawproject": "0.5.99",
61
- "@volter/blender-engine": "0.1.37",
62
- "@volter/editor-project": "0.5.99",
63
- "@volter/editor-sdk": "0.5.99",
64
- "@volter/editor-live": "0.5.99",
65
- "@volter/game-live": "0.5.99",
53
+ "@volter/editor-core": "0.5.100",
54
+ "@volter/editor-game": "0.5.100",
55
+ "@volter/editor-react": "0.5.100",
56
+ "@volter/editor-threejs": "0.5.100",
57
+ "@volter/editor-xstate": "0.5.100",
58
+ "@volter/editor-blender": "0.1.40",
59
+ "@volter/dawproject": "0.5.100",
60
+ "@volter/editor-dawproject": "0.5.100",
61
+ "@volter/blender-engine": "0.1.38",
62
+ "@volter/editor-project": "0.5.100",
63
+ "@volter/editor-sdk": "0.5.100",
64
+ "@volter/editor-live": "0.5.100",
65
+ "@volter/game-live": "0.5.100",
66
66
  "@modelcontextprotocol/sdk": "1.30.0",
67
- "@volter/game-runtime": "0.5.99",
68
- "@volter/threejs-runtime": "0.5.99",
67
+ "@volter/game-runtime": "0.5.100",
68
+ "@volter/threejs-runtime": "0.5.100",
69
69
  "undici": "7.29.1",
70
70
  "typescript": "5.9.3",
71
71
  "@colyseus/schema": "^4.0.14",
@@ -1 +0,0 @@
1
- import{a as t}from"./jsx-runtime-DPjLkJKQ.js";import{Object3DSnapshotDocument as m}from"./EntityModelDocument-ihLmZ24x.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./editor-shell-store-BRi8Vv17.js";import"./output-pass-HurwNl0G.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./Pass-D1MRT672.js";import"./editor-layers-BadrAIuA.js";import"./workspace-arrangement-BrA73ntW.js";import"./index-Dji-5Ngh.js";import"./index-nmcBqr7Y.js";import"./index-D_NuPfjr.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./user-data-BIoZkgOJ.js";import"./entity-object-DgmLa7_T.js";import"./three-contract-Dkt6PmWY.js";import"./live-mixers-B-bwLZ7c.js";import"./asset-preview-DyRWJUUG.js";import"./renderer-ownership-BovSEcLv.js";import"./hierarchy-marks-Bz6FH5xl.js";import"./studio-environment-D6JkSE7Q.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./environment-Dg-YaLsA.js";import"./RoomEnvironment-BkknvS_I.js";import"./EXRLoader-CITMBvGd.js";import"./HDRLoader-BTGuGhVo.js";import"./bitmap-label-Ct4k6ehY.js";import"./StageHost-BqIe86Q5.js";import"./three-state-Jjh8RKmv.js";import"./standard-viewport-dressing-BVichQxX.js";import"./content-bounds-CSAlBN5N.js";import"./preview-renderer-BrYNFV1p.js";import"./live-gesture-lock-DJbrjOqf.js";import"./three-integration-B0Pips-D.js";import"./host-hierarchy-objects-BV3WqU2w.js";import"./layered-pick-DfTP1-Cr.js";import"./root-stacking-BEd9ZvxC.js";import"./model-thumbnail-DrHjLgzh.js";import"./object3d-document-session-registry-CatZ54tz.js";import"./component-instance-root-BaRyIQ5L.js";import"./viewport-door-DkrIQ3Lf.js";import"./model-inspection-CPrGFWhU.js";import"./three-viewport-presentation-DMl9pRzL.js";import"./clip-planes-CnAI6DZn.js";import"./three-BeNC5ULQ.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./OrbitControls-B13MKuwC.js";import"./LineSegments2-DN9pUfWA.js";import"./three.quarks.esm-C_HmSKXo.js";import"./scene-framing-C5vUXepb.js";import"./source-object3d-authoring-adapter-CkrMfTNh.js";import"./three-projection-core-CktgE3qZ.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./transport-strip-B_-5H4dc.js";import"./viewport-surface-status-DD1DHTG4.js";function ut({previewKey:o,object:r,displayName:i,fill:p=!1}){return t.jsx("div",{"data-testid":"inspector-object-preview",style:p?{position:"absolute",inset:0,overflow:"hidden"}:{width:"100%",height:220,minHeight:220,borderBottom:"1px solid var(--volter-structural-divider)",overflow:"hidden",position:"relative"},children:t.jsx(m,{documentId:`inspector-preview:${o}`,source:r,displayName:i,active:!0,chromeless:!0})})}export{ut as InspectorObjectPreview};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/StageHost-BqIe86Q5.js","assets/index-Dji-5Ngh.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/three-state-Jjh8RKmv.js","assets/editor-shell-store-BRi8Vv17.js","assets/output-pass-HurwNl0G.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/Pass-D1MRT672.js","assets/editor-layers-BadrAIuA.js","assets/workspace-arrangement-BrA73ntW.js","assets/user-data-BIoZkgOJ.js","assets/entity-object-DgmLa7_T.js","assets/three-contract-Dkt6PmWY.js","assets/standard-viewport-dressing-BVichQxX.js","assets/content-bounds-CSAlBN5N.js","assets/hierarchy-marks-Bz6FH5xl.js","assets/environment-Dg-YaLsA.js","assets/RoomEnvironment-BkknvS_I.js","assets/EXRLoader-CITMBvGd.js","assets/HDRLoader-BTGuGhVo.js","assets/preview-renderer-BrYNFV1p.js","assets/renderer-ownership-BovSEcLv.js","assets/live-mixers-B-bwLZ7c.js","assets/live-gesture-lock-DJbrjOqf.js","assets/three-integration-B0Pips-D.js","assets/host-hierarchy-objects-BV3WqU2w.js","assets/layered-pick-DfTP1-Cr.js","assets/root-stacking-BEd9ZvxC.js","assets/model-thumbnail-DrHjLgzh.js","assets/studio-environment-D6JkSE7Q.js","assets/KTX2Loader-CaqVE6nY.js","assets/GLTFLoader-KeoruJgS.js","assets/BufferGeometryUtils-B22h7jo4.js","assets/object3d-document-session-registry-CatZ54tz.js","assets/component-instance-root-BaRyIQ5L.js","assets/viewport-door-DkrIQ3Lf.js","assets/asset-preview-DyRWJUUG.js","assets/bitmap-label-Ct4k6ehY.js","assets/model-inspection-CPrGFWhU.js","assets/three-viewport-presentation-DMl9pRzL.js","assets/clip-planes-CnAI6DZn.js","assets/three-BeNC5ULQ.js","assets/viewport-editor-controls-BYaAZ_Ku.js","assets/OrbitControls-B13MKuwC.js","assets/LineSegments2-DN9pUfWA.js","assets/three.quarks.esm-C_HmSKXo.js","assets/scene-framing-C5vUXepb.js","assets/source-object3d-authoring-adapter-CkrMfTNh.js","assets/three-projection-core-CktgE3qZ.js","assets/editor-presentation-activity-CqJH4G9t.js","assets/transport-strip-B_-5H4dc.js","assets/viewport-surface-status-DD1DHTG4.js"])))=>i.map(i=>d[i]);
2
- import{ak as r,_ as a}from"./index-Dji-5Ngh.js";import{a as o}from"./jsx-runtime-DPjLkJKQ.js";import{r as n}from"./index-nmcBqr7Y.js";import{V as c,O as u}from"./viewport-surface-status-DD1DHTG4.js";const s=n.lazy(async()=>({default:(await a(()=>import("./StageHost-BqIe86Q5.js").then(e=>e.S),__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]))).Object3DDocumentViewport}));function l(t){return i(t.documentId,t.chromeless),o.jsx(n.Suspense,{fallback:o.jsx(c,{testId:"object3d-document-loading",children:u}),children:o.jsx(s,{...t})})}function i(t,e=!1){n.useEffect(()=>{if(!e)return r(t)},[t,e])}export{l as O};
@@ -1 +0,0 @@
1
- import{T as i,r as m}from"./index-Dji-5Ngh.js";import{e as p}from"./game-network-BexquSG7.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-D2m1zyhH.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-B-T_4soJ.js";import"./contract-system-adapters-BuU4GKY2.js";import"./game-contract-seams-l_8ZaYZ3.js";import"./seeded-random-B_ZVFnMw.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-D4cO2mDW.js";import"./capability-coverage-CRb3vmWs.js";import"./edit-mode-authoring-euM9VW6K.js";import"./json-history-resource-CIxXZ9Kl.js";import"./binding-resolver-BWRRdIaX.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-Cg17rNWu.js";import"./canvas-entry-runtime-CRWe-Gxi.js";import"./three-ingest-runtime-QR_mSA3s.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-h6X9yZNA.js";import"./ingest-source-persistence-BQ3VwPMh.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-CBBdlbEP.js";import"./mounted-authoring-DBEo6Vnv.js";import"./entity-object-DgmLa7_T.js";import"./user-data-BIoZkgOJ.js";import"./workspace-arrangement-BrA73ntW.js";import"./three-contract-Dkt6PmWY.js";import"./three-BeNC5ULQ.js";import"./editor-layers-BadrAIuA.js";import"./component-instance-root-BaRyIQ5L.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-BC0M_LjK.js";import"./source-persistence-backend-Dxv1DyQP.js";import"./three-projection-core-CktgE3qZ.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-Cnq-NbcK.js";import"./deferred-ingest-play-BhS77VgZ.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-BxVhWmgw.js";import"./board-guides-CC1g9px4.js";import"./relative-import-specifier-KuoBpIGI.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-DZInhjtn.js";import"./inference-diagnostics-BJUcoifD.js";import"./writer-tw6EcuVO.js";import"./three-state-Jjh8RKmv.js";import"./editor-shell-store-BRi8Vv17.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-DkrIQ3Lf.js";import"./game-surface-defaults-D8S4cRxi.js";const Ut="workspace.service";function e(o){p().catch(t=>{m().console.error(`${o}: ${t instanceof Error?t.message:String(t)}`,"play")})}function bt(){let o,t=!1;const r=i(()=>{t||new URLSearchParams(window.location.search).get("play")==="1"&&(t=!0,o=window.setTimeout(()=>e("Could not enter requested Play mode"),0))});return()=>{o!==void 0&&window.clearTimeout(o),r()}}export{Ut as point,bt as start};
@@ -1 +0,0 @@
1
- import{ah as m}from"./index-Dji-5Ngh.js";import{b as p,a as e,c as n,s}from"./game-network-BexquSG7.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-D2m1zyhH.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-B-T_4soJ.js";import"./contract-system-adapters-BuU4GKY2.js";import"./game-contract-seams-l_8ZaYZ3.js";import"./seeded-random-B_ZVFnMw.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-D4cO2mDW.js";import"./capability-coverage-CRb3vmWs.js";import"./edit-mode-authoring-euM9VW6K.js";import"./json-history-resource-CIxXZ9Kl.js";import"./binding-resolver-BWRRdIaX.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-Cg17rNWu.js";import"./canvas-entry-runtime-CRWe-Gxi.js";import"./three-ingest-runtime-QR_mSA3s.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-h6X9yZNA.js";import"./ingest-source-persistence-BQ3VwPMh.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-CBBdlbEP.js";import"./mounted-authoring-DBEo6Vnv.js";import"./entity-object-DgmLa7_T.js";import"./user-data-BIoZkgOJ.js";import"./workspace-arrangement-BrA73ntW.js";import"./three-contract-Dkt6PmWY.js";import"./three-BeNC5ULQ.js";import"./editor-layers-BadrAIuA.js";import"./component-instance-root-BaRyIQ5L.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-BC0M_LjK.js";import"./source-persistence-backend-Dxv1DyQP.js";import"./three-projection-core-CktgE3qZ.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-Cnq-NbcK.js";import"./deferred-ingest-play-BhS77VgZ.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-BxVhWmgw.js";import"./board-guides-CC1g9px4.js";import"./relative-import-specifier-KuoBpIGI.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-DZInhjtn.js";import"./inference-diagnostics-BJUcoifD.js";import"./writer-tw6EcuVO.js";import"./three-state-Jjh8RKmv.js";import"./editor-shell-store-BRi8Vv17.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-DkrIQ3Lf.js";import"./game-surface-defaults-D8S4cRxi.js";const zt="workspace.command",a=()=>({ok:!1,error:"not in play mode — start play before using the debug seam"}),Bt={"set-instance-count":{derivedRefresh:"always",handle:o=>{if(!e())return a();const r=o.names;if(Array.isArray(r)&&r.every(i=>typeof i=="string"))return r.length<1?{ok:!1,error:'set-instance-count "names" must have at least one entry.'}:(n(r),{ok:!0});const t=o.count;return typeof t!="number"||!Number.isFinite(t)||t<1?{ok:!1,error:`set-instance-count requires a whole "count" >= 1 (or a "names" array), got ${String(t)}.`}:(s(Math.floor(t)-1),{ok:!0})}},"list-instances":{derivedRefresh:"if-content-changed",handle:()=>({ok:!0,data:{instances:m(),named:p()}})}};export{Bt as commands,zt as point};
@@ -1 +0,0 @@
1
- import{i as t}from"./game-network-BexquSG7.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-Dji-5Ngh.js";import"./index-nmcBqr7Y.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"./native-debug-module-D2m1zyhH.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-B-T_4soJ.js";import"./contract-system-adapters-BuU4GKY2.js";import"./game-contract-seams-l_8ZaYZ3.js";import"./seeded-random-B_ZVFnMw.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-D4cO2mDW.js";import"./capability-coverage-CRb3vmWs.js";import"./edit-mode-authoring-euM9VW6K.js";import"./json-history-resource-CIxXZ9Kl.js";import"./binding-resolver-BWRRdIaX.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-Cg17rNWu.js";import"./canvas-entry-runtime-CRWe-Gxi.js";import"./three-ingest-runtime-QR_mSA3s.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-h6X9yZNA.js";import"./ingest-source-persistence-BQ3VwPMh.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-CBBdlbEP.js";import"./mounted-authoring-DBEo6Vnv.js";import"./entity-object-DgmLa7_T.js";import"./user-data-BIoZkgOJ.js";import"./workspace-arrangement-BrA73ntW.js";import"./three-contract-Dkt6PmWY.js";import"./three-BeNC5ULQ.js";import"./editor-layers-BadrAIuA.js";import"./component-instance-root-BaRyIQ5L.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-BC0M_LjK.js";import"./source-persistence-backend-Dxv1DyQP.js";import"./three-projection-core-CktgE3qZ.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-Cnq-NbcK.js";import"./deferred-ingest-play-BhS77VgZ.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-BxVhWmgw.js";import"./board-guides-CC1g9px4.js";import"./relative-import-specifier-KuoBpIGI.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-DZInhjtn.js";import"./inference-diagnostics-BJUcoifD.js";import"./writer-tw6EcuVO.js";import"./three-state-Jjh8RKmv.js";import"./editor-shell-store-BRi8Vv17.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-DkrIQ3Lf.js";import"./game-surface-defaults-D8S4cRxi.js";const zt="workspace.service";function At(){t()}export{zt as point,At as start};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/r3f-design-session-B7g85Ubb.js","assets/index-Dji-5Ngh.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-euM9VW6K.js","assets/game-network-BexquSG7.js","assets/index-OZVqp6xS.js","assets/index-Da9JhEvW.js","assets/native-debug-module-D2m1zyhH.js","assets/native-entry-surface-BE8LJNdu.js","assets/debug-registry-B-T_4soJ.js","assets/contract-system-adapters-BuU4GKY2.js","assets/game-contract-seams-l_8ZaYZ3.js","assets/seeded-random-B_ZVFnMw.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-D4cO2mDW.js","assets/capability-coverage-CRb3vmWs.js","assets/json-history-resource-CIxXZ9Kl.js","assets/binding-resolver-BWRRdIaX.js","assets/adapter-surface-Y37Nzcyw.js","assets/structural-signature-Dc7skRiy.js","assets/webgl-frame-capture-DdJkM2mi.js","assets/realm-services-Cg17rNWu.js","assets/canvas-entry-runtime-CRWe-Gxi.js","assets/three-ingest-runtime-QR_mSA3s.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-h6X9yZNA.js","assets/ingest-source-persistence-BQ3VwPMh.js","assets/pixi-story-model-DNkfnWUV.js","assets/surface-content-Dg9Kkazf.js","assets/viewport-root-presentation-CBBdlbEP.js","assets/mounted-authoring-DBEo6Vnv.js","assets/entity-object-DgmLa7_T.js","assets/user-data-BIoZkgOJ.js","assets/workspace-arrangement-BrA73ntW.js","assets/three-contract-Dkt6PmWY.js","assets/three-BeNC5ULQ.js","assets/editor-layers-BadrAIuA.js","assets/component-instance-root-BaRyIQ5L.js","assets/viewport-editor-controls-BYaAZ_Ku.js","assets/three-authoring-adapter-BC0M_LjK.js","assets/source-persistence-backend-Dxv1DyQP.js","assets/three-projection-core-CktgE3qZ.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-Cnq-NbcK.js","assets/deferred-ingest-play-BhS77VgZ.js","assets/rrweb-Cd2ifIRP.js","assets/react-world-authoring-adapter-BxVhWmgw.js","assets/board-guides-CC1g9px4.js","assets/relative-import-specifier-KuoBpIGI.js","assets/story-arg-descriptors-Ek86ExX7.js","assets/inspect-DZInhjtn.js","assets/inference-diagnostics-BJUcoifD.js","assets/writer-tw6EcuVO.js","assets/three-state-Jjh8RKmv.js","assets/editor-shell-store-BRi8Vv17.js","assets/output-pass-HurwNl0G.js","assets/viewport-door-DkrIQ3Lf.js","assets/game-surface-defaults-D8S4cRxi.js","assets/scene-framing-C5vUXepb.js","assets/assets-BcrMQHRv.js","assets/loader-BTUKnX5Q.js","assets/KTX2Loader-CaqVE6nY.js","assets/GLTFLoader-KeoruJgS.js","assets/BufferGeometryUtils-B22h7jo4.js","assets/create-runtime-D7OGGNf7.js","assets/binding-Bmxqznjk.js","assets/root-stacking-BEd9ZvxC.js","assets/setup-renderer-CeDRVovn.js","assets/index-DHhMOs_s.js","assets/defaults-DKiBJCPN.js","assets/render-settings-Cvt-UEn5.js","assets/render-features-BNRGwsS3.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,aF as n}from"./index-Dji-5Ngh.js";import{r as a}from"./design-time-mount-registry-DUpXCg1U.js";import{q as c}from"./edit-mode-authoring-euM9VW6K.js";import{a as u}from"./json-history-resource-CIxXZ9Kl.js";import{o as h}from"./three-authoring-adapter-BC0M_LjK.js";import{t as i}from"./editor-shell-store-BRi8Vv17.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-BaRyIQ5L.js";import"./user-data-BIoZkgOJ.js";import"./workspace-arrangement-BrA73ntW.js";import"./source-persistence-backend-Dxv1DyQP.js";import"./ingest-source-persistence-BQ3VwPMh.js";import"./three-projection-core-CktgE3qZ.js";import"./editor-layers-BadrAIuA.js";import"./three-BeNC5ULQ.js";import"./entity-object-DgmLa7_T.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-Cnq-NbcK.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-B7g85Ubb.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 +0,0 @@
1
- import{e as r}from"./three-integration-B0Pips-D.js";import"./index-Dji-5Ngh.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-DfTP1-Cr.js";import"./root-stacking-BEd9ZvxC.js";import"./user-data-BIoZkgOJ.js";import"./workspace-arrangement-BrA73ntW.js";import"./model-thumbnail-DrHjLgzh.js";import"./studio-environment-D6JkSE7Q.js";import"./KTX2Loader-CaqVE6nY.js";import"./GLTFLoader-KeoruJgS.js";import"./BufferGeometryUtils-B22h7jo4.js";import"./object3d-document-session-registry-CatZ54tz.js";import"./three-state-Jjh8RKmv.js";import"./editor-shell-store-BRi8Vv17.js";import"./output-pass-HurwNl0G.js";import"./Pass-D1MRT672.js";import"./editor-layers-BadrAIuA.js";import"./entity-object-DgmLa7_T.js";import"./three-contract-Dkt6PmWY.js";import"./hierarchy-marks-Bz6FH5xl.js";import"./component-instance-root-BaRyIQ5L.js";import"./viewport-door-DkrIQ3Lf.js";import"./content-bounds-CSAlBN5N.js";import"./asset-preview-DyRWJUUG.js";import"./bitmap-label-Ct4k6ehY.js";const Q="workspace.service";function R(){return r()}export{Q as point,R as start};
@@ -1 +0,0 @@
1
- import{a as o}from"./jsx-runtime-DPjLkJKQ.js";import{r as t}from"./index-Dji-5Ngh.js";import{r as m}from"./index-nmcBqr7Y.js";import{P as p}from"./PlayBar-D-SgnHBi.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-D_NuPfjr.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./configurations-Dr0vG1VD.js";import"./run-selection-D8BpmvGy.js";import"./game-network-BexquSG7.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-D2m1zyhH.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-B-T_4soJ.js";import"./contract-system-adapters-BuU4GKY2.js";import"./game-contract-seams-l_8ZaYZ3.js";import"./seeded-random-B_ZVFnMw.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-D4cO2mDW.js";import"./capability-coverage-CRb3vmWs.js";import"./edit-mode-authoring-euM9VW6K.js";import"./json-history-resource-CIxXZ9Kl.js";import"./binding-resolver-BWRRdIaX.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-Cg17rNWu.js";import"./canvas-entry-runtime-CRWe-Gxi.js";import"./three-ingest-runtime-QR_mSA3s.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-h6X9yZNA.js";import"./ingest-source-persistence-BQ3VwPMh.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-CBBdlbEP.js";import"./mounted-authoring-DBEo6Vnv.js";import"./entity-object-DgmLa7_T.js";import"./user-data-BIoZkgOJ.js";import"./workspace-arrangement-BrA73ntW.js";import"./three-contract-Dkt6PmWY.js";import"./three-BeNC5ULQ.js";import"./editor-layers-BadrAIuA.js";import"./component-instance-root-BaRyIQ5L.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-BC0M_LjK.js";import"./source-persistence-backend-Dxv1DyQP.js";import"./three-projection-core-CktgE3qZ.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-Cnq-NbcK.js";import"./deferred-ingest-play-BhS77VgZ.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-BxVhWmgw.js";import"./board-guides-CC1g9px4.js";import"./relative-import-specifier-KuoBpIGI.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-DZInhjtn.js";import"./inference-diagnostics-BJUcoifD.js";import"./writer-tw6EcuVO.js";import"./three-state-Jjh8RKmv.js";import"./editor-shell-store-BRi8Vv17.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-DkrIQ3Lf.js";import"./game-surface-defaults-D8S4cRxi.js";const Dr="workspace.header",Fr=0;function Gr(){const{project:r}=t();return m.useSyncExternalStore(r.subscribe,r.mounts,r.mounts)?o.jsx(p,{}):null}export{Gr as default,Fr as order,Dr as point};
@@ -1,2 +0,0 @@
1
- const d="/work/.volter-session",ae=`${d}/session.py`,se=[`${d}/in`,`${d}/reply`],L="/__editor/blender-wasm";function ie(e){return e.startsWith("@@VOLTER-ERROR")?"error":e.startsWith("@@VOLTER-WARN")?"warn":"log"}function D(e){return new URL(`${L}/${e}`,import.meta.url).href}async function M(){const e=await fetch(D("status"));return e.ok?await e.json():{available:!1,skew:null,dir:null,sizes:{},encoded:{},missing:[`${L}/status answered ${e.status}`]}}async function W(e){const t=await M();if(!t.available)throw new Error(`The headless Blender WebAssembly build is not served by this editor: ${t.missing.join("; ")}`);if(t.skew==="wali"){const{startWaliBlenderEngine:n}=await import("./blender-wali-engine-CAscERoY.js");return n(e,t)}const{startEmscriptenBlenderEngine:r}=await import("./blender-emscripten-engine-DnpXL9Lg.js");return r(e,t)}function J(e){return e<200?1:e<5e3?5:25}const U=e=>new Promise(t=>setTimeout(t,e)),B=new TextDecoder;function ce(e,t,r){let n=0,a=0;const o=new Set;async function s(u){for(const l of o)u.has(`${l}.done`)||(await e.unlink(`${d}/reply/${l}.json`),await e.unlink(`${d}/reply/${l}.done`),o.delete(l))}async function i(){let u;try{u=await e.readdir(`${d}/ask`)}catch{return}const l=new Set(u.filter(w=>w.endsWith(".done")));await s(l);for(const w of l){const h=w.slice(0,-5);if(Number(h)<=a)continue;a=Number(h);const $=JSON.parse(B.decode(await e.readFile(`${d}/ask/${h}.json`)));let p;try{p=await t.ask($)}catch(v){p={error:v instanceof Error?v.message:String(v)}}await Promise.all([e.writeFile(`${d}/reply/${h}.json`,JSON.stringify(p??null)),e.writeFile(`${d}/reply/${h}.done`,"1")]),o.add(h)}}async function c(u){const l=String(++n);await Promise.all([e.writeFile(`${d}/in/${l}.json`,JSON.stringify(u)),e.writeFile(`${d}/in/${l}.done`,"1")]);const w=performance.now();for(;;){if(await i(),await e.stat(`${d}/out/${l}.done`)){const p=JSON.parse(B.decode(await e.readFile(`${d}/out/${l}.json`)));if(await e.unlink(`${d}/in/${l}.json`),await e.unlink(`${d}/in/${l}.done`),p.error)throw new Error(p.error);return p.result}const h=r?.();if(h)throw new Error(`Blender is gone, so this call will never be answered: ${h}. The session keeps its directory and its cached banner, so every later call would wait on the same missing answer; start a new program with \`blender-start {fresh: true}\` (\`VOLTER_BLENDER_FRESH_SESSION=1\` for the battery harness).`);const $=J(performance.now()-w);await(e.changed?e.changed($):U($))}}return{request:c}}const I=e=>typeof e=="object"&&e!==null&&typeof e.offset=="number"&&typeof e.length=="number"&&typeof e.dtype=="string"&&typeof e.count=="number"&&typeof e.stride=="number",C={f32:e=>new Float32Array(e.buffer,e.byteOffset,e.byteLength>>2),f64:e=>new Float64Array(e.buffer,e.byteOffset,e.byteLength>>3),u32:e=>new Uint32Array(e.buffer,e.byteOffset,e.byteLength>>2),i32:e=>new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),u16:e=>new Uint16Array(e.buffer,e.byteOffset,e.byteLength>>1),i16:e=>new Int16Array(e.buffer,e.byteOffset,e.byteLength>>1),u8:e=>e,i8:e=>new Int8Array(e.buffer,e.byteOffset,e.byteLength)};function z(e,t,r){const n=C[r.dtype];if(!n)throw new Error(`Blender frame column ${t}: unknown dtype ${r.dtype}`);const{offset:a,length:o}=r;if(a<0||o<0||a+o>e.byteLength)throw new Error(`Blender frame column ${t}: bytes ${a}..${a+o} lie outside the ${e.byteLength}-byte export arena`);const s=e.subarray(a,a+o).slice(),i=n(s),c=r.count*r.stride;if(i.length!==c)throw new Error(`Blender frame column ${t}: ${i.length} values, ${c} declared (${r.count} x ${r.stride})`);return i}function V(e,t){const r=(n,a)=>{if(I(n)){const o=z(e,a,n);return a==="co"?Float64Array.from(o):o}if(Array.isArray(n))return n.map(o=>r(o,a));if(typeof n=="object"&&n!==null){const o={};for(const[s,i]of Object.entries(n))o[s]=r(i,s);return o}return n};return r(t,"")}async function H(e,t){const r=async(n,a)=>{if(I(n)){const{offset:o,length:s,dtype:i}=n;if(o<0||s<0||o+s>e.byteLength)throw new Error(`Blender frame column ${a}: bytes ${o}..${o+s} lie outside the ${e.byteLength}-byte export arena`);const c=e.subarray(o,o+s).slice(),u=await crypto.subtle.digest("SHA-256",c),l=[...new Uint8Array(u)].map(w=>w.toString(16).padStart(2,"0")).join("");return{dtype:i,length:s,sha256:l}}if(Array.isArray(n))return Promise.all(n.map(o=>r(o,a)));if(typeof n=="object"&&n!==null){const o={};for(const[s,i]of Object.entries(n))o[s]=await r(i,s);return o}return n};return r(t,"")}const m=e=>self.postMessage(e),k=(e,t)=>m({op:"log",level:e,text:t});let b=null,S=null,G=0;const j=new Map;function K(e,t,r){const n=++G,a=[],o=e;for(const s of[o?.meshes??{},o?.images??{}])for(const i of Object.values(s))for(const c of Object.values(i))ArrayBuffer.isView(c)&&c.buffer instanceof ArrayBuffer&&!a.includes(c.buffer)&&a.push(c.buffer);return new Promise((s,i)=>{j.set(n,{resolve:s,reject:i}),self.postMessage({op:"present",id:n,frame:e,description:t,...r?{capture:r}:{}},a)})}let f=null,E=null,T=!1,A=Promise.resolve();function Q(e){const t=A.then(e);return A=t.catch(()=>{}),t}function P(e){T=e,m({op:"document-dirty",dirty:e})}async function N(){if(!f||E===null)return;const e=E;let t;try{t=await f.request({op:"save-document"})}catch(n){throw new Error(`The Blender document ${e} could not be saved: ${g(n)}`)}if(!t?.saved||typeof t.path!="string")throw new Error(`Blender did not save the document ${e}`);let r;try{r=await f.files.readFile(t.path)}catch(n){throw new Error(`The Blender document ${e} could not be read back out of the engine: ${g(n)}`)}y.delete(t.path);try{const n=await fetch(`/__editor/blender-document?path=${encodeURIComponent(e)}`,{method:"POST",headers:{"content-type":"application/octet-stream"},body:new Blob([r])});if(!n.ok){const a=await n.text().catch(()=>"");throw new Error(`HTTP ${n.status} ${a}`)}}catch(n){throw new Error(`The Blender document ${e} was not written to the project: ${g(n)}`)}P(!1),k("log",`@@VOLTER-DOCUMENT ${JSON.stringify({path:e,bytes:r.length})}`)}async function X(e,t){const r={engine:null},n=await W({project:e,log:k,ask:async({frame:o,capture:s,saveDue:i})=>{if(!r.engine)throw new Error("The Blender session presented before it started");i&&E!==null&&P(!0);const c=await r.engine.readArena(),u=await H(c,o),l=await K(V(c,o),u,s);return{...typeof l.capture=="object"&&l.capture!==null?l.capture:{},..."held"in l?{held:l.held}:{}}}});r.engine=n,f=n,t&&await _(n.files,e);const a=await n.request({op:"start",project:e,...t?{document:t}:{}});return t&&(E=t),b={start:async()=>a,execute:async o=>{const s=await n.request({op:"execute",code:o});return s.error?`Error executing code: ${s.error}`:`Code executed successfully: ${s.result}`},sceneInfo:async()=>JSON.stringify(await n.request({op:"scene-info"}),null,2),objectInfo:async o=>JSON.stringify(await n.request({op:"object-info",name:o}),null,2),screenshotView:async o=>(await n.request({op:"present",capture:{size:o}}),JSON.stringify({view:{size:o}}))},{...a,engine:"blender-wasm",skew:n.skew,bootMs:Math.round(n.bootMs),releasedPayloadMB:n.releasedPayloadBytes===null?null:Math.round(n.releasedPayloadBytes/1048576)}}async function Y(){try{const e=await fetch("/__editor/blender-wasm/status");return e.ok?await e.json():{available:!1,missing:[`status answered ${e.status}`]}}catch(e){return{available:!1,missing:[String(e)]}}}async function Z(e,t){if(b)throw new Error("The Blender session is already started");if(!e.startsWith("/"))throw new Error("The Blender session needs the project's absolute path");if(t!==void 0&&!q(t))throw new Error(`The Blender document must be a project-relative .blend path with no traversal (models/model.blend); got ${JSON.stringify(t)}`);const r=await Y();if(!r.available)throw new Error(`Headless Blender is not served by this editor, so there is no modeling engine: ${r.missing.join("; ")}. The engine is Blender compiled to WebAssembly (packages/blender-engine/wasm, or the directory VOLTER_BLENDER_WASM_DIR names); nothing stands in for it.`);return S=e,X(e,t)}function q(e){return!e.endsWith(".blend")||e.startsWith("/")||e.includes("\\")?!1:e.split("/").every(r=>r!==""&&r!=="."&&r!=="..")}const x=new Set;function O(e){x.has(e)||(x.add(e),k("error",e))}async function ee(e){const t=s=>(O(`The project's files are not readable from Python: ${s}`),null);let r;try{r=await fetch("/__editor/blender-project-index")}catch(s){return t(String(s))}if(!r.ok)return t(`/__editor/blender-project-index answered ${r.status}`);let n;try{if(n=await r.json(),typeof n?.root!="string"||!Array.isArray(n.files))return t("invalid project index")}catch(s){return t(String(s))}const{root:a,files:o}=n;return a!==e&&O(`The editor serving this tab has ${a} open, not ${e}; its files are mounted at ${e}, which is where Python is looking.`),o}const y=new Map;async function te(e,t){const r=await e.stat(t);return r?`${r.size}:${r.mtimeMs}`:""}async function _(e,t){const r=await ee(t);if(!r)return;const n=new Set(r.map(a=>`${t}/${a.path}`));for(const a of[...y.keys()])if(!n.has(a)){try{await e.unlink(a)}catch{}y.delete(a)}for(const a of r){const o=`${t}/${a.path}`,s=`${a.size}:${a.mtime}`;if(y.get(o)?.host===s||!y.has(o)&&await e.stat(o)!==null)continue;const i=await fetch(`/__editor/blender-project-file?path=${encodeURIComponent(a.path)}`);if(!i.ok){O(`${a.path}: HTTP ${i.status}`);continue}const c=o.slice(0,o.lastIndexOf("/"));c&&await e.mkdirTree(c),await e.writeFile(o,new Uint8Array(await i.arrayBuffer())),y.set(o,{host:s,engine:await te(e,o)})}}async function ne(e,t){const r=[],n=async a=>{let o;try{o=await e.readdir(a)}catch{return}for(const s of o){if(s==="."||s==="..")continue;const i=`${a.replace(/\/$/,"")}/${s}`,c=await e.stat(i);if(c){if((c.mode&61440)===16384){await n(i);continue}y.get(i)?.engine!==`${c.size}:${c.mtimeMs}`&&r.push({path:i,size:c.size,mtime:c.mtimeMs})}}};return await n(t),r}async function F(e){switch(e.op){case"start":return Z(e.project,e.document);case"present-result":{const n=j.get(e.id);j.delete(e.id),n&&(e.error?n.reject(new Error(e.error)):n.resolve({...e.capture===void 0?{}:{capture:e.capture},..."held"in e?{held:e.held}:{}}));return}}if(!b||!S||!f)throw new Error("The Blender session has not started");const t=f.files,r=f.request.bind(f);switch(e.op){case"flush-document":return T?(await N(),{saved:!0}):{saved:!1};case"history-begin":case"history-end":return r({op:e.op});case"history-step":return r({op:"history-step",token:e.token,direction:e.direction});case"execute":await _(t,S);{const n=await r({op:"execute",code:e.code,history:e.history??!0,label:e.label??"Blender Python"});return n.error?`Error executing code: ${n.error}`:`Code executed successfully: ${n.result}`}case"present":return r({op:"present"});case"scene-info":return b.sceneInfo();case"object-info":return b.objectInfo(e.name);case"rna":return r({op:"rna",path:e.path,...e.names===void 0?{}:{names:e.names}});case"rna-context":return r({op:"rna-context",...e.object===void 0?{}:{object:e.object},...e.collection===void 0?{}:{collection:e.collection}});case"view-shading":return r({op:"view-shading",shading:e.shading});case"rna-set":return r({op:"rna-set",history:e.history!==!1,path:e.path,property:e.property,value:e.value,...e.index===void 0?{}:{index:e.index}});case"outliner":return r({op:"outliner",...e.selected===void 0?{}:{selected:[...e.selected]}});case"node-tree":return r({op:"node-tree",...e.path===void 0?{}:{path:e.path},...e.material===void 0?{}:{material:e.material}});case"uv-layout":return r({op:"uv-layout",...e.object===void 0?{}:{object:e.object},...e.uvLayer===void 0?{}:{uvLayer:e.uvLayer}});case"rig":return r({op:"rig",...e.object===void 0?{}:{object:e.object}});case"action-clip":return r({op:"action-clip",...e.object===void 0?{}:{object:e.object},...e.bake===void 0?{}:{bake:e.bake}});case"outliner-set":return r({op:"outliner-set",path:e.path,column:e.column,value:e.value});case"screenshot-view":return JSON.parse(await b.screenshotView(e.maxSize));case"read-file":return t.readFile(e.path);case"write-file":{const n=e.path.slice(0,e.path.lastIndexOf("/"));n&&await t.mkdirTree(n),await t.writeFile(e.path,e.bytes),y.delete(e.path);return}case"list-files":return ne(t,e.path)}throw new Error(`Unknown Blender worker request ${e.op}`)}function g(e){if(e instanceof Error)return e.stack??`${e.name}: ${e.message}`;if(typeof e=="object"&&e!==null){const t=e;if(typeof t.message=="string")return typeof t.name=="string"?`${t.name}: ${t.message}`:t.message;try{return JSON.stringify(e)??Object.prototype.toString.call(e)}catch{return Object.prototype.toString.call(e)}}return String(e)}function re(){if(!f)return;const e=f.memoryBytes();e!==null&&m({op:"memory",bytes:e})}self.onmessage=e=>{const t=e.data;if(t.op==="present-result"){F(t);return}Q(()=>oe(t))};async function oe(e){try{const t=await F(e);T&&await N(),await R(),m({id:e.id,result:t})}catch(t){let r=g(t);try{await R()}catch(n){r+=`
2
- Unable to deliver Blender history: ${g(n)}`}m({id:e.id,error:r})}re()}async function R(){if(!f||!b)return;const e=await f.request({op:"history-events"});e.length&&m({op:"history",entries:e})}export{L as A,se as P,d as S,D as a,ae as b,ie as c,ce as o,U as s};