@volter/game-editor 0.5.65

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 (653) hide show
  1. package/BUNDLED_NOTICES +11228 -0
  2. package/LICENSE +686 -0
  3. package/LICENSE-BLENDER +1409 -0
  4. package/LICENSE-MCP +21 -0
  5. package/NOTICE +21 -0
  6. package/catalog/entries/audio.json +14 -0
  7. package/catalog/entries/bake.json +36 -0
  8. package/catalog/entries/blender.json +17 -0
  9. package/catalog/entries/react-root.json +24 -0
  10. package/catalog/entries/reflections.json +29 -0
  11. package/catalog/entries/static-batch.json +25 -0
  12. package/catalog/project-source/LICENSE +37 -0
  13. package/catalog/project-source/src/contributions/bake.kind.ts +40 -0
  14. package/catalog/project-source/src/contributions/builder-document.tsx +65 -0
  15. package/catalog/project-source/src/contributions/builder-state.ts +27 -0
  16. package/catalog/project-source/src/contributions/builder-ui.tsx +61 -0
  17. package/catalog/project-source/src/contributions/module-source.ts +502 -0
  18. package/catalog/project-source/src/contributions/pages.finder.ts +61 -0
  19. package/catalog/project-source/src/lib/audio/sfx.ts +255 -0
  20. package/catalog/project-source/src/lib/bake/asset-seed.ts +128 -0
  21. package/catalog/project-source/src/lib/bake/bake-schema.ts +65 -0
  22. package/catalog/project-source/src/lib/bake/clip-layering.ts +203 -0
  23. package/catalog/project-source/src/lib/bake/gltf-bake.ts +657 -0
  24. package/catalog/project-source/src/lib/bake/mesh-slice.ts +157 -0
  25. package/catalog/project-source/src/lib/bake/node-image.ts +463 -0
  26. package/catalog/project-source/src/lib/bake/object3d-bake.ts +121 -0
  27. package/catalog/project-source/src/lib/bake/object3d-lifecycle.ts +15 -0
  28. package/catalog/project-source/src/lib/bake/object3d-source.ts +8 -0
  29. package/catalog/project-source/src/lib/bake/params.ts +75 -0
  30. package/catalog/project-source/src/lib/bake/rest-relative-animation.ts +217 -0
  31. package/catalog/project-source/src/lib/bake/use-model.ts +95 -0
  32. package/catalog/project-source/src/lib/react-root/index.ts +20 -0
  33. package/catalog/project-source/src/lib/react-root/react-root-adapter.tsx +57 -0
  34. package/catalog/project-source/src/lib/reflections/ReflectionProbe.tsx +201 -0
  35. package/catalog/project-source/src/lib/reflections/index.ts +19 -0
  36. package/catalog/project-source/src/lib/reflections/probe-controller.ts +75 -0
  37. package/catalog/project-source/src/lib/reflections/reflection-probe-registry.ts +402 -0
  38. package/catalog/project-source/src/lib/reflections/volume-reflection-material.ts +416 -0
  39. package/catalog/project-source/src/lib/static-batch/Frozen.tsx +91 -0
  40. package/catalog/project-source/src/lib/static-batch/freeze.ts +579 -0
  41. package/catalog/project-source/src/lib/static-batch/index.ts +44 -0
  42. package/catalog/project-source/src/lib/static-batch/mutation-watch.ts +149 -0
  43. package/catalog/project-source/src/lib/static-batch/shadow-cache.ts +171 -0
  44. package/catalog/project-source/src/tools/bake-module.tool.ts +139 -0
  45. package/catalog/project-source/src/tools/bake-preview.tool.ts +475 -0
  46. package/dist/.vite/manifest.json +8304 -0
  47. package/dist/assets/AssetBudgetPanel-J9--TZPU.js +23 -0
  48. package/dist/assets/AudioViewer-CR7333fe.js +1 -0
  49. package/dist/assets/BVHLoader-6bQIXhMX.js +1 -0
  50. package/dist/assets/BufferGeometryUtils-Nz37EVXf.js +1 -0
  51. package/dist/assets/CCDIKSolver-CD7vLpsK.js +1 -0
  52. package/dist/assets/CSS3DRenderer-CL7ABLVK.js +1 -0
  53. package/dist/assets/CanvasSceneViewport-Bpi6gVTC.js +1 -0
  54. package/dist/assets/ColladaLoader-aVOPIsCh.js +3 -0
  55. package/dist/assets/ColorInput-DQBNrW-K.js +1 -0
  56. package/dist/assets/ConvexGeometry-CAzXlPVG.js +1 -0
  57. package/dist/assets/ConvexHull-BINCESFp.js +1 -0
  58. package/dist/assets/CopyShader-BzTUYzf6.js +24 -0
  59. package/dist/assets/DecalGeometry-160KRdfg.js +1 -0
  60. package/dist/assets/EXRLoader-Cdans_oJ.js +1 -0
  61. package/dist/assets/EffectComposer-DQxfsXBZ.js +1 -0
  62. package/dist/assets/EntityModelDocument-Ccvw66N9.js +1 -0
  63. package/dist/assets/EnvironmentAssetDocument-Dg-Qq6O6.js +1 -0
  64. package/dist/assets/FBXLoader-B4MoUtAn.js +1 -0
  65. package/dist/assets/Fbo-Dz-Soul3.js +1 -0
  66. package/dist/assets/FontLoader-CvGoVI5a.js +2 -0
  67. package/dist/assets/GLTFExporter-HgrCle4L.js +1 -0
  68. package/dist/assets/GameplaySessionTimeline-B52W3FVZ.js +1 -0
  69. package/dist/assets/Gltf-UHVWKz65.js +2 -0
  70. package/dist/assets/HDRLoader-THU88oVD.js +5 -0
  71. package/dist/assets/ImageViewer-Tn7s_MnW.js +1 -0
  72. package/dist/assets/InspectorCanvasPreview-CEr_Kxna.js +1 -0
  73. package/dist/assets/InspectorObjectPreview-CVejvLRg.js +1 -0
  74. package/dist/assets/JsonAssetDocument-C7VGcLhu.js +3 -0
  75. package/dist/assets/LineSegments2-CsOpKSiM.js +370 -0
  76. package/dist/assets/MTLLoader-_Xzd4_0p.js +2 -0
  77. package/dist/assets/MarchingCubes-Bsp4wrzd.js +1 -0
  78. package/dist/assets/MeshBVH-BiDHDcu-.js +1 -0
  79. package/dist/assets/ModelAssetDocument-F5GACirk.js +1 -0
  80. package/dist/assets/NonThreeAuthoringBootstrap-C3woOMxX.js +1 -0
  81. package/dist/assets/OBJLoader-BhIC6Hwo.js +5 -0
  82. package/dist/assets/Object3DDocumentViewport-DB7T0NTl.js +2 -0
  83. package/dist/assets/Object3DPreview-DL8oi7Xs.js +2 -0
  84. package/dist/assets/OnlineAssetDetail-C6z9RvYK.js +2 -0
  85. package/dist/assets/OrbitControls-CM3bPray.js +1 -0
  86. package/dist/assets/OrbitControls-DLpayAaK.js +1 -0
  87. package/dist/assets/OrthographicCamera-bQozawrh.js +1 -0
  88. package/dist/assets/PLYLoader-DYQqs5Ik.js +2 -0
  89. package/dist/assets/PerspectiveCamera-CQ2lh01o.js +1 -0
  90. package/dist/assets/PlayBar-BR-Vg3Jb.js +2 -0
  91. package/dist/assets/RGBELoader-BgBcQv8j.js +1 -0
  92. package/dist/assets/RectAreaLightUniformsLib-CMMoWfll.js +1 -0
  93. package/dist/assets/RenderPass-DPrn-Uky.js +1 -0
  94. package/dist/assets/ResolutionPicker-C67vs1F3.js +1 -0
  95. package/dist/assets/RootSelectionOverlay-BZPlxmXU.js +1 -0
  96. package/dist/assets/RoundedBox-BDGBg6QZ.js +1 -0
  97. package/dist/assets/RoundedBoxGeometry-CyUuYPfW.js +1 -0
  98. package/dist/assets/STLLoader-Dyv3lsxY.js +1 -0
  99. package/dist/assets/SelectionBox-D_75KrNW.js +1 -0
  100. package/dist/assets/ShaderPass-QYRpPuFJ.js +1 -0
  101. package/dist/assets/ShadowEditor-DkImwu1Y.js +1 -0
  102. package/dist/assets/SimplifyModifier-C8ayvRzd.js +1 -0
  103. package/dist/assets/SkeletonUtils-Cps8GOC6.js +1 -0
  104. package/dist/assets/Sky-CQKCgYDs.js +154 -0
  105. package/dist/assets/SourceAssetViewer-2SWQoUut.js +12 -0
  106. package/dist/assets/StageHost-BN-IoTef.js +2 -0
  107. package/dist/assets/StoryPreviewMount-DjyxRCXu.js +1 -0
  108. package/dist/assets/TDSLoader-D_T8XJ81.js +1 -0
  109. package/dist/assets/TextGeometry-DOWAEUV0.js +1 -0
  110. package/dist/assets/ThreeBoardDocument-CVncZyIq.js +2 -0
  111. package/dist/assets/ThreeIsolationSceneContent-C8C8whSF.js +1 -0
  112. package/dist/assets/ToolObject3DPreview-BRoDWe4Q.js +1 -0
  113. package/dist/assets/TrackballControls-DfznuQTh.js +1 -0
  114. package/dist/assets/TransientHint-BB1fwrvK.js +1 -0
  115. package/dist/assets/UnrealBloomPass-CR-cS_K5.js +83 -0
  116. package/dist/assets/VideoViewer-C6kocgIU.js +1 -0
  117. package/dist/assets/_commonjsHelpers-D6-XlEtG.js +1 -0
  118. package/dist/assets/active-ingest-CT6jSGhr.js +3 -0
  119. package/dist/assets/adapter-surface-Y37Nzcyw.js +1 -0
  120. package/dist/assets/after-paint-CB4bz1-e.js +1 -0
  121. package/dist/assets/agx-base-srgb-BjWZJgrZ.lut +0 -0
  122. package/dist/assets/agx-look-medium-high-contrast-D5F_ob1L.lut +0 -0
  123. package/dist/assets/agx-look-punchy-dxsnycNs.lut +0 -0
  124. package/dist/assets/animation-clock-CnjZqfJp.js +1 -0
  125. package/dist/assets/asset-budget-asset.menu-Di3KiQCd.js +1 -0
  126. package/dist/assets/asset-budget.action-DCzzcuTh.js +1 -0
  127. package/dist/assets/asset-budget.document-BWU8wnVW.js +1 -0
  128. package/dist/assets/asset-budget.menu-BGZpT_31.js +1 -0
  129. package/dist/assets/asset-editor-persistence-BBaONOJt.js +1 -0
  130. package/dist/assets/asset-loaders-BOy5Ss8k.js +2 -0
  131. package/dist/assets/asset-parse-error-BHMwBRU3.js +3 -0
  132. package/dist/assets/assets-BuSoGjBX.js +1 -0
  133. package/dist/assets/audio-meter-CyiToeUW.js +1 -0
  134. package/dist/assets/audio-unlock.service-CfUgUQVy.js +1 -0
  135. package/dist/assets/audio.utility-C6K6jem8.js +1 -0
  136. package/dist/assets/authoring-CgcOFhGS.js +1 -0
  137. package/dist/assets/autoplay.service-BZBGNSvt.js +1 -0
  138. package/dist/assets/axe-LkjAB6Lv.js +30 -0
  139. package/dist/assets/babylon-authoring-adapter-CL02gWDn.js +1 -0
  140. package/dist/assets/binding-Bmxqznjk.js +1 -0
  141. package/dist/assets/binding-identity-DcTpbvyg.js +1 -0
  142. package/dist/assets/binding-resolver-Dsh-6Vor.js +2 -0
  143. package/dist/assets/blender-emscripten-engine-9ZIRYNhe.js +2 -0
  144. package/dist/assets/blender-node-editor.document-iIDkB9sI.js +1 -0
  145. package/dist/assets/blender-properties-tab-C5CyPydi.js +3 -0
  146. package/dist/assets/blender-runtime-host-BpBwGv7r.js +4 -0
  147. package/dist/assets/blender-runtime-skin-DyQ9B6CR.js +7140 -0
  148. package/dist/assets/blender-runtime.document-lIYhhPtv.js +8 -0
  149. package/dist/assets/blender-timeline.document-77fx96N7.js +1 -0
  150. package/dist/assets/blender-uv-editor.document-fsT7B4gV.js +1 -0
  151. package/dist/assets/blender-version.status-o6dBm3n6.js +1 -0
  152. package/dist/assets/blender-wali-engine-wTOcrOMC.js +2 -0
  153. package/dist/assets/blender.command-BtJeWk-A.js +1 -0
  154. package/dist/assets/blender.keymap-GAQgeklK.js +1 -0
  155. package/dist/assets/blender.status-ujwGU6dU.js +1 -0
  156. package/dist/assets/blender.style-Dcem5f_T.js +1 -0
  157. package/dist/assets/board-guides-DziKSTss.js +1 -0
  158. package/dist/assets/body-marks-h_xDxiDE.js +1 -0
  159. package/dist/assets/bridge.command-o5gDNEwa.js +3 -0
  160. package/dist/assets/browserAll-DeWblVez.js +1 -0
  161. package/dist/assets/build-profiles.document-kW8iw8Xj.js +2 -0
  162. package/dist/assets/build-progress.status-BNRLytg2.js +1 -0
  163. package/dist/assets/build-session-C_sg3CEn.js +9 -0
  164. package/dist/assets/build.action-lYjTLb7K.js +1 -0
  165. package/dist/assets/build.command-DIGgUPU_.js +1 -0
  166. package/dist/assets/build.header-CKajx5U3.js +1 -0
  167. package/dist/assets/build.menu-BdU0QXny.js +1 -0
  168. package/dist/assets/build.service-CbBAyeu3.js +1 -0
  169. package/dist/assets/bus-mixer-CGfWDP3C.js +1 -0
  170. package/dist/assets/camera-KEsKvOL7.js +1 -0
  171. package/dist/assets/camera-runtime.inspector-B7unX4g1.js +1 -0
  172. package/dist/assets/canvas-entry-runtime-SfBxaR9M.js +2 -0
  173. package/dist/assets/capability-coverage-Czas4C18.js +7 -0
  174. package/dist/assets/chrome-trace-YZHMz60-.js +1 -0
  175. package/dist/assets/client-DNXj_opT.js +25 -0
  176. package/dist/assets/clip-planes-CnAI6DZn.js +1 -0
  177. package/dist/assets/collaboration-presence-DLoZ7EA3.js +1 -0
  178. package/dist/assets/collider-Bw0mXlsW.js +1 -0
  179. package/dist/assets/collider-dimensions-9xoFADXN.js +1 -0
  180. package/dist/assets/collision-system-DpNUJRJ3.js +1 -0
  181. package/dist/assets/command-results-CUQD49AB.js +1 -0
  182. package/dist/assets/component-board-registry-DrIa2csL.js +1 -0
  183. package/dist/assets/component-board.service-DCwcUssB.js +2 -0
  184. package/dist/assets/component-board.service-DidCyM4O.js +2 -0
  185. package/dist/assets/component-verbs.command-7xzfjGMZ.js +1 -0
  186. package/dist/assets/component-verbs.service-Bv9jId3q.js +1 -0
  187. package/dist/assets/config-CEZk921y.js +6 -0
  188. package/dist/assets/configurations-DTBMdaTL.js +1 -0
  189. package/dist/assets/connection.status-BifnQdOs.js +1 -0
  190. package/dist/assets/console-bridge-CHcb-xk5.js +1 -0
  191. package/dist/assets/constraint-De8f1Uiq.js +1 -0
  192. package/dist/assets/constraints.inspector-B9U9Yj-u.js +1 -0
  193. package/dist/assets/countdown-timer-CUm74dom.js +1 -0
  194. package/dist/assets/coverage.service-VTX5Mcsx.js +3 -0
  195. package/dist/assets/crash-null-boundary-v3a0uEgw.js +1 -0
  196. package/dist/assets/create-runtime-CVCc1BDx.js +1 -0
  197. package/dist/assets/curve-7Q79VgU4.js +1 -0
  198. package/dist/assets/data-asset-4hjS642k.js +5 -0
  199. package/dist/assets/data-check-core-CQEjuFyt.js +1 -0
  200. package/dist/assets/data-ref-CQI28C0D.js +1 -0
  201. package/dist/assets/debug-bridge-CCohG-d-.js +1 -0
  202. package/dist/assets/debug-registry-Dgvitx8M.js +1 -0
  203. package/dist/assets/defaults-DKiBJCPN.js +1 -0
  204. package/dist/assets/deferred-commands-CEMmvL47.js +1 -0
  205. package/dist/assets/deferred-ingest-play-DCJi_Pgu.js +2 -0
  206. package/dist/assets/design-time-layers-wYgOTgni.js +1 -0
  207. package/dist/assets/design-time-mount-registry-DUpXCg1U.js +1 -0
  208. package/dist/assets/design-time-mount.service-BzY21e1F.js +2 -0
  209. package/dist/assets/design-time-react-mount-DM9WLrF2.js +1 -0
  210. package/dist/assets/dev-build-gDYrq68M.js +1 -0
  211. package/dist/assets/directional-shadow-fit-BVkOKAv2.js +1 -0
  212. package/dist/assets/document-preview-three-Kbg2GCLm.js +1 -0
  213. package/dist/assets/dom-authoring-adapter-CY8C7f4T.js +1 -0
  214. package/dist/assets/draco3d-BBUTcNkz.js +1 -0
  215. package/dist/assets/draco_decoder-DsQ12WqX.wasm +0 -0
  216. package/dist/assets/draco_encoder-2Tcju8Ns.wasm +0 -0
  217. package/dist/assets/edit-mode-audio.service-Bzetwd5B.js +1 -0
  218. package/dist/assets/edit-mode-authoring-B47TfLqu.js +1 -0
  219. package/dist/assets/edit-mode-networking.service-YCX6RRb_.js +1 -0
  220. package/dist/assets/editor-api-BoJIcyZG.js +1 -0
  221. package/dist/assets/editor-port-C_FeBdeV.js +1 -0
  222. package/dist/assets/editor-presentation-activity-C7SNSmTd.js +1 -0
  223. package/dist/assets/entry-adjudication-Cq8Yeb74.js +1 -0
  224. package/dist/assets/environment-capture-7himRh2L.js +1 -0
  225. package/dist/assets/esbuild-BHljloGq.wasm +0 -0
  226. package/dist/assets/events-156d8d12.esm-ErOhDXXB.js +36 -0
  227. package/dist/assets/extend-B-eOccUm.js +36 -0
  228. package/dist/assets/extends-CF3RwP-h.js +1 -0
  229. package/dist/assets/eyedropper-session-bjPXnfeX.js +1 -0
  230. package/dist/assets/fflate.module-DPuTF8aG.js +6 -0
  231. package/dist/assets/filmic-srgb-Ct35FIH6.lut +0 -0
  232. package/dist/assets/first-party-audio-system-DxnGJOER.js +1 -0
  233. package/dist/assets/first-party-navigation-system-CL5Bquub.js +1 -0
  234. package/dist/assets/fork-menu-BoVyw2Wu.js +1 -0
  235. package/dist/assets/frame-debugger-store-D1Mf_5up.js +1 -0
  236. package/dist/assets/frame-delta-D2nsw_Ht.js +1 -0
  237. package/dist/assets/frame-pacing-D5acoOzO.js +1 -0
  238. package/dist/assets/frame-selector-cache-cCeUbcjG.js +1 -0
  239. package/dist/assets/game-DHOZVb-7.js +1 -0
  240. package/dist/assets/game-contract-seams-a5YXejOu.js +1 -0
  241. package/dist/assets/game-css-scope-transform-Eng4wS8E.js +33 -0
  242. package/dist/assets/game-document.service-DbRfx2V0.js +1 -0
  243. package/dist/assets/game-eval.command-D-7Dxbj_.js +2 -0
  244. package/dist/assets/game-input-seams-CIQdetRw.js +1 -0
  245. package/dist/assets/game-loop-CZvXlY00.js +1 -0
  246. package/dist/assets/game-module-access-B2mFxv-i.js +1 -0
  247. package/dist/assets/game.layout-CBASrvQu.js +1 -0
  248. package/dist/assets/gameplay-export-BoKXm51x.js +1 -0
  249. package/dist/assets/gameplay-replay-e5umMlXv.js +1 -0
  250. package/dist/assets/gameplay-rng-trap-CTNhm-UW.js +3 -0
  251. package/dist/assets/gameplay.command-DxcVYX6F.js +1 -0
  252. package/dist/assets/generation-DhwCUHPf.css +1 -0
  253. package/dist/assets/generation-jobs-BQrXbGp_.js +1 -0
  254. package/dist/assets/generation.service-CDIgObuw.js +1 -0
  255. package/dist/assets/generations-DzUogZsM.js +1 -0
  256. package/dist/assets/generations.status-CgOUBCum.js +1 -0
  257. package/dist/assets/hierarchy-marks-BLPfSIym.js +1 -0
  258. package/dist/assets/host-pointer-DbGSCjE9.js +1 -0
  259. package/dist/assets/hosted-asset-materialization-CiIvWkGU.js +2 -0
  260. package/dist/assets/ibl-override-material-BlmCxFKq.js +6 -0
  261. package/dist/assets/index-96FBF1Oj.js +1 -0
  262. package/dist/assets/index-BAWkB0dv.js +1 -0
  263. package/dist/assets/index-BDnS2b6S.js +1 -0
  264. package/dist/assets/index-BHp07vN0.js +2 -0
  265. package/dist/assets/index-BMxv2MNV.js +1 -0
  266. package/dist/assets/index-BP6wv2A0.js +5 -0
  267. package/dist/assets/index-BcCBqgM_.js +952 -0
  268. package/dist/assets/index-Bge9JUr6.js +1 -0
  269. package/dist/assets/index-BjTCPEQ7.js +134 -0
  270. package/dist/assets/index-BncK9THk.js +1 -0
  271. package/dist/assets/index-CJbYy-CF.js +3 -0
  272. package/dist/assets/index-CVCb_ImQ.js +1 -0
  273. package/dist/assets/index-CZd9o7Lu.js +1 -0
  274. package/dist/assets/index-CanA16PU.js +2 -0
  275. package/dist/assets/index-CinJrH5C.js +9 -0
  276. package/dist/assets/index-CtzuWnCS.js +1 -0
  277. package/dist/assets/index-D2fNXpHa.css +1 -0
  278. package/dist/assets/index-DUpHH6JR.js +3120 -0
  279. package/dist/assets/index-DUqP1RMl.js +1 -0
  280. package/dist/assets/index-D_NuPfjr.js +9 -0
  281. package/dist/assets/index-Da9JhEvW.js +25 -0
  282. package/dist/assets/index-DgapqSPi.js +7 -0
  283. package/dist/assets/index-FUuS4qwW.js +562 -0
  284. package/dist/assets/index-GIL7oGEO.js +4894 -0
  285. package/dist/assets/index-IEjydI9d.js +1 -0
  286. package/dist/assets/index-OrYXPk3Z.js +487 -0
  287. package/dist/assets/index-V1R-e5Bd.js +1 -0
  288. package/dist/assets/index-bQE2NA0D.js +1 -0
  289. package/dist/assets/index-gHZae-lw.js +13 -0
  290. package/dist/assets/index-mjWQmGhM.js +1 -0
  291. package/dist/assets/index-nmcBqr7Y.js +1 -0
  292. package/dist/assets/inference-diagnostics-Dhmtfbq_.js +1 -0
  293. package/dist/assets/ingest-BbYMC2vQ.js +1 -0
  294. package/dist/assets/ingest-boot-viewport-D5rI_Kk_.js +1 -0
  295. package/dist/assets/ingest-siblings-Bop2kqVl.js +1 -0
  296. package/dist/assets/ingest-source-persistence-C_6Hiyra.js +1 -0
  297. package/dist/assets/ingest.service-BTDnQfM1.js +1 -0
  298. package/dist/assets/input-manager-DH_hGW6d.js +1 -0
  299. package/dist/assets/input-router-BNQvtIqw.js +1 -0
  300. package/dist/assets/inspect-BZfi3mmo.js +1 -0
  301. package/dist/assets/inspection-CObLhnrs.js +1 -0
  302. package/dist/assets/instance-fork-actions-D3sRzS3K.js +1 -0
  303. package/dist/assets/instances.command-D6UkZNO8.js +1 -0
  304. package/dist/assets/instruments-CKR02Y8I.js +1 -0
  305. package/dist/assets/json-history-resource-BbxllWfV.js +1 -0
  306. package/dist/assets/jsx-runtime-DPjLkJKQ.js +9 -0
  307. package/dist/assets/light-D-_wsKTq.js +1 -0
  308. package/dist/assets/light-camera-factory-CWbbe9gI.js +1 -0
  309. package/dist/assets/lil-gui.module.min-BF55BEwA.js +10 -0
  310. package/dist/assets/live-behaviors-Bxq49Maz.js +1 -0
  311. package/dist/assets/live-gesture-lock-DJbrjOqf.js +1 -0
  312. package/dist/assets/loader-CaF_I7Yt.js +1 -0
  313. package/dist/assets/logger-Dqis-7W1.js +1 -0
  314. package/dist/assets/loop-gate-report-N52EWFGD.js +1 -0
  315. package/dist/assets/matcap-texture-CVfalpWT.js +1 -0
  316. package/dist/assets/material-CpAdjDxn.js +1 -0
  317. package/dist/assets/material-factory-Bz6h__6g.js +1 -0
  318. package/dist/assets/mesh-B3WPtNKO.js +1 -0
  319. package/dist/assets/mesh-shadow-CZnXrw_l.js +1 -0
  320. package/dist/assets/mikktspace.module-DO88SLib.js +1 -0
  321. package/dist/assets/model-asset-sections-CFvvihfx.css +1 -0
  322. package/dist/assets/model-asset-sections.service-CHhFS3ZX.js +1 -0
  323. package/dist/assets/model.layout-BJUEQYUI.js +1 -0
  324. package/dist/assets/models.finder-G2jQgIRu.js +1 -0
  325. package/dist/assets/module-mode-DVBLT9d-.js +2 -0
  326. package/dist/assets/mount-canvas-ingest-root-DDuAWf_C.js +2 -0
  327. package/dist/assets/mount-dom-ingest-root-D_EiBgpn.js +2 -0
  328. package/dist/assets/mount-game-6t9cKNo4.js +1 -0
  329. package/dist/assets/mount-ingest-root-glv2SSWf.js +2 -0
  330. package/dist/assets/mount-manifest-CGVxhmAw.js +1 -0
  331. package/dist/assets/mount-readiness-Ds0HvvLH.js +4 -0
  332. package/dist/assets/mount-three-ingest-root-hrUt9VVU.js +1 -0
  333. package/dist/assets/mounted-authoring-Dmg5xmhP.js +1 -0
  334. package/dist/assets/mounted-story-viewport-source-DjP6RA9U.js +1 -0
  335. package/dist/assets/native-debug-module-CWicoSGD.js +1 -0
  336. package/dist/assets/native-entry-surface-BE8LJNdu.js +1 -0
  337. package/dist/assets/navigation-CIiCx-SM.js +1 -0
  338. package/dist/assets/navmesh-workflow-store-Cmnm57TB.js +1 -0
  339. package/dist/assets/navmesh.menu-CAKiH8PW.js +1 -0
  340. package/dist/assets/navmesh.service-jgDWlgj1.js +1 -0
  341. package/dist/assets/network.utility-CEu5nHf7.js +1 -0
  342. package/dist/assets/object-marks-DwvIEBOK.js +1 -0
  343. package/dist/assets/object3d-authoring-subject-CH5sI2oP.js +1 -0
  344. package/dist/assets/output-DK8waum9.js +195 -0
  345. package/dist/assets/particles-Y626p22p.js +1 -0
  346. package/dist/assets/particles-factory-DnLOHXT8.js +1 -0
  347. package/dist/assets/pasteboard-materialize-BqSS4QzV.js +20 -0
  348. package/dist/assets/pasteboard.action-DU3UHtJG.js +2 -0
  349. package/dist/assets/performance-profiler-D_Jey87L.js +1 -0
  350. package/dist/assets/physics-registry-B2Jkp8e6.js +1 -0
  351. package/dist/assets/physics-registry-CUB9cT9p.js +1 -0
  352. package/dist/assets/pixi-authoring-adapter-CjibysC3.js +1 -0
  353. package/dist/assets/pixi-live-write-target-DuWydlWb.js +1 -0
  354. package/dist/assets/pixi-primitive-DlWbUPN9.js +1 -0
  355. package/dist/assets/pixi-react-root-factory-DYsznYRQ.js +1 -0
  356. package/dist/assets/pixi-story-model-DNkfnWUV.js +1 -0
  357. package/dist/assets/pixi-transform-channels-VjdohT11.js +1 -0
  358. package/dist/assets/play-mode-BFU2PCkG.js +22 -0
  359. package/dist/assets/play.command-BpqqLqkq.js +2 -0
  360. package/dist/assets/playtest-BXIL1JEF.js +1 -0
  361. package/dist/assets/pose-guard-6Osb2cFu.js +1 -0
  362. package/dist/assets/presentation-BPP5pXeQ.js +1 -0
  363. package/dist/assets/product-DFhyARJj.js +1 -0
  364. package/dist/assets/profiler.action-CaXJDp3t.js +1 -0
  365. package/dist/assets/profiler.menu-BIMF6Bi4.js +1 -0
  366. package/dist/assets/profiler.utility-BExw9wBO.js +1 -0
  367. package/dist/assets/project-authoring-session-Bnt6icLr.js +2 -0
  368. package/dist/assets/project-provenance-BoP3nrle.js +1 -0
  369. package/dist/assets/prompt-labels-DSMdM2_B.js +1 -0
  370. package/dist/assets/properties-bone-constraints.inspector-ByT6p7S-.js +1 -0
  371. package/dist/assets/properties-bone.inspector-z4qJwKO5.js +1 -0
  372. package/dist/assets/properties-collection.inspector-D0_3ijWU.js +1 -0
  373. package/dist/assets/properties-constraints.inspector-CESzjuls.js +1 -0
  374. package/dist/assets/properties-data.inspector-hG8Wgyzb.js +1 -0
  375. package/dist/assets/properties-material.inspector-CzY0JCQ6.js +1 -0
  376. package/dist/assets/properties-modifiers.inspector-3dDhwf7g.js +1 -0
  377. package/dist/assets/properties-object.inspector-CiarfxkT.js +1 -0
  378. package/dist/assets/properties-output.inspector-DKJxmKSD.js +1 -0
  379. package/dist/assets/properties-particles.inspector-CCEdYWGm.js +1 -0
  380. package/dist/assets/properties-physics.inspector-B2c0KUyA.js +1 -0
  381. package/dist/assets/properties-render.inspector-Bcm0HLRW.js +1 -0
  382. package/dist/assets/properties-scene.inspector-PIM_eTb_.js +1 -0
  383. package/dist/assets/properties-texture.inspector-CgFlnyr8.js +1 -0
  384. package/dist/assets/properties-view-layer.inspector-DGjF_Aqo.js +1 -0
  385. package/dist/assets/properties-world.inspector-CrMvaRvB.js +1 -0
  386. package/dist/assets/r3f-design-session-D-4yyDO9.js +2 -0
  387. package/dist/assets/r3f-physics-binding-BBo8oma9.js +1 -0
  388. package/dist/assets/r3f-root-factory-z9llD1OU.js +1 -0
  389. package/dist/assets/r3f-source-authoring-adapter-w6Bc60K-.js +13 -0
  390. package/dist/assets/rapier-physics-adapter-CaZqWLu0.js +1 -0
  391. package/dist/assets/rapier-physics-bridge-CMoeVo3Y.js +1 -0
  392. package/dist/assets/react-18-By2b4xR9.js +1 -0
  393. package/dist/assets/react-inspector.service-B_neRnSK.js +1 -0
  394. package/dist/assets/react-root-CEz5NTck.js +1 -0
  395. package/dist/assets/react-story-board-BDDwiE2H.js +1 -0
  396. package/dist/assets/react-three-fiber.esm-CycrbDlA.js +1 -0
  397. package/dist/assets/react-three-rapier.esm-CEfKpvxT.js +1 -0
  398. package/dist/assets/react-world-authoring-adapter-DmrwM3py.js +1 -0
  399. package/dist/assets/realm-services-CobQsq_X.js +1 -0
  400. package/dist/assets/rebind-controller-Dtq19Vb3.js +1 -0
  401. package/dist/assets/recast-navigation.wasm-compat-Dsoa_MD-.js +1 -0
  402. package/dist/assets/reflection-probe-Don-M3Fj.js +1 -0
  403. package/dist/assets/reflection-probe-capture.inspector-CmFUoJCx.js +1 -0
  404. package/dist/assets/register-render-vitals-BiZk29b2.js +1 -0
  405. package/dist/assets/registry-02YZjMNp.js +1 -0
  406. package/dist/assets/relative-path-guard-GiM7Lsz8.js +1 -0
  407. package/dist/assets/render-audio-control-vMRlePWb.js +1 -0
  408. package/dist/assets/render-batch-system-0vq7p0VC.js +1 -0
  409. package/dist/assets/render-census-BrQX_CXv.js +1 -0
  410. package/dist/assets/render-control-Df3yTiyr.js +1 -0
  411. package/dist/assets/render-env-D2IV2x5k.js +1 -0
  412. package/dist/assets/render-features-CPQ_e568.js +1 -0
  413. package/dist/assets/render-seed-DF4JHy7P.js +1 -0
  414. package/dist/assets/render-settings-Bw4W9SYF.js +1 -0
  415. package/dist/assets/render-vitals-BZ5HtvMi.js +1 -0
  416. package/dist/assets/renderer-config-BqG4O8i9.js +1 -0
  417. package/dist/assets/resolve-three-SZE_WWUM.js +702 -0
  418. package/dist/assets/root-seam-contract-Z0VWX3Bk.js +1 -0
  419. package/dist/assets/rrweb-Cd2ifIRP.js +142 -0
  420. package/dist/assets/run-ticks-settled-C4ksViyA.js +1 -0
  421. package/dist/assets/runtime-inspection-l2iFQSsg.js +1 -0
  422. package/dist/assets/scene-capture-BQKzU0NT.js +1 -0
  423. package/dist/assets/scene-capture-CGYF-Viw.js +1 -0
  424. package/dist/assets/scene-document.service-qkDjUrlP.js +2 -0
  425. package/dist/assets/scene-framing-Cat0GtyJ.js +1 -0
  426. package/dist/assets/scene-index-B6BZOHMk.js +1 -0
  427. package/dist/assets/scene-query-C7_N-TpI.js +1 -0
  428. package/dist/assets/schema-kl9-2B_J.js +1 -0
  429. package/dist/assets/sculpt.layout-zJF55yCR.js +1 -0
  430. package/dist/assets/seeded-random-i3mtgBKZ.js +1 -0
  431. package/dist/assets/session-CZ5JPg-z.js +4877 -0
  432. package/dist/assets/setup-audio-S8GQF91f.js +1 -0
  433. package/dist/assets/setup-particles-GCXlnkj_.js +1 -0
  434. package/dist/assets/setup-physics-BeZ7-LKD.js +1 -0
  435. package/dist/assets/setup-renderer-DVXaSGin.js +1587 -0
  436. package/dist/assets/shading.layout-DULYZV6M.js +1 -0
  437. package/dist/assets/sim-clock-CLflx7kg.js +1 -0
  438. package/dist/assets/sky-precompute-worker-ChN7J87v.js +1 -0
  439. package/dist/assets/soft-particle-depth-DGvfQDi1.js +1 -0
  440. package/dist/assets/source-object3d-authoring-adapter-B-L6Ha6f.js +1 -0
  441. package/dist/assets/source-persistence-backend-C-aR-B_Y.js +1 -0
  442. package/dist/assets/spark-renderer-lifecycle-ynWESJcv.js +1 -0
  443. package/dist/assets/spark.module-4pXQoz5d.js +12120 -0
  444. package/dist/assets/stage-invalidation-DBg3C3Ta.js +1 -0
  445. package/dist/assets/stage-keyboard-n-5kKH-m.js +1 -0
  446. package/dist/assets/stage-overlay-set-B9zp2sLB.js +1 -0
  447. package/dist/assets/stage-presence-markers-DiGI6A45.js +1 -0
  448. package/dist/assets/standard-viewport-dressing-CzjAe_0A.js +7 -0
  449. package/dist/assets/state-bridge-DLP1jLRW.js +1 -0
  450. package/dist/assets/state-watch.action-BOvQR2qt.js +1 -0
  451. package/dist/assets/state-watch.menu-CNLvDeeY.js +1 -0
  452. package/dist/assets/state-watch.utility-Bg1tTTQU.js +1 -0
  453. package/dist/assets/static-batch-advisor-B13QEH7d.js +1 -0
  454. package/dist/assets/stats.module-BL02l9NC.js +1 -0
  455. package/dist/assets/story-arg-descriptors-Ek86ExX7.js +1 -0
  456. package/dist/assets/story-capture-_gC8dXV-.js +1 -0
  457. package/dist/assets/story-documents--TDLaPeL.js +3 -0
  458. package/dist/assets/story-documents.service-BiS_YbNQ.js +1 -0
  459. package/dist/assets/story-documents.service-CxOPYJ2j.js +1 -0
  460. package/dist/assets/story-media-presence-BHzk2IV5.js +1 -0
  461. package/dist/assets/story-mount-turn-DFRTj5hi.js +1 -0
  462. package/dist/assets/story-pixi-preview-BUrOJZXS.js +1 -0
  463. package/dist/assets/story-presentation-j2AVN-mK.js +1 -0
  464. package/dist/assets/story-three-preview-BHEDZzcl.js +2 -0
  465. package/dist/assets/structural-ids-Dc-7rEwi.js +1 -0
  466. package/dist/assets/structural-signature-0w-i_ats.js +1 -0
  467. package/dist/assets/surface-content-Dg9Kkazf.js +1 -0
  468. package/dist/assets/surface-state-DaxyruCj.js +3 -0
  469. package/dist/assets/system-adapters-rIC8FSGP.js +1 -0
  470. package/dist/assets/system-runner-DkOjxEBt.js +1 -0
  471. package/dist/assets/system-slot-E2mEdiih.js +1 -0
  472. package/dist/assets/team-playtest.service-DqOinFVA.js +1 -0
  473. package/dist/assets/texture.layout-DASpHVht.js +1 -0
  474. package/dist/assets/three-CDSueJyJ.js +1 -0
  475. package/dist/assets/three-authoring-adapter-CmSQ3Vui.js +1 -0
  476. package/dist/assets/three-authoring.service-iuHLwtf1.js +2 -0
  477. package/dist/assets/three-ingest-runtime-QzDYk6tU.js +1 -0
  478. package/dist/assets/three-projection-core-BmKMZ-nf.js +1 -0
  479. package/dist/assets/three-viewport-presentation-QBQpSdMh.js +1 -0
  480. package/dist/assets/three.module-D396a9Mn.js +3840 -0
  481. package/dist/assets/three.quarks.esm-B1C61jGo.js +1039 -0
  482. package/dist/assets/tools-B_NJsk05.js +1 -0
  483. package/dist/assets/transform-writer-BhBBTx33.js +1 -0
  484. package/dist/assets/transport.header-B-6HQlU2.js +1 -0
  485. package/dist/assets/trigger-volume-BNK2XzPL.js +1 -0
  486. package/dist/assets/tuples-CIQ4Bn1U.js +1 -0
  487. package/dist/assets/tween.module-DciWpAG6.js +1 -0
  488. package/dist/assets/ui-board-document-Bwtt--xp.js +2 -0
  489. package/dist/assets/unexported-game-trap-Dm1JYKHy.js +2 -0
  490. package/dist/assets/unmanaged-root-detector-B8CpbkSN.js +2 -0
  491. package/dist/assets/upstream-pin-BdgRH6ID.js +1 -0
  492. package/dist/assets/use-data-Dzq-MytE.js +1 -0
  493. package/dist/assets/use-live-actor-state-DErbWQWF.js +1 -0
  494. package/dist/assets/use-selection-DbR73-xd.js +1 -0
  495. package/dist/assets/user-data-BB2Of6Ht.js +1 -0
  496. package/dist/assets/utility-view-state-BHypxA33.js +1 -0
  497. package/dist/assets/uv-editing.layout-BEKHxmHw.js +1 -0
  498. package/dist/assets/vgai-shared-fontawesome-CU65D4Ij.js +1 -0
  499. package/dist/assets/vgai-shared-jsx-dev-runtime-DFDKL7fx.js +1 -0
  500. package/dist/assets/vgai-shared-jsx-runtime-DIqBpTut.js +1 -0
  501. package/dist/assets/vgai-shared-react-BT7rMc2H.js +1 -0
  502. package/dist/assets/vgai-shared-react-dom-DFajMqMT.js +1 -0
  503. package/dist/assets/vgai-shared-react-dom-client-S0ozfl6_.js +1 -0
  504. package/dist/assets/vgai-shared-three-Bc5PvpLM.js +1 -0
  505. package/dist/assets/viewport-pick-context-DkawXbEi.js +1 -0
  506. package/dist/assets/viewport-root-presentation-CWsE56K6.js +1 -0
  507. package/dist/assets/viewport-shading-BuA88e_A.js +1 -0
  508. package/dist/assets/viewport-shading-boundary-B_-_gABg.js +82 -0
  509. package/dist/assets/viewport-surface-status-B3om4Kcf.js +1 -0
  510. package/dist/assets/vision_bundle-DX0dWqEa.js +15 -0
  511. package/dist/assets/voxel-surface-DtcsSWRL.js +1 -0
  512. package/dist/assets/wav-encode-D31zWF6O.js +1 -0
  513. package/dist/assets/webgl-frame-capture-FlF9zQmW.js +1 -0
  514. package/dist/assets/webgl-gpu-timer-D3YX7RaD.js +1 -0
  515. package/dist/assets/webworkerAll-CM2o_dnz.js +1 -0
  516. package/dist/assets/worker-UrMcrc5_.js +2 -0
  517. package/dist/assets/world-documents-147tiFZe.js +1 -0
  518. package/dist/assets/world-root-stage-binding-vwTrtBz6.js +1 -0
  519. package/dist/assets/world-state-BWG-IcOd.js +1 -0
  520. package/dist/assets/writer-B-KovzkA.js +5 -0
  521. package/dist/assets/xstate-animation-binding-Brd0NST6.js +1 -0
  522. package/dist/assets/xstate-animation-meta-Q3u9zh_m.js +1 -0
  523. package/dist/assets/xstate-behavior.action-B8UluFBK.js +1 -0
  524. package/dist/assets/xstate-behavior.document-CKAsE45I.js +1 -0
  525. package/dist/assets/xstate-behavior.inspector-vJJyuifc.js +1 -0
  526. package/dist/assets/xstate-behavior.menu-BXbPICIh.js +1 -0
  527. package/dist/assets/xstate-inspection-BsZv8LS9.js +1 -0
  528. package/dist/vgai-shared-react.json +10 -0
  529. package/dist/vgai-shared-three.json +3 -0
  530. package/dist-node/cli.js +9320 -0
  531. package/dist-node/create.js +3239 -0
  532. package/package.json +91 -0
  533. package/presets.mjs +2 -0
  534. package/src/contributions.d.ts +4 -0
  535. package/src/index.ts +38 -0
  536. package/starter/cube.blend +0 -0
  537. package/starter/cube.py +81 -0
  538. package/template/.agents/references/project-manual.md +341 -0
  539. package/template/.agents/skills/editor/SKILL.md +53 -0
  540. package/template/.agents/skills/editor/agents/openai.yaml +4 -0
  541. package/template/.agents/skills/editor/references/editor-control.md +363 -0
  542. package/template/.agents/skills/vgai-3d-models/SKILL.md +64 -0
  543. package/template/.agents/skills/vgai-ingest-existing-game/SKILL.md +112 -0
  544. package/template/.agents/skills/vgai-threejs-authoring/SKILL.md +347 -0
  545. package/template/.agents/skills/vgai-threejs-authoring/agents/openai.yaml +4 -0
  546. package/template/.agents/skills/vgai-threejs-authoring/references/helper-catalog.md +65 -0
  547. package/template/.claude/skills/editor/SKILL.md +53 -0
  548. package/template/.claude/skills/editor/agents/openai.yaml +4 -0
  549. package/template/.claude/skills/editor/references/editor-control.md +363 -0
  550. package/template/.claude/skills/vgai-3d-models/SKILL.md +64 -0
  551. package/template/.claude/skills/vgai-ingest-existing-game/SKILL.md +112 -0
  552. package/template/.claude/skills/vgai-threejs-authoring/SKILL.md +347 -0
  553. package/template/.claude/skills/vgai-threejs-authoring/agents/openai.yaml +4 -0
  554. package/template/.claude/skills/vgai-threejs-authoring/references/helper-catalog.md +65 -0
  555. package/template/.github/copilot-instructions.md +6 -0
  556. package/template/.github/skills/editor/SKILL.md +53 -0
  557. package/template/.github/skills/editor/agents/openai.yaml +4 -0
  558. package/template/.github/skills/editor/references/editor-control.md +363 -0
  559. package/template/.github/skills/vgai-3d-models/SKILL.md +64 -0
  560. package/template/.github/skills/vgai-ingest-existing-game/SKILL.md +112 -0
  561. package/template/.github/skills/vgai-threejs-authoring/SKILL.md +347 -0
  562. package/template/.github/skills/vgai-threejs-authoring/agents/openai.yaml +4 -0
  563. package/template/.github/skills/vgai-threejs-authoring/references/helper-catalog.md +65 -0
  564. package/template/.mcp.json +12 -0
  565. package/template/.vgai/assets.json +1 -0
  566. package/template/.vgai/provenance.json +4 -0
  567. package/template/.volter/tracker/validation/.preset.base.mts +178 -0
  568. package/template/.volter/tracker/validation/preset.mts +186 -0
  569. package/template/.volter/tracker/visualizer/.extension.base.tsx +14 -0
  570. package/template/.volter/tracker/visualizer/extension.tsx +14 -0
  571. package/template/.volter/tracker-config.json +17 -0
  572. package/template/AGENTS.md +176 -0
  573. package/template/CLAUDE.md +1 -0
  574. package/template/DEVLOG.md +20 -0
  575. package/template/IDIOMS.md +118 -0
  576. package/template/LICENSE +30 -0
  577. package/template/README.md +83 -0
  578. package/template/ROADMAP.md +20 -0
  579. package/template/asset-manifest.json +3 -0
  580. package/template/check-idioms.ts +1533 -0
  581. package/template/index.html +18 -0
  582. package/template/manifest-entry-modules-plugin.ts +53 -0
  583. package/template/package.json +62 -0
  584. package/template/public/jsm/libs/basis/basis_transcoder.js +19 -0
  585. package/template/public/jsm/libs/basis/basis_transcoder.wasm +0 -0
  586. package/template/public/jsm/libs/draco/gltf/draco_decoder.js +33 -0
  587. package/template/public/jsm/libs/draco/gltf/draco_decoder.wasm +0 -0
  588. package/template/public/jsm/libs/draco/gltf/draco_encoder.js +33 -0
  589. package/template/public/jsm/libs/draco/gltf/draco_wasm_wrapper.js +116 -0
  590. package/template/public/shaders/daylight-sky.frag.glsl +15 -0
  591. package/template/public/shaders/daylight-sky.vert.glsl +7 -0
  592. package/template/scripts/patch-drei-stats-gl.mjs +35 -0
  593. package/template/server/colyseus-setup.ts +111 -0
  594. package/template/server/loopback.ts +76 -0
  595. package/template/server/main.ts +78 -0
  596. package/template/server/rooms/arena-room.ts +488 -0
  597. package/template/server/rooms/game-room.ts +274 -0
  598. package/template/server/rooms.ts +15 -0
  599. package/template/server/tsconfig.json +19 -0
  600. package/template/src/bot/QaTester.tsx +35 -0
  601. package/template/src/bot/behaviors.ts +203 -0
  602. package/template/src/bot/bot-station.ts +192 -0
  603. package/template/src/bot/tester-run.ts +238 -0
  604. package/template/src/bot/tester-station.ts +193 -0
  605. package/template/src/components/environment/DaylightSky.tsx +54 -0
  606. package/template/src/components/environment/Ground.tsx +129 -0
  607. package/template/src/components/environment/SceneAtmosphere.tsx +14 -0
  608. package/template/src/components/environment/SoftGroundShadow.tsx +62 -0
  609. package/template/src/components/environment/SunShadowFit.tsx +141 -0
  610. package/template/src/contributions/README.md +98 -0
  611. package/template/src/contributions/analytics.analytics.tsx +26 -0
  612. package/template/src/contributions/data.document.tsx +35 -0
  613. package/template/src/contributions/pages.finder.ts +61 -0
  614. package/template/src/contributions/tester.inspector.tsx +64 -0
  615. package/template/src/contributions/use-game-modules.ts +80 -0
  616. package/template/src/data/README.md +17 -0
  617. package/template/src/input.ts +97 -0
  618. package/template/src/lib/audio/capability.json +4 -0
  619. package/template/src/lib/audio/sfx.ts +255 -0
  620. package/template/src/lib/react-root/capability.json +4 -0
  621. package/template/src/lib/react-root/index.ts +20 -0
  622. package/template/src/lib/react-root/react-root-adapter.tsx +57 -0
  623. package/template/src/lib/reflections/ReflectionProbe.tsx +201 -0
  624. package/template/src/lib/reflections/capability.json +4 -0
  625. package/template/src/lib/reflections/index.ts +19 -0
  626. package/template/src/lib/reflections/probe-controller.ts +75 -0
  627. package/template/src/lib/reflections/reflection-probe-registry.ts +402 -0
  628. package/template/src/lib/reflections/volume-reflection-material.ts +416 -0
  629. package/template/src/lib/static-batch/Frozen.tsx +91 -0
  630. package/template/src/lib/static-batch/capability.json +4 -0
  631. package/template/src/lib/static-batch/freeze.ts +579 -0
  632. package/template/src/lib/static-batch/index.ts +44 -0
  633. package/template/src/lib/static-batch/mutation-watch.ts +149 -0
  634. package/template/src/lib/static-batch/shadow-cache.ts +171 -0
  635. package/template/src/main.ts +63 -0
  636. package/template/src/manifest-entry-modules.d.ts +3 -0
  637. package/template/src/prefabs/HeroBox.stories.tsx +23 -0
  638. package/template/src/prefabs/HeroBox.tsx +35 -0
  639. package/template/src/scenes/MainScene.tsx +77 -0
  640. package/template/src/world.tsx +87 -0
  641. package/template/tsconfig.json +35 -0
  642. package/template/tsconfig.node.json +32 -0
  643. package/template/tsconfig.tools.json +22 -0
  644. package/template/validate-asset-content.ts +27 -0
  645. package/template/validate-assets.ts +60 -0
  646. package/template/validate-manifest.ts +55 -0
  647. package/template/vgai.adapter.ts +76 -0
  648. package/template/vgai.project.json +24 -0
  649. package/template/vite.config.ts +247 -0
  650. package/template-dotfiles/gitignore +63 -0
  651. package/workbench/src/media/game-cover.css +83 -0
  652. package/workbench/src/product.contribution.ts +188 -0
  653. package/workbench/src/vgaiGameSkew.ts +276 -0
@@ -0,0 +1 @@
1
+ import{b as t,a as i}from"./blender-properties-tab-C5CyPydi.js";import"./jsx-runtime-DPjLkJKQ.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-GIL7oGEO.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"./three.module-D396a9Mn.js";import"./blender-runtime-host-BpBwGv7r.js";import"./clip-planes-CnAI6DZn.js";const e=[{title:"Modifiers",from:"Modifiers",collection:!0,active:"activeModifier",properties:["name","type","show_viewport","show_render","show_in_editmode","show_on_cage","use_pin_to_last","is_active"],andDeclared:!0}],o={id:"modifier",curated:e},u="selection.inspector",M="Modifiers",w="properties-modifiers",v=80,T="object",A=i(o),D=t(o);export{D as default,w as icon,A as match,v as order,u as point,T as railGroup,M as title};
@@ -0,0 +1 @@
1
+ import{b as t,a as o}from"./blender-properties-tab-C5CyPydi.js";import"./jsx-runtime-DPjLkJKQ.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-GIL7oGEO.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"./three.module-D396a9Mn.js";import"./blender-runtime-host-BpBwGv7r.js";import"./clip-planes-CnAI6DZn.js";const i=[{title:"Transform",properties:["location","lock_location","rotation_quaternion","rotation_axis_angle","rotation_euler","lock_rotation_w","lock_rotation","rotation_mode","scale","lock_scale"]},{title:"Delta Transform",closed:!0,properties:["delta_location","delta_rotation_quaternion","delta_rotation_euler","delta_scale"]},{title:"Relations",closed:!0,properties:["parent","parent_type","parent_bone","parent_bone_head_tail_factor","parent_vertices","use_parent_final_indices","use_camera_lock_parent","track_axis","up_axis","pass_index"]},{title:"Collections",closed:!0,properties:["users_collection"]},{title:"Instancing",closed:!0,properties:["instance_type","use_instance_vertices_rotation","instance_collection","show_instancer_for_viewport","show_instancer_for_render"],sub:[{title:"Scale by Face Size",closed:!0,properties:["use_instance_faces_scale","instance_faces_scale"]}]},{title:"Viewport Display",closed:!0,properties:["show_name","show_axis","show_wire","show_all_edges","show_texture_space","show_in_front","display_type","color","show_bounds","display_bounds_type","display"]},{title:"Shadow Terminator",closed:!0,properties:["shadow_terminator_normal_offset","shadow_terminator_geometry_offset","shadow_terminator_shading_offset"]},{title:"Visibility",closed:!0,properties:["hide_select","hide_surface_pick","hide_viewport","hide_render","visible_camera","visible_shadow","visible_raycast","visible_diffuse","visible_glossy","visible_transmission","visible_volume_scatter","hide_probe_volume","hide_probe_sphere","hide_probe_plane","use_grease_pencil_lights","is_holdout"]},{title:"Line Art",closed:!0,properties:["lineart"]},{title:"Animation",closed:!0,properties:["animation_data"]}],e={id:"object",standing:"object",curated:i},f="selection.inspector",w="Object",v="properties-object",y=70,g="object",k=!0,x=o(e),T=t(e);export{T as default,v as icon,x as match,y as order,f as point,k as railDefault,g as railGroup,w as title};
@@ -0,0 +1 @@
1
+ import{b as t,a as r}from"./blender-properties-tab-C5CyPydi.js";import"./jsx-runtime-DPjLkJKQ.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-GIL7oGEO.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"./three.module-D396a9Mn.js";import"./blender-runtime-host-BpBwGv7r.js";import"./clip-planes-CnAI6DZn.js";const s=[{title:"Format",properties:["resolution_x","resolution_y","resolution_percentage","pixel_aspect_x","pixel_aspect_y","use_border","use_crop_to_border","fps","fps_base"]},{title:"Frame Range",properties:[{from:"Scene",property:"frame_start"},{from:"Scene",property:"frame_end"},{from:"Scene",property:"frame_step"}],sub:[{title:"Time Stretching",closed:!0,properties:["frame_map_old","frame_map_new"]}]},{title:"Stereoscopy",closed:!0,properties:["use_multiview","views_format","views"]},{title:"Output",properties:["save_output","filepath","use_file_extension","use_render_cache","use_overwrite","use_placeholder"],sub:[{title:"Color Management",closed:!0,from:"Image",properties:["color_management"]},{title:"Pixel Density",closed:!0,properties:["ppm_factor","ppm_base"]}]},{title:"Encoding",closed:!0,from:"FFmpeg",when:[{from:"Image",property:"file_format",is:["FFMPEG","XVID","H264","THEORA"]}],properties:["format","use_autosplit"],sub:[{title:"Video",from:"FFmpeg",properties:["codec",{from:"Image",property:"color_depth"},"use_lossless_output","ffmpeg_prores_profile","constant_rate_factor","custom_constant_rate_factor","ffmpeg_preset","gopsize","use_max_b_frames","max_b_frames","video_bitrate","minrate","maxrate","buffersize","muxrate","packetsize"]},{title:"Audio",from:"FFmpeg",properties:["audio_codec","audio_channels","audio_mixrate","audio_volume","audio_bitrate"]}]},{title:"Metadata",closed:!0,properties:["metadata_input","use_stamp_date","use_stamp_time","use_stamp_render_time","use_stamp_frame","use_stamp_frame_range","use_stamp_memory","use_stamp_hostname","use_stamp_camera","use_stamp_lens","use_stamp_scene","use_stamp_marker","use_stamp_filename","use_stamp_sequencer_strip"],sub:[{title:"Note",closed:!0,properties:["use_stamp_note","stamp_note_text"]},{title:"Burn Into Image",closed:!0,properties:["use_stamp","stamp_font_size","stamp_foreground","stamp_background","use_stamp_labels"]}]},{title:"Post Processing",closed:!0,properties:["use_compositing","use_sequencer","dither_intensity"]}],e={id:"output",standing:"any",curated:s},b="selection.inspector",x="Output",y="properties-output",h=20,F="scene",v=r(e),w=t(e);export{w as default,y as icon,v as match,h as order,b as point,F as railGroup,x as title};
@@ -0,0 +1 @@
1
+ import{b as r,a as i}from"./blender-properties-tab-C5CyPydi.js";import"./jsx-runtime-DPjLkJKQ.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-GIL7oGEO.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"./three.module-D396a9Mn.js";import"./blender-runtime-host-BpBwGv7r.js";import"./clip-planes-CnAI6DZn.js";const e=[{from:"Settings",property:"type",is:["HAIR"]}],s=[{title:"Particle Systems",from:"Particle Systems",collection:!0,active:"activeParticleSystem",properties:["name","settings"]},{title:"Emission",from:"Settings",when:[{from:"Settings",property:"is_fluid",is:[!1]}],properties:["count",{from:"Active",property:"seed"},"hair_length","hair_step","frame_start","frame_end","lifetime","lifetime_random"],sub:[{title:"Source",closed:!0,from:"Settings",properties:["emit_from","use_modifier_stack","distribution","use_emit_random","invert_grid","hexagonal_grid","use_even_distribution","userjit","jitter_factor","grid_resolution","grid_random"]}]},{title:"Hair Dynamics",closed:!0,from:"Hair Dynamics",when:e,properties:[{from:"Active",property:"use_hair_dynamics"},"quality","pin_stiffness"],sub:[{title:"Collisions",closed:!0,from:"Hair Collisions",properties:["collision_quality","distance_min","impulse_clamp","collection"]},{title:"Structure",closed:!0,from:"Hair Dynamics",properties:["mass","bending_stiffness",{from:"Settings",property:"bending_random"},"bending_damping"]},{title:"Volume",closed:!0,from:"Hair Dynamics",properties:["air_damping","internal_friction","voxel_cell_size","density_target","density_strength"]}]},{title:"Cache",closed:!0,from:"Active",when:[{from:"Settings",property:"physics_type",isNot:["NO","KEYED"]}],properties:["point_cache"]},{title:"Velocity",closed:!0,from:"Settings",when:[{from:"Settings",property:"physics_type",isNot:["BOIDS"]}],properties:["normal_factor","tangent_factor","tangent_phase","object_align_factor","particle_factor","object_factor","factor_random"]},{title:"Rotation",closed:!0,from:"Settings",when:[{from:"Settings",property:"physics_type",isNot:["BOIDS"]}],properties:["use_rotations","rotation_mode","rotation_factor_random","phase_factor","phase_factor_random","use_dynamic_rotation"],sub:[{title:"Angular Velocity",closed:!0,from:"Settings",properties:["angular_velocity_mode","angular_velocity_factor"]}]},{title:"Physics",closed:!0,from:"Settings",properties:["physics_type","mass","use_multiply_size_mass","keyed_loops",{from:"Active",property:"use_keyed_timing"},"fluid","boids"],sub:[{title:"Forces",from:"Settings",when:[{from:"Settings",property:"physics_type",is:["NEWTON","FLUID"]}],properties:["brownian_factor","drag_factor","damping"]},{title:"Deflection",closed:!0,from:"Settings",when:[{from:"Settings",property:"physics_type",is:["NEWTON","FLUID"]}],properties:["use_size_deflect","use_die_on_collision","collision_collection"]},{title:"Integration",closed:!0,from:"Settings",when:[{from:"Settings",property:"physics_type",is:["NEWTON","FLUID"]}],properties:["integrator","timestep","subframes","use_adaptive_subframes","courant_target"]}]},{title:"Render",closed:!0,from:"Settings",properties:["render_type","particle_size","size_random","material_slot",{from:"Active",property:"parent"}],sub:[{title:"Path",from:"Settings",when:[{from:"Settings",property:"render_type",is:["PATH"]}],properties:["use_hair_bspline","render_step"],sub:[{title:"Timing",closed:!0,from:"Settings",properties:["use_absolute_path_time","path_start","path_end","length_random"]}]},{title:"Object",from:"Settings",when:[{from:"Settings",property:"render_type",is:["OBJECT"]}],properties:["instance_object","use_global_instance","use_rotation_instance","use_scale_instance"]},{title:"Collection",from:"Settings",when:[{from:"Settings",property:"render_type",is:["COLLECTION"]}],properties:["instance_collection","use_whole_collection","use_collection_pick_random","use_global_instance","use_rotation_instance","use_scale_instance"],sub:[{title:"Use Count",closed:!0,from:"Settings",properties:["use_collection_count","instance_weights"]}]},{title:"Extra",closed:!0,from:"Settings",when:[{from:"Settings",property:"render_type",isNot:["NONE"]}],properties:["use_parent_particles","show_unborn","use_dead"]}]},{title:"Viewport Display",closed:!0,from:"Settings",properties:["display_method","display_color","color_maximum","display_percentage","display_step","display_size"]},{title:"Children",closed:!0,from:"Settings",properties:["child_type","child_percent","rendered_child_count","child_length","child_length_threshold",{from:"Active",property:"child_seed"},"virtual_parents","create_long_hair_children","child_size","child_size_random","child_radius","child_roundness"],sub:[{title:"Parting",closed:!0,from:"Settings",when:[{from:"Settings",property:"child_type",is:["INTERPOLATED"]}],properties:["child_parting_factor","child_parting_min","child_parting_max"]},{title:"Clumping",closed:!0,from:"Settings",when:[{from:"Settings",property:"child_type",isNot:["NONE"]}],properties:["use_clump_curve","clump_factor","clump_shape","twist","use_twist_curve"],sub:[{title:"Clump Noise",closed:!0,from:"Settings",properties:["use_clump_noise","clump_noise_size"]}]},{title:"Roughness",closed:!0,from:"Settings",when:[{from:"Settings",property:"child_type",isNot:["NONE"]}],properties:["use_roughness_curve","roughness_1","roughness_1_size","roughness_endpoint","roughness_end_shape","roughness_2","roughness_2_size","roughness_2_threshold"]},{title:"Kink",closed:!0,from:"Settings",when:[{from:"Settings",property:"child_type",isNot:["NONE"]}],properties:["kink","kink_amplitude","kink_amplitude_random","kink_amplitude_clump","kink_axis","kink_axis_random","kink_frequency","kink_shape","kink_extra_steps","kink_flat"]}]},{title:"Hair Shape",closed:!0,from:"Settings",when:e,properties:["shape","root_radius","tip_radius","radius_scale","use_close_tip"]},{title:"Field Weights",closed:!0,from:"Settings",properties:["effector_weights","apply_effector_to_children","effect_hair"]},{title:"Force Field Settings",closed:!0,from:"Settings",properties:["use_self_effect","effector_amount","force_field_1","force_field_2"]},{title:"Vertex Groups",closed:!0,from:"Active",properties:["vertex_group_density","invert_vertex_group_density","vertex_group_length","invert_vertex_group_length","vertex_group_clump","invert_vertex_group_clump","vertex_group_kink","invert_vertex_group_kink","vertex_group_roughness_1","invert_vertex_group_roughness_1","vertex_group_roughness_2","invert_vertex_group_roughness_2","vertex_group_roughness_end","invert_vertex_group_roughness_end","vertex_group_twist","invert_vertex_group_twist"]},{title:"Textures",closed:!0,from:"Settings",properties:["texture_slots","active_texture"]},{title:"Animation",closed:!0,from:"Settings",properties:["animation_data"]}],t={id:"particle",curated:s},y="selection.inspector",S="Particles",v="properties-particles",b=90,k="object",x=i(t),w=r(t);export{w as default,v as icon,x as match,b as order,y as point,k as railGroup,S as title};
@@ -0,0 +1 @@
1
+ import{b as i,a as t}from"./blender-properties-tab-C5CyPydi.js";import"./jsx-runtime-DPjLkJKQ.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-GIL7oGEO.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"./three.module-D396a9Mn.js";import"./blender-runtime-host-BpBwGv7r.js";import"./clip-planes-CnAI6DZn.js";const o=[{title:"Rigid Body",from:"Rigid Body",properties:["type"],sub:[{title:"Settings",from:"Rigid Body",properties:["mass","kinematic","enabled"]},{title:"Collisions",from:"Rigid Body",properties:["collision_shape","mesh_source","use_deform"],sub:[{title:"Surface Response",closed:!0,from:"Rigid Body",properties:["friction","restitution"]},{title:"Sensitivity",closed:!0,from:"Rigid Body",properties:["use_margin","collision_margin"]},{title:"Collections",closed:!0,from:"Rigid Body",properties:["collision_collections"]}]},{title:"Dynamics",closed:!0,from:"Rigid Body",when:[{from:"Rigid Body",property:"type",is:["ACTIVE"]}],properties:["linear_damping","angular_damping"],sub:[{title:"Deactivation",closed:!0,from:"Rigid Body",properties:["use_deactivation","use_start_deactivated","deactivate_linear_velocity","deactivate_angular_velocity"]}]}]},{title:"Rigid Body Constraint",from:"Rigid Body Constraint",properties:["type"],sub:[{title:"Settings",from:"Rigid Body Constraint",properties:["enabled","disable_collisions","use_breaking","breaking_threshold"]},{title:"Objects",from:"Rigid Body Constraint",properties:["object1","object2"]},{title:"Override Iterations",closed:!0,from:"Rigid Body Constraint",properties:["use_override_solver_iterations","solver_iterations"]},{title:"Limits",closed:!0,from:"Rigid Body Constraint",properties:[],sub:[{title:"Linear",from:"Rigid Body Constraint",properties:["use_limit_lin_x","limit_lin_x_lower","limit_lin_x_upper","use_limit_lin_y","limit_lin_y_lower","limit_lin_y_upper","use_limit_lin_z","limit_lin_z_lower","limit_lin_z_upper"]},{title:"Angular",from:"Rigid Body Constraint",properties:["use_limit_ang_x","limit_ang_x_lower","limit_ang_x_upper","use_limit_ang_y","limit_ang_y_lower","limit_ang_y_upper","use_limit_ang_z","limit_ang_z_lower","limit_ang_z_upper"]}]},{title:"Motor",closed:!0,from:"Rigid Body Constraint",properties:[],sub:[{title:"Linear",from:"Rigid Body Constraint",properties:["use_motor_lin","motor_lin_target_velocity","motor_lin_max_impulse"]},{title:"Angular",from:"Rigid Body Constraint",properties:["use_motor_ang","motor_ang_target_velocity","motor_ang_max_impulse"]}]},{title:"Springs",closed:!0,from:"Rigid Body Constraint",properties:["spring_type"]}]},{title:"Cloth",from:"Cloth",properties:["quality","time_scale"],sub:[{title:"Physical Properties",from:"Cloth",properties:["mass","air_damping","bending_model"],sub:[{title:"Stiffness",from:"Cloth",properties:["tension_stiffness","compression_stiffness","shear_stiffness","bending_stiffness"]},{title:"Damping",from:"Cloth",properties:["tension_damping","compression_damping","shear_damping","bending_damping"]},{title:"Internal Springs",closed:!0,from:"Cloth",properties:["use_internal_springs","internal_spring_max_length","internal_spring_max_diversion","internal_spring_normal_check","internal_tension_stiffness","internal_compression_stiffness","internal_tension_stiffness_max","internal_compression_stiffness_max","vertex_group_intern"]},{title:"Pressure",closed:!0,from:"Cloth",properties:["use_pressure","uniform_pressure_force","use_pressure_volume","target_volume","pressure_factor","fluid_density","vertex_group_pressure"]}]},{title:"Cache",closed:!0,from:"Cloth Modifier",properties:["point_cache"]},{title:"Shape",closed:!0,from:"Cloth",properties:["vertex_group_mass","pin_stiffness","use_sewing_springs","sewing_force_max","shrink_min","use_dynamic_mesh","rest_shape_key"]},{title:"Collisions",closed:!0,from:"Cloth",properties:["collision_quality"],sub:[{title:"Object Collisions",from:"Cloth Collisions",properties:["use_collision","distance_min","impulse_clamp","vertex_group_object_collisions","collection"]},{title:"Self Collisions",from:"Cloth Collisions",properties:["use_self_collision","self_friction","self_distance_min","self_impulse_clamp"]}]},{title:"Field Weights",closed:!0,from:"Cloth",properties:["effector_weights"]}]},{title:"Soft Body",from:"Soft Body",properties:["collision_collection"],sub:[{title:"Object",closed:!0,from:"Soft Body",properties:["friction","mass","vertex_group_mass"]},{title:"Simulation",closed:!0,from:"Soft Body",properties:["speed"]},{title:"Goal",closed:!0,from:"Soft Body",properties:["use_goal","vertex_group_goal"],sub:[{title:"Strengths",closed:!0,from:"Soft Body",properties:["goal_default","goal_min","goal_max"]},{title:"Settings",closed:!0,from:"Soft Body",properties:["goal_spring","goal_friction"]}]},{title:"Edges",closed:!0,from:"Soft Body",properties:["use_edges","vertex_group_spring","pull","push","damping","plastic","bend","spring_length","use_edge_collision","use_face_collision"],sub:[{title:"Aerodynamics",closed:!0,from:"Soft Body",properties:["aerodynamics_type","aero"]},{title:"Stiffness",closed:!0,from:"Soft Body",properties:["use_stiff_quads","shear"]}]},{title:"Self Collision",closed:!0,from:"Soft Body",properties:["use_self_collision","collision_type","ball_size","ball_stiff","ball_damp"]},{title:"Solver",closed:!0,from:"Soft Body",properties:["step_min","step_max","use_auto_step","error_threshold"],sub:[{title:"Diagnostics",closed:!0,from:"Soft Body",properties:["use_diagnose","use_estimate_matrix"]},{title:"Helpers",closed:!0,from:"Soft Body",properties:["choke","fuzzy"]}]},{title:"Field Weights",closed:!0,from:"Soft Body",properties:["effector_weights"]},{title:"Cache",closed:!0,from:"Soft Body Modifier",properties:["point_cache"]}]},{title:"Force Fields",from:"Force Field",properties:["type"],sub:[{title:"Settings",from:"Force Field",properties:["shape","strength","flow","apply_to_location","apply_to_rotation","source_object","use_smoke_density","falloff_power","use_max_distance","distance_max","texture_mode","texture_nabla","use_object_coords","use_2d_force","guide_free","use_guide_path_add","use_guide_path_weight","guide_clump_amount","guide_clump_shape","guide_minimum"],sub:[{title:"Kink",from:"Force Field",when:[{from:"Force Field",property:"type",is:["GUIDE"]}],properties:["guide_kink_type","guide_kink_axis","guide_kink_frequency","guide_kink_shape","guide_kink_amplitude"]},{title:"Texture",from:"Force Field",when:[{from:"Force Field",property:"type",is:["TEXTURE"]}],properties:["texture"]}]},{title:"Falloff",from:"Force Field",when:[{from:"Force Field",property:"type",isNot:["NONE","GUIDE"]}],properties:["falloff_type"],sub:[{title:"Angular",from:"Force Field",when:[{from:"Force Field",property:"falloff_type",is:["CONE"]}],properties:["radial_falloff","use_radial_min","radial_min","use_radial_max","radial_max"]},{title:"Radial",from:"Force Field",when:[{from:"Force Field",property:"falloff_type",is:["TUBE"]}],properties:["radial_falloff","use_radial_min","radial_min","use_radial_max","radial_max"]}]}]},{title:"Collision",from:"Collision",properties:["use","absorption"],sub:[{title:"Particle",from:"Collision",properties:["permeability","stickiness","use_particle_kill","damping_factor","damping_random","friction_factor","friction_random"]},{title:"Softbody & Cloth",from:"Collision",properties:["damping","thickness_outer","thickness_inner","cloth_friction","use_culling","use_normal"]}]},{title:"Fluid",from:"Fluid",properties:["fluid_type","domain_settings","flow_settings","effector_settings"]},{title:"Dynamic Paint",from:"Dynamic Paint",properties:["ui_type","canvas_settings","brush_settings"]}],e={id:"physics",curated:o},y="selection.inspector",h="Physics",b="properties-physics",C=100,B="object",x=t(e),S=i(e);export{S as default,b as icon,x as match,C as order,y as point,B as railGroup,h as title};
@@ -0,0 +1 @@
1
+ import{b as i,a as o}from"./blender-properties-tab-C5CyPydi.js";import"./jsx-runtime-DPjLkJKQ.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-GIL7oGEO.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"./three.module-D396a9Mn.js";import"./blender-runtime-host-BpBwGv7r.js";import"./clip-planes-CnAI6DZn.js";const e=["BLENDER_EEVEE"],t=["BLENDER_WORKBENCH"],s=[{title:"Render Engine",properties:["engine"]},{title:"Sampling",engine:e,from:"EEVEE",properties:[],sub:[{title:"Viewport",from:"EEVEE",properties:["taa_samples","use_taa_reprojection","use_shadow_jitter_viewport"]},{title:"Render",from:"EEVEE",properties:["taa_render_samples"]},{title:"Shadows",closed:!0,from:"EEVEE",properties:["use_shadows","shadow_ray_count","shadow_step_count","use_volumetric_shadows","volumetric_shadow_samples","shadow_resolution_scale"]},{title:"Advanced",closed:!0,from:"EEVEE",properties:["light_threshold"]}]},{title:"Light Paths",closed:!0,engine:e,from:"EEVEE",properties:[],sub:[{title:"Clamping",from:"EEVEE",properties:[],sub:[{title:"Surface",from:"EEVEE",properties:["clamp_surface_direct","clamp_surface_indirect"]},{title:"Volume",from:"EEVEE",properties:["clamp_volume_direct","clamp_volume_indirect"]}]},{title:"Intensity",from:"EEVEE",properties:["direct_light_intensity","indirect_light_intensity"]}]},{title:"Raytracing",closed:!0,engine:e,from:"EEVEE",properties:["use_raytracing","ray_tracing_method",{from:"Raytracing",property:"resolution_scale"}],sub:[{title:"Screen Tracing",closed:!0,from:"Raytracing",properties:["screen_trace_quality","screen_trace_thickness","use_backface_hit","backface_radiance_scale"]},{title:"Denoising",closed:!0,from:"Raytracing",properties:["use_denoise","denoise_spatial","denoise_temporal","denoise_bilateral"]},{title:"Fast GI Approximation",closed:!0,from:"EEVEE",properties:["use_fast_gi",{from:"Raytracing",property:"trace_max_roughness"},"fast_gi_method","fast_gi_resolution","fast_gi_ray_count","fast_gi_step_count","fast_gi_quality","fast_gi_distance","fast_gi_thickness_near","fast_gi_bias"]}]},{title:"Volumes",closed:!0,engine:e,from:"EEVEE",properties:["volumetric_tile_size","volumetric_samples","volumetric_sample_distribution","volumetric_ray_depth"],sub:[{title:"Custom Range",closed:!0,from:"EEVEE",properties:["use_volume_custom_range","volumetric_start","volumetric_end"]}]},{title:"Depth of Field",closed:!0,engine:e,from:"EEVEE",properties:["bokeh_max_size","bokeh_threshold","bokeh_neighbor_max","use_bokeh_jittered","bokeh_overblur"]},{title:"Motion Blur",closed:!0,engine:e,properties:["use_motion_blur","motion_blur_position","motion_blur_shutter",{from:"EEVEE",property:"motion_blur_depth_scale"},{from:"EEVEE",property:"motion_blur_max"},{from:"EEVEE",property:"motion_blur_steps"}]},{title:"Film",closed:!0,engine:e,properties:["filter_size","film_transparent",{from:"EEVEE",property:"use_overscan"},{from:"EEVEE",property:"overscan_size"}]},{title:"Performance",closed:!0,engine:e,properties:["use_high_quality_normals","anisotropic_filter"],sub:[{title:"Compositor",closed:!0,properties:["compositor_device","compositor_precision"],sub:[{title:"Denoise Nodes",closed:!0,properties:["compositor_denoise_device","compositor_denoise_preview_quality","compositor_denoise_final_quality"]}]},{title:"Memory",closed:!0,from:"EEVEE",properties:["shadow_pool_size","gi_irradiance_pool_size"]},{title:"Viewport",closed:!0,properties:["preview_pixel_size"]}]},{title:"Sampling",engine:t,from:"Workbench",properties:["render_aa","viewport_aa"]},{title:"Lighting",engine:t,from:"Workbench Shading",properties:["light","studio_light","use_world_space_lighting","studiolight_rotate_z"]},{title:"Object Color",engine:t,from:"Workbench Shading",properties:["color_type","single_color"]},{title:"Options",engine:t,from:"Workbench Shading",properties:["show_backface_culling","show_object_outline","object_outline_color","show_specular_highlight","show_xray","xray_alpha","show_shadows","shadow_intensity","use_dof","show_cavity","cavity_type","cavity_ridge_factor","cavity_valley_factor","curvature_ridge_factor","curvature_valley_factor"]},{title:"Film",closed:!0,engine:t,properties:["film_transparent"]},{title:"Grease Pencil",closed:!0,from:"Grease Pencil",properties:[],sub:[{title:"Viewport",closed:!0,from:"Grease Pencil",properties:["antialias_threshold"]},{title:"Render",closed:!0,from:"Grease Pencil",properties:["antialias_threshold_render","aa_samples","motion_blur_steps"]}]},{title:"Simplify",closed:!0,properties:["use_simplify"],sub:[{title:"Viewport",properties:["simplify_subdivision","simplify_child_particles","simplify_volumes","use_simplify_normals"]},{title:"Render",properties:["simplify_subdivision_render","simplify_child_particles_render"]}]},{title:"Color Management",closed:!0,from:"View Settings",properties:[{from:"Display Device",property:"display_device"},"view_transform","look","exposure","gamma"],sub:[{title:"White Balance",closed:!0,from:"View Settings",properties:["use_white_balance","white_balance_temperature","white_balance_tint"]},{title:"Curves",closed:!0,from:"View Settings",properties:["use_curve_mapping","curve_mapping"]},{title:"Advanced",closed:!0,from:"Display Device",properties:["emulation"]}]}],r={id:"render",standing:"any",curated:s},y="selection.inspector",b="Render",v="properties-render",w=10,V="scene",R=o(r),k=i(r);export{k as default,v as icon,R as match,w as order,y as point,V as railGroup,b as title};
@@ -0,0 +1 @@
1
+ import{b as t,a as i}from"./blender-properties-tab-C5CyPydi.js";import"./jsx-runtime-DPjLkJKQ.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-GIL7oGEO.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"./three.module-D396a9Mn.js";import"./blender-runtime-host-BpBwGv7r.js";import"./clip-planes-CnAI6DZn.js";const o=[{title:"Scene",properties:["camera","background_set","active_clip"]},{title:"Units",closed:!0,from:"Units",properties:["system","scale_length","use_separate","system_rotation","length_unit","mass_unit","time_unit","temperature_unit"]},{title:"Gravity",closed:!0,properties:["use_gravity","gravity"]},{title:"Simulation",closed:!0,properties:["use_custom_simulation_range","simulation_frame_start","simulation_frame_end"]},{title:"Keying Sets",closed:!0,properties:["keying_sets"]},{title:"Audio",closed:!0,properties:["audio_volume","audio_distance_model","audio_doppler_speed","audio_doppler_factor"]},{title:"Rigid Body World",closed:!0,from:"Rigid Body World",properties:["enabled"],sub:[{title:"Settings",from:"Rigid Body World",properties:["collection","constraints","time_scale","use_split_impulse","substeps_per_frame","solver_iterations"]},{title:"Cache",closed:!0,from:"Rigid Body World",properties:["point_cache"]},{title:"Field Weights",closed:!0,from:"Rigid Body World",properties:["effector_weights"]}]},{title:"Light Probes",closed:!0,from:"EEVEE",engine:["BLENDER_EEVEE"],properties:["gi_cubemap_resolution"]},{title:"Animation",closed:!0,properties:["animation_data"]}],e={id:"scene",standing:"any",curated:o},y="selection.inspector",b="Scene",E="properties-scene",h=40,B="scene",R=i(e),S=t(e);export{S as default,E as icon,R as match,h as order,y as point,B as railGroup,b as title};
@@ -0,0 +1 @@
1
+ import{b as o,a as i}from"./blender-properties-tab-C5CyPydi.js";import"./jsx-runtime-DPjLkJKQ.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-GIL7oGEO.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"./three.module-D396a9Mn.js";import"./blender-runtime-host-BpBwGv7r.js";import"./clip-planes-CnAI6DZn.js";const e=r=>[{from:"Texture",property:"type",is:[r]},{from:"Texture",property:"use_nodes",is:[!1]}],s=[{title:"Texture",from:"Texture",properties:["type","use_nodes","node_tree"]},{title:"Clouds",from:"Texture",when:e("CLOUDS"),properties:["noise_basis","noise_type","cloud_type","noise_scale","noise_depth","nabla"]},{title:"Wood",from:"Texture",when:e("WOOD"),properties:["noise_basis","wood_type","noise_basis_2","noise_type","noise_scale","turbulence","nabla"]},{title:"Marble",from:"Texture",when:e("MARBLE"),properties:["noise_basis","marble_type","noise_basis_2","noise_type","noise_scale","noise_depth","turbulence","nabla"]},{title:"Magic",from:"Texture",when:e("MAGIC"),properties:["noise_depth","turbulence"]},{title:"Blend",from:"Texture",when:e("BLEND"),properties:["progression","use_flip_axis"]},{title:"Stucci",from:"Texture",when:e("STUCCI"),properties:["noise_basis","stucci_type","noise_type","noise_scale","turbulence"]},{title:"Image",from:"Texture",when:e("IMAGE"),properties:["image","image_user"],sub:[{title:"Alpha",closed:!0,from:"Texture",properties:["use_alpha","use_calculate_alpha","invert_alpha"]},{title:"Sampling",closed:!0,from:"Texture",properties:["use_interpolation","filter_size"]},{title:"Mapping",closed:!0,from:"Texture",properties:["use_flip_axis","extension","repeat_x","repeat_y","use_mirror_x","use_mirror_y","checker_distance","use_checker_even","use_checker_odd"],sub:[{title:"Crop",closed:!0,from:"Texture",properties:["crop_min_x","crop_min_y","crop_max_x","crop_max_y"]}]}]},{title:"Musgrave",from:"Texture",when:e("MUSGRAVE"),properties:["noise_basis","musgrave_type","noise_scale","nabla","dimension_max","lacunarity","octaves","offset","noise_intensity","gain"]},{title:"Voronoi",from:"Texture",when:e("VORONOI"),properties:["distance_metric","minkovsky_exponent","color_mode","noise_intensity","noise_scale","nabla"],sub:[{title:"Feature Weights",from:"Texture",properties:["weight_1","weight_2","weight_3","weight_4"]}]},{title:"Distorted Noise",from:"Texture",when:e("DISTORTED_NOISE"),properties:["noise_basis","noise_distortion","distortion","noise_scale","nabla"]},{title:"Mapping",from:"User",properties:["texture_coords","object","uv_layer","mapping","mapping_x","mapping_y","mapping_z","offset","scale"]},{title:"Influence",closed:!0,from:"User",properties:["blend_type","color"]},{title:"Colors",closed:!0,from:"Texture",properties:["use_clamp","factor_red","factor_green","factor_blue","intensity","contrast","saturation"],sub:[{title:"Color Ramp",closed:!0,from:"Texture",properties:["use_color_ramp","color_ramp"]}]},{title:"Animation",closed:!0,from:"Texture",properties:["animation_data"]}],t={id:"texture",curated:s},h="selection.inspector",y="Texture",g="properties-texture",w=160,M="texture",C=i(t),A=o(t);export{A as default,g as icon,C as match,w as order,h as point,M as railGroup,y as title};
@@ -0,0 +1 @@
1
+ import{b as s,a as t}from"./blender-properties-tab-C5CyPydi.js";import"./jsx-runtime-DPjLkJKQ.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-GIL7oGEO.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"./three.module-D396a9Mn.js";import"./blender-runtime-host-BpBwGv7r.js";import"./clip-planes-CnAI6DZn.js";const r=[{title:"View Layer",properties:["use",{from:"Render",property:"use_single_layer"}]},{title:"Passes",properties:[],sub:[{title:"Data",engine:["BLENDER_EEVEE"],properties:["use_pass_combined","use_pass_z","use_pass_mist","use_pass_normal","use_pass_position","use_pass_vector","use_pass_grease_pencil"]},{title:"Data",engine:["BLENDER_WORKBENCH"],properties:["use_pass_combined","use_pass_z","use_pass_grease_pencil"]},{title:"Light",engine:["BLENDER_EEVEE"],properties:["use_pass_diffuse_direct","use_pass_diffuse_color","use_pass_glossy_direct","use_pass_glossy_color",{from:"EEVEE",property:"use_pass_volume_direct"},"use_pass_emit","use_pass_environment","use_pass_shadow","use_pass_ambient_occlusion",{from:"EEVEE",property:"use_pass_transparent"},{from:"EEVEE",property:"ambient_occlusion_distance"}]},{title:"Cryptomatte",closed:!0,properties:["use_pass_cryptomatte_object","use_pass_cryptomatte_material","use_pass_cryptomatte_asset","pass_cryptomatte_depth"]},{title:"Shader AOV",closed:!0,properties:["aovs"]},{title:"Light Groups",closed:!0,properties:["lightgroups"]}]},{title:"Filter",closed:!0,properties:["use_sky","use_solid","use_strand","use_volumes","use_grease_pencil","use_motion_blur"]},{title:"Override",closed:!0,properties:["material_override","world_override","samples"]}],e={id:"view_layer",standing:"any",curated:r},g="selection.inspector",b="View Layer",f="properties-view-layer",v=30,V="scene",h=t(e),L=s(e);export{L as default,f as icon,h as match,v as order,g as point,V as railGroup,b as title};
@@ -0,0 +1 @@
1
+ import{b as t,a as o}from"./blender-properties-tab-C5CyPydi.js";import"./jsx-runtime-DPjLkJKQ.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-GIL7oGEO.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"./three.module-D396a9Mn.js";import"./blender-runtime-host-BpBwGv7r.js";import"./clip-planes-CnAI6DZn.js";const r=[{title:"Surface",engine:["BLENDER_EEVEE"],properties:["use_nodes","node_tree"]},{title:"Volume",closed:!0,engine:["BLENDER_EEVEE"],properties:["use_eevee_finite_volume"]},{title:"Mist Pass",closed:!0,from:"Mist",engine:["BLENDER_EEVEE"],properties:["start","depth","falloff"]},{title:"Settings",closed:!0,engine:["BLENDER_EEVEE"],properties:[],sub:[{title:"Light Probe",properties:["probe_resolution"]},{title:"Sun",properties:["sun_threshold","sun_angle"],sub:[{title:"Shadow",closed:!0,properties:["use_sun_shadow","use_sun_shadow_jitter","sun_shadow_jitter_overblur","sun_shadow_filter_radius","sun_shadow_maximum_resolution"]}]}]},{title:"Viewport Display",closed:!0,properties:["color"]},{title:"Animation",closed:!0,properties:["animation_data"]}],e={id:"world",standing:"any",curated:r},b="selection.inspector",f="World",w="properties-world",g=50,D="scene",V=o(e),B=t(e);export{B as default,w as icon,V as match,g as order,b as point,D as railGroup,f as title};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/r3f-source-authoring-adapter-w6Bc60K-.js","assets/index-GIL7oGEO.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/three.module-D396a9Mn.js","assets/index-D2fNXpHa.css","assets/live-gesture-lock-DJbrjOqf.js","assets/writer-B-KovzkA.js","assets/three-projection-core-BmKMZ-nf.js","assets/three-CDSueJyJ.js","assets/viewport-pick-context-DkawXbEi.js","assets/inference-diagnostics-Dhmtfbq_.js","assets/instance-fork-actions-D3sRzS3K.js","assets/r3f-physics-binding-BBo8oma9.js","assets/object3d-authoring-subject-CH5sI2oP.js","assets/user-data-BB2Of6Ht.js","assets/object-marks-DwvIEBOK.js"])))=>i.map(i=>d[i]);
2
+ import{ft as Me,aj as Ae,g2 as Ce,_ as Ee,fl as Pe,V as $,p as le,bu as de,ju as xe,df as ue,jv as Fe,jw as Ie,bv as je,bw as De,aF as Be,bY as pe,db as He,jx as Le}from"./index-GIL7oGEO.js";import{p as Ve,B as fe,q as ye}from"./edit-mode-authoring-B47TfLqu.js";import{a as Ge}from"./entry-adjudication-Cq8Yeb74.js";import{a as Oe}from"./realm-services-CobQsq_X.js";import{p as _e}from"./scene-framing-Cat0GtyJ.js";import{installNativeDebugBindings as ze,installNativeSystemsBindings as We,nativeDebugBindingFromEntryModule as qe,nativeSystemsBindingFromEntryModule as Ue}from"./native-debug-module-CWicoSGD.js";import{createAssetCache as Ne}from"./assets-BuSoGjBX.js";import{createGameLoop as Qe}from"./game-loop-CZvXlY00.js";import{registerThreeRoot as Je}from"./create-runtime-CVCc1BDx.js";import{createGame as Ke}from"./game-DHOZVb-7.js";import{C as me,a0 as ee,w as Xe,T as Ye}from"./three.module-D396a9Mn.js";import{w as Ze,l as ke}from"./live-gesture-lock-DJbrjOqf.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./r3f-root-factory-z9llD1OU.js";import"./register-render-vitals-BiZk29b2.js";import"./render-census-BrQX_CXv.js";import"./structural-signature-0w-i_ats.js";import"./render-vitals-BZ5HtvMi.js";import"./static-batch-advisor-B13QEH7d.js";import"./webgl-frame-capture-FlF9zQmW.js";import"./world-state-BWG-IcOd.js";import"./debug-registry-Dgvitx8M.js";import"./frame-selector-cache-cCeUbcjG.js";import"./dev-build-gDYrq68M.js";import"./game-input-seams-CIQdetRw.js";import"./seeded-random-i3mtgBKZ.js";import"./render-seed-DF4JHy7P.js";import"./frame-delta-D2nsw_Ht.js";import"./events-156d8d12.esm-ErOhDXXB.js";import"./index-bQE2NA0D.js";import"./canvas-entry-runtime-SfBxaR9M.js";import"./three-ingest-runtime-QzDYk6tU.js";import"./EffectComposer-DQxfsXBZ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-QYRpPuFJ.js";import"./CSS3DRenderer-CL7ABLVK.js";import"./native-entry-surface-BE8LJNdu.js";import"./playtest-BXIL1JEF.js";import"./game-contract-seams-a5YXejOu.js";import"./loader-CaF_I7Yt.js";import"./frame-pacing-D5acoOzO.js";import"./adapter-surface-Y37Nzcyw.js";import"./binding-Bmxqznjk.js";import"./setup-renderer-DVXaSGin.js";import"./index-BcCBqgM_.js";import"./defaults-DKiBJCPN.js";import"./render-settings-Bw4W9SYF.js";import"./render-features-CPQ_e568.js";import"./input-router-BNQvtIqw.js";import"./render-control-Df3yTiyr.js";import"./loop-gate-report-N52EWFGD.js";import"./system-slot-E2mEdiih.js";import"./user-data-BB2Of6Ht.js";import"./object-marks-DwvIEBOK.js";import"./sim-clock-CLflx7kg.js";import"./system-runner-DkOjxEBt.js";import"./performance-profiler-D_Jey87L.js";import"./input-manager-DH_hGW6d.js";import"./asset-parse-error-BHMwBRU3.js";import"./binding-identity-DcTpbvyg.js";import"./prompt-labels-DSMdM2_B.js";import"./schema-kl9-2B_J.js";import"./gameplay-rng-trap-CTNhm-UW.js";import"./state-bridge-DLP1jLRW.js";function et(t,e){const i=()=>{},a=new Set(["dispose","forceContextLoss","forceContextRestore","setAnimationLoop","setSize","setPixelRatio","setDrawingBufferSize"]),p=new Map,S={...e.shadowMap};let v=e.xr.enabled;const b=e.getClearColor(new me);let C=e.getClearAlpha(),M=null,V=0,G=0;const u=e.getViewport(new ee),h=e.getScissor(new ee);let P=e.getScissorTest(),y=!1,x=!1,F=!1;const O=(l,o,s,r,w)=>{typeof o=="number"?l.set(o,s,r,w):l.copy(o)},B=new Proxy(e.xr,{get(l,o){if(o==="enabled")return v;if(o==="setAnimationLoop"||o==="addEventListener"||o==="removeEventListener")return i;const s=Reflect.get(l,o,l);return typeof s=="function"?s.bind(l):s},set(l,o,s){return o==="enabled"?(v=s,!0):Reflect.set(l,o,s,l)}}),q=new Proxy(e.renderLists,{get(l,o){if(o==="dispose")return i;const s=Reflect.get(l,o,l);return typeof s=="function"?s.bind(l):s}});function _(l,o){const s=new Map,r={...e.shadowMap},w=e.xr.enabled,R=e.getClearColor(new me),I=e.getClearAlpha(),J=e.getRenderTarget(),K=e.getActiveCubeFace(),W=e.getActiveMipmapLevel(),U=e.getViewport(new ee),te=e.getScissor(new ee),X=e.getScissorTest();try{for(const[j,N]of p)s.set(j,Reflect.get(e,j)),Reflect.set(e,j,N);return Object.assign(e.shadowMap,S),e.xr.enabled=v,e.setClearColor(b,C),e.setViewport(u),e.setScissor(h),e.setScissorTest(P),e.setRenderTarget(M,V,G),y&&e.setViewport(u),x&&e.setScissor(h),F&&e.setScissorTest(P),l.apply(e,o)}finally{for(const[j,N]of s)Reflect.set(e,j,N);Object.assign(e.shadowMap,r),e.xr.enabled=w,e.setClearColor(R,I),e.setViewport(U),e.setScissor(te),e.setScissorTest(X),e.setRenderTarget(J,K,W)}}const z=new Map;return new Proxy(e,{get(l,o){if(o==="domElement")return t;if(o==="shadowMap")return S;if(o==="xr")return B;if(o==="renderLists")return q;if(a.has(o))return i;if(o==="getRenderTarget")return()=>M;if(o==="getActiveCubeFace")return()=>V;if(o==="getActiveMipmapLevel")return()=>G;if(o==="setRenderTarget")return(r,w=0,R=0)=>{M=r,V=w,G=R,y=x=F=!1};if(o==="getViewport")return r=>r.copy(u);if(o==="getCurrentViewport")return r=>M&&!y?r.copy(M.viewport):(r.copy(u).multiplyScalar(e.getPixelRatio()),y?r.round():r.floor());if(o==="getScissor")return r=>r.copy(h);if(o==="getScissorTest")return()=>P;if(o==="setViewport")return(r,w,R,I)=>{O(u,r,w,R,I),y=!0};if(o==="setScissor")return(r,w,R,I)=>{O(h,r,w,R,I),x=!0};if(o==="setScissorTest")return r=>{P=r,F=!0};if(o==="getClearColor")return r=>r.copy(b);if(o==="getClearAlpha")return()=>C;if(o==="setClearColor")return(r,w=C)=>{b.set(r),C=w};if(o==="setClearAlpha")return r=>{C=r};if(p.has(o))return p.get(o);const s=Reflect.get(l,o,l);if(typeof s!="function")return s;if(!z.has(o)){const r=/^(render|compile|clear|copy|init|readRenderTarget)/.test(String(o));z.set(o,r?(...w)=>{if(!((o==="render"||String(o).startsWith("clear"))&&!M))return _(s,w)}:s.bind(l))}return z.get(o)},set(l,o,s){return o!=="domElement"&&p.set(o,s),!0}})}class tt{pending=new WeakMap;remember(e,i){const a=[...i];a.length===0?this.pending.delete(e):this.pending.set(e,a)}take(e,i){const a=[...i],p=this.pending.get(e)??[];return this.pending.delete(e),a.length>0?a:p}}function he(t){return decodeURIComponent(t.split("?")[0]).replace(/^\/@fs\/(?=[A-Za-z]:\/)/,"").replace(/^\/@fs/,"")}class ot{sources=new Map;applied=new Map;expected=new Map;missingRevision=!1;source(e){this.sources.set(e.file,e)}complete(e){for(const[i,a]of this.sources){const p=e.filter(v=>a.timestamp===v.timestamp);(a.boundaries?a.boundaries.every(v=>p.some(b=>b.acceptedPath===v)):p.some(v=>he(v.acceptedPath)===i))&&(this.applied.set(a.path,a.sha),this.sources.delete(i))}}matches(e){const i=he(e.acceptedPath);return[...this.sources.values()].some(a=>a.timestamp===e.timestamp&&(a.boundaries?a.boundaries.includes(e.acceptedPath):a.file===i))}revision(e){for(const i of e)this.expected.set(i.path,i.sha),i.sha===null&&this.applied.delete(i.path)}needsRemount(){if(this.missingRevision)return!0;for(const[e,i]of this.expected)if(i===null||this.applied.get(e)!==i)return!0;return!1}missing(){this.missingRevision=!0}mounted(){this.expected.clear(),this.applied.clear(),this.sources.clear(),this.missingRevision=!1}}function st(t){return t instanceof Xe||t!==null&&typeof t=="object"&&t.isScene===!0}function nt(t){return t.find(e=>e.surface==="three")?.id??null}const ge=new tt;function rt(t,e,i){return new Error(`three root "${t}" failed to mount: ${e} did not export a RootAdapter or a default React component (exports: ${i.join(", ")||"(nothing)"}).`)}function it(t,e){const i=je(e);return $.error(`[r3f-design] world "${t}" failed to mount: ${i}`,"authoring"),De({worldId:t,kind:"three",identity:"default-three",message:i}),i}async function at(t,e,i,a){const p=await t.loadEntryModule(i,e,"three"),S=a===i?p:await t.loadEntryModule(a,e,"three");return{designModule:p,rootModule:S}}function ct(t,e,i,a,p,S){Je(t,e,i,{id:a}),ze(t,p?[p]:[]),We(t,S?[S]:[])}function lt(t){const e=document.createElement("canvas"),i=et(e,t),a=Ne(),p=Ke({loop:Qe({update:()=>{}}),assets:a});return p.input.setEnabled(!1),{game:p,host:{three:Ye,surface:{canvas:e,width:1280,height:720},renderer:i,assets:a,headless:!1,game:p},dispose:()=>p.dispose()}}function we(t){return{id:t.id,kind:t.surface,adapter:t.adapter,entryOrScenePath:t.entry??t.scene,zOrder:t.zOrder??0,pausable:t.pausable??!0}}function re(t){let e=!1,i=!1;const a=()=>{e||i||t.playState!=="stopped"||(i=!0,ye())},p=t.subscribe(a);return a(),()=>{e=!0,p()}}async function Po(t,e,i){const a=Be();if(!a)return()=>{};const p=await Me();if(t.playState!=="stopped")return re(t);const S=Ve(p);if(!S)return()=>{};const v=nt(Ae(S)),b=v?Ce(S,v):void 0;if(!b)return()=>{};const C=b.world?.entry??b.entry,M=b.world?.export;if(!C||!/\.(tsx|jsx)$/.test(C))return()=>{};const V=Ee(()=>import("./r3f-source-authoring-adapter-w6Bc60K-.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])),G=Pe();let u=!1,h=!1,P=null,y=null,x=!1,F=null,O=!1,B=!1,q,_,z,l=null,o=null;const s=b.id,r=C,w=()=>{o||!l||u||h||t.playState!=="stopped"||(o=l.systemAdapters,pe(o))},R=()=>{o&&(o=null,pe(null))},I=async()=>{const n=await Oe(a.rootPath,He()),{designModule:d,rootModule:f}=await at(n,s,r,b.entry??r),c=qe(s,f),m=Ue(s,f,"three"),g=await Ge(d,s,{...M===void 0?{}:{namedExport:M},entryPath:r});if(!g)throw rt(s,r,Object.keys(d));return M!==void 0?{adapter:g,entryDebug:c,entrySystems:m}:{adapter:g,entryDebug:c,entrySystems:m,components:d.components??d.behaviors}},J=async(n,d,f)=>{const{host:c,game:m,dispose:g}=lt(i);let T;try{T=await n.mount(c)}catch(Z){throw g(),Z}if(T.kind!=="three"||!st(T.scene))throw T.dispose(),g(),new Error(`entry adapter for world "${s}" did not mount a three scene`);return ct(m,n,T,s,d,f),{root:T,game:m,disposeHost:g}},K=n=>{P=n.root,l=n.game,_?.();const d=n.game;_=d.subscribeSystemAdapters?.(()=>{if(l!==d)return;const f=d.systemAdapters;o&&(o=f,Le(f)),t.notifyIngestEdit()}),q=n.disposeHost},W=()=>{R(),_?.(),_=void 0,l=null;try{P?.dispose()}catch(n){$.error(`[r3f-design] dispose failed: ${n}`,"authoring")}P=null;try{q?.()}catch(n){$.error(`[r3f-design] design host dispose failed: ${n}`,"authoring")}q=void 0},U=()=>{if(!x)return;x=!1;const n=F;F=null,n?t.releaseAdoptedScene(n):t.exitPlayScene()},te=()=>{h=!0,U(),W(),e.replaceChild(s,new fe(t,we(b),"R3F design session suspended by play mode — Stop restores it.")),t.notifyIngestEdit()},X=n=>{const d=it(s,n);e.replaceChild(s,new fe(t,we(b),d)),t.notifyIngestEdit()},j=setTimeout(()=>{$.warn(`[r3f-design] world "${s}" is still importing after 20s (${r}). The in-browser compiler or a module download may be stalled on a slow connection — it keeps trying; reload the tab if nothing appears.`,"authoring")},2e4);try{const[n,{R3fSourceAuthoringAdapter:d},f]=await Promise.all([I(),V,G]);if(clearTimeout(j),!n)return $.warn(`[r3f-design] world "${s}" produced no design entry (${r}) — the scene stays empty. This is a bug worth reporting; reload the tab to retry.`,"authoring"),()=>{};if(u)return()=>{};if(t.playState!=="stopped")return re(t);const c=await J(n.adapter,n.entryDebug,n.entrySystems);if(K(c),u||t.playState!=="stopped")return W(),u?()=>{}:re(t);y=new d(t,c.root.scene,{worldId:s,entryPath:r,writeBackend:f,physics:()=>le(l?.systemAdapters.physics)}),e.replaceChild(s,y);const m=ge.take(t,t.selectedEntityIds);t.enterPlayScene(c.root.scene,c.root.rendererConfig),x=!0,F=c.root.scene,t.focusOnScene(()=>_e(null,c.root.scene));const g=m.filter(T=>e.hierarchy.node(T)!==null);g.length>0&&t.selectMultiple(g),de(s),w(),t.notifyIngestEdit(),$.log(`[r3f-design] world "${s}" mounted for design-time authoring (${r})`,"authoring")}catch(n){clearTimeout(j),X(n)}const N=(n,d,f,c,m)=>{const g=performance.now()-d;g<400||console.info(`[r3f-design] world "${n}" remounted in ${g.toFixed(0)}ms (import ${(f-d).toFixed(0)}ms, mount ${(c-f).toFixed(0)}ms, settle ${(m-c).toFixed(0)}ms, adopt ${(performance.now()-m).toFixed(0)}ms)`)},be=async()=>{if(u||h)return;const n=[...t.selectedEntityIds],d=H,f=t.projectHistory?.getSnapshot().busy===!0;let c="importing";const m=setTimeout(()=>{$.warn(`[r3f-design] world "${s}" remount is still ${c} after 20s (${r}) — it keeps trying; reload the tab if nothing appears.`,"authoring")},2e4),g=performance.now();let T=g,Z=g,ae=g;try{const D=await I();if(T=performance.now(),!D||u||h){console.info(`[r3f-design] world "${s}" remount abandoned after import (${D?u?"torn down":"suspended":"no entry"})`);return}c="mounting";const A=await J(D.adapter,D.entryDebug,D.entrySystems);Z=performance.now();for(let E=0;E<50&&(await Ze(),await Se(),!(!ke()&&t.projectHistory?.getSnapshot().busy!==!0));E+=1);if(ae=performance.now(),!u&&!h&&H!==d){A.root.dispose(),A.disposeHost(),L();return}if(u||h){console.info(`[r3f-design] world "${s}" remount abandoned after mount (${u?"torn down":"suspended"})`),A.root.dispose(),A.disposeHost();return}const k=new Set(t.selectedEntityIds);if(U(),W(),K(A),y)y.adoptScene(A.root.scene),e.childAdapters().find(ne=>ne.worldId===s)?.adapter!==y&&(e.replaceChild(s,y),$.log(`[r3f-design] world "${s}" recovered and remounted for design-time authoring (${r})`,"authoring"));else{const[{R3fSourceAuthoringAdapter:E},ne]=await Promise.all([V,G]);y=new E(t,A.root.scene,{worldId:s,entryPath:r,writeBackend:ne,physics:()=>le(l?.systemAdapters.physics)}),e.replaceChild(s,y),$.log(`[r3f-design] world "${s}" recovered and mounted for design-time authoring (${r})`,"authoring")}const $e=k.size>0&&(k.size!==n.length||n.some(E=>!k.has(E)));t.enterPlayScene(A.root.scene,A.root.rendererConfig),x=!0,F=A.root.scene;const ce=($e?[...k]:n).filter(E=>y?.hierarchy.node(E)!==null);ce.length>0&&t.selectMultiple(ce),de(s),w(),t.notifyIngestEdit(),N(s,g,T,Z,ae),Q.mounted(),clearTimeout(Y),B=!1}catch(D){X(D),!B&&!u&&!h?(B=!0,setTimeout(()=>{!u&&!h&&L()},400)):!u&&!h&&(H===d&&!f?ve(D):(B=!1,L()))}finally{clearTimeout(m),!u&&!h&&H!==d&&L()}},Se=async()=>{const n=t.projectHistory;if(!n)return;const d=Date.now()+1e4;for(;n.getSnapshot().busy&&Date.now()<d;)await new Promise(f=>{const c=setTimeout(f,250),m=n.subscribe(()=>{clearTimeout(c),m(),f()})})},ve=async n=>{const d=n instanceof Error?n.message:String(n);if(!d.includes("fiber crashed"))return;if(/Could not load |Failed to fetch|Unexpected token '<'|not valid JSON/.test(d)){$.error(`World "${s}" failed to load a project asset (${d}). The edit is kept; the world remounts once the asset can be served.`,"authoring");return}const f=t.projectHistory;if(!f)return;const c=f.getSnapshot(),m=c.canUndo?c.transactions[c.cursor-1]:void 0;if(!m||Date.now()-m.timestamp>15e3){console.info(`[r3f-design] world "${s}" crash auto-undo skipped (${m?"last edit too old":c.canUndo?"no entry":`cannot undo: busy=${c.busy} blocked=${c.blocked}`})`);return}if(!await f.undo().catch(()=>!1)){console.info(`[r3f-design] world "${s}" crash auto-undo refused by history`);return}B=!1,$.error(`Undid “${m.label}”: that edit crashed world "${s}" (${n instanceof Error?n.message:String(n)}). The previous source is restored.`,"authoring"),L()};let H=0;const Q=new ot;let Y;const L=()=>{if(u||h){console.info(`[r3f-design] world "${s}" remount skipped: ${u?"session torn down":"suspended for play"}`);return}O||(O=!0,setTimeout(()=>{O=!1,be()},80))},Re=xe(()=>{H+=1,L()});let oe=ue()?.revision??0;const Te=Fe(n=>{H+=1;const f=ue()?.revisions.filter(m=>m.revision>oe)??[];f.length!==n-oe&&Q.missing(),oe=n;const c=f.flatMap(m=>m.resources);Q.revision(c),!(c.length&&!Q.needsRemount())&&(clearTimeout(Y),Y=setTimeout(()=>{c.length&&!Q.needsRemount()||(H+=1,L())},2e3))});let ie=!1,se=!1;return z=t.subscribe(()=>{if(!u){if(t.playState==="stopped"?w():R(),!h&&!se&&t.playState!=="stopped"){se=!0,Ie(()=>{se=!1,!(u||h||t.playState==="stopped")&&te()});return}h&&!ie&&t.playState==="stopped"&&(ie=!0,ye())}}),()=>{u=!0,console.info(`[r3f-design] world "${s}" design session torn down`),R(),Re(),Te(),clearTimeout(Y),z?.(),!h&&t.playState==="stopped"&&t.selectedEntityIds.size>0&&ge.remember(t,t.selectedEntityIds),U(),W()}}export{at as loadR3FDesignEntryModules,Po as mountR3FDesignSession,ct as registerR3FDesignRoot,it as reportDesignMountFailure,rt as unresolvedDesignEntryError};
@@ -0,0 +1 @@
1
+ import"./index-GIL7oGEO.js";function n(t,i){return i!=="position"&&i!=="rotation"&&i!=="scale"?!1:t?.physicsBinding?!0:t?.r3fAuthoring?.bodyForwarded?.includes(i)===!0}function u(t,i){const o=t?.physicsBinding;if(!o||i!=="position"&&i!=="rotation"&&i!=="scale")return null;const s=`${t.file.split("/").pop()??t.file}:${o.line}`,r=`${i} is owned by ${o.hook} at ${s}`;return o.forwarded.includes(i)?`${r}, which reads this component's own ${i} prop — write it where the instance is placed, not on this element`:o.literal.includes(i)?`${r} — the body spawns from that hook's own argument, and a hook argument has no write anchor`:`${r} — this node is placed by the simulation, so a ${i} written here is overwritten on the next frame`}export{n as b,u as p};
@@ -0,0 +1 @@
1
+ import{r as s}from"./index-nmcBqr7Y.js";import{registerRenderVitals as k}from"./register-render-vitals-BiZk29b2.js";import{f as I,c as L,a as W,b as _}from"./webgl-frame-capture-FlF9zQmW.js";import{RENDER_SUBMIT_PHASE as B}from"./render-vitals-BZ5HtvMi.js";import{WorldProvider as H}from"./world-state-BWG-IcOd.js";import{g as z}from"./debug-registry-Dgvitx8M.js";import{devBuildEnabled as G}from"./dev-build-gDYrq68M.js";import{wireGameInputSeams as U,DEFAULT_INPUT_MAP_PATH as N}from"./game-input-seams-CIQdetRw.js";import{setHostFrameDelta as V,clearHostFrameDelta as O}from"./frame-delta-D2nsw_Ht.js";import{e as q,c as J,a as K,f as Q,b as D}from"./events-156d8d12.esm-ErOhDXXB.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./render-census-BrQX_CXv.js";import"./structural-signature-0w-i_ats.js";import"./static-batch-advisor-B13QEH7d.js";import"./index-GIL7oGEO.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./three.module-D396a9Mn.js";import"./frame-selector-cache-cCeUbcjG.js";import"./seeded-random-i3mtgBKZ.js";import"./render-seed-DF4JHy7P.js";import"./index-bQE2NA0D.js";class X extends s.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(i){this.props.onError(i)}render(){return this.state.failed?null:this.props.children}}function Y(r,i){const d=s.createElement(i);return{id:r,async mount(e){q(e.three);const o=e.game?z(e.game):null;o&&await U(e,o,{id:r,inputMapPath:N,optionalInputMap:!0});const F=e.surface.canvas,f=J(F);let v;const M=new Promise(t=>{v=t});let R;const S=new Promise(t=>{R=t});function A(){return s.useEffect(R,[]),null}await f.configure({gl:e.renderer,shadows:e.renderer.shadowMap?.enabled??!1,frameloop:"never",size:{width:e.surface.width,height:e.surface.height,top:0,left:0},...e.headless?{}:{events:K},onCreated:t=>v(t)});const b=e.game,h=s.createElement(s.Fragment,null,d,s.createElement(A,{key:"vgai-mount-effects-ready"})),T=b?s.createElement(H,{game:b},h):h,p=await new Promise((t,a)=>{const l=c=>{E(),f.unmount(),o?.strip(r),a(new Error(`three world "${r}": fiber crashed before its first commit — ${c}`))},n=c=>{l(c.message)},w=setTimeout(()=>{E(),f.unmount(),o?.strip(r),a(new Error(`three world "${r}": onCreated did not fire within 10s — the R3F tree never reached its first commit (mount() fails loudly instead of hanging)`))},1e4),E=()=>{clearTimeout(w),typeof window<"u"&&window.removeEventListener("error",n)};typeof window<"u"&&window.addEventListener("error",n),f.render(s.createElement(X,{onError:c=>l(c.message)},T)),Promise.all([M,S]).then(([c])=>{E(),t(c)})});p.clock.autoStart=!1,p.clock.stop();const m=()=>p.get();let g=null;if(!e.headless&&e.game&&G()){if(e.game.profiler.enabled=!0,!o)throw new Error(`three world "${r}": mounted Game has no debug registry.`);g=k({registry:o,worldId:r,profiler:e.game.profiler,scene:m().scene,renderer:e.renderer})}const $=typeof e.renderer.getContext=="function"?e.renderer.getContext():void 0,C=I(e.headless??!1,$),P=C?L(C):null,u=P?W({capture:P,scene:p.scene,memory:()=>_(m().scene,e.renderer.info)}):null,x=o?{debug:o.adapter}:{};u&&(x.renderDebug=u.adapter);let y=0;return{kind:"three",get scene(){return m().scene},get camera(){return m().camera},drivesOwnLoop:!1,updateCadence:"display",systems:x,systemScope:m().scene,update(t){y+=t;const a=m();V(a,t);try{u?.beforeRender();const l=e.game?.profiler;if(!l?.enabled){D(y,!0,a);return}const n=e.renderer.info,w=n?.render.frame??0;l.beginPhase();try{D(y,!0,a)}finally{l.endPhase(B)}n&&l.reportRender({gpuMs:null,drawCalls:n.render.calls,triangles:n.render.triangles,geometries:n.memory.geometries,textures:n.memory.textures,renderPasses:n.render.frame-w})}finally{O(a),u?.afterRender()}},resize(t,a){m().setSize(t,a)},dispose(){u?.dispose(),Q(()=>f.unmount()),g?.dispose(),g=null,o?.strip(r)}}}}}function Z(r,i){const d=r;return typeof d?.default=="function"?Y(i,d.default):null}const xe=(r,i)=>{const d=Z(i.entryModule,r.id);if(d)return{kind:"three",adapter:d};throw new Error(`r3fRootFactory: entry module "${r.entry??"(none)"}" for root "${r.id}" must default-export a React component (\`export default function World() { … }\`).`)};export{xe as r3fRootFactory,Z as resolveR3FEntryAdapter};
@@ -0,0 +1,13 @@
1
+ import{dE as Mt,fE as Lt,aH as fe,lp as Ft,fJ as _,lq as Bt,lr as jt,fI as M,fG as re,eP as ne,ls as B,lt as Dt,d9 as Nt,eH as Wt,bT as ie,bU as oe,dG as j,V as Pe,lu as Re,bV as _t}from"./index-GIL7oGEO.js";import{b as Ht,e as Ae}from"./live-gesture-lock-DJbrjOqf.js";import{f as me,a as ke,i as xe,b as zt,o as Jt,r as Vt,c as Ut}from"./writer-B-KovzkA.js";import{S as Kt,C as Gt,r as qt}from"./three-projection-core-BmKMZ-nf.js";import{w as Xt}from"./inference-diagnostics-Dhmtfbq_.js";import{f as Qt,d as Zt,e as Ee,g as Yt,h as er,j as tr,k as rr,l as Te,m as nr,n as ir}from"./instance-fork-actions-D3sRzS3K.js";import{c as or,T as sr,n as ar}from"./three-CDSueJyJ.js";import{b as cr,p as lr}from"./r3f-physics-binding-BBo8oma9.js";import{object3DAuthoringSubjectOf as Ce}from"./object3d-authoring-subject-CH5sI2oP.js";import{getUserData as ye}from"./user-data-BB2Of6Ht.js";import{r as C,V as m,e as ur,j as dr,ae as hr,Q as Y,u as Me}from"./three.module-D396a9Mn.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"./viewport-pick-context-DkawXbEi.js";import"./object-marks-DwvIEBOK.js";function H(o,e,t){let r=0,n=1;for(;n<e;){const i=o.indexOf(`
2
+ `,r);if(i===-1)return o.length;r=i+1,n+=1}return r+t}function pr(o){return`${o.code}|${o.file}|${o.line}|${o.col}`}function fr(...o){const e=new Set,t=[];for(const r of o)for(const n of r?.diagnostics??[]){const i=pr(n);e.has(i)||(e.add(i),t.push(n))}return t}const Le=["#7dd3fc","#60a5fa","#818cf8","#a78bfa","#c084fc"],Fe=1e3;function ft(o){return o.lod.updateWorldMatrix(!0,!1),o.lod.getWorldPosition(new m)}function Be(o){return Le[o%Le.length]}function mr(o){const e=ft(o),t=[],r=[];return o.lod.levels.forEach((n,i)=>{!Number.isFinite(n.distance)||n.distance<=0||(t.push({kind:"sphere",center:[e.x,e.y,e.z],radius:n.distance,color:Be(i),opacity:.56}),r.push({id:`lod:${encodeURIComponent(o.key)}:${i}`,label:`LOD ${i} distance`,position:[e.x+n.distance,e.y,e.z],color:Be(i),writable:o.writableDistances.has(i)}))}),{id:`lod:${o.key}`,category:"lod",guides:t,handles:r}}function yr(o){return Math.round(o*Fe)/Fe}function mt(o,e,t){const r=o.lod.levels[e-1]?.distance,n=o.lod.levels[e+1]?.distance,i=r===void 0?0:r+.01,s=n===void 0?Number.POSITIVE_INFINITY:Math.max(i,n-.01);return yr(C.clamp(t,i,s))}function je(o,e,t){const r=/^lod:([^:]+):(\d+)$/.exec(e);if(!r)return null;const n=decodeURIComponent(r[1]),i=Number(r[2]),s=o.find(c=>c.key===n);if(!s||!s.writableDistances.has(i))return null;const a=new m(...t).distanceTo(ft(s));return{binding:s,level:i,value:mt(s,i,a)}}function yt(o){const e=o.binding.lod.levels[o.level];e&&(e.distance=o.value)}const gt="#ff9f43",gr="#ffd166",De=1e3;function wr(o){const e=o.system?.emitterShape;return e&&typeof e.type=="string"?e:null}function $e(o){return encodeURIComponent(o.sourceOid)}function wt(o){return[o.x,o.y,o.z]}function br(o,e){return o.emitter.updateWorldMatrix(!0,!1),wt(e.clone().applyMatrix4(o.emitter.matrixWorld))}function b(o,e,t=.72){o.emitter.updateWorldMatrix(!0,!1);const r=o.emitter.matrixWorld;return{kind:"line",points:e.map(n=>wt(n.clone().applyMatrix4(r))),color:gt,opacity:t}}function A(o,e="xy",t=48,r=Math.PI*2){const n=[];for(let i=0;i<=t;i+=1){const s=i/t*r,a=Math.cos(s)*o,c=Math.sin(s)*o;n.push(e==="xy"?new m(a,c,0):e==="xz"?new m(a,0,c):new m(0,a,c))}return n}function Ne(o,e){return o.map(t=>t.clone().applyAxisAngle(new m(0,0,1),e))}function We(o,e,t=24){const r=[];for(let n=0;n<=t;n+=1){const i=n/t*Math.PI,s=Math.cos(i)*o,a=Math.sin(i)*o;r.push(new m(s,0,a))}return r}function P(o,e,t){const r=o[e];return typeof r=="number"&&Number.isFinite(r)?r:t}function vr(o){const e=o.shape,t=P(e,"radius",10),r=C.clamp(P(e,"arc",Math.PI*2),0,Math.PI*2),n=Math.abs(r-Math.PI*2)<.001;switch(e.type){case"point":return[b(o,[new m(-.2,0,0),new m(.2,0,0)]),b(o,[new m(0,-.2,0),new m(0,.2,0)]),b(o,[new m(0,0,-.2),new m(0,0,.2)])];case"sphere":return[b(o,A(t,"xy",48,r)),b(o,A(t,"xz"),.5),b(o,Ne(A(t,"xz"),n?Math.PI/2:r),.5)];case"hemisphere":return[b(o,A(t,"xy",48,r)),b(o,We(t),.55),b(o,Ne(We(t),n?Math.PI/2:r),.55)];case"cone":{const i=P(e,"angle",Math.PI/6),s=Math.max(t,1),a=[b(o,A(t,"xy",48,r))],c=n?[0,Math.PI/2,Math.PI,3*Math.PI/2]:[0,r/3,r*2/3,r];for(const l of c){const u=new m(Math.cos(l)*t,Math.sin(l)*t,0),d=u.clone().add(new m(Math.cos(l)*Math.sin(i),Math.sin(l)*Math.sin(i),Math.cos(i)).multiplyScalar(s));a.push(b(o,[u,d],.58))}return a}case"circle":return[b(o,A(t,"xy",48,r))];case"donut":{const i=P(e,"donutRadius",t*.2);return[b(o,A(Math.max(0,t-i),"xy",48,r),.45),b(o,A(t,"xy",48,r)),b(o,A(t+i,"xy",48,r),.45),b(o,A(i,"xz").map(s=>s.add(new m(t,0,0))),.45)]}case"rectangle":case"grid":{const i=P(e,"width",e.type==="grid"?1:10),s=P(e,"height",e.type==="grid"?1:10),a=i/2,c=s/2,l=[b(o,[new m(-a,-c,0),new m(a,-c,0),new m(a,c,0),new m(-a,c,0),new m(-a,-c,0)])];if(e.type==="grid"){const u=Math.min(16,Math.max(1,Math.round(P(e,"column",10)))),d=Math.min(16,Math.max(1,Math.round(P(e,"row",10))));for(let h=1;h<u;h+=1){const p=-a+h/u*i;l.push(b(o,[new m(p,-c,0),new m(p,c,0)],.24))}for(let h=1;h<d;h+=1){const p=-c+h/d*s;l.push(b(o,[new m(-a,p,0),new m(a,p,0)],.24))}}return l}}}function z(o,e,t,r){return{id:`particle:${$e(o)}:${e}`,label:t,position:br(o,r),color:e==="angle"?gr:gt,writable:o.writableFields.has(e)}}function Or(o){const e=o.shape,t=P(e,"radius",10),r=[];if(["sphere","hemisphere","cone","circle","donut"].includes(e.type)&&r.push(z(o,"radius","Emitter radius",new m(t,0,0))),e.type==="cone"){const n=P(e,"angle",Math.PI/6),i=Math.max(t,1);r.push(z(o,"angle","Cone angle",new m(t+Math.sin(n)*i,0,Math.cos(n)*i)))}return e.type==="donut"&&r.push(z(o,"donutRadius","Donut tube radius",new m(t,0,P(e,"donutRadius",t*.2)))),(e.type==="rectangle"||e.type==="grid")&&r.push(z(o,"width","Emitter width",new m(P(e,"width",1)/2,0,0)),z(o,"height","Emitter height",new m(0,P(e,"height",1)/2,0))),{id:`particle:${$e(o)}`,category:"particles",guides:vr(o),handles:r}}function se(o){return Math.round(o*De)/De}function bt(o,e){return o==="angle"?se(C.clamp(e,.01,Math.PI/2-.01)):o==="arc"?se(C.clamp(e,0,Math.PI*2)):o==="thickness"?se(C.clamp(e,0,1)):o==="column"||o==="row"?Math.max(1,Math.round(e)):se(Math.max(.01,e))}function Sr(o,e){return bt(o,e)}function _e(o,e,t){const r=/^particle:([^:]+):(radius|angle|donutRadius|width|height)$/.exec(e),n=r?o.find(l=>$e(l)===r[1]):void 0,i=r?.[2];if(!n||!i||!n.writableFields.has(i))return null;n.emitter.updateWorldMatrix(!0,!1);const s=n.emitter.worldToLocal(new m(...t)),a=P(n.shape,"radius",10);let c;return i==="radius"?c=n.shape.type==="sphere"||n.shape.type==="hemisphere"?s.length():Math.hypot(s.x,s.y):i==="angle"?c=Math.atan2(Math.max(0,Math.hypot(s.x,s.y)-a),Math.abs(s.z)||.001):i==="donutRadius"?c=Math.abs(s.z):i==="width"?c=Math.abs(s.x)*2:c=Math.abs(s.y)*2,{binding:n,field:i,value:bt(i,c)}}function vt(o){o.binding.shape[o.field]=o.value}const Ot={Light:"light",Material:"material",Camera:"camera",Audio:"audio"};function y(o,e,t,r,n,i=`${Ot[o]}.${t}`,s){return{prop:t,label:r,type:n,group:o,target:e,path:i,...s?{options:s}:{}}}function D(o,e,t){return{prop:o,label:e,type:"asset",group:"Material",target:"material",path:`${Ot.Material}.${o}`,colorSpace:t}}const Pr=[D("map","Base Color Map","srgb"),D("normalMap","Normal Map","linear"),D("roughnessMap","Roughness Map","linear"),D("metalnessMap","Metalness Map","linear"),D("emissiveMap","Emissive Map","srgb"),D("aoMap","Ambient Occlusion Map","linear")];function xr(o){const e=o;return e&&e.isColor?`#${e.getHexString()}`:void 0}const St="vgaiAssetPath",He=new WeakSet,$r=new ur;function Pt(o){const e=o;if(!e||!e.isTexture)return"";const t=e.userData?.[St];if(typeof t=="string"&&t)return t;if(e.name)return e.name;const r=e.image?.src;return typeof r=="string"?r:""}function Ir(o){return/^(?:[a-z]+:|\/)/i.test(o)?o:`/${o}`}function Rr(o,e,t){if(!o)return null;const r=o,n=r[e.prop],i=t==null?"":String(t);if(n&&He.has(n)&&Pt(n)!==i&&n.dispose(),!i)return r[e.prop]=null,o.needsUpdate=!0,"";const s=$r.load(Ir(i));return s.colorSpace=e.colorSpace==="srgb"?dr:hr,s.userData[St]=i,s.name=i,He.add(s),r[e.prop]=s,o.needsUpdate=!0,i}function Ar(o){const e=o,t=[y("Light","self","color","Color","color"),y("Light","self","intensity","Intensity","number")];return(e.isPointLight||e.isSpotLight)&&t.push(y("Light","self","distance","Distance","number"),y("Light","self","decay","Decay","number")),e.isSpotLight&&t.push(y("Light","self","angle","Angle","number"),y("Light","self","penumbra","Penumbra","number")),t}function xt(o){const e=o;return e.isDirectionalLight||e.isPointLight||e.isSpotLight?y("Light","self","castShadow","Cast Shadow","boolean","shadow.cast"):void 0}function kr(o){const e=o,t=[];e.color?.isColor&&t.push(y("Material","material","color","Color","color")),typeof e.roughness=="number"&&t.push(y("Material","material","roughness","Roughness","number")),typeof e.metalness=="number"&&t.push(y("Material","material","metalness","Metalness","number")),e.emissive?.isColor&&t.push(y("Material","material","emissive","Emissive","color")),t.push(y("Material","material","opacity","Opacity","number"),y("Material","material","transparent","Transparent","boolean")),typeof e.wireframe=="boolean"&&t.push(y("Material","material","wireframe","Wireframe","boolean"));const r=o;for(const n of Pr)n.prop in r&&t.push(n);return t}function Er(o){const e=o;return e.isPerspectiveCamera?[y("Camera","self","fov","FOV","number"),y("Camera","self","near","Near","number"),y("Camera","self","far","Far","number"),y("Camera","self","zoom","Zoom","number")]:e.isOrthographicCamera?[y("Camera","self","zoom","Zoom","number"),y("Camera","self","near","Near","number"),y("Camera","self","far","Far","number"),y("Camera","self","left","Left","number"),y("Camera","self","right","Right","number"),y("Camera","self","top","Top","number"),y("Camera","self","bottom","Bottom","number")]:[]}function ee(o){const e=o;return typeof e.getRefDistance=="function"&&typeof e.setRefDistance=="function"&&!!e.panner}function Tr(o="PositionalAudio"){return[y("Audio","self",o==="PositionalAudio"?"distance":"panner-refDistance","Reference Distance","number","audio.refDistance"),y("Audio","self","panner-distanceModel","Distance Model","enum","audio.distanceModel",["inverse","linear","exponential"]),y("Audio","self","panner-rolloffFactor","Rolloff","number","audio.rolloffFactor"),y("Audio","self","panner-maxDistance","Maximum Distance","number","audio.maxDistance"),y("Audio","self","panner-coneInnerAngle","Inner Cone","number","audio.coneInnerAngle"),y("Audio","self","panner-coneOuterAngle","Outer Cone","number","audio.coneOuterAngle"),y("Audio","self","panner-coneOuterGain","Outside Gain","number","audio.coneOuterGain")]}function $t(o,e,t){const r=o,n=[];return r.isLight&&n.push(...Ar(o)),r.isCamera&&n.push(...Er(o)),ee(o)&&n.push(...Tr(t)),e&&n.push(...kr(e)),n}function Z(o,e,t,r){const n=xt(o);return $t(o,e,r).find(i=>i.path===t)??(n?.path===t?n:void 0)}function It(o,e,t){return t.target==="material"?e:o}function J(o,e,t){if(t.group==="Audio"&&ee(o)){const i=o.panner;switch(t.path){case"audio.refDistance":return o.getRefDistance();case"audio.distanceModel":return o.getDistanceModel();case"audio.rolloffFactor":return o.getRolloffFactor();case"audio.maxDistance":return o.getMaxDistance();case"audio.coneInnerAngle":return i.coneInnerAngle;case"audio.coneOuterAngle":return i.coneOuterAngle;case"audio.coneOuterGain":return i.coneOuterGain}}const r=It(o,e,t);if(!r)return;const n=r[t.prop];return t.type==="color"?xr(n):t.type==="asset"?Pt(n):n}function Cr(o,e,t){if(e.path==="audio.distanceModel"){const n=String(t);return n!=="inverse"&&n!=="linear"&&n!=="exponential"?null:(o.setDistanceModel(n),n)}const r=Number(t);if(!Number.isFinite(r))return null;switch(e.path){case"audio.refDistance":return o.setRefDistance(Math.max(.01,r)),Math.max(.01,r);case"audio.rolloffFactor":return o.setRolloffFactor(Math.max(0,r)),Math.max(0,r);case"audio.maxDistance":return o.setMaxDistance(Math.max(o.getRefDistance()+.01,r)),Math.max(o.getRefDistance()+.01,r);case"audio.coneInnerAngle":{const n=Math.max(0,Math.min(o.panner.coneOuterAngle,r));return o.setDirectionalCone(n,o.panner.coneOuterAngle,o.panner.coneOuterGain),n}case"audio.coneOuterAngle":{const n=Math.max(o.panner.coneInnerAngle,Math.min(360,r));return o.setDirectionalCone(o.panner.coneInnerAngle,n,o.panner.coneOuterGain),n}case"audio.coneOuterGain":{const n=Math.max(0,Math.min(1,r));return o.setDirectionalCone(o.panner.coneInnerAngle,o.panner.coneOuterAngle,n),n}default:return null}}function T(o,e,t,r){if(t.group==="Audio"&&ee(o))return Cr(o,t,r);if(t.type==="asset")return Rr(e,t,r);const n=It(o,e,t);if(!n)return null;if(t.type==="color"){const s=String(r);return n[t.prop]?.set(s),s}if(t.type==="boolean"){const s=!!r;return n[t.prop]=s,ze(o,e,t),s}const i=Number(r);return Number.isFinite(i)?(n[t.prop]=i,ze(o,e,t),i):null}function ze(o,e,t){t.group==="Camera"&&o.updateProjectionMatrix?.(),t.target==="material"&&e&&(t.prop==="transparent"||t.prop==="wireframe")&&(e.needsUpdate=!0)}const Je="#42c8ff",Ve="#287fb8",Ue="#ffd166",Ke="#ff9f43",Ge=100;function k(o){return[o.x,o.y,o.z]}function Rt(o){o.updateWorldMatrix(!0,!1);const e=o.getWorldPosition(new m),t=o.getWorldQuaternion(new Y);return{origin:e,forward:new m(0,0,1).applyQuaternion(t).normalize(),right:new m(1,0,0).applyQuaternion(t).normalize()}}function qe(o,e,t,r,n){const i=C.degToRad(n/2);return o.clone().addScaledVector(e,Math.cos(i)*r).addScaledVector(t,Math.sin(i)*r)}function Mr(o,e){if(!ee(o))return null;const{origin:t,forward:r,right:n}=Rt(o),i=o.getRefDistance(),s=o.getMaxDistance(),a=o.getDistanceModel(),c=o.panner.coneInnerAngle,l=o.panner.coneOuterAngle,u=l<359.5,d=Math.max(1,Math.min(8,i*2.5)),h=[{kind:"sphere",center:k(t),radius:i,color:Je,opacity:.75}],p=[{id:"audio-ref-distance",label:"Reference distance",position:k(t.clone().addScaledVector(n,i)),color:Je,writable:e("audio.refDistance")}];return a==="linear"&&(h.push({kind:"sphere",center:k(t),radius:s,color:Ve,opacity:.42,dashed:!0}),p.push({id:"audio-max-distance",label:"Maximum distance",position:k(t.clone().addScaledVector(n,s)),color:Ve,writable:e("audio.maxDistance")})),u&&(h.push({kind:"cone",origin:k(t),direction:k(r),length:d,angle:l,color:Ke,opacity:.72}),p.push({id:"audio-outer-cone",label:"Outer cone angle",position:k(qe(t,r,n,d,l)),color:Ke,writable:e("audio.coneOuterAngle")}),c<359.5&&(h.push({kind:"cone",origin:k(t),direction:k(r),length:d,angle:c,color:Ue,opacity:.58,dashed:!0}),p.push({id:"audio-inner-cone",label:"Inner cone angle",position:k(qe(t,r,n,d,c)),color:Ue,writable:e("audio.coneInnerAngle")}))),{id:"positional-audio",category:"audio",guides:h,handles:p}}function ge(o){return Math.round(o*Ge)/Ge}function Lr(o,e,t,r){if(!ee(o))return null;const{origin:n,forward:i}=Rt(o),a=new m(...r).sub(n);let c,l;switch(t){case"audio-ref-distance":c="audio.refDistance",l=Math.max(.01,ge(a.length()));break;case"audio-max-distance":c="audio.maxDistance",l=Math.max(o.getRefDistance()+.01,ge(a.length()));break;case"audio-inner-cone":case"audio-outer-cone":{c=t==="audio-inner-cone"?"audio.coneInnerAngle":"audio.coneOuterAngle";const d=a.dot(i),h=Math.sqrt(Math.max(0,a.lengthSq()-d*d));l=ge(C.radToDeg(Math.atan2(h,d))*2);break}default:return null}const u=Z(o,null,c,e);return u?{field:u,value:l}:null}function Fr(o,e){T(o,null,e.field,e.value)}const Br="#00e58a",jr="#c77dff",ae=.01,Xe=1e3;function E(o){return Math.round(o*Xe)/Xe}function Dr(o){return[o.x,o.y,o.z]}function At(o){return{center:new m(...o.position),rotation:new Y(...o.rotation)}}function ce(o,e){const{center:t,rotation:r}=At(o);return Dr(new m(...e).applyQuaternion(r).add(t))}function le(o,e){return`collider:${encodeURIComponent(o.sourceOid)}:${e}`}function Nr(o){const{snapshot:e}=o,t=e.sensor?jr:Br,r={color:t,writable:o.writable},n=[],i=[];switch(e.shape.type){case"cuboid":{const s=e.shape.halfExtents;n.push({kind:"box",center:e.position,rotation:e.rotation,halfExtents:s,color:t,opacity:.78});for(const[a,c]of[[0,"X"],[1,"Y"],[2,"Z"]])for(const l of[-1,1]){const u=[0,0,0];u[a]=s[a]*l,i.push({id:le(o,`${a}:${l}`),label:`${c} ${l>0?"positive":"negative"} half extent`,position:ce(e,u),...r})}break}case"ball":n.push({kind:"sphere",center:e.position,radius:e.shape.radius,color:t,opacity:.78}),i.push({id:le(o,"radius"),label:"Collider radius",position:ce(e,[e.shape.radius,0,0]),...r});break;case"capsule":n.push({kind:"capsule",center:e.position,rotation:e.rotation,radius:e.shape.radius,halfHeight:e.shape.halfHeight,color:t,opacity:.78}),i.push({id:le(o,"radius"),label:"Collider radius",position:ce(e,[e.shape.radius,0,0]),...r},{id:le(o,"half-height"),label:"Collider half height",position:ce(e,[0,e.shape.halfHeight+e.shape.radius,0]),...r});break}return{id:`collider:${o.sourceOid}`,category:"colliders",guides:n,handles:i}}function Wr(o){if(!o.startsWith("collider:"))return null;const e=o.slice(9),t=e.indexOf(":");if(t<1)return null;try{return{oid:decodeURIComponent(e.slice(0,t)),part:e.slice(t+1)}}catch{return null}}function _r(o){return o>1e-8?o:1}function Qe(o,e,t){const r=Wr(e),n=r?o.find(u=>u.sourceOid===r.oid):null;if(!n||!r||!n.writable)return null;const{center:i,rotation:s}=At(n.snapshot),a=new m(...t).sub(i).applyQuaternion(s.clone().invert()),c=n.snapshot.shape,l=n.snapshot.scale.map(_r);if(c.type==="cuboid"&&/^[012]:(?:-1|1)$/.test(r.part)){const u=Number(r.part[0]),d=[...c.halfExtents];return d[u]=Math.max(ae,E(Math.abs(a.getComponent(u)))),{sourceOid:n.sourceOid,colliderId:n.snapshot.id,shape:{type:"cuboid",halfExtents:d},args:d.map((h,p)=>E(h/l[p]))}}if(c.type==="ball"&&r.part==="radius"){const u=Math.max(ae,E(a.length()));return{sourceOid:n.sourceOid,colliderId:n.snapshot.id,shape:{type:"ball",radius:u},args:[E(u/l[0])]}}if(c.type==="capsule"){if(r.part==="radius"){const u=Math.max(ae,E(Math.hypot(a.x,a.z)));return{sourceOid:n.sourceOid,colliderId:n.snapshot.id,shape:{...c,radius:u},args:[E(c.halfHeight/l[0]),E(u/l[1])]}}if(r.part==="half-height"){const u=Math.max(ae,E(Math.abs(a.y)-c.radius));return{sourceOid:n.sourceOid,colliderId:n.snapshot.id,shape:{...c,halfHeight:u},args:[E(u/l[0]),E(c.radius/l[1])]}}}return null}const we="#ffb020",Ze=1e3;function Ie(o){return`${o.source.line}:${o.source.col}`}function Ye(o,e){return`joint:${Ie(o)}:${e}`}function Hr(o){const e=o.snapshot,t=[{kind:"line",points:[e.worldAnchor1,e.worldAnchor2],color:we,opacity:.9}];if(e.worldAxis){const r=new m(...e.worldAnchor1),n=new m(...e.worldAxis).normalize();t.push({kind:"line",points:[[r.x-n.x,r.y-n.y,r.z-n.z],[r.x+n.x,r.y+n.y,r.z+n.z]],color:"#ffd166",opacity:.82,dashed:!0})}return{id:`joint:${Ie(o)}`,category:"joints",guides:t,handles:[{id:Ye(o,0),label:"Joint anchor A",position:e.worldAnchor1,color:we,writable:o.writable},{id:Ye(o,1),label:"Joint anchor B",position:e.worldAnchor2,color:we,writable:o.writable}]}}function be(o){return Math.round(o*Ze)/Ze}function zr(o){const e=/^joint:(\d+:\d+):([01])$/.exec(o);return e?{key:e[1],endpoint:Number(e[2])}:null}function Jr(o,e){return o.source.hook==="useFixedJoint"&&e===1?2:e}function et(o,e,t){const r=zr(e),n=r?o.find(d=>Ie(d)===r.key):void 0;if(!n||!r||!n.writable||!n.source.params)return null;const i=n.snapshot,s=r.endpoint===0?i.body1Position:i.body2Position,a=r.endpoint===0?i.body1Rotation:i.body2Rotation,c=new m(...t).sub(new m(...s)).applyQuaternion(new Y(...a).invert()),l=[be(c.x),be(c.y),be(c.z)],u=n.source.params.map(d=>Array.isArray(d)?[...d]:d);return u[Jr(n,r.endpoint)]=l,{binding:n,endpoint:r.endpoint,anchor:l,params:u}}const tt="#ffd166",rt="#ff9f43",nt=1e3;function V(o){return[o.x,o.y,o.z]}function it(o){return Math.round(o*nt)/nt}function kt(o){o.updateWorldMatrix(!0,!1);const e=o.getWorldQuaternion(new Y);return{origin:o.getWorldPosition(new m),rangeAxis:new m(1,0,0).applyQuaternion(e).normalize()}}function Et(o){o.updateWorldMatrix(!0,!1),o.target.updateWorldMatrix(!0,!1);const e=o.getWorldPosition(new m),r=o.target.getWorldPosition(new m).sub(e).normalize();r.lengthSq()<1e-8&&r.set(0,0,-1).applyQuaternion(o.getWorldQuaternion(new Y));const n=Math.abs(r.y)>.98?new m(1,0,0):new m(0,1,0),i=new m().crossVectors(r,n).normalize();return{origin:e,direction:r,radial:i}}function Vr(o,e,t,r,n){return o.clone().addScaledVector(e,Math.cos(n)*r).addScaledVector(t,Math.sin(n)*r)}function Ur(o,e){const t=o;if(!t.isPointLight&&!t.isSpotLight)return null;const{origin:r,rangeAxis:n}=kt(o),i=typeof t.distance=="number"?t.distance:0,s=[],a=[];if(i>0&&(s.push({kind:"sphere",center:V(r),radius:i,color:tt,opacity:.62}),a.push({id:"light-range",label:"Light range",position:V(r.clone().addScaledVector(n,i)),color:tt,writable:e("light.distance")})),t.isSpotLight){const c=o,{direction:l,radial:u}=Et(c),d=r.distanceTo(c.target.getWorldPosition(new m)),h=i>0?i:Math.max(1,d),p=C.radToDeg(c.angle*2);s.push({kind:"cone",origin:V(r),direction:V(l),length:h,angle:p,color:rt,opacity:.75}),a.push({id:"light-angle",label:"Spot angle",position:V(Vr(r,l,u,h,c.angle)),color:rt,writable:e("light.angle")})}return s.length>0||a.length>0?{id:"light",category:"lights",guides:s,handles:a}:null}function Kr(o,e,t,r){const n=o,i=new m(...r);let s,a;if(t==="light-range"&&(n.isPointLight||n.isSpotLight))s="light.distance",a=Math.max(.01,it(i.distanceTo(kt(o).origin)));else if(t==="light-angle"&&n.isSpotLight){s="light.angle";const{origin:l,direction:u}=Et(o),d=i.sub(l),h=d.dot(u),p=Math.sqrt(Math.max(0,d.lengthSq()-h*h));a=it(Math.max(.01,Math.min(Math.PI/2,Math.atan2(p,h))))}else return null;const c=Z(o,null,s,e);return c?{field:c,value:a}:null}function Gr(o,e){T(o,null,e.field,e.value)}function qr(o){const e=(t,r,n)=>{const i=o.object(t);if(!i)return null;const s=o.sourceTag(t),a=Kr(i,s,r,n);if(a)return{field:a.field,value:a.value,preview:()=>Gr(i,a)};const c=Lr(i,s,r,n);return c?{field:c.field,value:c.value,preview:()=>Fr(i,c)}:null};return{layers:t=>{const r=o.object(t);if(!r)return[];const n=i=>o.writable(t,i);return[...o.colliderBindings(t).map(Nr),...o.jointBindings(t).map(Hr),...o.particleBindings(t).map(Or),...o.lodBindings(t).map(mr),Ur(r,n),Mr(r,n)].filter(i=>i!==null)},preview:(t,r,n)=>{const i=Qe(o.colliderBindings(t),r,n);if(i){o.previewCollider(i.colliderId,i.shape);return}const s=et(o.jointBindings(t),r,n);if(s){o.previewJointAnchor(s.binding.snapshot.id,s.endpoint,s.anchor);return}const a=_e(o.particleBindings(t),r,n);if(a){vt(a);return}const c=je(o.lodBindings(t),r,n);if(c){yt(c);return}e(t,r,n)?.preview()},commit:(t,r,n)=>{const i=Qe(o.colliderBindings(t),r,n);if(i)return o.commitCollider(t,i.sourceOid,i.args);const s=et(o.jointBindings(t),r,n);if(s)return o.commitJoint(s.binding,s.params);const a=_e(o.particleBindings(t),r,n);if(a)return o.commitParticle(a.binding,a.field,a.value);const c=je(o.lodBindings(t),r,n);if(c)return o.commitLodDistance(c.binding,c.level,c.value);const l=e(t,r,n);if(!(!l||!o.writable(t,l.field.path)))return o.commit(t,l.field.path,l.value)}}}const Q=/^-?\d+(\.\d+)?$/,Xr=/^#[0-9a-fA-F]{3,8}$/,U=1e-6;function $(o){const e=o.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z])([A-Z][a-z])/g,"$1 $2").trim();return e?e[0].toUpperCase()+e.slice(1):o}const Qr=new Set(["key","ref","data-oid","userData-oid","children"]),Zr=o=>Qr.has(o)||/^on[A-Z]/.test(o)||o.startsWith("userData-")||o.startsWith("__vgai"),Yr=new Set(["position","rotation","scale","name","visible"]),en=new Set;function ue(o){return o instanceof Error?o.message:String(o)}function F(o){const e=Math.round(o*1e4)/1e4;return Object.is(e,-0)?"0":String(e)}function K(o){return`[${o.map(F).join(", ")}]`}function ve(o){return o.replace(/^\.?\//,"")}function ot(o){return o.replace(/["\\]/g,"")}function tn(o){return(o.split("/").pop()??o).replace(Ct,"")||"Model"}function rn(o){if(!xe(o))return!1;const e=o.trim().slice(1,-1).split(",").map(t=>t.trim()).filter(t=>t!=="");return e.length===3&&e.every(t=>Q.test(t))}function Oe(o){return o.isCamera===!0&&_(o)!==void 0}function I(o){const e=o.material;return Array.isArray(e)?e[0]??null:e??null}const de="this session has no source-write backend",O="jsx.",he="wrap.",N="collider.",st="joint.",at="particle.",Se="lod.",R="scene.background.",W="scene.environment.",S="scene.fog.",ct={CuboidCollider:"cuboid",BallCollider:"ball",CapsuleCollider:"capsule"},nn={useFixedJoint:"fixed",useSphericalJoint:"spherical",useRevoluteJoint:"revolute",usePrismaticJoint:"prismatic",useRopeJoint:"rope",useSpringJoint:"spring"};function G(o){return!!o&&o.isColor===!0}function on(o){return!!o&&o.isTexture===!0}function L(o){return!!o&&o.isFog===!0}function q(o){return!!o&&o.isFogExp2===!0}function lt(o){return o&&typeof o=="object"?o:null}function sn(o){const e=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(o.trim());if(!e)return null;const t=e[1].toLowerCase();return t.length===3?t.split("").map(r=>`${r}${r}`).join(""):t}function an(o){return Array.isArray(o)}function Tt(o,e,t,r,n){const i=Array.isArray(e),s=Array.isArray(t),a=an(r);if(i||s||a)return!i||!s||!a||e.length!==t.length||e.length!==r.length?!1:e.every((l,u)=>Tt(o,l,t[u],r[u],n));if(e===t)return!0;const c=o.slice(r.start,r.end);return(typeof e=="number"?Number(c)!==e:c!==String(e))?!1:(n.push({start:r.start,end:r.end,text:typeof t=="number"?F(t):t?"true":"false"}),!0)}function cn(o,e){const t=o.source.params?.[e];if(t!==void 0)return t;const r=o.source.hook,n=o.snapshot;if(e===0)return n.anchor1;if(e===(r==="useFixedJoint"?2:1))return n.anchor2;if(e===2&&(r==="useRevoluteJoint"||r==="usePrismaticJoint"))return n.axis;if(e===3&&n.limits)return[n.limits.min,n.limits.max]}function ln(o,e){return e===void 0?o:Array.isArray(o)?o[e]:void 0}const ut={group:`<group>
3
+ </group>`,mesh:`<mesh position={[0, 0, 0]}>
4
+ <boxGeometry />
5
+ <meshStandardMaterial color="#8888ff" />
6
+ </mesh>`,pointLight:"<pointLight position={[0, 2, 0]} intensity={1} />",ambientLight:"<ambientLight intensity={0.5} />",directionalLight:"<directionalLight position={[5, 10, 5]} intensity={1} />",reflectionProbe:"<ReflectionProbe position={[0, 2, 0]} size={[10, 6, 10]} blendDistance={1} />"},Ct=/\.(glb|gltf)$/i,dt=new Set(["name","position","rotation","scale","children"]),pe="@react-three/drei",X="Gltf",ht={group:"Group",mesh:"Mesh (box)",pointLight:"Point Light",ambientLight:"Ambient Light",directionalLight:"Directional Light",reflectionProbe:"Reflection Probe"};class Cn{constructor(e,t,r){this.store=e,this.options=r,this.scene=t,this.documentNodeId=`r3f-document:${r.worldId}`,this.identity=or(r.worldId),this.projector=new sr(this.identity,{pickScope:"store-object-map"}),this.writeBackend=Mt(r.writeBackend,e.projectHistory),this.capabilities={transform:!0,inspectorFields:!0,persist:this.writeBackend!==void 0},this.writeBackend&&(this.persistence={isDirty:()=>!1,save:async()=>{},destination:r.entryPath,lastError:()=>{const n=e.projectHistory?.getSnapshot().lastError;return n&&(n.code==="apply-failed"||n.code==="compensation-failed"||n.code==="history-limit")?n.message:null}}),this.selectionState=new Kt({store:e,owns:n=>this.byId.has(n),initial:[this.documentNodeId]}),this.indexGraph(),this.definitionRootIds=(r.hierarchyRoots??this.projectedChildren(this.scene)).map(n=>this.idByObject.get(n)).filter(n=>n!==void 0),this.definitionView=new Gt({projector:this.projector,scene:this.scene,documentNodeId:this.documentNodeId,rootIds:this.definitionRootIds}),this.stories=Lt("three",e,n=>this.storyComponent(n)),this.refreshSourceState()}documentNodeId;scene;identity;projector;definitionRootIds;definitionView;selectionState;oidIndex=new Map;sourceRefreshId=0;sourceRefreshPending=!1;sources=new Map;valueEcho=new Map;dynamicPaths=new Set;reflectionProbeAvailable=!1;lockedIds=new Set;structureClipboard=null;writeBackend;transformEdits=new Map;completedTransformEdits=[];transformCommitQueue=Promise.resolve();stories;capabilities;persistence;provenance={source:"source-code",label:"R3F source",detail:"Live react-three-fiber scene; literal JSX props write back to the .tsx source (expression-bound props are read-only)."};get byId(){return this.projector.objects}get idByObject(){return this.projector.idsByObject}get instanceRoots(){return this.identity.instanceRoots}get oidRepresentative(){return this.identity.representatives}indexGraph(){this.projector.project(this.scene),this.watchStructure()}disposed=!1;dispose(){if(!this.disposed){this.disposed=!0;for(const e of this.watchedForStructure)e.removeEventListener("childadded",this.onStructureChanged),e.removeEventListener("childremoved",this.onStructureChanged);this.watchedForStructure=[]}}watchedForStructure=[];structureReindexQueued=!1;staleOidRefreshes=new Set;onStructureChanged=e=>{fe(e.child)||this.scheduleStructureReindex()};watchStructure(){const e=r=>r;for(const r of this.watchedForStructure)e(r).removeEventListener("childadded",this.onStructureChanged),e(r).removeEventListener("childremoved",this.onStructureChanged);this.watchedForStructure=[];const t=r=>{e(r).addEventListener("childadded",this.onStructureChanged),e(r).addEventListener("childremoved",this.onStructureChanged),this.watchedForStructure.push(r)};t(this.scene);for(const[,r]of this.byId)t(r)}scheduleStructureReindex(){this.disposed||this.structureReindexQueued||(this.structureReindexQueued=!0,queueMicrotask(()=>{if(this.structureReindexQueued=!1,this.disposed)return;this.indexGraph();let e=!1;for(const t of this.liveOids()){const r=this.oidIndex.get(t);if(r===void 0||!this.sources.has(r.file)){e=!0;break}}e&&this.refreshSourceState(),this.syncAdoptedObjectMap(),this.store.notifyIngestEdit()}))}syncAdoptedObjectMap(){if(this.store.scene!==this.scene)return;const e=this.store.objectMap;e.clear();for(const[r,n]of this.byId)e.set(r,n);const t=[...this.store.selectedEntityIds].filter(r=>e.has(r));t.length!==this.store.selectedEntityIds.size&&this.store.selectMultiple(t)}liveInstanceCount(e){const t=this.oidOf(e);return t?this.instanceRoots.get(t):void 0}borrowsRepresentativeCallsite(e){if(!Ft(e))return!1;const t=this.byId.get(e),r=t?_(t):void 0,n=r?this.oidRepresentative.get(r):void 0;return!n||!Bt(t,n)}adoptScene(e){this.scene=e,this.valueEcho.clear(),this.dynamicPaths.clear(),this.pendingDuplicateLabels.clear(),this.pendingDuplicateCounts.clear(),this.indexGraph(),setTimeout(()=>this.applyPendingCreatedSelection(),0),this.refreshSourceState()}pendingCreatedSelection=null;recordPendingCreatedSelection(e,t){this.pendingCreatedSelection={parentId:e,before:new Set(this.hierarchy.node(e)?.childIds??[]),selectionAtWrite:new Set(this.store.selectedEntityIds),...t?{afterId:t}:{}}}applyPendingCreatedSelection(){const e=this.pendingCreatedSelection;if(this.pendingCreatedSelection=null,!e)return;const t=this.store.selectedEntityIds;if(!(t.size===e.selectionAtWrite.size&&[...t].every(a=>e.selectionAtWrite.has(a))))return;const n=this.hierarchy.node(e.parentId)?.childIds??[],i=e.afterId?this.childWrittenAfter(n,e.afterId):null;if(i){this.store.selectMultiple([i]);return}const s=n.filter(a=>!e.before.has(a));s.length>0&&this.store.selectMultiple(s)}childWrittenAfter(e,t){const r=this.sourceLocation(t);if(!r)return null;let n=null;for(const i of e){if(i===t)continue;const s=this.sourceLocation(i);!s||s.file!==r.file||!(s.line>r.line||s.line===r.line&&s.col>r.col)||(!n||s.line<n.line||s.line===n.line&&s.col<n.col)&&(n={id:i,line:s.line,col:s.col})}return n?.id??null}async refreshSourceState(){const e=this.writeBackend;if(this.disposed||!e?.index||!e.readSource)return;const t=++this.sourceRefreshId;this.sourceRefreshPending=!0;try{const r=await e.index();if(this.disposed||t!==this.sourceRefreshId)return;const n=new Map(Object.entries(r)),i=new Set;for(const c of this.liveOids()){const l=n.get(c);l&&i.add(l.file)}const s=new Map;if(await Promise.all([...i].map(async c=>{const l=await e.readSource(c);s.set(c,l.source)})),this.disposed||t!==this.sourceRefreshId)return;const a=await jt().exists("src/lib/reflections/index.ts").catch(()=>!1);if(this.disposed||t!==this.sourceRefreshId)return;this.oidIndex=n,this.sources=s,this.reflectionProbeAvailable=a,this.store.notifyIngestEdit()}catch{}finally{t===this.sourceRefreshId&&(this.sourceRefreshPending=!1)}}liveOids(){const e=new Set;for(const[,t]of this.byId){const r=_(t);r!==void 0&&e.add(r)}for(const t of[this.scene.background,this.scene.environment,this.scene.fog]){const r=M(lt(t));r!==void 0&&e.add(r)}return e}oidOf(e){return _(this.byId.get(e))??null}attrsOf(e){const t=this.oidOf(e);if(!t)return null;const r=this.oidIndex.get(t);if(!r)return null;const n=this.sources.get(r.file);if(n===void 0)return null;const i=H(n,r.line,r.col);if(n[i]!=="<")return null;const s=me(n,i);return s<0?null:ke(n,i,s)}sourceLocation(e){const t=this.oidOf(e);return t?this.oidIndex.get(t):void 0}definitionLocation(e){const t=this.definitionOid(e);return t?this.oidIndex.get(t):void 0}storyComponent(e){const t=this.hierarchy.node(e);if(t?.role!=="component")return null;const r=this.definitionLocation(e),n=this.sourceLocation(e),i=r?.component??n?.tag??t.typeLabel??t.label;return r?.file?{name:i,sourcePath:r.file}:{name:i}}definitionOid(e){const t=this.byId.get(e);if(!t||!re(t))return null;const r=ne(t),n=M(t);return n===void 0||n===r?null:n}canForkComponent(e){return typeof this.writeBackend?.forkComponent!="function"?!1:!!this.oidOf(e)&&!!this.definitionOid(e)}async forkComponent(e){const t=this.sourceLocation(e),r=this.oidOf(e),n=this.definitionOid(e),i=t?.tag??"component";if(!r||!n||!t)return Qt(i);const s=this.writeBackend,a=this.store.projectHistory;if(!s?.forkComponent||!s.readSource||!s.applySource||!a)return Zt(i);let c;try{c=await s.forkComponent(r,n,this.forkNameSeed(e))}catch(p){return Ee(ue(p))}const{newName:l,newResourcePath:u,callsiteFile:d,callsiteNewSource:h}=c;if(!c.ok||!l||!u||!d||!h)return Ee(c.error??"the fork was refused without a reason.");try{await B(s,a,{file:d,source:h,label:c.label??`Fork ${i} → ${l}`})}catch(p){return Yt(i,l,u,ue(p))}return await this.refreshSourceState(),er(c.tag??i,l,u)}forkNameSeed(e){const t=this.attrsOf(e)?.find(r=>r.name==="name");return t?.isLiteral&&t.rawValue?t.rawValue:this.byId.get(e)?.name||void 0}canExtractComponent(e){return!!(this.oidOf(e)&&this.writeBackend?.extractComponent)}async extractComponent(e,t){const r=this.sourceLocation(e),n=this.oidOf(e),i=r?.tag??"element";if(!n||!r)return tr(i);const s=this.writeBackend,a=this.store.projectHistory;if(!s?.extractComponent||!s.readSource||!s.applySource||!a)return rr(i);let c;try{c=await s.extractComponent(n,t??this.forkNameSeed(e))}catch(f){return Te(ue(f))}const{newName:l,componentResourcePath:u,storyResourcePath:d,callsiteFile:h,callsiteNewSource:p}=c;if(!c.ok||!l||!u||!d||!h||!p)return Te(c.error??"the extraction was refused without a reason.");try{await B(s,a,{file:h,source:p,label:c.label??`Extract ${l}`})}catch(f){return nr(i,l,u,ue(f))}return await this.refreshSourceState(),ir(c.tag??i,l,u,d)}diagnosticsFor(e){const t=this.borrowsRepresentativeCallsite(e)?void 0:this.sourceLocation(e);return fr(t,this.definitionLocation(e))}internalChildren(e){if(this.options.hierarchyMode==="definition")return;const t=this.byId.get(e);if(t)return this.internalChildObjects(t).map(r=>({...this.objectNode(r),parentId:e}))}hasInternals(e){if(this.options.hierarchyMode==="definition")return!1;const t=this.byId.get(e);return t?this.internalChildObjects(t).length>0:!1}internalChildObjects(e){return e.children.filter(t=>this.idByObject.has(t)&&!this.isProjectedRow(t))}objectNode(e){const t=this.idByObject.get(e),r=this.projectedParentId(e),n=this.borrowsRepresentativeCallsite(t),i=this.isComponentBoundary(e)&&!n,s=n?void 0:this.oidEntryOf(e)?.tag;return{id:t,label:i?ye(e,"authoringLabel")||e.name||s||"Component":e.name||e.type||"Object3D",role:i?"component":"entity",kind:ar(this.transformObject(t)??e),...i&&s&&/^[A-Z]/.test(s)?{typeLabel:s}:{},parentId:r,childIds:this.projector.childIdsOf(this.projectedChildren(e))}}isComponentBoundary(e){return re(e)&&ye(e,"authoringRoot")!==!0}spatialTargetOf(e){return e}transformObject(e){const t=this.byId.get(e);return t?this.isComponentBoundary(t)?this.spatialTargetOf(t):t:null}oidEntryOf(e){const t=this.idByObject.get(e);return t?this.sourceLocation(t):void 0}componentOwnerChain(e){const t=[];let r=e;for(;r&&r!==this.scene;){for(;r&&r!==this.scene&&!this.isComponentBoundary(r);)r=r.parent;if(!r||r===this.scene)break;const n=ne(r);let i=r;for(;i.parent&&i.parent!==this.scene&&ne(i.parent)===n;)i=i.parent;t.push(i),r=i.parent}return t.reverse()}selectionOwnerObject(e,t=this.componentOwnerChain(e)){return t.at(-1)??this.stampedOwnerObject(e)}stampedOwnerObject(e){let t=e;for(;t&&t!==this.scene&&this.oidOf(this.idByObject.get(t)??"")===null;)t=t.parent??void 0;return!t||t===this.scene?null:t}insideTransparentTopLevel(e){return this.componentOwnerChain(e).length===1}isProjectedRow(e){if(e===this.scene||fe(e))return!1;const t=this.idByObject.get(e);if(t===void 0)return!1;if(Oe(e))return!0;const r=this.componentOwnerChain(e);return this.selectionOwnerObject(e,r)===e?!0:r.length===1&&this.oidOf(t)!==null}projectedChildren(e){const t=[],r=new Set,n=i=>{if(!fe(i)){if(this.isProjectedRow(i)){r.has(i)||(r.add(i),t.push(i));return}for(const s of i.children)n(s)}};for(const i of e.children)n(i);return t}projectedParentId(e){let t=e.parent;for(;t&&t!==this.scene;){if(this.isProjectedRow(t))return this.idByObject.get(t);t=t.parent}return this.documentNodeId}selectionOwnerId(e){const t=this.byId.get(e);if(!t)return null;if(Oe(t))return e;const n=this.componentOwnerChain(t).slice(1).at(-1)??this.stampedOwnerObject(t);return n?this.idByObject.get(n)??null:null}hierarchy={roots:()=>[this.hierarchy.node(this.documentNodeId)],node:e=>{if(e===this.documentNodeId)return{id:e,label:this.options.worldId,secondaryLabel:this.options.entryPath,role:"document",kind:"three-source",parentId:null,childIds:this.options.hierarchyMode==="definition"?this.definitionView.rootIds():this.projector.childIdsOf(this.projectedChildren(this.scene))};const t=this.byId.get(e);return t?this.options.hierarchyMode==="definition"?this.definitionView.node(t):this.objectNode(t):null},object3D:e=>this.transformObject(e),idForObject3D:e=>this.idByObject.get(e)??null};truth={resolve:e=>{const t=this.oidOf(e);if(!t)return{site:{anchored:!1,reason:e===this.documentNodeId?"The World document is a composition, not a source element.":"This rendered object has no authored source identity."},writeAnchorKind:this.transformWriteAnchorKind(e)};const r=this.oidIndex.get(t);if(!r)return{site:{anchored:!1,reason:"Source metadata is still loading or unavailable."},writeAnchorKind:this.transformWriteAnchorKind(e)};const n=this.projectRelativeSourceFile(r.file);return{site:{anchored:!0,kind:"source",file:n,line:r.line,col:r.col,display:`${n}:${r.line}`},writeAnchorKind:this.transformWriteAnchorKind(e)}}};transformWriteAnchorKind(e){if(!this.byId.has(e))return;const t=this.oidOf(e);return!t||!this.writeBackend?.writeProp?"live-only":cr(this.oidIndex.get(t),"position")?"physics-binding":"source-prop"}pickable={pick:(e,t)=>this.projector.pick(this.store,e,t,r=>this.isPickLocked(r)),candidates:(e,t)=>this.projector.candidates(this.store,e,t,r=>this.isPickLocked(r))};isPickLocked(e){let t=e,r=0;for(;t&&r++<1e3;){if(this.lockedIds.has(t))return!0;t=this.hierarchy.node(t)?.parentId??null}return!1}selection={get:()=>this.selectionState.current(),set:(e,t)=>this.selectionState.publish(e.map(r=>this.options.hierarchyMode==="definition"||t?.intent==="exact"||r===this.documentNodeId?r:this.selectionOwnerId(r)??r).filter(r=>r===this.documentNodeId||this.byId.has(r))),resolve:(e,t)=>{const r=this.byId.get(e);if(!r)return null;if(this.options.hierarchyMode==="definition")return{id:e};if(Oe(r))return{id:e};const n=this.componentOwnerChain(r),i=t?.scopeId?n.findIndex(u=>this.idByObject.get(u)===t.scopeId):-1,s=i>=0?i+1:1,a=t?.intent==="deep"?s+1:s,c=n[a]??n[s]??this.stampedOwnerObject(r),l=c?this.idByObject.get(c)??null:null;return l?{id:l}:null}};related={links:e=>{const t=ye(this.byId.get(e),"authoringDocument");return!t||t.kind!=="project-tool"?[]:[{id:`definition:project-tool:${t.name}`,title:t.title,open:()=>{Dt(this.store,t.name)}}]}};instanceProp(e,t){if(!t.startsWith(O))return null;const r=t.slice(O.length),n=this.declaredPropsOf(e).find(s=>s.name===r),i=this.attrsOf(e)?.find(s=>s.name===r);return n&&i?{prop:r,spec:n,attr:i}:null}affectedInstances(e,t){const r=this.definitionLocation(e);if(!r)return 0;let n=0;for(const[i,s]of this.byId){if(!re(s))continue;const a=this.definitionLocation(i);a?.file!==r.file||a.component!==r.component||this.attrsOf(i)?.some(c=>c.name===t)||(n+=1)}return n+1}instances={openComponent:()=>{Nt(Wt)},describe:e=>{const t=this.storyComponent(e);if(!t||this.stories.storiesFor(e).length===0)return null;const r=this.inspector.properties(e).filter(n=>n.resettable&&n.path.startsWith(O)).map(n=>{const i=this.instanceProp(e,n.path),s=!!i?.attr.isLiteral&&i.spec.defaultValue!==void 0&&!!this.definitionOid(e)&&!!this.writeBackend?.runGesture&&!!this.writeBackend.writeComponentDefault&&!!this.writeBackend.removeProp;return{path:n.path,label:n.label,value:this.inspector.get(e,n.path),...n.revertsTo===void 0?{}:{defaultText:n.revertsTo},canApplyToComponent:s,affectedInstanceCount:i?this.affectedInstances(e,i.prop):0,...s?{}:{applyUnavailableReason:i?.spec.defaultValue===void 0?"The component default is computed or absent, so source cannot be changed safely.":"This session cannot atomically update the component and its callsite."}}});return{componentName:t.name,...t.sourcePath?{sourcePath:this.projectRelativeSourceFile(t.sourcePath)}:{},overrides:r}},revert:async(e,t)=>{const r=this.oidOf(e),n=this.writeBackend;if(!r||!n?.removeProp)return;const i=t.map(c=>this.instanceProp(e,c)?.prop).filter(c=>!!c);let s=!1;const a=async c=>{for(const l of i){const u=await c.removeProp?.(r,l);s||=u?.changed===!0}};return i.length>1&&n.runGesture?await n.runGesture(`Revert ${i.length} Overrides`,a):await a(n),await this.refreshSourceState(),s?{destination:this.destinationOf(e),persisted:!0}:void 0},applyToComponent:async(e,t)=>{const r=this.instanceProp(e,t),n=this.definitionOid(e),i=this.oidOf(e),s=this.writeBackend;if(!r||r.spec.defaultValue===void 0||!n||!i||!s?.runGesture||!s.writeComponentDefault||!s.removeProp)return{changed:!1,message:"Apply was refused because both literal source writes are not available."};const a=this.inspector.get(e,t);return await s.runGesture(`Apply ${r.prop} to ${this.storyComponent(e)?.name??"Component"}`,async c=>{const l=await c.writeComponentDefault?.(n,r.prop,this.serializeValue(a));if(!l?.changed)throw new Error(l?.error??"The component default did not change.");const u=await c.removeProp?.(i,r.prop);if(!u?.changed)throw new Error(u?.error??"The callsite override was not removed.")}),await this.refreshSourceState(),{changed:!0,message:`${r.prop} now defaults to ${String(a)} in ${this.storyComponent(e)?.name??"the component"}.`,write:{destination:this.destinationOf(e),persisted:!0}}}};transforms={dimensions:e=>this.transformObject(e)?"3d":null,get:e=>qt(this.transformObject(e)),editability:(e,t)=>this.transformEditability(e,t),beginEdit:e=>{if(!this.transformEditability(e,"position").writable&&!this.transformEditability(e,"rotation").writable&&!this.transformEditability(e,"scale").writable)return;const t=this.transformObject(e);t&&(this.transformEdits.has(e)||this.transformEdits.set(e,{id:e,position:t.position.toArray(),quaternion:t.quaternion.toArray(),euler:[t.rotation.x,t.rotation.y,t.rotation.z],scale:t.scale.toArray()}))},apply:(e,t)=>{const r=this.transformObject(e);r&&(r.position.fromArray(t.position),r.quaternion.fromArray(t.rotation),r.scale.fromArray(t.scale))},endEdit:e=>{const t=this.transformEdits.get(e);if(!t||(this.transformEdits.delete(e),this.completedTransformEdits.push(t),this.transformEdits.size>0))return;const r=this.completedTransformEdits.splice(0);Ht();const n=this.transformCommitQueue.then(()=>ie(this.pipedTransformCommit(r)));return n.then(Ae,Ae),this.transformCommitQueue=n.then(()=>{},i=>{console.error("[R3fSourceAuthoringAdapter] transform commit failed",i)}),n},remove:(e,t)=>{const r=this.oidOf(e);if(r)return this.pipedJsxRemove(()=>this.removeTransformChannel(e,r,t),this.destinationOf(e))}};async removeTransformChannel(e,t,r){const n=this.transformEditability(e,r);return!n.writable||n.removable!==!0?(console.warn(`[R3fSourceAuthoringAdapter] cannot drop "${r}" on "${e}": ${n.reason??"this callsite authors no such attribute"}.`),!1):this.removeOidProp(e,t,`${O}${r}`,r)}destinationOf(e){const t=this.sourceLocation(e);return t?this.projectRelativeSourceFile(t.file):this.options.entryPath}pipedJsxWrite(e,t=this.writeBackend?.writeProp!==void 0,r=this.options.entryPath){return ie({resolve:()=>t?{reaches:"writer",anchorKind:"source-prop",destination:r,write:e}:oe(de),record:()=>{},report:n=>console.warn(`[R3fSourceAuthoringAdapter] this edit stays live-only — ${n}.`)})}pipedSourceTokenWrite(e){return ie({resolve:()=>this.writeBackend&&this.store.projectHistory?{reaches:"writer",anchorKind:"construction-literal",destination:this.options.entryPath,write:()=>e().catch(t=>(console.error("[R3fSourceAuthoringAdapter] source token write failed",t),!1))}:oe(de),record:()=>{},report:t=>console.warn(`[R3fSourceAuthoringAdapter] this edit stays live-only — ${t}.`)})}pipedTransformCommit(e){return{resolve:()=>this.writeBackend?.writeProp?{reaches:"writer",anchorKind:"source-prop",destination:this.destinationOf(e[0]?.id??""),write:()=>this.commitTransformEdits(e).catch(t=>(console.error("[R3fSourceAuthoringAdapter] transform commit failed",t),!1))}:oe(de),record:()=>{},report:t=>console.warn(`[R3fSourceAuthoringAdapter] this edit stays live-only — ${t}.`)}}transformEditability(e,t){if(this.borrowsRepresentativeCallsite(e)){const c=this.byId.get(e),l=c?this.oidEntryOf(c)?.tag:void 0;return{writable:!1,reason:`Rendered by ${l?`<${l}>`:"its component"} — this object has no writable source transform of its own.`}}const r=this.oidOf(e);if(!r){const c=ne(this.byId.get(e)),l=c!==void 0?this.oidIndex.get(c)?.tag:void 0;return{writable:!1,reason:l?`Rendered by <${l}> — this object has no writable source transform of its own.`:"This rendered part has no authored source identity."}}if(!this.writeBackend?.writeProp)return{writable:!1,reason:"This session has no source writer."};const n=lr(this.oidIndex.get(r),t);if(n)return{writable:!1,reason:n};const i=this.attrsOf(e);if(!i)return this.staleOidRefreshes.has(r)||(this.staleOidRefreshes.add(r),this.refreshSourceState()),this.sourceRefreshPending?{writable:!1,reason:"Source metadata for this element is being refreshed — try again in a moment."}:(un(e),{writable:!1,reason:"Source metadata is missing for this element — an element added by hot reload is not in the OID index until the page reloads. Reload the editor page to author it."});const s=i.find(c=>c.name===t),a=this.byId.get(e);if(a&&this.isComponentBoundary(a)){const c=this.oidEntryOf(a)?.r3fAuthoring,l=c?.transformProps.includes(t)??!1,u=c?.simulationOwnedTransform===!0;if(u)return{writable:!1,reason:`${this.oidEntryOf(a)?.tag??"This component"} drives its own ${t} every frame — this instance is placed by the simulation, not by the editor.`};if(!s){if(l)return{writable:!0};const h=u?`drives its own ${t} every frame — this instance is placed by the simulation, not by the editor`:c?.root==="multiple"?"renders multiple roots":c?.root==="non-spatial"?"has no spatial root":c?.root==="unknown"?"has no statically provable native root":c?.root==="single"?`does not forward ${t} to its ${c.rootTag??"native"} root`:`does not expose a ${t} prop`;return{writable:!1,reason:`${this.oidEntryOf(a)?.tag??"This component"} ${h}.`}}if(c&&!l)return{writable:!1,reason:`${this.oidEntryOf(a)?.tag??"This component"} does not forward ${t} to its ${c.rootTag??"native"} root.`};if(!(s.isExpression&&(rn(s.rawValue)||t==="scale"&&Q.test(s.rawValue))))return{writable:!1,reason:t==="scale"?"scale is not exposed as a number or three-number tuple by this component.":`${t} is not exposed as a three-number tuple by this component.`}}return s?.isExpression&&!s.isLiteral?{writable:!1,reason:`${t} is controlled by the JSX expression {${s.rawValue}}.`}:{writable:!0,...s&&this.writeBackend?.removeProp?{removable:!0}:{}}}async commitTransformEdits(e){if(e.length===0)return!1;const t=this.writeBackend;let r=!1;const n=async i=>{for(const s of e)await this.commitTransformEdit(s,i,!1)&&(r=!0)};return e.length>1&&t?.runGesture?await t.runGesture("Transform Selection",i=>n(i)):await n(t),r}async commitTransformEdit(e,t,r=!0){const n=this.transformObject(e.id);if(!n)return!1;const i=this.oidOf(e.id),s=i?this.attrsOf(e.id):null,a={position:!this.nearlyEqual(n.position.toArray(),e.position),rotation:!this.nearlyEqual([n.rotation.x,n.rotation.y,n.rotation.z],e.euler),scale:!this.nearlyEqual(n.scale.toArray(),e.scale)};if(!a.position&&!a.rotation&&!a.scale)return!1;const c=p=>{p==="position"?n.position.fromArray(e.position):p==="rotation"?n.quaternion.fromArray(e.quaternion):n.scale.fromArray(e.scale),this.store.notifyIngestEdit()},l=t??this.writeBackend;if(!i||!l?.writeProp){console.warn(`[R3fSourceAuthoringAdapter] transform on "${e.id}" is not persistable (${i?"no source-write backend":"node has no source stamp"}) — reverting.`);for(const p of["position","rotation","scale"])a[p]&&c(p);return!1}const u=[];for(const p of["position","rotation","scale"]){if(!a[p])continue;const f=p==="position"?n.position.toArray():p==="rotation"?[n.rotation.x,n.rotation.y,n.rotation.z]:n.scale.toArray(),g=s?.find(v=>v.name===p);if(g&&g.isExpression&&!g.isLiteral){console.warn(`[R3fSourceAuthoringAdapter] "${p}" on "${e.id}" is expression-bound (guarded) — reverting the live object.`),this.dynamicPaths.add(`${e.id}|${p}`),c(p);continue}if(p==="scale"&&g&&Q.test(g.rawValue)){const[v,x,w]=f;Math.abs(v-x)<U&&Math.abs(x-w)<U?u.push({channel:p,value:F(v)}):u.push({channel:p,value:K(f),shapeUpgrade:!0});continue}u.push({channel:p,value:K(f)})}if(u.length===0)return!1;let d=!1;const h=async p=>{for(const f of u){const g=await p.writeProp(i,f.channel,f.value,{addIfMissing:!0,...f.shapeUpgrade?{allowShapeUpgrade:!0}:{}});g.changed&&(d=!0),g.changed||(g.dynamic&&this.dynamicPaths.add(`${e.id}|${f.channel}`),console.warn(`[R3fSourceAuthoringAdapter] ${f.channel} write refused for oid "${i}": ${g.dynamic?"dynamic expression (guarded)":g.error??"no change"} — reverting.`),c(f.channel))}};return r&&u.length>1&&l.runGesture?await l.runGesture("Transform",p=>h(p)):await h(l),this.store.notifyIngestEdit(),d}nearlyEqual(e,t){return e.length===t.length&&e.every((r,n)=>Math.abs(r-(t[n]??0))<U)}materialOidOf(e){return M(I(e))??null}attrsOfOid(e){const t=this.oidIndex.get(e);if(!t)return null;const r=this.sources.get(t.file);if(r===void 0)return null;const n=H(r,t.line,t.col);if(r[n]!=="<")return null;const i=me(r,n);return i<0?null:ke(r,n,i)}descriptorTypeFor(e,t,r,n){const i=(()=>{if(!e.isLiteral)return"string";const c=e.rawValue;if(c==="true"||c==="false")return"boolean";if(e.isExpression&&Q.test(c))return"number";if(e.isExpression&&xe(c))return"json";const l=e.isExpression?c.replace(/^['"]|['"]$/g,""):c;return Xr.test(l)?"color":"string"})(),s=this.oidIndex.get(t.oid);return n===void 0&&s?.propsResolved===!0&&/^[A-Z]/.test(s.tag??"")&&Xt(s?.file??this.options.entryPath,r,i),i}literalValueOf(e){if(!e.isLiteral)return`{${e.rawValue}}`;const t=e.rawValue;if(!e.isExpression)return t;if(t==="true")return!0;if(t==="false")return!1;if(Q.test(t))return Number(t);if(xe(t))try{return JSON.parse(t.replace(/,\s*\]$/,"]"))}catch{return t}return t.replace(/^['"]|['"]$/g,"")}parseWrapperPropertyPath(e){if(!e.startsWith(he))return null;const t=e.slice(he.length),r=t.indexOf(".");if(r<1)return null;try{return{oid:decodeURIComponent(t.slice(0,r)),prop:t.slice(r+1)}}catch{return null}}declaredPropsOf(e){const t=this.oidOf(e);return(t?this.oidIndex.get(t)?.props:void 0)??[]}nodeSubject(e){const t=this.oidOf(e);return t?{oid:t,declared:this.declaredPropsOf(e),pathFor:r=>`${O}${r}`,keyFor:r=>`${e}|${O}${r}`}:null}wrapperSubject(e){const t=r=>`${he}${encodeURIComponent(e)}.${r}`;return{oid:e,declared:this.oidIndex.get(e)?.props??[],pathFor:t,keyFor:t}}collapsedWrappersOf(e){const t=this.oidOf(e);if(!t)return[];const r=this.liveOids(),n=[];let i=this.oidIndex.get(t)?.parentOid;for(let s=0;i&&s<16&&!r.has(i);s+=1){const a=this.oidIndex.get(i);if(!a)break;/^[A-Z]/.test(a.tag)&&n.push({oid:i,tag:a.tag}),i=a.parentOid}return n.reverse()}rigidBodyOidOf(e){const t=this.byId.get(e),r=[this.definitionOid(e),M(t),this.oidOf(e)].filter(n=>typeof n=="string");for(const n of r){let i=n;for(let s=0;i&&s<32;s+=1){const a=this.oidIndex.get(i);if(!a)break;if(a.tag==="RigidBody")return i;i=a.parentOid}}return null}explicitColliderOids(e){const t=r=>{let n=this.oidIndex.get(r)?.parentOid;for(let i=0;n&&i<32;i+=1){if(n===e)return!0;const s=this.oidIndex.get(n);if(!s||s.tag==="RigidBody")return!1;n=s.parentOid}return!1};return[...this.oidIndex.entries()].filter(([r,n])=>n.tag in ct&&t(r)).sort(([,r],[,n])=>r.file===n.file?r.line-n.line||r.col-n.col:r.file.localeCompare(n.file)).map(([r])=>r)}steppingPhysics(){return this.store.playState==="stopped"?null:this.options.physics?.()??null}colliderBindingsOf(e){const t=this.rigidBodyOidOf(e),r=this.steppingPhysics();if(!t||!r?.colliders)return[];const n=this.explicitColliderOids(t),i=[...r.colliders(e)];if(n.length===0||n.length!==i.length)return[];const s=[];for(let a=0;a<n.length;a+=1){const c=n[a],l=this.oidIndex.get(c)?.tag,u=i[a];if(!l||ct[l]!==u.shape.type)return[];const d=this.attrsOfOid(c)?.find(h=>h.name==="args");s.push({sourceOid:c,sourceTag:l,snapshot:u,writable:!!this.writeBackend?.writeProp&&!!d?.isLiteral&&!this.dynamicPaths.has(`${N}${encodeURIComponent(c)}.args`)})}return s}parseColliderArgPath(e){if(!e.startsWith(N))return null;const t=/^collider\.([^.]*)\.arg\.(\d+)$/.exec(e);if(!t)return null;try{return{oid:decodeURIComponent(t[1]),index:Number(t[2])}}catch{return null}}colliderArgs(e){const t=this.valueEcho.get(`${N}${encodeURIComponent(e)}.args`);if(Array.isArray(t)&&t.every(i=>typeof i=="number"))return[...t];const r=this.attrsOfOid(e)?.find(i=>i.name==="args"),n=r?this.literalValueOf(r):null;return Array.isArray(n)&&n.every(i=>typeof i=="number")?[...n]:null}colliderDimensionRows(e){return(e.sourceTag==="CuboidCollider"?["Half extent X","Half extent Y","Half extent Z"]:e.sourceTag==="CapsuleCollider"?["Half height","Radius"]:["Radius"]).map((r,n)=>({path:`${N}${encodeURIComponent(e.sourceOid)}.arg.${n}`,label:r,type:"number",group:$(e.sourceTag),readonly:!e.writable}))}jointBindingsOf(e){const t=this.rigidBodyOidOf(e),r=t?this.oidIndex.get(t):void 0,n=this.steppingPhysics();if(!t||!r?.jointBindings||!n?.joints)return[];const i=[...n.joints(e)];if(r.jointBindings.length!==i.length)return[];const s=[];for(let a=0;a<r.jointBindings.length;a+=1){const c=r.jointBindings[a],l=i[a];if(nn[c.hook]!==l.type)return[];s.push({sourceOid:t,sourceFile:r.file,source:c,snapshot:l,writable:!!c.params&&!!c.paramRanges&&!!this.writeBackend?.readSource&&!!this.writeBackend.applySource&&!!this.store.projectHistory})}return s}jointKey(e){return`${e.source.line}:${e.source.col}`}jointPath(e,t){return`${st}${this.jointKey(e)}.${t}`}jointBindingForPath(e,t){const r=/^joint\.(\d+:\d+)\./.exec(t);return r?this.jointBindingsOf(e).find(n=>this.jointKey(n)===r[1])??null:null}jointParamPath(e){const t=/^joint\.\d+:\d+\.param\.(\d+)(?:\.(\d+))?$/.exec(e);return t?{param:Number(t[1]),...t[2]===void 0?{}:{part:Number(t[2])}}:null}jointTupleRows(e,t,r,n=["X","Y","Z"]){const i=$(e.source.hook.replace(/^use/,""));return n.map((s,a)=>({path:this.jointPath(e,`param.${r}.${a}`),label:`${t} ${s}`,type:"number",readonly:!e.writable,group:i}))}jointScalarRow(e,t,r){return{path:this.jointPath(e,`param.${r}`),label:t,type:"number",readonly:!e.writable,group:$(e.source.hook.replace(/^use/,""))}}jointDetailRows(e){switch(e.source.hook){case"useFixedJoint":return e.source.params?[...this.jointTupleRows(e,"Local Frame A",1,["X","Y","Z","W"]),...this.jointTupleRows(e,"Local Frame B",3,["X","Y","Z","W"])]:[];case"useRevoluteJoint":case"usePrismaticJoint":return[...this.jointTupleRows(e,"Axis",2),...e.source.params?.[3]||e.snapshot.limits?[...this.jointTupleRows(e,"Limit",3,["Min","Max"])]:[]];case"useRopeJoint":return e.source.params?[this.jointScalarRow(e,"Length",2)]:[];case"useSpringJoint":return e.source.params?[this.jointScalarRow(e,"Rest Length",2),this.jointScalarRow(e,"Stiffness",3),this.jointScalarRow(e,"Damping",4)]:[];default:return[]}}jointRows(e){const t=$(e.source.hook.replace(/^use/,""));return[{path:this.jointPath(e,"body1"),label:"Body A",type:"string",readonly:!0,group:t},{path:this.jointPath(e,"body2"),label:"Body B",type:"string",readonly:!0,group:t},...this.jointTupleRows(e,"Anchor A",0),...this.jointTupleRows(e,"Anchor B",e.source.hook==="useFixedJoint"?2:1),...this.jointDetailRows(e),{path:this.jointPath(e,"contacts"),label:"Contacts Enabled",type:"boolean",readonly:!0,group:t}]}jointValue(e,t){const r=this.jointBindingForPath(e,t);if(!r)return;if(t.endsWith(".body1"))return r.source.body1Ref;if(t.endsWith(".body2"))return r.source.body2Ref;if(t.endsWith(".contacts"))return r.snapshot.contactsEnabled;const n=this.jointParamPath(t);if(n)return ln(cn(r,n.param),n.part)}particleBindingsOf(e){const t=this.byId.get(e);if(!t)return[];const r=[];t.traverse(i=>{const s=M(i)??_(i);!s||!this.oidIndex.get(s)?.particleBinding||r.push({emitter:i,sourceOid:s})});const n=[];for(const{emitter:i,sourceOid:s}of r){const a=this.oidIndex.get(s),c=a?.particleBinding,l=wr(i);!a||!c||!l||c.shape!==l.type||n.push({sourceOid:s,sourceFile:a.file,source:c,emitter:i,shape:l,writableFields:new Set(Object.keys(c.fields).filter(()=>!!this.writeBackend?.readSource&&!!this.writeBackend.applySource&&!!this.store.projectHistory))})}return n}particleKey(e){return encodeURIComponent(e.sourceOid)}particlePath(e,t){return`${at}${this.particleKey(e)}.${t}`}particleBindingForPath(e,t){const r=/^particle\.([^.]+)\./.exec(t);return r?this.particleBindingsOf(e).find(n=>this.particleKey(n)===r[1])??null:null}particleFieldPath(e){return/^particle\.[^.]+\.([A-Za-z][A-Za-z0-9]*)$/.exec(e)?.[1]??null}particleRows(e){const t=$(e.source.constructor),r={radius:"Radius",arc:"Arc",thickness:"Thickness",angle:"Angle",donutRadius:"Donut Radius",width:"Width",height:"Height",column:"Columns",row:"Rows"},n={point:[],sphere:["radius","arc","thickness"],hemisphere:["radius","arc","thickness"],cone:["radius","arc","thickness","angle"],circle:["radius","arc","thickness"],donut:["radius","arc","thickness","donutRadius"],rectangle:["width","height","thickness"],grid:["width","height","column","row"]};return[{path:this.particlePath(e,"type"),label:"Shape",type:"string",readonly:!0,group:t},...(n[e.shape.type]??[]).map(i=>({path:this.particlePath(e,i),label:r[i]??$(i),type:"number",readonly:!e.writableFields.has(i),group:t}))]}particleValue(e,t){const r=this.particleBindingForPath(e,t),n=this.particleFieldPath(t);if(!(!r||!n))return n==="type"?r.shape.type:r.shape[n]}async writeParticleField(e,t,r){const n=this.writeBackend,i=this.store.projectHistory,s=e.source.fields[t],a=this.sources.get(e.sourceFile);if(!n||!i||!s||!e.writableFields.has(t)||a===void 0||s.start<0||s.end>a.length||Number(a.slice(s.start,s.end))!==s.value)return!1;const c=Sr(t,r),l=e.shape[t];vt({binding:e,field:t,value:c}),this.store.notifyIngestEdit();const u=`${a.slice(0,s.start)}${F(c)}${a.slice(s.end)}`;try{return await B(n,i,{file:e.sourceFile,source:u,label:`Edit ${$(e.source.constructor)} ${$(t)}`}),this.sources.set(e.sourceFile,u),await this.refreshSourceState(),!0}catch(d){throw e.shape[t]=l,this.store.notifyIngestEdit(),d}}lodBindingsOf(e){const t=this.byId.get(e);if(!t)return[];const r=[];t.traverse(i=>{i.isLOD&&r.push(i)});const n=!!this.writeBackend?.readSource&&!!this.writeBackend.applySource&&!!this.store.projectHistory;return r.map((i,s)=>{const a=M(i)??_(i),c=a?this.oidIndex.get(a):void 0,l=c?.lodBinding,u=!!l?.distances&&l.distances.length===i.levels.length&&l.distances.every((h,p)=>Math.abs(h.value-i.levels[p].distance)<U),d=!!l?.hysteresis&&i.levels.every(h=>Math.abs(h.hysteresis-l.hysteresis.value)<U);return{key:a??`${e}:${s}`,...a?{sourceOid:a}:{},...c?{sourceFile:c.file}:{},...l?{source:l}:{},lod:i,writableDistances:new Set(n&&u?i.levels.map((h,p)=>p):[]),writableHysteresis:n&&d}})}lodPath(e,t){return`${Se}${encodeURIComponent(e.key)}.${t}`}lodBindingForPath(e,t){const r=/^lod\.([^.]+)\./.exec(t);if(!r)return null;const n=decodeURIComponent(r[1]);return this.lodBindingsOf(e).find(i=>i.key===n)??null}lodPreviewOption(e,t){const r=e.lod.levels[t]?.object,n=r?r.name||r.type:"";return`Level ${t}${n?` — ${n}`:""}`}lodRows(e){const t="Level of Detail",r=[{path:this.lodPath(e,"preview"),label:"Preview Level",type:"enum",options:["Auto",...e.lod.levels.map((n,i)=>this.lodPreviewOption(e,i))],group:t},{path:this.lodPath(e,"active"),label:"Active Level",type:"string",readonly:!0,group:t}];return e.lod.levels.forEach((n,i)=>{r.push({path:this.lodPath(e,`level.${i}.object`),label:`Level ${i} Object`,type:"string",readonly:!0,group:t},{path:this.lodPath(e,`level.${i}.distance`),label:`Level ${i} Distance`,type:"number",readonly:!e.writableDistances.has(i),group:t})}),e.lod.levels.length>0&&r.push({path:this.lodPath(e,"hysteresis"),label:"Hysteresis",type:"number",readonly:!e.writableHysteresis,group:t}),r}lodValue(e,t){const r=this.lodBindingForPath(e,t);if(!r)return;if(t.endsWith(".preview")){const s=this.store.getLodForcedLevel(e);return s===null?"Auto":this.lodPreviewOption(r,s)}if(t.endsWith(".active")){const s=this.store.getLodForcedLevel(e);return this.lodPreviewOption(r,s??r.lod.getCurrentLevel())}if(t.endsWith(".hysteresis"))return r.lod.levels[0]?.hysteresis;const n=/\.level\.(\d+)\.(object|distance)$/.exec(t);if(!n)return;const i=r.lod.levels[Number(n[1])];if(i)return n[2]==="distance"?i.distance:i.object.name||i.object.type||`Level ${n[1]}`}async writeLodToken(e,t,r,n,i,s){const a=this.writeBackend,c=this.store.projectHistory,l=e.sourceFile,u=l?this.sources.get(l):void 0;if(!a||!c||!l||u===void 0||t.start<0||t.end>u.length||Number(u.slice(t.start,t.end))!==t.value)return!1;i(),this.store.notifyIngestEdit();const d=`${u.slice(0,t.start)}${F(r)}${u.slice(t.end)}`;try{return await B(a,c,{file:l,source:d,label:n}),this.sources.set(l,d),await this.refreshSourceState(),!0}catch(h){throw s(),this.store.notifyIngestEdit(),h}}writeLodDistance(e,t,r){const n=e.source?.distances?.[t];if(!n||!e.writableDistances.has(t))return Promise.resolve(!1);const i=mt(e,t,r),s=e.lod.levels[t]?.distance;return this.writeLodToken(e,n,i,`Edit LOD ${t} distance`,()=>yt({binding:e,level:t,value:i}),()=>{const a=e.lod.levels[t];a&&s!==void 0&&(a.distance=s)})}writeLodHysteresis(e,t){const r=e.source?.hysteresis;if(!r||!e.writableHysteresis)return Promise.resolve(!1);const n=Math.round(Math.max(0,Math.min(1,t))*1e3)/1e3,i=e.lod.levels.map(s=>s.hysteresis);return this.writeLodToken(e,r,n,"Edit LOD hysteresis",()=>{for(const s of e.lod.levels)s.hysteresis=n},()=>{e.lod.levels.forEach((s,a)=>{s.hysteresis=i[a]??s.hysteresis})})}async writeJointParams(e,t){const r=this.writeBackend,n=this.store.projectHistory,i=this.sources.get(e.sourceFile),s=e.source.params,a=e.source.paramRanges;if(!r||!n||i===void 0||!s||!a)return!1;const c=[];if(!Tt(i,s,t,a,c)||c.length===0)return!1;c.sort((u,d)=>d.start-u.start);let l=i;for(const u of c){if(u.start<0||u.end>l.length)return!1;l=`${l.slice(0,u.start)}${u.text}${l.slice(u.end)}`}return await B(r,n,{file:e.sourceFile,source:l,label:`Edit ${$(e.source.hook.replace(/^use/,""))}`}),this.sources.set(e.sourceFile,l),await this.refreshSourceState(),!0}isOverride(e,t,r){return!e?.isLiteral||this.dynamicPaths.has(r)||!t?.optional?!1:!!this.writeBackend?.removeProp}measuredTypeFor(e,t){if(!e)return null;const r=e[t];return typeof r=="number"?"number":typeof r=="boolean"?"boolean":typeof r=="object"&&r!==null&&r.isColor?"color":null}componentProperties(e,t,r,n=en,i=null){const s=new Map(r.map(d=>[d.name,d])),a=e.declared,c=[],l=(d,h)=>{if(Zr(d)||Yr.has(d)||n.has(d))return;const p=s.get(d),f=!p&&h?.defaultText!==void 0&&h.defaultValue===void 0,g=h?.type??null,v=e.pathFor(d),x=this.isOverride(p,h,e.keyFor(d));c.push({path:v,label:$(d),type:f?"string":g??this.measuredTypeFor(i,d)??(p?this.descriptorTypeFor(p,e,d,h):"string"),...h?.options?{options:[...h.options]}:{},readonly:f||(p?!p.isLiteral:!1)||this.dynamicPaths.has(e.keyFor(d)),...p?{}:{defaulted:!0},...x?{resettable:!0}:{},...x&&h?.defaultText!==void 0?{revertsTo:h.defaultText}:{},group:t})};for(const d of a)l(d.name,d);const u=new Set(a.map(d=>d.name));for(const d of r)u.has(d.name)||l(d.name,void 0);return c}nativeEnvironmentSource(e,t){const r=M(lt(e)),n=r?this.oidIndex.get(r):void 0;return r&&n?.environmentBinding?.kind===t?{oid:r,file:n.file,binding:n.environmentBinding}:null}canWriteEnvironmentToken(e,t){if(!e||!t||!this.writeBackend?.readSource||!this.writeBackend.applySource||!this.store.projectHistory)return!1;const r=this.sources.get(e.file);if(r===void 0||t.start<0||t.end>r.length)return!1;const n=r.slice(t.start,t.end);return"quote"in t?n===`${t.quote}${t.value}${t.quote}`:Number(n)===t.value}backgroundSource(){return G(this.scene.background)?this.nativeEnvironmentSource(this.scene.background,"background-color"):null}fogSource(){return L(this.scene.fog)?this.nativeEnvironmentSource(this.scene.fog,"fog"):q(this.scene.fog)?this.nativeEnvironmentSource(this.scene.fog,"fog-exp2"):null}textureLabel(e){return e?e.isCubeTexture?e.name||"Cube Texture":e.name||"Texture":"None"}worldProperties(){const e=[{path:"name",label:"World",type:"string",readonly:!0,group:"World"},{path:"source.path",label:"Entry",type:"string",readonly:!0,group:"World"}],t=this.scene.background,r=this.backgroundSource();if(e.push({path:`${R}type`,label:"Background",type:"string",readonly:!0,group:"Environment"}),G(t)){const s=r?.binding.kind==="background-color"?r.binding.color:void 0;e.push({path:`${R}color`,label:"Background Color",type:"color",readonly:!this.canWriteEnvironmentToken(r,s),group:"Environment"})}else on(t)&&e.push({path:`${R}intensity`,label:"Background Intensity",type:"number",readonly:!0,group:"Environment"},{path:`${R}blurriness`,label:"Background Blur",type:"number",readonly:!0,group:"Environment"},{path:`${R}rotation`,label:"Background Rotation Y",type:"number",readonly:!0,group:"Environment"});e.push({path:`${W}map`,label:"Lighting Environment",type:"string",readonly:!0,group:"Environment"}),this.scene.environment&&e.push({path:`${W}intensity`,label:"Environment Intensity",type:"number",readonly:!0,group:"Environment"},{path:`${W}rotation`,label:"Environment Rotation Y",type:"number",readonly:!0,group:"Environment"});const n=this.scene.fog,i=this.fogSource();if(e.push({path:`${S}mode`,label:"Mode",type:"string",readonly:!0,group:"Fog"}),n){const s=i?.binding.color;e.push({path:`${S}color`,label:"Color",type:"color",readonly:!this.canWriteEnvironmentToken(i,s),group:"Fog"})}if(L(n)){const s=i?.binding.kind==="fog"?i.binding:void 0;e.push({path:`${S}near`,label:"Near",type:"number",readonly:!this.canWriteEnvironmentToken(i,s?.near),group:"Fog"},{path:`${S}far`,label:"Far",type:"number",readonly:!this.canWriteEnvironmentToken(i,s?.far),group:"Fog"})}else if(q(n)){const s=i?.binding.kind==="fog-exp2"?i.binding:void 0;e.push({path:`${S}density`,label:"Density",type:"number",readonly:!this.canWriteEnvironmentToken(i,s?.density),group:"Fog"})}return e}worldValue(e){const t=this.scene.background,r=this.scene.fog;if(e==="name")return this.options.worldId;if(e==="source.path")return this.options.entryPath;if(e===`${R}type`)return t?G(t)?"Color":this.textureLabel(t):"None";if(e===`${R}color`&&G(t))return`#${t.getHexString()}`;if(e===`${R}intensity`)return this.scene.backgroundIntensity;if(e===`${R}blurriness`)return this.scene.backgroundBlurriness;if(e===`${R}rotation`)return this.scene.backgroundRotation.y*180/Math.PI;if(e===`${W}map`)return this.textureLabel(this.scene.environment);if(e===`${W}intensity`)return this.scene.environmentIntensity;if(e===`${W}rotation`)return this.scene.environmentRotation.y*180/Math.PI;if(e===`${S}mode`)return L(r)?"Linear":q(r)?"Exponential":"None";if(e===`${S}color`&&r)return`#${r.color.getHexString()}`;if(e===`${S}near`&&L(r))return r.near;if(e===`${S}far`&&L(r))return r.far;if(e===`${S}density`&&q(r))return r.density}setWorldValue(e,t){const r=this.scene.background,n=this.scene.fog;if(e===`${R}color`&&G(r)){const s=this.backgroundSource(),a=s?.binding.kind==="background-color"?s.binding.color:void 0;if(typeof t!="string"||!s||!a)return!1;const c=`#${r.getHexString()}`;return this.writeEnvironmentToken(s,a,t,"Edit background color",()=>r.set(t),()=>r.set(c))}const i=this.fogSource();if(!n||!i)return!1;if(e===`${S}color`&&typeof t=="string"){const s=i.binding.color;if(!s)return!1;const a=`#${n.color.getHexString()}`;return this.writeEnvironmentToken(i,s,t,"Edit fog color",()=>n.color.set(t),()=>n.color.set(a))}if(typeof t!="number")return!1;if(e===`${S}near`&&L(n)){const s=i.binding.kind==="fog"?i.binding.near:void 0;if(!s)return!1;const a=n.near,c=Math.max(0,Math.min(t,n.far-.01));return this.writeEnvironmentToken(i,s,c,"Edit fog near",()=>{n.near=c},()=>{n.near=a})}else if(e===`${S}far`&&L(n)){const s=i.binding.kind==="fog"?i.binding.far:void 0;if(!s)return!1;const a=n.far,c=Math.max(n.near+.01,t);return this.writeEnvironmentToken(i,s,c,"Edit fog far",()=>{n.far=c},()=>{n.far=a})}else if(e===`${S}density`&&q(n)){const s=i.binding.kind==="fog-exp2"?i.binding.density:void 0;if(!s)return!1;const a=n.density,c=Math.max(0,t);return this.writeEnvironmentToken(i,s,c,"Edit fog density",()=>{n.density=c},()=>{n.density=a})}return!1}async writeEnvironmentToken(e,t,r,n,i,s){const a=this.writeBackend,c=this.store.projectHistory,l=this.sources.get(e.file);if(!a||!c||l===void 0||!this.canWriteEnvironmentToken(e,t))return!1;let u;if("quote"in t){if(typeof r!="string"||sn(r)===null)return!1;const h=r.replaceAll("\\","\\\\").replaceAll(t.quote,`\\${t.quote}`);u=`${t.quote}${h}${t.quote}`}else{if(typeof r!="number"||!Number.isFinite(r))return!1;u=F(r)}i(),this.store.notifyIngestEdit();const d=`${l.slice(0,t.start)}${u}${l.slice(t.end)}`;try{return await B(a,c,{file:e.file,source:d,label:n}),this.sources.set(e.file,d),await this.refreshSourceState(),!0}catch(h){throw s(),this.store.notifyIngestEdit(),h}}visibilityEditability(e){if(this.borrowsRepresentativeCallsite(e))return{writable:!1,reason:"This rendered part has no visibility prop of its own."};if(!this.oidOf(e))return{writable:!1,reason:"This rendered part has no authored source identity."};if(!this.writeBackend?.writeProp)return{writable:!1,reason:"This session has no source writer."};const r=this.attrsOf(e);if(!r)return{writable:!1,reason:"Source metadata is still loading or unavailable."};const n=r.find(a=>a.name==="visible"),i=this.byId.get(e);if(i&&this.isComponentBoundary(i)){const a=this.oidEntryOf(i),c=a?.r3fAuthoring;if(c?.visibleProp!==!0)return{writable:!1,reason:`${a?.tag??"This component"} does not prove that visible reaches its ${c?.rootTag??"native"} root.`}}return n?n.isLiteral?n.valueStart<0||n.isExpression&&(n.rawValue==="true"||n.rawValue==="false")?{writable:!0}:{writable:!1,reason:"visible is not exposed as a boolean JSX literal."}:{writable:!1,reason:`visible is controlled by the JSX expression {${n.rawValue}}.`}:{writable:!0}}async writeVisibility(e,t,r){const n=this.visibilityEditability(e),i=this.oidOf(e),s=this.writeBackend;if(!n.writable||!i||!s?.writeProp){const l=n.reason??"No native visibility write is available.";return console.warn(`[R3fSourceAuthoringAdapter] visibility write refused: ${l}`),j(l),!1}const a=t.visible,c=this.echoKey(e,"visible");t.visible=r,this.valueEcho.set(c,r),this.store.notifyIngestEdit();try{const l=await s.writeProp(i,"visible",this.serializeValue(r),{addIfMissing:!0});return l.changed?!0:(l.dynamic&&this.dynamicPaths.add(c),t.visible=a,this.valueEcho.delete(c),this.store.notifyIngestEdit(),console.warn(`[R3fSourceAuthoringAdapter] visibility write refused for oid "${i}": ${l.dynamic?"dynamic expression (guarded)":l.error??"no change"} — reverting.`),!1)}catch(l){return t.visible=a,this.valueEcho.delete(c),this.store.notifyIngestEdit(),console.warn(`[R3fSourceAuthoringAdapter] visibility write failed for oid "${i}": ${String(l)} — reverting.`),!1}}inspector={preview:(e,t,r)=>{const n=this.transformObject(e);if(!n)return;const i=Z(n,I(n),t,this.sourceLocation(e)?.tag);!i||i.type==="asset"||(T(n,I(n),i,r),this.store.notifyIngestEdit())},properties:e=>{if(e===this.documentNodeId)return this.worldProperties();const t=this.byId.get(e),r=this.transformObject(e);if(!t||!r)return[];const n=this.attrsOf(e)?.find(f=>f.name==="visible"),i=this.visibilityEditability(e),s=this.attrsOf(e)?.find(f=>f.name==="name"),a=[{path:"name",label:"Name",type:"string",readonly:!this.writeBackend?.writeProp||s?.isLiteral===!1},{path:"visible",label:"Visible",type:"boolean",readonly:!i.writable,...!i.writable&&i.reason?{readonlyReason:i.reason}:{},...n?{}:{defaulted:!0}},{path:"locked",label:"Locked",type:"boolean"}],c=Ce(r);c?.fields&&a.push(...c.fields().filter(f=>!["name","visible","locked"].includes(f.path)).map(({value:f,...g})=>g));const l=xt(r),u=[...$t(r,I(r),this.sourceLocation(e)?.tag),...l?[l]:[]],d=new Set(u.filter(f=>f.target==="self").map(f=>f.prop)),h=this.lodBindingsOf(e);h.length>0&&(d.add("distances"),d.add("hysteresis"));for(const f of h)a.push(...this.lodRows(f));const p=this.attrsOf(e);if(p){for(const w of this.collapsedWrappersOf(e))a.push(...this.componentProperties(this.wrapperSubject(w.oid),$(w.tag),this.attrsOfOid(w.oid)??[]));for(const w of this.colliderBindingsOf(e))a.push(...this.colliderDimensionRows(w)),a.push(...this.componentProperties(this.wrapperSubject(w.sourceOid),$(w.sourceTag),this.attrsOfOid(w.sourceOid)??[],new Set(["args"])));for(const w of this.jointBindingsOf(e))a.push(...this.jointRows(w));for(const w of this.particleBindingsOf(e))a.push(...this.particleRows(w));const f=this.oidEntryOf(t),g=f?.tag?$(f.tag):"Properties";this.sourceLocation(e)&&a.push({path:"source.location",label:"Source",type:"string",readonly:!0,group:g});const x=this.nodeSubject(e);x&&a.push(...this.componentProperties(x,g,p,d,r))}for(const f of u)a.push(this.typedThreeRow(e,r,f));return a},editability:(e,t)=>t==="visible"?this.visibilityEditability(e):t==="locked"?{writable:this.byId.has(e)}:{writable:!0},get:(e,t)=>{if(e===this.documentNodeId)return this.worldValue(t);const r=this.byId.get(e),n=this.transformObject(e);if(!r||!n)return;const i=this.valueEcho.get(this.echoKey(e,t));if(i!==void 0)return i;if(t==="name")return this.oidEntryOf(r)?.tag||n.name||n.type;if(t==="visible")return n.visible;if(t==="locked")return this.lockedIds.has(e);if(t==="object.type")return n.type;const s=Ce(n)?.fields?.().find(u=>u.path===t);if(s)return s.value();if(t==="source.location"){const u=this.sourceLocation(e);return u?`${u.file.split("/").slice(-2).join("/")}:${u.line}`:""}const a=Z(n,I(n),t,this.sourceLocation(e)?.tag);if(a)return this.readTypedThree(n,a);const c=this.parseColliderArgPath(t);if(c)return this.colliderArgs(c.oid)?.[c.index];if(t.startsWith(st))return this.jointValue(e,t);if(t.startsWith(at))return this.particleValue(e,t);if(t.startsWith(Se))return this.lodValue(e,t);const l=this.parseWrapperPropertyPath(t);if(l)return this.propValue(this.attrsOfOid(l.oid),this.oidIndex.get(l.oid)?.props??[],l.prop);if(t.startsWith(O)){const u=t.slice(O.length);return this.propValue(this.attrsOf(e),this.declaredPropsOf(e),u)}},set:(e,t,r)=>{if(e===this.documentNodeId)return this.pipedSourceTokenWrite(async()=>this.setWorldValue(t,r));const n=this.byId.get(e),i=this.transformObject(e);if(!n||!i)return;if(t==="visible")return this.pipedJsxWrite(()=>this.writeVisibility(e,i,!!r),void 0,this.destinationOf(e));if(t==="name"){const d=String(r??"").trim();return!d||d===i.name?void 0:this.pipedJsxWrite(()=>this.writeJsxProp(e,"name","name",d),void 0,this.destinationOf(e))}if(t==="locked"){r?this.lockedIds.add(e):this.lockedIds.delete(e),this.store.notifyIngestEdit();return}const s=Z(i,I(i),t,this.sourceLocation(e)?.tag);if(s)return s.type==="asset"?this.setTypedAsset(e,i,s,r):this.pipedJsxWrite(()=>this.writeTypedThree(e,i,s,r),void 0,this.destinationOf(e));const a=this.parseColliderArgPath(t);if(a&&typeof r=="number"){const d=this.colliderArgs(a.oid);return!d||a.index>=d.length?void 0:(d[a.index]=Math.max(.01,r),this.pipedJsxWrite(()=>this.writeOidProp(e,a.oid,`${N}${encodeURIComponent(a.oid)}.args`,"args",d),void 0,this.destinationOf(e)))}const c=this.jointParamPath(t);if(c&&typeof r=="number"){const d=this.jointBindingForPath(e,t);if(!d?.writable||!d.source.params)return;const h=d.source.params.map(f=>Array.isArray(f)?[...f]:f),p=h[c.param];if(c.part===void 0){if(typeof p!="number")return;h[c.param]=r}else{if(!Array.isArray(p)||typeof p[c.part]!="number")return;p[c.part]=r}return this.pipedSourceTokenWrite(()=>this.writeJointParams(d,h))}const l=this.particleFieldPath(t);if(l&&typeof r=="number"){const d=this.particleBindingForPath(e,t);return!d||!d.writableFields.has(l)?void 0:this.pipedSourceTokenWrite(()=>this.writeParticleField(d,l,r))}if(t.startsWith(Se)){const d=this.lodBindingForPath(e,t);if(!d)return;if(t.endsWith(".preview")){const p=typeof r=="string"?/^Level (\d+)/.exec(r):null,f=r==="Auto"?null:p?Number(p[1]):Number.NaN;(f===null||Number.isInteger(f)&&f>=0&&f<d.lod.levels.length)&&this.store.setLodForcedLevel(e,f);return}const h=/\.level\.(\d+)\.distance$/.exec(t);if(h&&typeof r=="number")return this.pipedSourceTokenWrite(()=>this.writeLodDistance(d,Number(h[1]),r));if(t.endsWith(".hysteresis")&&typeof r=="number")return this.pipedSourceTokenWrite(()=>this.writeLodHysteresis(d,r))}const u=this.parseWrapperPropertyPath(t);if(u)return this.pipedJsxWrite(()=>this.writeOidProp(e,u.oid,t,u.prop,r),void 0,this.destinationOf(e));if(t.startsWith(O))return this.pipedJsxWrite(()=>this.writeJsxProp(e,t,t.slice(O.length),r),void 0,this.destinationOf(e))},remove:(e,t)=>{const r=this.parseWrapperPropertyPath(t);if(r)return this.pipedJsxRemove(()=>this.removeOidProp(e,r.oid,t,r.prop),this.destinationOf(e));if(!t.startsWith(O))return;const n=this.oidOf(e);if(n)return this.pipedJsxRemove(()=>this.removeOidProp(e,n,t,t.slice(O.length)),this.destinationOf(e))}};spatialHandles=qr({object:e=>this.transformObject(e),sourceTag:e=>this.sourceLocation(e)?.tag,writable:(e,t)=>{const r=this.inspector.properties(e).find(n=>n.path===t);return!!r&&r.readonly!==!0},commit:(e,t,r)=>this.inspector.set(e,t,r),colliderBindings:e=>this.colliderBindingsOf(e),previewCollider:(e,t)=>this.options.physics?.()?.previewCollider?.(e,t),commitCollider:(e,t,r)=>this.pipedJsxWrite(()=>this.writeOidProp(e,t,`${N}${encodeURIComponent(t)}.args`,"args",r),void 0,this.destinationOf(e)),jointBindings:e=>this.jointBindingsOf(e),previewJointAnchor:(e,t,r)=>this.options.physics?.()?.previewJointAnchor?.(e,t,r),commitJoint:(e,t)=>this.pipedSourceTokenWrite(()=>this.writeJointParams(e,t)),particleBindings:e=>this.particleBindingsOf(e),commitParticle:(e,t,r)=>this.pipedSourceTokenWrite(()=>this.writeParticleField(e,t,r)),lodBindings:e=>this.lodBindingsOf(e),commitLodDistance:(e,t,r)=>this.pipedSourceTokenWrite(()=>this.writeLodDistance(e,t,r))});serializeValue(e){return Array.isArray(e)?K(e.map(t=>Number(t))):typeof e=="number"?F(e):typeof e=="boolean"?e?"true":"false":String(e)}propValue(e,t,r){const n=e?.find(s=>s.name===r);if(n)return this.literalValueOf(n);const i=t.find(s=>s.name===r);return i?i.defaultValue??i.defaultText:void 0}echoKey(e,t){return t.startsWith(he)?t:`${e}|${t}`}projectRelativeSourceFile(e){const t=e.replaceAll("\\","/"),r=this.options.entryPath.replaceAll("\\","/").replace(/^\.\//,"");if(!t.startsWith("/")&&!/^[A-Za-z]:\//.test(t))return t;for(const n of this.oidIndex.values()){const i=n.file.replaceAll("\\","/");if(i!==r&&!i.endsWith(`/${r}`))continue;const s=i.slice(0,-r.length);if(t.startsWith(s))return t.slice(s.length)}return r}pipedJsxRemove(e,t=this.options.entryPath){return this.pipedJsxWrite(e,this.writeBackend?.removeProp!==void 0,t)}async removeOidProp(e,t,r,n){if(!this.writeBackend?.removeProp)return console.warn(`[R3fSourceAuthoringAdapter] cannot revert "${n}": no source-write backend.`),!1;this.valueEcho.delete(this.echoKey(e,r));const i=await this.writeBackend.removeProp(t,n);return i.changed?(await this.refreshSourceState(),!0):(this.store.notifyIngestEdit(),console.warn(`[R3fSourceAuthoringAdapter] revert refused/no-op for oid "${t}" prop "${n}": ${i.dynamic?"dynamic expression (guarded)":i.error??"no change"}`),!1)}async writeOidProp(e,t,r,n,i){if(!this.writeBackend?.writeProp)return console.warn(`[R3fSourceAuthoringAdapter] cannot write "${n}": no source-write backend.`),!1;const s=this.echoKey(e,r);this.valueEcho.set(s,i),this.store.notifyIngestEdit();let a;try{a=await this.writeBackend.writeProp(t,n,this.serializeValue(i),{addIfMissing:!0})}catch(c){return this.valueEcho.delete(s),this.store.notifyIngestEdit(),console.warn(`[R3fSourceAuthoringAdapter] prop write failed for oid "${t}" prop "${n}": ${String(c)}`),!1}return a.changed?!0:(this.valueEcho.delete(s),a.dynamic&&this.dynamicPaths.add(s),this.store.notifyIngestEdit(),console.warn(`[R3fSourceAuthoringAdapter] prop write refused/no-op for oid "${t}" prop "${n}": ${a.dynamic?"dynamic expression (guarded)":a.error??"no change"}`),!1)}async writeJsxProp(e,t,r,n){const i=this.oidOf(e);if(!i||!this.writeBackend?.writeProp)return console.warn(`[R3fSourceAuthoringAdapter] cannot write "${r}" on "${e}": ${i?"no source-write backend in this session":"node has no source stamp"}.`),!1;const s=`${e}|${t}`;this.valueEcho.set(s,n),this.store.notifyIngestEdit();let a;try{a=await this.writeBackend.writeProp(i,r,this.serializeValue(n),{addIfMissing:r==="name"||this.declaredPropsOf(e).some(c=>c.name===r)})}catch(c){return this.valueEcho.delete(s),this.store.notifyIngestEdit(),console.warn(`[R3fSourceAuthoringAdapter] prop write failed for oid "${i}" prop "${r}": ${String(c)}`),!1}return a.changed?!0:(this.valueEcho.delete(s),a.dynamic&&this.dynamicPaths.add(s),this.store.notifyIngestEdit(),console.warn(`[R3fSourceAuthoringAdapter] prop write refused/no-op for oid "${i}" prop "${r}": ${a.dynamic?"dynamic expression (guarded)":a.error??"no change"}`),!1)}typedFieldOid(e,t,r){return r.target==="material"?this.materialOidOf(t):this.oidOf(e)}propDrivingTypedField(e,t,r){if(r.target!=="material")return null;const n=this.materialOidOf(t);if(!n)return null;const i=this.attrsOfOid(n)?.find(a=>a.name===r.prop);if(!i||i.isLiteral)return null;const s=i.rawValue.trim();return/^[A-Za-z_$][\w$]*$/.test(s)&&this.declaredPropsOf(e).some(a=>a.name===s)?s:null}typedThreeRow(e,t,r){if(r.type==="asset")return{path:r.path,label:r.label,type:r.type,group:r.group,readonly:!I(t),...I(t)?{}:{readonlyReason:"This object has no material to assign a texture to."}};const n=this.typedFieldOid(e,t,r),s=(r.target==="material"?n?this.attrsOfOid(n):null:this.attrsOf(e))?.find(u=>u.name===r.prop)??null,a=this.propDrivingTypedField(e,t,r),c=(s?!s.isLiteral:!1)&&!a||this.dynamicPaths.has(`${e}|${r.path}`),l=!!n&&!!this.writeBackend?.writeProp&&!c;return{path:r.path,label:r.label,type:r.type,...r.options?{options:[...r.options]}:{},group:r.group,readonly:!l,...s?{}:{defaulted:!0}}}readTypedThree(e,t){return J(e,I(e),t)}setTypedAsset(e,t,r,n){const i=I(t),s=T(t,i,r,n);return s!==null&&(this.valueEcho.set(`${e}|${r.path}`,J(t,i,r)),this.store.notifyIngestEdit()),ie({resolve:()=>oe(s===null?`"${r.label}" has no material on "${e}" to assign to`:`a texture slot binds a loaded THREE.Texture, not a JSX attribute literal — assigning "${r.prop}" in source means adding a useTexture() binding to the component, which this adapter's attribute writer cannot author`),record:()=>{},report:a=>console.warn(`[R3fSourceAuthoringAdapter] this edit stays live-only — ${a}.`)})}async writeTypedThree(e,t,r,n){const i=this.propDrivingTypedField(e,t,r);if(i){const h=I(t),p=J(t,h,r),f=T(t,h,r,n);if(f===null)return!1;this.store.notifyIngestEdit();const g=await this.writeJsxProp(e,`${O}${i}`,i,f);return!g&&p!==null&&p!==void 0&&(T(t,h,r,p),this.store.notifyIngestEdit()),g}const s=this.typedFieldOid(e,t,r),a=I(t);if(!s||!this.writeBackend?.writeProp)return console.warn(`[R3fSourceAuthoringAdapter] cannot write "${r.path}" on "${e}": ${s?"no source-write backend in this session":"no source stamp for this field"}.`),!1;const c=J(t,a,r),l=T(t,a,r,n);if(l===null)return!1;const u=`${e}|${r.path}`;this.valueEcho.set(u,J(t,a,r)),this.store.notifyIngestEdit();let d;try{d=await this.writeBackend.writeProp(s,r.prop,this.serializeValue(l),{addIfMissing:!0})}catch(h){return this.valueEcho.delete(u),await this.refreshSourceState(),this.store.notifyIngestEdit(),console.warn(`[R3fSourceAuthoringAdapter] typed "${r.prop}" write failed for oid "${s}": ${String(h)}`),!1}return d.changed||d.dynamic&&this.declaredPropsOf(e).some(h=>h.name===r.prop)&&(this.valueEcho.delete(u),await this.writeJsxProp(e,`${O}${r.prop}`,r.prop,l))?!0:(this.valueEcho.delete(u),d.dynamic&&this.dynamicPaths.add(u),c!=null&&T(t,a,r,c),this.store.notifyIngestEdit(),Pe.warn(`“${r.prop}” on “${this.hierarchy.node(e)?.label??e}” is ${d.dynamic?"bound to an expression in the component’s own source, so a direct edit cannot land — the preview was reverted. Edit the prop that drives it (or the component source) instead.":`not writable here (${d.error??"no change"}) — the preview was reverted.`}`,"editor"),!1)}structureClipboardPayload(e){const t=new Set(e),r=[...new Set(e)].filter(l=>{let u=this.hierarchy.node(l)?.parentId??null;for(;u;){if(t.has(u))return!1;u=this.hierarchy.node(u)?.parentId??null}return!0}),n=[],i=new Set;for(const l of r){const u=this.oidOf(l);if(!u||i.has(u))continue;i.add(u);const d=this.oidIndex.get(u),h=d?this.sources.get(d.file):void 0;if(!d||h===void 0)return null;const p=H(h,d.line,d.col),f=zt(h,p);if(h[p]!=="<"||f<=p)return null;const g=h.slice(h.lastIndexOf(`
7
+ `,p-1)+1,p),v=h.slice(p,f),x=/^\s*$/.test(g)?v.split(`
8
+ `).map((w,te)=>te>0&&w.startsWith(g)?w.slice(g.length):w).join(`
9
+ `):v;n.push({file:d.file,offset:p,text:x})}if(n.length===0)return null;const s=n[0].file;if(n.some(l=>l.file!==s))return null;n.sort((l,u)=>l.offset-u.offset);const a=this.transformObject(r[0]??""),c=a?new Me().setFromObject(a).getSize(new m).x:Number.NaN;return{sourceFile:s,text:n.map(l=>l.text).join(`
10
+ `),count:n.length,pasteOffset:[Number.isFinite(c)&&c>0?c+.5:1.5,0,0]}}refuseStructureClipboard(e){return console.warn(`[R3fSourceAuthoringAdapter] ${e}`),j(e),!1}async copyStructure(e){this.structureClipboard=null;const t=this.structureClipboardPayload(e);if(!t)return this.refuseStructureClipboard("Copy needs source-addressable entities from one source file. Generated or cross-file selections stay unchanged.");const r=globalThis.navigator?.clipboard;if(!r?.writeText)return this.refuseStructureClipboard("The system clipboard is unavailable, so no entities were copied.");try{await r.writeText(t.text)}catch{return this.refuseStructureClipboard("The system clipboard refused the entity copy.")}return this.structureClipboard=t,j(`Copied ${t.count} ${t.count===1?"entity":"entities"}.`),!0}async cutStructure(e){return await this.copyStructure(e)?Re(await this.removeMany(e)):!1}clipboardPasteTarget(e){if(!e||e===this.documentNodeId){const i=this.topLevelEntryElements(),s=i.at(-1)??null,a=s?this.oidOf(s):null,c=a?this.oidIndex.get(a):void 0;if(!s||!a||!c)return null;const l=this.topLevelInstanceDefinitionRoot(s);if(l&&this.childrenSlotForOid(l.oid)==="open"){const d=this.sceneDropAnchor(l);return d?{id:s,oid:d,file:l.file,op:"create-sibling"}:{id:s,oid:l.oid,file:l.file,op:"create"}}const u=i.length===1&&this.childrenSlotForOid(a)==="open"?"create":i.length>1?"create-sibling":null;return u?{id:s,oid:a,file:c.file,op:u}:null}const t=this.definitionOid(e)??this.oidOf(e),r=t?this.oidIndex.get(t):void 0;if(!t||!r||this.childrenSlotForOid(t)!=="open")return null;const n=this.definitionOid(e);if(n){const i=this.sceneDropAnchor({oid:n,file:r.file});if(i)return{id:e,oid:i,file:r.file,op:"create-sibling"}}return{id:e,oid:t,file:r.file,op:"create"}}canPasteStructure(e){const t=this.structureClipboard,r=this.clipboardPasteTarget(e);return!!t&&!!r&&r.file===t.sourceFile}async pasteStructure(e){const t=this.structureClipboard;if(!t)return this.refuseStructureClipboard("Copy or cut an entity in this scene before pasting.");const r=globalThis.navigator?.clipboard;if(!r?.readText)return this.refuseStructureClipboard("The system clipboard is unavailable, so nothing was pasted.");try{const s=a=>a.replace(/\r\n/g,`
11
+ `);if(s(await r.readText())!==s(t.text))return this.refuseStructureClipboard("The clipboard changed after the entity copy, so nothing was pasted.")}catch{return this.refuseStructureClipboard("The system clipboard refused the entity paste.")}const n=this.clipboardPasteTarget(e);if(!n)return this.refuseStructureClipboard("Paste needs a source-addressable parent with a children slot.");if(n.file!==t.sourceFile)return this.refuseStructureClipboard("Cross-file paste is refused because the destination may not import the copied component dependencies.");const i=t.pasteOffset?Jt(t.text,t.pasteOffset):t.text;return this.recordPendingCreatedSelection(n.op==="create"?n.id:this.hierarchy.node(n.id)?.parentId??this.documentNodeId),Re(await this.structOp(n.id,n.op,{snippet:i},n.oid))}structure={create:(e,t)=>{const r=ut[e];if(!r||!t)return{id:"",ack:this.structRefusal(`create refused: ${r?"no parent node given":`unknown preset kind "${e}"`}.`)};const n=this.definitionOid(t),i=n??this.oidOf(t),s=i?this.oidIndex.get(i)?.file:void 0,a=this.structOp(t,"create",{snippet:r,...e==="reflectionProbe"?{ensureImport:{name:"ReflectionProbe",module:Vt(s?this.projectRelativeSourceFile(s):this.options.entryPath,"src/lib/reflections")}}:{}},i),c=this.byId.get(t);if(!(this.options.hierarchyMode!=="definition"&&n!==void 0&&e!=="reflectionProbe"&&!(c&&this.insideTransparentTopLevel(c))))return{id:"",ack:a};const u=this.hierarchy.node(t)?.label??t,d=ht[e]??e,h=s?this.projectRelativeSourceFile(s):void 0;return{id:"",ack:a.then(p=>(p.persisted&&Pe.warn(`Added ${d} inside ${u}'s definition${h?` (${h})`:""}. This hierarchy folds ${u}'s own elements under it, so the new ${d} cannot be selected here yet — edit it in ${h??"that file"} (right-click ${u} → Open Component Source).`,"authoring"),p))}},creatableKinds:e=>{if(!e||e===this.documentNodeId)return[];const t=this.definitionOid(e)??this.oidOf(e);return!t||this.childrenSlotForOid(t)!=="open"?[]:Object.keys(ut).filter(r=>r!=="reflectionProbe"||this.reflectionProbeAvailable).map(r=>({kind:r,label:ht[r]??r}))},wrap:(e,t)=>this.structOp(e,"wrap",{wrapperTag:t??"group"}),unwrap:e=>this.structOp(e,"unwrap"),group:e=>{const t=[...new Set(e)];if(t.length<2||!this.writeBackend?.writeStructMany)return{id:null,ack:void 0};const r=t.map(i=>this.hierarchy.node(i)),n=r[0]?.parentId;return!n||r.some(i=>!i||i.parentId!==n)||t.some(i=>!this.oidOf(i))?{id:null,ack:this.structRefusal("group requires two or more source-addressable siblings.")}:{id:"",ack:this.groupMany(t)}},canUngroup:e=>{const t=this.byId.get(e),r=t?this.oidEntryOf(t):null;return!!(t&&r?.tag==="group"&&!this.isComponentBoundary(t)&&this.hierarchy.node(e)?.childIds.length)},ungroup:e=>this.structure.canUngroup?.(e)?{ids:[...this.hierarchy.node(e)?.childIds??[]],ack:this.structOp(e,"unwrap")}:{ids:[],ack:void 0},remove:e=>this.dropSelectionOnRemoval([e],this.structOp(e,"delete")),removeMany:e=>this.dropSelectionOnRemoval(e,this.removeMany(e)),copy:e=>this.copyStructure(e),canCopy:e=>this.structureClipboardPayload(e)!==null,cut:e=>this.cutStructure(e),paste:e=>this.pasteStructure(e),canPaste:e=>this.canPasteStructure(e),duplicate:e=>(this.recordPendingCreatedSelection(this.hierarchy.node(e)?.parentId??this.documentNodeId,e),{id:e,ack:this.structOp(e,"duplicate",{duplicate:this.duplicateRewrite(e)})}),reparent:(e,t)=>{const r=t?this.topLevelInstanceDefinitionRoot(t)?.oid??this.oidOf(t):null;if(!r)return this.refuseReparent(t?"That row has no authored source element to move into.":"The world root is not an authored source element — drop onto a row instead.");const n=this.reparentContext(e,t);return"error"in n?this.refuseReparent(n.error):this.reparentThrough(e,r,n)},reorder:(e,t)=>{const r={};if(t){const n=this.oidOf(t);if(!n)return this.structRefusal("reorder target has no source stamp — refused.");r.targetOid=n}else{const n=this.hierarchy.node(e),i=n?.parentId?this.oidOf(n.parentId):null;if(!i)return this.structRefusal("reorder-to-end needs a source-addressable parent — refused.");r.parentOid=i}return this.structOp(e,"reorder",r)}};assetDrop={accepts:(e,t,r)=>{const n=r?.item?.kind==="component"?r.item:null;return n&&this.ensureComponentPropSpecs(n),this.assetDropPlan(e,t,r).ok},drop:async(e,t,r)=>{const n=r?.item?.kind==="component"?r.item:null;if(n){await this.ensureComponentPropSpecs(n);const c=this.unsuppliedRequiredProps(n);if(c.length>0){const l=`${n.name} needs ${c.map(u=>`\`${u.name}\``).join(", ")} — required props with no default, which a drop cannot supply. Place it from a story that provides them, or give them defaults in ${n.sourcePath}.`;console.warn(`[R3fSourceAuthoringAdapter] asset drop refused — ${l}`),j(l);return}}const i=this.assetDropPlan(e,t,r);if(!i.ok){console.warn(`[R3fSourceAuthoringAdapter] asset drop refused — ${i.reason}`),j(i.reason);return}const s=i.op==="create-sibling"?this.idForOid(i.sourceOid):null,a=s?this.hierarchy.node(s)?.parentId??i.parentId:i.parentId;return this.recordPendingCreatedSelection(a,s??void 0),this.structOp(i.parentId,i.op,{snippet:i.snippet,ensureImport:i.ensureImport},i.sourceOid??null)}};idForOid(e){if(!e)return null;const t=this.oidRepresentative.get(e);return t?this.idByObject.get(t)??null:null}assetDropPlan(e,t,r){if(!this.writeBackend)return{ok:!1,reason:"This session has no source writer, so nothing can be added."};const n=r?.item?.kind==="component"?r.item:null;if(n&&n.surface!=="three")return{ok:!1,reason:`${n.name} is a ${n.surface} component, not a Three prefab.`};if(!n&&!Ct.test(t))return{ok:!1,reason:`${t} is not a .glb/.gltf model. A three world mounts models as scene nodes; an image or an audio file has no element to become here — a texture belongs on a material, not in the hierarchy.`};const i=c=>n?this.componentSnippet(n.name,r,c):this.modelSnippet(t,r,c);if(e===""||e===this.documentNodeId){const c=this.lastTopLevelEntryElement();if(!c)return{ok:!1,reason:`No top-level element of this world is authored in ${this.options.entryPath}, so there is nowhere to append the model — drop it onto a hierarchy row instead.`};const l=this.topLevelInstanceDefinitionRoot(c);if(l&&this.childrenSlotForOid(l.oid)==="open"){const u=this.sceneDropAnchor(l);return{ok:!0,parentId:c,op:u?"create-sibling":"create",snippet:i(c),sourceOid:u??l.oid,ensureImport:n?this.componentImport(c,n,l.file):{name:X,module:pe}}}return{ok:!0,parentId:c,op:"create-sibling",snippet:i(this.documentNodeId),ensureImport:n?this.componentImport(c,n):{name:X,module:pe}}}if(!this.oidOf(e))return{ok:!1,reason:"That row has no authored source element to add the model to."};const s=this.topLevelInstanceDefinitionRoot(e);if(s){const c=this.childrenSlotForOid(s.oid);if(c!=="open")return{ok:!1,reason:c==="unknown"?"That component's source file has not loaded yet — try the drop again in a moment.":`${this.hierarchy.node(e)?.label??"That component"}'s root element is written self-closing, so nothing can be authored inside it.`};const l=this.sceneDropAnchor(s);return{ok:!0,parentId:e,op:l?"create-sibling":"create",snippet:i(e),sourceOid:l??s.oid,ensureImport:n?this.componentImport(e,n,s.file):{name:X,module:pe}}}const a=this.childrenSlot(e);return a==="unknown"?{ok:!1,reason:"That row's source file has not loaded yet — try the drop again in a moment."}:a==="self-closing"?{ok:!1,reason:`<${this.hierarchy.node(e)?.label??"That element"}> is written self-closing, so it has no children slot to put the model in. Drop onto a row that wraps its children, or onto the viewport.`}:{ok:!0,parentId:e,op:"create",snippet:i(e),ensureImport:n?this.componentImport(e,n):{name:X,module:pe}}}uniqueSiblingName(e,t){const r=new Set((t?this.hierarchy.node(t)?.childIds??[]:[]).map(i=>this.hierarchy.node(i)?.label).filter(i=>typeof i=="string"));let n=e;for(let i=2;r.has(n);i++)n=`${e} ${i}`;return n}componentSnippet(e,t,r){const n=this.uniqueSiblingName(e,r),i=t?.item?.kind==="component"?t.item:null,s=` name=${JSON.stringify(n)}`+(t?.position?` position={${K(t.position)}}`:"")+(i?this.requiredEnumDefaults(i):"");return`<${e}${s} />`}componentPropSpecs=new Map;componentPropSpecsPending=new Map;componentSpecKey(e){return`${e.sourcePath}::${e.exportKind}:${e.name}`}ensureComponentPropSpecs(e){const t=this.componentSpecKey(e);if(this.componentPropSpecs.has(t))return Promise.resolve();const r=this.componentPropSpecsPending.get(t);if(r)return r;const n=this.writeBackend?.componentProps;if(!n)return this.componentPropSpecs.set(t,null),Promise.resolve();const i=n(this.projectRelativeSourceFile(e.sourcePath),{name:e.name,exportKind:e.exportKind}).then(s=>{this.componentPropSpecs.set(t,s)}).catch(s=>{console.warn(`[R3fSourceAuthoringAdapter] declared props of ${e.name} unavailable — ${s instanceof Error?s.message:String(s)}`),this.componentPropSpecs.set(t,null)}).finally(()=>{this.componentPropSpecsPending.delete(t)});return this.componentPropSpecsPending.set(t,i),i}unsuppliedRequiredProps(e){const t=this.componentPropSpecs.get(this.componentSpecKey(e));return t?t.filter(r=>!r.optional&&r.defaultText===void 0&&r.type!=="enum"&&!dt.has(r.name)):[]}requiredEnumDefaults(e){const t=this.componentPropSpecs.get(this.componentSpecKey(e));if(!t)return"";let r="";for(const n of t){if(n.optional||n.defaultText!==void 0||n.type!=="enum"||dt.has(n.name))continue;const i=n.options?.[0];i!==void 0&&(r+=typeof i=="string"?` ${n.name}=${JSON.stringify(i)}`:` ${n.name}={${i}}`)}return r}sceneDropAnchor(e){let t=null;for(const n of this.sceneInstancesByParent(e).values())(!t||n.length>t.length)&&(t=n);if(!t)return null;let r=t[0];for(const n of t)(n.line>r.line||n.line===r.line&&n.col>r.col)&&(r=n);return r.oid}sceneInstancesByParent(e){const t=this.oidIndex.get(e.oid)?.component??null,r=new Map;for(const[n,i]of this.oidIndex){if(i.file!==e.file||t!==null&&i.component!==t||!/^[A-Z]/.test(i.tag)||n===e.oid)continue;const s=r.get(i.parentOid??"")??[];s.push({oid:n,line:i.line,col:i.col}),r.set(i.parentOid??"",s)}return r}topLevelInstanceDefinitionRoot(e){const t=this.byId.get(e);if(!t||!re(t)||this.componentOwnerChain(t).length>1)return null;const r=this.definitionOid(e),n=r?this.oidIndex.get(r)?.file:void 0;return r&&n?{oid:r,file:n}:null}componentImport(e,t,r){const n=r??this.sourceLocation(e)?.file??this.options.entryPath;return{name:t.name,module:this.relativeProjectModule(n,t.sourcePath),kind:t.exportKind}}relativeProjectModule(e,t){const n=this.projectRelativeSourceFile(e).split("/").slice(0,-1),i=ve(this.projectRelativeSourceFile(t)).replace(/\.[cm]?[jt]sx?$/,"").split("/");for(;n[0]&&n[0]===i[0];)n.shift(),i.shift();const s=[...n.map(()=>".."),...i].join("/");return s.startsWith(".")?s:`./${s}`}modelSnippet(e,t,r){const n=[`name="${ot(this.uniqueSiblingName(tn(e),r))}"`];return t?.position&&n.push(`position={${K(t.position)}}`),`<group ${n.join(" ")}>
12
+ <${X} src="${ot(e)}" />
13
+ </group>`}lastTopLevelEntryElement(){return this.topLevelEntryElements().at(-1)??null}topLevelEntryElements(){const e=ve(this.options.entryPath),t=[];for(const r of this.hierarchy.node(this.documentNodeId)?.childIds??[]){const n=this.oidOf(r),i=n?this.oidIndex.get(n):void 0;if(!i||ve(i.file)!==e)continue;const s=this.sources.get(i.file);if(s===void 0)continue;const a=H(s,i.line,i.col);s[a]==="<"&&t.push({id:r,offset:a})}return t.sort((r,n)=>r.offset-n.offset),t.map(r=>r.id)}childrenSlot(e){const t=this.oidOf(e);return t?this.childrenSlotForOid(t):"unknown"}childrenSlotForOid(e){const t=this.oidIndex.get(e);if(!t)return"unknown";const r=this.sources.get(t.file);if(r===void 0)return"unknown";const n=H(r,t.line,t.col);if(r[n]!=="<")return"unknown";const i=me(r,n);return i<0?"unknown":r[i-1]==="/"?"self-closing":"open"}refuseReparent(e){return this.structRefusal(`reparent refused — ${e}`,e)}reparentContext(e,t){const r=this.liveInstanceCount(t),n=this.liveInstanceCount(e),i={...r===void 0?{}:{destinationInstances:r},...n===void 0?{}:{sourceInstances:n}},s=this.transformObject(e),a=this.byId.get(t);if(!s||!a)return i;s.updateWorldMatrix(!0,!1),a.updateWorldMatrix(!0,!1);const c=a.matrixWorld.clone().invert().multiply(s.matrixWorld),l=s.position.clone(),u=s.quaternion.clone(),d=s.scale.clone();c.decompose(l,u,d);const h=s.rotation.clone().setFromQuaternion(u,s.rotation.order),p=[["position",l.toArray(),s.position.toArray()],["rotation",[h.x,h.y,h.z],[s.rotation.x,s.rotation.y,s.rotation.z]],["scale",d.toArray(),s.scale.toArray()]],f={};for(const[v,x,w]of p){if(this.nearlyEqual(x,w))continue;const te=this.transformEditability(e,v);if(!te.writable)return{error:`Moving this changes its world ${v}, so the move would have to rewrite ${v} — but ${te.reason??`${v} is not writable here.`}`};f[v]=x}const g=Object.keys(f).length>0;return{...i,...g?{rebase:f}:{}}}reparentThrough(e,t,r){const n=this.oidOf(e);return n?this.structPipe.pipedStruct(async()=>{const i=await this.writeBackend.writeStruct(n,"reparent",{parentOid:t,...r});return i.changed?(i.warning&&j(i.warning),this.store.notifyIngestEdit(),!0):(this.refuseReparent(i.error??"The move produced no source change."),!1)},"reparent",this.writeBackend?.writeStruct!==void 0,this.destinationOf(e)):this.refuseReparent("This row has no authored source element to move.")}structPipe=Ut({report:e=>console.warn(`[R3fSourceAuthoringAdapter] ${e}`),noWriterReason:de,backend:()=>this.writeBackend,onChanged:()=>this.store.notifyIngestEdit()});pendingDuplicateLabels=new Set;pendingDuplicateCounts=new Map;duplicateRewrite(e){const t=this.hierarchy.node(e),r={};if(t){const i=t.label.replace(/ \d+$/,""),s=new Set((t.parentId?this.hierarchy.node(t.parentId)?.childIds??[]:[]).map(c=>this.hierarchy.node(c)?.label).filter(c=>typeof c=="string"));let a=2;for(;s.has(`${i} ${a}`)||this.pendingDuplicateLabels.has(`${i} ${a}`);)a++;r.name=`${i} ${a}`,this.pendingDuplicateLabels.add(r.name)}const n=this.transformObject(e);if(n){const i=new Me().setFromObject(n).getSize(new m),s=Number.isFinite(i.x)&&i.x>0?i.x:1,a=(this.pendingDuplicateCounts.get(e)??0)+1;this.pendingDuplicateCounts.set(e,a),r.positionOffset=[(s+.5)*a,0,0]}return r}structOp(e,t,r,n){return this.structPipe.structOp(n??this.oidOf(e),e,t,r,this.destinationOf(e))}dropSelectionOnRemoval(e,t){const r=new Set(e);return[...this.store.selectedEntityIds].some(i=>r.has(i))&&this.store.selectMultiple([]),t}async removeMany(e){const t=[...new Set(e.map(r=>this.oidOf(r)).filter(r=>!!r))];if(t.length===0||!this.writeBackend?.writeStructMany){let r=_t;for(const n of e)r=await this.structOp(n,"delete");return r}return this.structPipe.structMany(t,"delete",void 0,this.destinationOf(e[0]??""))}groupMany(e){const t=e.map(r=>this.oidOf(r)).filter(r=>!!r);return this.structPipe.structMany(t,"group",void 0,this.destinationOf(e[0]??""))}structRefusal(e,t){return this.structPipe.structRefusal(e,t)}subscribe(e){return this.store.subscribe(e)}get documentId(){return this.documentNodeId}}const pt=new Set;function un(o){pt.has(o)||(pt.add(o),Pe.warn(`Element "${o}" has no source metadata — added by hot reload, so the OID index does not cover it until the editor page reloads. Its Inspector fields refuse writes until then; reload the page to author it.`))}export{Cn as R3fSourceAuthoringAdapter};
@@ -0,0 +1 @@
1
+ function b(s,t){return`[RapierPhysicsAdapter] ${s}: this world does not know node id "${t}", so there is no body to drive. Refusing rather than reporting a completed write — gate on ownerOf(id) !== 'unresolved' before driving physics from a game-scoped adapter.`}function y(s){const t=new Map,c=(o,e)=>{const n=s(e);if(n.kind==="unresolved")throw new Error(b(o,e));return n.kind==="body"?n.body:null};return{ownerOf(o){const e=s(o);return e.kind==="unresolved"?"unresolved":e.kind==="no-body"||e.body.isFixed()?"editor":"physics"},freeze(o){const e=c("freeze",o);!e||t.has(e)||(t.set(e,e.bodyType()),e.setBodyType(2,!0))},commit(o,e){const n=c("commit",o);n&&(n.setTranslation({x:e.position[0],y:e.position[1],z:e.position[2]},!0),n.setRotation({x:e.rotation[0],y:e.rotation[1],z:e.rotation[2],w:e.rotation[3]},!0))},unfreeze(o){const e=c("unfreeze",o);if(!e)return;const n=t.get(e);n!==void 0&&(e.setBodyType(n,!0),t.delete(e))}}}function w(s,t,c){let o=new Float32Array(192),e=0;const n=(r,d,i)=>{if((e+1)*3>o.length){const a=new Float32Array(o.length*2);a.set(o),o=a}o[e*3]=r,o[e*3+1]=d,o[e*3+2]=i,e++},l=r=>{const d=r.numSolverContacts();for(let i=0;i<d;i++){const a=r.solverContactPoint(i);a&&n(a.x,a.y,a.z)}},f=()=>{if(!t)return o.subarray(0,0);const r=t.rapierWorld;e=0;for(const[,d]of s.entries())r.contactPairsWith(d.collider,i=>{i.handle<=d.collider.handle||r.contactPair(d.collider,i,l)});return o.subarray(0,e*3)},u={...y(r=>{const d=c(r);if(!d)return{kind:"unresolved"};const i=s.get(d)?.body;return i?{kind:"body",body:i}:{kind:"no-body"}})};return t&&(u.debugDraw=()=>t.debugMesh,u.setDebugDrawEnabled=r=>{t.debugEnabled=r,t.debugMesh.visible=r},u.contactPoints=f),u}export{y as createRapierBodyEditing,w as createRapierPhysicsAdapter};
@@ -0,0 +1 @@
1
+ import{useRapier as W}from"./react-three-rapier.esm-CEfKpvxT.js";import{declareScopedSystem as L,createSystemSlot as V}from"./system-slot-E2mEdiih.js";import{createRapierBodyEditing as I}from"./rapier-physics-adapter-CaZqWLu0.js";import{r as X}from"./index-nmcBqr7Y.js";import{u as $}from"./events-156d8d12.esm-ErOhDXXB.js";import{V as b,Q as x}from"./three.module-D396a9Mn.js";import"./index-GIL7oGEO.js";import"./jsx-runtime-DPjLkJKQ.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-D_NuPfjr.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./BufferGeometryUtils-Nz37EVXf.js";import"./index-bQE2NA0D.js";function E(l,i){let a;for(const r of l)if(r.object.traverse(c=>{!a&&c.userData.entityId===i&&(a=c)}),a)return a}function k(l,i){const a=new Map;for(const r of i)a.set(r.object,r.rigidBody);for(let r=l;r;r=r.parent){const c=a.get(r);if(c)return c}}function dt({onDebugChange:l}){const i=$(f=>f.scene),{colliderStates:a,rapier:r,rigidBodyStates:c,world:y}=W();return X.useEffect(()=>{const f=t=>{const e=E(c.values(),t);if(e)return k(e,c.values())},P=t=>{const e=E(c.values(),t);if(!e)return{kind:"unresolved"};const o=k(e,c.values());return o?{kind:"body",body:o}:{kind:"no-body"}},A=t=>r.ShapeType[t]??`shapeType ${t}`,S=t=>{switch(t.shapeType()){case r.ShapeType.Cuboid:{const e=t.halfExtents();return{type:"cuboid",halfExtents:[e.x,e.y,e.z]}}case r.ShapeType.Ball:return{type:"ball",radius:t.radius()};case r.ShapeType.Capsule:return{type:"capsule",halfHeight:t.halfHeight(),radius:t.radius()};default:return{type:"unsupported",kind:A(t.shapeType())}}},M=t=>{const e=f(t);if(!e)return[];const o=[];for(const n of a.values()){if(n.collider.parent()?.handle!==e.handle)continue;const s=S(n.collider);n.object.updateWorldMatrix(!0,!1);const d=n.collider.translation(),m=n.collider.rotation(),g=n.object.getWorldScale(new b);o.push({id:String(n.collider.handle),shape:s,position:[d.x,d.y,d.z],rotation:[m.x,m.y,m.z,m.w],scale:[Math.abs(g.x),Math.abs(g.y),Math.abs(g.z)],sensor:n.collider.isSensor()})}return o.sort((n,s)=>Number(n.id)-Number(s.id))},j=(t,e)=>{const o=[...a.values()].find(n=>String(n.collider.handle)===t)?.collider;if(!(!o||S(o)?.type!==e.type))switch(e.type){case"cuboid":o.setHalfExtents({x:e.halfExtents[0],y:e.halfExtents[1],z:e.halfExtents[2]});break;case"ball":o.setRadius(e.radius);break;case"capsule":o.setHalfHeight(e.halfHeight),o.setRadius(e.radius);break}},B=t=>{switch(t){case r.JointType.Revolute:return"revolute";case r.JointType.Fixed:return"fixed";case r.JointType.Prismatic:return"prismatic";case r.JointType.Rope:return"rope";case r.JointType.Spring:return"spring";case r.JointType.Spherical:return"spherical";default:return"generic"}},u=t=>[t.x,t.y,t.z],h=t=>[t.x,t.y,t.z,t.w],v=(t,e)=>{const o=new b(e.x,e.y,e.z).applyQuaternion(new x(...h(t.rotation()))).add(new b(...u(t.translation())));return u(o)},H=(t,e)=>{if(e!=="revolute"&&e!=="prismatic")return{};const o=t;return o.limitsEnabled()?{limits:{min:o.limitsMin(),max:o.limitsMax()}}:{}},N=(t,e,o)=>{if(e!=="revolute"&&e!=="prismatic")return{};const n=t.frameX1(),s=new b(1,0,0).applyQuaternion(new x(n.x,n.y,n.z,n.w)),d=s.clone().applyQuaternion(new x(...h(o.rotation())));return{axis:u(s),worldAxis:u(d)}},Q=t=>{const e=t.body1(),o=t.body2(),n=t.anchor1(),s=t.anchor2(),d=B(t.type());return{id:String(t.handle),type:d,body1:String(e.handle),body2:String(o.handle),anchor1:u(n),anchor2:u(s),worldAnchor1:v(e,n),worldAnchor2:v(o,s),body1Position:u(e.translation()),body2Position:u(o.translation()),body1Rotation:h(e.rotation()),body2Rotation:h(o.rotation()),...N(t,d,e),...H(t,d),contactsEnabled:t.contactsEnabled()}},D=t=>{const e=f(t);if(!e)return[];const o=[];return y.impulseJoints.forEachJointHandleAttachedToRigidBody(e.handle,n=>{const s=y.impulseJoints.get(n);s&&o.push(Q(s))}),o.sort((n,s)=>Number(n.id)-Number(s.id))},F=(t,e,o)=>{const n=y.impulseJoints.get(Number(t));if(!n)return;const s={x:o[0],y:o[1],z:o[2]};e===0?n.setAnchor1(s):n.setAnchor2(s)},w={...I(P),setDebugDrawEnabled:t=>l(t),colliders:M,previewCollider:j,joints:D,previewJointAnchor:F},C=J(i);if(p.has(i))throw new Error("rapierPhysicsSystem: multiple bridges mounted in the same Fiber scene.");const O=C.attach(w);return p.set(i,w),()=>{p.get(i)===w&&p.delete(i),O()}},[a,l,r,c,i,y]),null}const T=new WeakMap,p=new Map;function z(){return V({name:"rapierPhysicsSystem",unattachedMessage:"no <RapierPhysicsBridge> is mounted inside a live <Physics> right now — the world is not playing, or the scene never mounted the bridge.",members:{ownerOf:{kind:"action"},freeze:{kind:"action"},commit:{kind:"action"},unfreeze:{kind:"action"},setDebugDrawEnabled:{kind:"action"},colliders:{kind:"action"},previewCollider:{kind:"action"},joints:{kind:"action"},previewJointAnchor:{kind:"action"}}})}function J(l){let i=T.get(l);return i||(i=z(),T.set(l,i)),i}const R=z().slot,q=L(new Proxy(R,{get(l,i){const a=Reflect.get(l,i);return typeof a!="function"?a:(...r)=>{if(p.size>1)throw new Error("rapierPhysicsSystem: unscoped access is ambiguous across multiple live worlds; use the mounted root’s bound systems.physics adapter.");const c=p.values().next().value??R;return Reflect.apply(Reflect.get(c,i),c,r)}}}),l=>J(l).slot);function ut(){return q}export{dt as RapierPhysicsBridge,ut as rapierPhysicsSystem};
@@ -0,0 +1 @@
1
+ import{r as s}from"./index-nmcBqr7Y.js";import{a as m}from"./client-DNXj_opT.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";var n=new Map;function l(){return globalThis.IS_REACT_ACT_ENVIRONMENT}var a=({callback:e,children:r})=>{let t=s.useRef();return s.useLayoutEffect(()=>{t.current!==e&&(t.current=e,e())},[e]),r};typeof Promise.withResolvers>"u"&&(Promise.withResolvers=()=>{let e=null,r=null;return{promise:new Promise((t,o)=>{e=t,r=o}),resolve:e,reject:r}});var w=async(e,r,t)=>{let o=await p(r,t);if(l()){o.render(e);return}let{promise:i,resolve:u}=Promise.withResolvers();return o.render(s.createElement(a,{callback:u},e)),i},h=(e,r)=>{let t=n.get(e);t&&(t.unmount(),n.delete(e))},p=async(e,r)=>{let t=n.get(e);return t||(t=m.createRoot(e,r),n.set(e,t)),t};export{w as renderElement,h as unmountElement};