@volter/game-editor 0.5.70 → 0.5.72

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 (326) hide show
  1. package/BUNDLED_NOTICES +18 -18
  2. package/catalog/entries/music.json +2 -2
  3. package/dist/.vite/manifest.json +2187 -2162
  4. package/dist/assets/{AssetBudgetPanel-DpXsaQ6w.js → AssetBudgetPanel-TYxRsWF2.js} +3 -3
  5. package/dist/assets/{AudioViewer-BdTHfNhD.js → AudioViewer-SyAuzT6d.js} +1 -1
  6. package/dist/assets/{CanvasBoardDocument-DY-7zohc.js → CanvasBoardDocument-bGKEifjb.js} +1 -1
  7. package/dist/assets/{CanvasSceneViewport-57CEFqSM.js → CanvasSceneViewport-DOvsDDXx.js} +1 -1
  8. package/dist/assets/{ColorInput-Co6tCY9p.js → ColorInput-ZEZlxzBn.js} +1 -1
  9. package/dist/assets/{EntityModelDocument-C-lhKrxv.js → EntityModelDocument-DLYhSTh-.js} +1 -1
  10. package/dist/assets/{EnvironmentAssetDocument-BNe6ANTN.js → EnvironmentAssetDocument-BNcQR6yX.js} +1 -1
  11. package/dist/assets/{GameplaySessionTimeline-CryFYfYN.js → GameplaySessionTimeline-B6GEizjr.js} +1 -1
  12. package/dist/assets/{ImageViewer-DiD2yIG4.js → ImageViewer-CVnrpv0B.js} +1 -1
  13. package/dist/assets/InspectorObjectPreview-BanF_X-B.js +1 -0
  14. package/dist/assets/{JsonAssetDocument-xyXetSbl.js → JsonAssetDocument-Cztt4zjY.js} +1 -1
  15. package/dist/assets/{LiveModuleDocument-BiAunjHS.js → LiveModuleDocument-26blElg2.js} +1 -1
  16. package/dist/assets/{LutAssetDocument-5sW-5rb0.js → LutAssetDocument-BnsiHHrS.js} +1 -1
  17. package/dist/assets/{ModelAssetDocument-Bdy7x47a.js → ModelAssetDocument-B5Yp9L8F.js} +1 -1
  18. package/dist/assets/{NonThreeAuthoringBootstrap-BP-1bVEr.js → NonThreeAuthoringBootstrap-BHOfZ9sF.js} +1 -1
  19. package/dist/assets/{Object3DDocumentToolbar-CvnSLDPI.js → Object3DDocumentToolbar-B6BaAth8.js} +1 -1
  20. package/dist/assets/Object3DDocumentViewport-B4A-C5QD.js +2 -0
  21. package/dist/assets/{Object3DPreview-D3w_dKrX.js → Object3DPreview-BbPdqVcd.js} +1 -1
  22. package/dist/assets/{OnlineAssetDetail-BnT8_p1W.js → OnlineAssetDetail-B9ku5sHJ.js} +1 -1
  23. package/dist/assets/{PlayBar-C8Mn-EI0.js → PlayBar-C72OdJpY.js} +1 -1
  24. package/dist/assets/{QuarksAssetDocument-DLMH5Csk.js → QuarksAssetDocument-B8WiFZqH.js} +1 -1
  25. package/dist/assets/{ReactCanvasControls-rNz8syVB.js → ReactCanvasControls-B-P7GL52.js} +1 -1
  26. package/dist/assets/{RootSelectionOverlay-Cn2Rbr1N.js → RootSelectionOverlay-DcHmoze3.js} +1 -1
  27. package/dist/assets/{ShaderAssetDocument-CsJCsNfA.js → ShaderAssetDocument-CAx5sVKJ.js} +1 -1
  28. package/dist/assets/{ShadowEditor-jB05hr1W.js → ShadowEditor-CCch2nLq.js} +1 -1
  29. package/dist/assets/{SourceAssetViewer-D0NgGrER.js → SourceAssetViewer-bAfvPckn.js} +1 -1
  30. package/dist/assets/{StageHost-B3Yt4I7r.js → StageHost-D_2vBQsa.js} +2 -2
  31. package/dist/assets/{StoryPreviewMount-CzzRn24c.js → StoryPreviewMount-BNoIvc7l.js} +1 -1
  32. package/dist/assets/{ThreeBoardDocument-BoHTN4Vl.js → ThreeBoardDocument-Bvu00xSO.js} +2 -2
  33. package/dist/assets/{ThreeIsolationSceneContent-BM-0S6J5.js → ThreeIsolationSceneContent-DGtDG--4.js} +1 -1
  34. package/dist/assets/{ToolObject3DPreview-BeM_kx_u.js → ToolObject3DPreview-BKlQKnPe.js} +1 -1
  35. package/dist/assets/{Toolbar-BZyog9MR.js → Toolbar-TU3vLh4L.js} +1 -1
  36. package/dist/assets/{TransientHint-RJEkOJoy.js → TransientHint-K6pZSJgG.js} +1 -1
  37. package/dist/assets/{VideoViewer-CxajgKrf.js → VideoViewer-DrtHx0m_.js} +1 -1
  38. package/dist/assets/{ViewportShadingMenu-S2lADFJg.js → ViewportShadingMenu-zMKOlcUM.js} +1 -1
  39. package/dist/assets/{active-ingest-CjZtqL7Q.js → active-ingest-gUx8jeyJ.js} +2 -2
  40. package/dist/assets/{animation-clock-CWVW-mqY.js → animation-clock-D-tLCTj6.js} +1 -1
  41. package/dist/assets/{animation-mixers.service-CpoYw8cs.js → animation-mixers.service-CuNPgPSv.js} +1 -1
  42. package/dist/assets/{animation-timeline.utility-CEerojaB.js → animation-timeline.utility-BzbSVAmj.js} +1 -1
  43. package/dist/assets/{asset-budget-asset.menu-Bk6scVWQ.js → asset-budget-asset.menu-B_A367BM.js} +1 -1
  44. package/dist/assets/{asset-budget.action-DtBDSfDj.js → asset-budget.action-UgvyFZGk.js} +1 -1
  45. package/dist/assets/{asset-budget.document-R2zyoJ8E.js → asset-budget.document-C20mZfef.js} +1 -1
  46. package/dist/assets/{asset-budget.menu-D6jza5Bc.js → asset-budget.menu-C1THP8Ir.js} +1 -1
  47. package/dist/assets/{asset-editor-persistence-DrgwOZIW.js → asset-editor-persistence-D-YVUM-o.js} +1 -1
  48. package/dist/assets/{asset-loaders-CUeYIjeH.js → asset-loaders-ClM8urgu.js} +1 -1
  49. package/dist/assets/{asset-preview-CQfnI2cX.js → asset-preview-BD4OZrEp.js} +1 -1
  50. package/dist/assets/{audio-unlock.service-W3UBKsw9.js → audio-unlock.service-krSi_8MS.js} +1 -1
  51. package/dist/assets/{audio.utility-qrXBdGXg.js → audio.utility-DjFH8tZN.js} +1 -1
  52. package/dist/assets/autoplay.service-C_iwBCWg.js +1 -0
  53. package/dist/assets/{babylon-authoring-adapter-CS9LZNmz.js → babylon-authoring-adapter-C6qqXaiV.js} +1 -1
  54. package/dist/assets/{binding-resolver-B9VI52zt.js → binding-resolver-B6upIc33.js} +2 -2
  55. package/dist/assets/{blender-node-editor.document-BWLFvA2g.js → blender-node-editor.document-DsDBkUHt.js} +1 -1
  56. package/dist/assets/{blender-properties-tab-BSmWG9d0.js → blender-properties-tab-9RSYwbBS.js} +1 -1
  57. package/dist/assets/{blender-runtime-host-Cbkie7m4.js → blender-runtime-host-DtpNeLGc.js} +1 -1
  58. package/dist/assets/{blender-runtime-skin-C_ATCb-z.js → blender-runtime-skin-EKCns7fu.js} +1 -1
  59. package/dist/assets/{blender-runtime.document-P9zdgwMt.js → blender-runtime.document-CmLNi8tH.js} +1 -1
  60. package/dist/assets/{blender-timeline.document-DRwySEJO.js → blender-timeline.document-qArofonU.js} +1 -1
  61. package/dist/assets/{blender-uv-editor.document-CmLoL2Vo.js → blender-uv-editor.document-Dv3ihJD4.js} +1 -1
  62. package/dist/assets/{blender-version.status-CP4Jqkry.js → blender-version.status-BEIisS2r.js} +1 -1
  63. package/dist/assets/{blender.command-BYGm0Q_s.js → blender.command-1xwFaSJs.js} +1 -1
  64. package/dist/assets/{board-guides-BG-MHK2G.js → board-guides-DnI_fMSm.js} +1 -1
  65. package/dist/assets/bridge.command-C5EYO4OS.js +3 -0
  66. package/dist/assets/{browserAll-DES3i79H.js → browserAll-Co_vDC8r.js} +1 -1
  67. package/dist/assets/{build-player.document-B42HrdSU.js → build-player.document-LBxyS2AI.js} +1 -1
  68. package/dist/assets/{build-profiles.document-Di5CQoH9.js → build-profiles.document-B_6Df2Sp.js} +1 -1
  69. package/dist/assets/{build-progress.status-B4te7-3j.js → build-progress.status-Cdt1Zuu_.js} +1 -1
  70. package/dist/assets/{build-session-Yw4JoE8T.js → build-session-DKHnqiXT.js} +1 -1
  71. package/dist/assets/{build.action-B-DBpUj6.js → build.action-DRDdqtZb.js} +1 -1
  72. package/dist/assets/{build.command-CfWoHNp0.js → build.command-ry_OUUh9.js} +1 -1
  73. package/dist/assets/{build.header-BaURztYD.js → build.header-CiTCHvry.js} +1 -1
  74. package/dist/assets/{build.menu-BFBn-dPJ.js → build.menu-DiViXEwh.js} +1 -1
  75. package/dist/assets/{build.service-D8gYWB3n.js → build.service-BSGXA-SQ.js} +1 -1
  76. package/dist/assets/{camera-C-uR_xQp.js → camera-B8Mdswus.js} +1 -1
  77. package/dist/assets/{camera-runtime.inspector-BOGGEqVq.js → camera-runtime.inspector-CupJRuBs.js} +1 -1
  78. package/dist/assets/{canvas-design-mount-DamLAaWn.js → canvas-design-mount-DS8xWFiw.js} +3 -3
  79. package/dist/assets/{canvas-entry-runtime-a6N7Rsrj.js → canvas-entry-runtime-BURQgaLB.js} +2 -2
  80. package/dist/assets/{canvas-preview-frames-XbrKuyJu.js → canvas-preview-frames-Crj5bFty.js} +1 -1
  81. package/dist/assets/{canvas-story-capture.service-DYRdEzkG.js → canvas-story-capture.service-DQ6Zw3b0.js} +2 -2
  82. package/dist/assets/{capability-coverage-7wKVA3PF.js → capability-coverage-Ctnmu2LE.js} +1 -1
  83. package/dist/assets/{collaboration-presence-DaVKEfxs.js → collaboration-presence-C-yh_YBU.js} +1 -1
  84. package/dist/assets/{collider-BEwlgkG5.js → collider-C_I5Xdtu.js} +1 -1
  85. package/dist/assets/{component-board.service-C9ZouakC.js → component-board.service-BJ2DCCXQ.js} +2 -2
  86. package/dist/assets/component-board.service-COaCvlbA.js +2 -0
  87. package/dist/assets/{component-board.service-D2eGKqHf.js → component-board.service-DwPBo3xK.js} +2 -2
  88. package/dist/assets/{component-contracts.service-D0uElctD.js → component-contracts.service-RJCV5AAt.js} +1 -1
  89. package/dist/assets/{component-instance-root-C1Xf4SwR.js → component-instance-root-DjA11g2U.js} +1 -1
  90. package/dist/assets/{component-verbs.command-N-Tj8KOS.js → component-verbs.command-BwYzS1c0.js} +1 -1
  91. package/dist/assets/{component-verbs.service-CWh4mQ7X.js → component-verbs.service-CJvrj9av.js} +1 -1
  92. package/dist/assets/{config-hmmj-QHZ.js → config-B4n-SqJs.js} +2 -2
  93. package/dist/assets/{configurations-B9Pi_eRN.js → configurations-Bqg2uvA4.js} +1 -1
  94. package/dist/assets/{connection.status-C2HPxoww.js → connection.status-BVL6eTcF.js} +1 -1
  95. package/dist/assets/{constraints.inspector-D-h1f3K2.js → constraints.inspector-CqY4o8xc.js} +1 -1
  96. package/dist/assets/{content-bounds-7UyI42Vj.js → content-bounds-C1-UpGMc.js} +1 -1
  97. package/dist/assets/{contract-system-adapters-Bq1LGdjs.js → contract-system-adapters-StvC0uNq.js} +1 -1
  98. package/dist/assets/{coverage.service-BiBikIsV.js → coverage.service-DI7ocYK8.js} +1 -1
  99. package/dist/assets/{create-runtime-Cx-q5z2y.js → create-runtime-DwcO7h9p.js} +1 -1
  100. package/dist/assets/{curve-Co_mro-I.js → curve-CPd2jkVJ.js} +1 -1
  101. package/dist/assets/{data-asset-Ckx4D_U_.js → data-asset-B2UtWmua.js} +1 -1
  102. package/dist/assets/{data-ref-70PUrMuT.js → data-ref-B036kumM.js} +1 -1
  103. package/dist/assets/{debug-bridge-CarsgKpm.js → debug-bridge-BG5c-HdI.js} +1 -1
  104. package/dist/assets/{debug-registry-DgYNlhH_.js → debug-registry--ZkoQWOO.js} +1 -1
  105. package/dist/assets/{deferred-ingest-play-Bpdhu2i-.js → deferred-ingest-play-CmJi6tql.js} +2 -2
  106. package/dist/assets/{design-time-canvas-mount-Ca9Q75Ui.js → design-time-canvas-mount-2sEXGMyx.js} +2 -2
  107. package/dist/assets/design-time-layers-CUuV2SKK.js +1 -0
  108. package/dist/assets/{design-time-mount.service-DL6ZK2TQ.js → design-time-mount.service-DaEwimcE.js} +2 -2
  109. package/dist/assets/design-time-mount.service-m_Alk1A4.js +2 -0
  110. package/dist/assets/design-time-react-mount-CcCuClCL.js +1 -0
  111. package/dist/assets/{document-preview-three-DoDs6q1q.js → document-preview-three-CRYXGELs.js} +1 -1
  112. package/dist/assets/{dom-authoring-adapter-adLQog9l.js → dom-authoring-adapter-BQor85A0.js} +1 -1
  113. package/dist/assets/{draco3d-aUvQF1Zx.js → draco3d-zcIWTWKV.js} +1 -1
  114. package/dist/assets/{edit-mode-audio.service-CHZ1ultu.js → edit-mode-audio.service-BZ_MguuB.js} +1 -1
  115. package/dist/assets/{edit-mode-authoring-ZQuUwc6e.js → edit-mode-authoring-B8NE5TIR.js} +1 -1
  116. package/dist/assets/{edit-mode-networking.service-C7fk2fL1.js → edit-mode-networking.service-BnR0zkEk.js} +1 -1
  117. package/dist/assets/editor-api-D9ypvXGZ.js +1 -0
  118. package/dist/assets/{editor-layers-CGX7iCSP.js → editor-layers-B2mwHrrn.js} +1 -1
  119. package/dist/assets/{editor-shell-store-BRqB1JZO.js → editor-shell-store-V7HfbGqh.js} +1 -1
  120. package/dist/assets/{entity-object--ZpqIat7.js → entity-object-BqQBOLh4.js} +1 -1
  121. package/dist/assets/{extend-BZQIQ18F.js → extend-vhXKbXwa.js} +1 -1
  122. package/dist/assets/{fork-menu-CziehkPx.js → fork-menu-CGygk03X.js} +1 -1
  123. package/dist/assets/{frame-debugger-store-BOQjrPsh.js → frame-debugger-store-BFHDpd_6.js} +1 -1
  124. package/dist/assets/{game-contract-seams-Dgqv6S8X.js → game-contract-seams-DYi5-NnM.js} +1 -1
  125. package/dist/assets/{game-css-scope-transform-anfk8vP_.js → game-css-scope-transform-tjGkUu5X.js} +1 -1
  126. package/dist/assets/game-document.service-jY65msUL.js +1 -0
  127. package/dist/assets/game-eval.command-C0iQ6vZD.js +2 -0
  128. package/dist/assets/{game-module-access-Cg1EB8Mx.js → game-module-access-BlCkxuVe.js} +1 -1
  129. package/dist/assets/game-network-gqU0qk9j.js +22 -0
  130. package/dist/assets/game-surface-defaults-D8S4cRxi.js +1 -0
  131. package/dist/assets/{gameplay-export-D0hZoeSg.js → gameplay-export-SxI2CiOU.js} +1 -1
  132. package/dist/assets/{gameplay-replay-BHz6VAVa.js → gameplay-replay-CLHO__fQ.js} +1 -1
  133. package/dist/assets/gameplay.command-CQyRcFql.js +1 -0
  134. package/dist/assets/{generation-jobs-D-zXQNZI.js → generation-jobs-C6l_ZBhD.js} +1 -1
  135. package/dist/assets/{generation.service-Bwt9lQEG.js → generation.service-CgbxxPGg.js} +1 -1
  136. package/dist/assets/{generations-d-U9lCVo.js → generations-DxppE9pN.js} +1 -1
  137. package/dist/assets/{generations.status-BQ8xhaLN.js → generations.status-DIzDQ4QZ.js} +1 -1
  138. package/dist/assets/{hierarchy-marks-CndAXtie.js → hierarchy-marks-CSQMtCBU.js} +1 -1
  139. package/dist/assets/{hosted-asset-materialization-r2vKfJGY.js → hosted-asset-materialization-TryBlckx.js} +1 -1
  140. package/dist/assets/{index-dlvCCB72.js → index-AagWeY8V.js} +1 -1
  141. package/dist/assets/{index-xjc_62Ha.js → index-C8u7p1K7.js} +1 -1
  142. package/dist/assets/{index-BqzpzjSB.js → index-Cj4vTL7A.js} +1 -1
  143. package/dist/assets/{index-BPVnvJfX.js → index-CpMTewhc.js} +1 -1
  144. package/dist/assets/{index-DoGlzvsX.js → index-DBIi3ND-.js} +1 -1
  145. package/dist/assets/{index-DSMLYme2.js → index-d2quMKQM.js} +1 -1
  146. package/dist/assets/{index-z0_InXxO.js → index-u6amYfnv.js} +2 -2
  147. package/dist/assets/{index-Cr9NTnJp.js → index-wjn2vkB8.js} +232 -232
  148. package/dist/assets/{index-CMU7lnXk.js → index-xsQaHGma.js} +1 -1
  149. package/dist/assets/{inference-diagnostics-D5jfxI5p.js → inference-diagnostics-dZd7OUSj.js} +1 -1
  150. package/dist/assets/{ingest-boot-viewport-Be0v44yf.js → ingest-boot-viewport-Chqb3b3L.js} +1 -1
  151. package/dist/assets/{ingest-siblings-BowXSozE.js → ingest-siblings-DyKim2on.js} +1 -1
  152. package/dist/assets/{ingest-source-persistence-BGIvThcv.js → ingest-source-persistence-D7jtuLEB.js} +1 -1
  153. package/dist/assets/{ingest.service-wVm-ZcTI.js → ingest.service-C2q5JocL.js} +1 -1
  154. package/dist/assets/{inspect-CN92MgRT.js → inspect-Cl65lNby.js} +1 -1
  155. package/dist/assets/instances.command-CnrRMqOy.js +1 -0
  156. package/dist/assets/{json-history-resource-C9G_vCX9.js → json-history-resource-DWPJt2Bk.js} +1 -1
  157. package/dist/assets/{layered-pick-D9tIz_m7.js → layered-pick-wB2IUStv.js} +1 -1
  158. package/dist/assets/{light-BGbl1a8K.js → light-BK4WrhlP.js} +1 -1
  159. package/dist/assets/{live-project-verbs-p1sdTwhF.js → live-project-verbs-CSKXil-5.js} +1 -1
  160. package/dist/assets/{machine.document-C1acXU7l.js → machine.document-Wxh00rVH.js} +1 -1
  161. package/dist/assets/{machines.finder-sOxNTYPx.js → machines.finder-Bq84a20u.js} +1 -1
  162. package/dist/assets/{material-D7289cYI.js → material-DzSXsXYn.js} +1 -1
  163. package/dist/assets/{material-factory-D0T-DH8c.js → material-factory-6zzgHeT5.js} +1 -1
  164. package/dist/assets/{mesh-1A-HHxD6.js → mesh-DTSUSSfl.js} +1 -1
  165. package/dist/assets/{model-asset-sections.service-DF-mllTL.js → model-asset-sections.service-eYy0ol55.js} +1 -1
  166. package/dist/assets/{model-inspection-CuVwNVvv.js → model-inspection-DM9bxnjs.js} +1 -1
  167. package/dist/assets/{model-thumbnail-xm1Fabi2.js → model-thumbnail-DcI972TR.js} +1 -1
  168. package/dist/assets/{models.finder-DrvU1qGk.js → models.finder-CbfSmlRN.js} +1 -1
  169. package/dist/assets/{module-mode-BHOAAbgO.js → module-mode-BCWTllUj.js} +2 -2
  170. package/dist/assets/mount-canvas-ingest-root-BWvMQ1oU.js +2 -0
  171. package/dist/assets/{mount-dom-ingest-root-eOOGPaxi.js → mount-dom-ingest-root-C8_3MNzH.js} +2 -2
  172. package/dist/assets/mount-ingest-root-CnfZV05y.js +2 -0
  173. package/dist/assets/mount-manifest-BHLEQ9MI.js +1 -0
  174. package/dist/assets/mount-three-ingest-root-Ci-ZYEqi.js +1 -0
  175. package/dist/assets/{mounted-authoring-DX3DC9PJ.js → mounted-authoring-CRGnDIkF.js} +1 -1
  176. package/dist/assets/{mounted-story-viewport-source-D8FqGpci.js → mounted-story-viewport-source-BV9Vkz5j.js} +1 -1
  177. package/dist/assets/{native-debug-module-CB738yQu.js → native-debug-module-D0TMOJ5J.js} +1 -1
  178. package/dist/assets/{navigation-B9ihB0qU.js → navigation-Dtw9RIIP.js} +1 -1
  179. package/dist/assets/{navmesh.menu-CPxr9LPT.js → navmesh.menu-BOqiQXs0.js} +1 -1
  180. package/dist/assets/{navmesh.service-BAtili_Y.js → navmesh.service-DRssu5HB.js} +1 -1
  181. package/dist/assets/network-observer.service-CSbHzsem.js +1 -0
  182. package/dist/assets/network.utility-DkecVQis.js +1 -0
  183. package/dist/assets/{object3d-document-session-registry-BWeuL0nf.js → object3d-document-session-registry-D68l_sLd.js} +2 -2
  184. package/dist/assets/{oid-transform-BYeAsBKI.js → oid-transform-DELHL858.js} +1 -1
  185. package/dist/assets/{particles-BXiQDiB-.js → particles-DxmpSiYm.js} +1 -1
  186. package/dist/assets/{pixi-authoring-adapter-CPsN0Yk7.js → pixi-authoring-adapter-crYHqvEe.js} +1 -1
  187. package/dist/assets/{pixi-live-write-target-BUbt5ixX.js → pixi-live-write-target-Cx72kgN6.js} +1 -1
  188. package/dist/assets/play.command-WI1aGM0Z.js +2 -0
  189. package/dist/assets/{presentation-C7ZHYsKF.js → presentation-CqPEUUNS.js} +1 -1
  190. package/dist/assets/{product-MSpbAqgo.js → product-dDGXQlJ0.js} +1 -1
  191. package/dist/assets/{profiler.action-1Jbc-7Q4.js → profiler.action-DsAh7yvt.js} +1 -1
  192. package/dist/assets/{profiler.menu-C544DxWZ.js → profiler.menu-eMeZSO2J.js} +1 -1
  193. package/dist/assets/{profiler.utility-QnzedS3X.js → profiler.utility-B9hb8tbg.js} +1 -1
  194. package/dist/assets/project-authoring-session-7KN3YlPS.js +2 -0
  195. package/dist/assets/{properties-bone-constraints.inspector-DRCPfugt.js → properties-bone-constraints.inspector-DoCD043b.js} +1 -1
  196. package/dist/assets/{properties-bone.inspector-CYHeZX0p.js → properties-bone.inspector-mlQIkyBf.js} +1 -1
  197. package/dist/assets/{properties-collection.inspector-DtGhPkiU.js → properties-collection.inspector-BSGr9-vR.js} +1 -1
  198. package/dist/assets/{properties-constraints.inspector-TIyIV777.js → properties-constraints.inspector-BfpdPfPN.js} +1 -1
  199. package/dist/assets/{properties-data.inspector-vA0MTaup.js → properties-data.inspector-yyf0b8Uw.js} +1 -1
  200. package/dist/assets/{properties-material.inspector-C73spBQh.js → properties-material.inspector-BjKs4qAn.js} +1 -1
  201. package/dist/assets/{properties-modifiers.inspector-9oyLBBE0.js → properties-modifiers.inspector-XAML7OJx.js} +1 -1
  202. package/dist/assets/{properties-object.inspector-7BuiUgbd.js → properties-object.inspector-cHVVC7vP.js} +1 -1
  203. package/dist/assets/{properties-output.inspector-CjYAggz2.js → properties-output.inspector-BE6O5uWt.js} +1 -1
  204. package/dist/assets/{properties-particles.inspector-DpSfjykX.js → properties-particles.inspector-DA9r9tox.js} +1 -1
  205. package/dist/assets/{properties-physics.inspector-BUTvmfU9.js → properties-physics.inspector-6V50bg6n.js} +1 -1
  206. package/dist/assets/{properties-render.inspector-CEdsDqbI.js → properties-render.inspector-1iXZTLFj.js} +1 -1
  207. package/dist/assets/{properties-scene.inspector-4kp0sLNw.js → properties-scene.inspector-8qzTDRZ-.js} +1 -1
  208. package/dist/assets/{properties-texture.inspector-Ckpqy9eo.js → properties-texture.inspector-DnndHFBA.js} +1 -1
  209. package/dist/assets/{properties-view-layer.inspector-CQIFbY8-.js → properties-view-layer.inspector-BFqtpGAW.js} +1 -1
  210. package/dist/assets/{properties-world.inspector-xZgNV6rI.js → properties-world.inspector-DrZZRQoS.js} +1 -1
  211. package/dist/assets/r3f-design-session-Bg3EEQz6.js +2 -0
  212. package/dist/assets/{r3f-physics-binding-oippu1v_.js → r3f-physics-binding-DSD0HHLc.js} +1 -1
  213. package/dist/assets/{r3f-source-authoring-adapter-CZJX6VLM.js → r3f-source-authoring-adapter-Ca9azh8e.js} +1 -1
  214. package/dist/assets/{react-canvas-navigation-DuzvnFoN.js → react-canvas-navigation-2OqMWHDI.js} +1 -1
  215. package/dist/assets/{react-inspector.service-CV4p6nrb.js → react-inspector.service-DYyJPfNc.js} +1 -1
  216. package/dist/assets/{react-story-board-mhldts6w.js → react-story-board-Cry0gSQl.js} +1 -1
  217. package/dist/assets/{react-three-rapier.esm-Bo9LjrZe.js → react-three-rapier.esm-DMmOHQDe.js} +1 -1
  218. package/dist/assets/{react-world-authoring-adapter-CuyruDfq.js → react-world-authoring-adapter-CQtYfgx9.js} +1 -1
  219. package/dist/assets/{realm-services-BtiLE3a-.js → realm-services-DBqdRLI4.js} +1 -1
  220. package/dist/assets/{reflection-probe-capture.inspector-mrrOHs-9.js → reflection-probe-capture.inspector-C5Bu6QzV.js} +1 -1
  221. package/dist/assets/{registry-DpUr2YIM.js → registry-_NCUhY0b.js} +1 -1
  222. package/dist/assets/{relative-import-specifier-CyT6yU4l.js → relative-import-specifier-BiEpXss5.js} +1 -1
  223. package/dist/assets/{render-env-C63BGT5v.js → render-env-D-pSIlJ1.js} +1 -1
  224. package/dist/assets/{render-features-CBl6rom9.js → render-features-l7BQbeaM.js} +1 -1
  225. package/dist/assets/{render-settings-DjarlnjI.js → render-settings-DjdbF9VX.js} +1 -1
  226. package/dist/assets/{resolve-three-OiswFiIS.js → resolve-three-C5BhpPqs.js} +3 -3
  227. package/dist/assets/{root-seam-contract-BYLQx4CQ.js → root-seam-contract-cbINkIcN.js} +1 -1
  228. package/dist/assets/{run-selection-BMu0v3qC.js → run-selection-CxsHUK_M.js} +1 -1
  229. package/dist/assets/{scene-capture-BLf3lJ44.js → scene-capture-CCifsWLp.js} +1 -1
  230. package/dist/assets/{scene-document.service-CjPDph5k.js → scene-document.service-TFlDSvVA.js} +2 -2
  231. package/dist/assets/{scene-framing-BhNk0WhI.js → scene-framing--293N2xY.js} +1 -1
  232. package/dist/assets/{seeded-random-DmdE0u-C.js → seeded-random-BMF_UDMF.js} +1 -1
  233. package/dist/assets/{setup-renderer-Bf8g2S0f.js → setup-renderer-ZCwGcqc7.js} +1 -1
  234. package/dist/assets/{source-object3d-authoring-adapter-IDRws2Nk.js → source-object3d-authoring-adapter-C2qh6_pn.js} +1 -1
  235. package/dist/assets/{source-persistence-backend-Dzc6MsmN.js → source-persistence-backend-iG_P2f_a.js} +1 -1
  236. package/dist/assets/{stage-keyboard-CpnIYiph.js → stage-keyboard-Bj7F0kP-.js} +1 -1
  237. package/dist/assets/{stage-overlay-set-BrJzOTCe.js → stage-overlay-set-4eMxmCWg.js} +1 -1
  238. package/dist/assets/{stage-presence-markers-BFTl9Djp.js → stage-presence-markers-Dvo3soHw.js} +1 -1
  239. package/dist/assets/{stage-transform-tools-QaenmSrC.js → stage-transform-tools-BGCCPEHD.js} +1 -1
  240. package/dist/assets/{standard-viewport-dressing-DuKH01r4.js → standard-viewport-dressing-DisOo98G.js} +1 -1
  241. package/dist/assets/{state-watch.action-BaRZ6YII.js → state-watch.action-BjMVtMnK.js} +1 -1
  242. package/dist/assets/{state-watch.menu-DR2AtQ6r.js → state-watch.menu-uo9i_GJH.js} +1 -1
  243. package/dist/assets/{state-watch.utility-VW8H9Fgi.js → state-watch.utility-BDSAOvyy.js} +1 -1
  244. package/dist/assets/{story-capture-BEVV48wm.js → story-capture-BZD3x0Pr.js} +1 -1
  245. package/dist/assets/{story-documents-DndjqJ7Y.js → story-documents-DOsBtURt.js} +1 -1
  246. package/dist/assets/{story-documents.service-CPrZ7gRM.js → story-documents.service-CbADy_Hj.js} +1 -1
  247. package/dist/assets/{story-documents.service-wCVmBPhh.js → story-documents.service-D_hsjJr9.js} +1 -1
  248. package/dist/assets/{story-media-presence-BSX78yVJ.js → story-media-presence-9jRxsUgl.js} +1 -1
  249. package/dist/assets/{story-pixi-preview-D4FuH7lJ.js → story-pixi-preview-DbcYdZMI.js} +1 -1
  250. package/dist/assets/{story-presentation-2AxtnKGb.js → story-presentation-CdTE_XUR.js} +1 -1
  251. package/dist/assets/{story-three-preview-DjObHSAF.js → story-three-preview-Bg0NL_U_.js} +2 -2
  252. package/dist/assets/{studio-environment-B--4k2mN.js → studio-environment-Cso4y0lE.js} +1 -1
  253. package/dist/assets/{surface-state-CQHVfsma.js → surface-state-B_0Yt3kv.js} +1 -1
  254. package/dist/assets/{syntactic-prop-specs-CewRyC4c.js → syntactic-prop-specs-BrDBqyDN.js} +1 -1
  255. package/dist/assets/team-playtest.service-BaW1I4YQ.js +1 -0
  256. package/dist/assets/{three-B86IzdNg.js → three-C0qVNsOS.js} +1 -1
  257. package/dist/assets/{three-authoring-adapter-BD8_MtYK.js → three-authoring-adapter-C92rm99z.js} +1 -1
  258. package/dist/assets/three-authoring.service-D_KTfVs4.js +2 -0
  259. package/dist/assets/{three-ingest-runtime-CXySzulx.js → three-ingest-runtime-DOUKRBrc.js} +1 -1
  260. package/dist/assets/{three-integration-nl5TC6EF.js → three-integration-pMMAFpYl.js} +2 -2
  261. package/dist/assets/three-integration.service-k1_xWOYd.js +1 -0
  262. package/dist/assets/{three-projection-core-D4m8lsPU.js → three-projection-core-BOq13mz-.js} +1 -1
  263. package/dist/assets/{three-state-C36FeFK4.js → three-state-B6NLTszJ.js} +1 -1
  264. package/dist/assets/{three-story-capture.service-C0icETyL.js → three-story-capture.service-CcRSfWad.js} +2 -2
  265. package/dist/assets/{three-story-model-CqWu9S2a.js → three-story-model-7qxVYOkR.js} +1 -1
  266. package/dist/assets/{three-viewport-presentation-CCMgGLI2.js → three-viewport-presentation-DatfjZJH.js} +1 -1
  267. package/dist/assets/{transform-mode-request-CIgYj1Qb.js → transform-mode-request-c8d5QQwQ.js} +1 -1
  268. package/dist/assets/{transport-strip-B1AJKpn-.js → transport-strip-BlGEb51b.js} +1 -1
  269. package/dist/assets/transport.header-DZ6f7-ON.js +1 -0
  270. package/dist/assets/{tuples-uyiMYXrv.js → tuples-ChC18dWq.js} +1 -1
  271. package/dist/assets/ui-board-document-CliGHHFn.js +2 -0
  272. package/dist/assets/{user-data-BXFD1jg-.js → user-data-C2bC2Cok.js} +1 -1
  273. package/dist/assets/{utility-view-state-I_o0WThv.js → utility-view-state-DbTE0Ome.js} +1 -1
  274. package/dist/assets/{viewport-door-AsLxGhLN.js → viewport-door-DNJf5Mej.js} +1 -1
  275. package/dist/assets/{viewport-root-presentation-B1qtThOB.js → viewport-root-presentation-CGYHAB1r.js} +1 -1
  276. package/dist/assets/{viewport-surface-status-CWmQeKTO.js → viewport-surface-status-Db1dCE5f.js} +1 -1
  277. package/dist/assets/{webworkerAll-DC445ANd.js → webworkerAll-K8X7iPJw.js} +1 -1
  278. package/dist/assets/{workspace-arrangement-dkubzCff.js → workspace-arrangement-coA4mYU_.js} +1 -1
  279. package/dist/assets/world-documents-kcOR7HSb.js +1 -0
  280. package/dist/assets/{world-root-stage-binding-BrvO8VMz.js → world-root-stage-binding-WQv8K4Zz.js} +1 -1
  281. package/dist/assets/{xstate-animation-binding-ChVFHSlM.js → xstate-animation-binding-BTIYbpkG.js} +1 -1
  282. package/dist/assets/{xstate-animation-meta-D7xnhyCE.js → xstate-animation-meta-D4bo9lqY.js} +1 -1
  283. package/dist-node/cli.js +14 -14
  284. package/package.json +14 -14
  285. package/template/.agents/references/project-manual.md +1 -1
  286. package/template/.agents/skills/volter-ingest-existing-game/SKILL.md +1 -1
  287. package/template/.agents/skills/volter-threejs-authoring/SKILL.md +1 -1
  288. package/template/.claude/skills/volter-ingest-existing-game/SKILL.md +1 -1
  289. package/template/.claude/skills/volter-threejs-authoring/SKILL.md +1 -1
  290. package/template/.github/skills/volter-ingest-existing-game/SKILL.md +1 -1
  291. package/template/.github/skills/volter-threejs-authoring/SKILL.md +1 -1
  292. package/template/IDIOMS.md +1 -1
  293. package/template/README.md +0 -3
  294. package/template/package.json +10 -10
  295. package/template/src/bot/bot-station.ts +1 -1
  296. package/template/vite.config.ts +2 -2
  297. package/template-dotfiles/gitignore +1 -1
  298. package/dist/assets/InspectorObjectPreview-BBVO8bDT.js +0 -1
  299. package/dist/assets/Object3DDocumentViewport-BE_OPc8T.js +0 -2
  300. package/dist/assets/autoplay.service-DQD3Swo9.js +0 -1
  301. package/dist/assets/bridge.command-DpUNErKN.js +0 -3
  302. package/dist/assets/component-board.service-BWSBM2Bb.js +0 -2
  303. package/dist/assets/design-time-layers-BIb71snu.js +0 -1
  304. package/dist/assets/design-time-mount.service-zKUVjKAu.js +0 -2
  305. package/dist/assets/design-time-react-mount-NrWimSxY.js +0 -1
  306. package/dist/assets/editor-api-C8MUOrwt.js +0 -1
  307. package/dist/assets/game-document.service-CqmgrRUA.js +0 -1
  308. package/dist/assets/game-eval.command-CoetFm6_.js +0 -2
  309. package/dist/assets/game-network-BqI-Ehz0.js +0 -22
  310. package/dist/assets/gameplay.command-CPc9GKuW.js +0 -1
  311. package/dist/assets/instances.command-B6gJuL1Z.js +0 -1
  312. package/dist/assets/mount-canvas-ingest-root-aVZkVNh4.js +0 -2
  313. package/dist/assets/mount-ingest-root-BsWbEvr_.js +0 -2
  314. package/dist/assets/mount-manifest-t6ipNsoF.js +0 -1
  315. package/dist/assets/mount-three-ingest-root-DIR0wKrN.js +0 -1
  316. package/dist/assets/network-observer.service-CqTuZNtI.js +0 -1
  317. package/dist/assets/network.utility-CclYEmfV.js +0 -1
  318. package/dist/assets/play.command-Bz5Ra6Uj.js +0 -2
  319. package/dist/assets/project-authoring-session-BhNfg7TY.js +0 -2
  320. package/dist/assets/r3f-design-session-D8VF-hty.js +0 -2
  321. package/dist/assets/team-playtest.service-B9m6CNk7.js +0 -1
  322. package/dist/assets/three-authoring.service-BjJ9wetk.js +0 -2
  323. package/dist/assets/three-integration.service-BEk5QkKM.js +0 -1
  324. package/dist/assets/transport.header-D-n6dQ5n.js +0 -1
  325. package/dist/assets/ui-board-document-6e4w4a8B.js +0 -2
  326. package/dist/assets/world-documents-psBK5u_2.js +0 -1
@@ -1 +1 @@
1
- import{_ as Ge}from"./index-Cr9NTnJp.js";import"./three.module-BLhyNg0e.js";import{cW as ke,N as Ve,cp as We,co as j,M as ie,fo as Ye,_ as Qe,cm as ne,bu as Xe}from"./three.core-3arARmh6.js";import{DEFAULTS as le}from"./defaults-DKiBJCPN.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";const $e=["Recast","Detour","DetourNavMeshBuilder","DetourTileCacheBuilder","NavMeshImporter","NavMeshExporter","CrowdUtils","ChunkyTriMeshUtils","RecastDebugDraw","DetourDebugDraw"],qe=["rcConfig","rcContext","dtNavMeshParams","dtNavMeshCreateParams","RecastLinearAllocator","RecastFastLZCompressor","rcChunkyTriMesh","dtTileCacheParams","dtTileCacheLayerHeader","Vec3","BoolRef","IntRef","UnsignedIntRef","UnsignedCharRef","UnsignedShortRef","FloatRef","IntArray","UnsignedIntArray","UnsignedCharArray","UnsignedShortArray","FloatArray"],s={isNull:a=>s.Module.getPointer(a)===0,destroy:a=>{s.Module.destroy(a)}},g={},f={},Ke=async a=>{if(s.Module===void 0){{const e=(await Ge(async()=>{const{default:t}=await import("./recast-navigation.wasm-compat-Dsoa_MD-.js");return{default:t}},[])).default;s.Module=await e()}for(const e of $e)s[e]=new s.Module[e];for(const e of qe)s[e]=s.Module[e];g.RC_BORDER_REG=s.Recast.BORDER_REG,g.RC_MULTIPLE_REGS=s.Recast.MULTIPLE_REGS,g.RC_BORDER_VERTEX=s.Recast.BORDER_VERTEX,g.RC_AREA_BORDER=s.Recast.AREA_BORDER,g.RC_CONTOUR_REG_MASK=s.Recast.CONTOUR_REG_MASK,g.RC_MESH_NULL_IDX=s.Recast.MESH_NULL_IDX,g.RC_NULL_AREA=s.Recast.NULL_AREA,g.RC_WALKABLE_AREA=s.Recast.WALKABLE_AREA,g.RC_NOT_CONNECTED=s.Recast.NOT_CONNECTED,g.RC_CONTOUR_TESS_WALL_EDGES=s.Module.RC_CONTOUR_TESS_WALL_EDGES,g.RC_CONTOUR_TESS_AREA_EDGES=s.Module.RC_CONTOUR_TESS_AREA_EDGES,g.RC_LOG_PROGRESS=s.Module.RC_LOG_PROGRESS,g.RC_LOG_WARNING=s.Module.RC_LOG_WARNING,g.RC_LOG_ERROR=s.Module.RC_LOG_ERROR,g.RC_TIMER_TOTAL=s.Module.RC_TIMER_TOTAL,g.RC_TIMER_TEMP=s.Module.RC_TIMER_TEMP,g.RC_TIMER_RASTERIZE_TRIANGLES=s.Module.RC_TIMER_RASTERIZE_TRIANGLES,g.RC_TIMER_BUILD_COMPACTHEIGHTFIELD=s.Module.RC_TIMER_BUILD_COMPACTHEIGHTFIELD,g.RC_TIMER_BUILD_CONTOURS=s.Module.RC_TIMER_BUILD_CONTOURS,g.RC_TIMER_BUILD_CONTOURS_TRACE=s.Module.RC_TIMER_BUILD_CONTOURS_TRACE,g.RC_TIMER_BUILD_CONTOURS_SIMPLIFY=s.Module.RC_TIMER_BUILD_CONTOURS_SIMPLIFY,g.RC_TIMER_FILTER_BORDER=s.Module.RC_TIMER_FILTER_BORDER,g.RC_TIMER_FILTER_WALKABLE=s.Module.RC_TIMER_FILTER_WALKABLE,g.RC_TIMER_MEDIAN_AREA=s.Module.RC_TIMER_MEDIAN_AREA,g.RC_TIMER_FILTER_LOW_OBSTACLES=s.Module.RC_TIMER_FILTER_LOW_OBSTACLES,g.RC_TIMER_BUILD_POLYMESH=s.Module.RC_TIMER_BUILD_POLYMESH,g.RC_TIMER_MERGE_POLYMESH=s.Module.RC_TIMER_MERGE_POLYMESH,g.RC_TIMER_ERODE_AREA=s.Module.RC_TIMER_ERODE_AREA,g.RC_TIMER_MARK_BOX_AREA=s.Module.RC_TIMER_MARK_BOX_AREA,g.RC_TIMER_MARK_CYLINDER_AREA=s.Module.RC_TIMER_MARK_CYLINDER_AREA,g.RC_TIMER_MARK_CONVEXPOLY_AREA=s.Module.RC_TIMER_MARK_CONVEXPOLY_AREA,g.RC_TIMER_BUILD_DISTANCEFIELD=s.Module.RC_TIMER_BUILD_DISTANCEFIELD,g.RC_TIMER_BUILD_DISTANCEFIELD_DIST=s.Module.RC_TIMER_BUILD_DISTANCEFIELD_DIST,g.RC_TIMER_BUILD_DISTANCEFIELD_BLUR=s.Module.RC_TIMER_BUILD_DISTANCEFIELD_BLUR,g.RC_TIMER_BUILD_REGIONS=s.Module.RC_TIMER_BUILD_REGIONS,g.RC_TIMER_BUILD_REGIONS_WATERSHED=s.Module.RC_TIMER_BUILD_REGIONS_WATERSHED,g.RC_TIMER_BUILD_REGIONS_EXPAND=s.Module.RC_TIMER_BUILD_REGIONS_EXPAND,g.RC_TIMER_BUILD_REGIONS_FLOOD=s.Module.RC_TIMER_BUILD_REGIONS_FLOOD,g.RC_TIMER_BUILD_REGIONS_FILTER=s.Module.RC_TIMER_BUILD_REGIONS_FILTER,g.RC_TIMER_BUILD_LAYERS=s.Module.RC_TIMER_BUILD_LAYERS,g.RC_TIMER_BUILD_POLYMESHDETAIL=s.Module.RC_TIMER_BUILD_POLYMESHDETAIL,g.RC_TIMER_MERGE_POLYMESHDETAIL=s.Module.RC_TIMER_MERGE_POLYMESHDETAIL,g.RC_MAX_TIMERS=s.Module.RC_MAX_TIMERS,f.DT_FAILURE=s.Detour.FAILURE,f.DT_SUCCESS=s.Detour.SUCCESS,f.DT_IN_PROGRESS=s.Detour.IN_PROGRESS,f.DT_STATUS_DETAIL_MASK=s.Detour.STATUS_DETAIL_MASK,f.DT_WRONG_MAGIC=s.Detour.WRONG_MAGIC,f.DT_WRONG_VERSION=s.Detour.WRONG_VERSION,f.DT_OUT_OF_MEMORY=s.Detour.OUT_OF_MEMORY,f.DT_INVALID_PARAM=s.Detour.INVALID_PARAM,f.DT_BUFFER_TOO_SMALL=s.Detour.BUFFER_TOO_SMALL,f.DT_OUT_OF_NODES=s.Detour.OUT_OF_NODES,f.DT_PARTIAL_RESULT=s.Detour.PARTIAL_RESULT,f.DT_ALREADY_OCCUPIED=s.Detour.ALREADY_OCCUPIED,f.DT_VERTS_PER_POLYGON=s.Detour.VERTS_PER_POLYGON,f.DT_NAVMESH_MAGIC=s.Detour.NAVMESH_MAGIC,f.DT_NAVMESH_VERSION=s.Detour.NAVMESH_VERSION,f.DT_NAVMESH_STATE_MAGIC=s.Detour.NAVMESH_STATE_MAGIC,f.DT_NAVMESH_STATE_VERSION=s.Detour.NAVMESH_STATE_VERSION,f.DT_TILECACHE_MAGIC=s.Detour.TILECACHE_MAGIC,f.DT_TILECACHE_VERSION=s.Detour.TILECACHE_VERSION,f.DT_TILECACHE_NULL_AREA=s.Detour.TILECACHE_NULL_AREA,f.DT_TILECACHE_WALKABLE_AREA=s.Detour.TILECACHE_WALKABLE_AREA,f.DT_TILECACHE_NULL_IDX=s.Detour.TILECACHE_NULL_IDX,f.DT_NULL_LINK=s.Detour.NULL_LINK,f.DT_NULL_LINK=s.Detour.NULL_LINK,f.DT_EXT_LINK=s.Detour.EXT_LINK,f.DT_OFFMESH_CON_BIDIR=s.Detour.OFFMESH_CON_BIDIR,f.DT_STRAIGHTPATH_START=s.Module.DT_STRAIGHTPATH_START,f.DT_STRAIGHTPATH_END=s.Module.DT_STRAIGHTPATH_END,f.DT_STRAIGHTPATH_OFFMESH_CONNECTION=s.Module.DT_STRAIGHTPATH_OFFMESH_CONNECTION,f.DT_STRAIGHTPATH_AREA_CROSSINGS=s.Module.DT_STRAIGHTPATH_AREA_CROSSINGS,f.DT_STRAIGHTPATH_ALL_CROSSINGS=s.Module.DT_STRAIGHTPATH_ALL_CROSSINGS,f.DT_FINDPATH_ANY_ANGLE=s.Module.DT_FINDPATH_ANY_ANGLE,f.DT_RAYCAST_USE_COSTS=s.Module.DT_RAYCAST_USE_COSTS,f.DT_CROWDAGENT_STATE_INVALID=s.Module.DT_CROWDAGENT_STATE_INVALID,f.DT_CROWDAGENT_STATE_WALKING=s.Module.DT_CROWDAGENT_STATE_WALKING,f.DT_CROWDAGENT_STATE_OFFMESH=s.Module.DT_CROWDAGENT_STATE_OFFMESH,f.DT_CROWDAGENT_TARGET_NONE=s.Module.DT_CROWDAGENT_TARGET_NONE,f.DT_CROWDAGENT_TARGET_FAILED=s.Module.DT_CROWDAGENT_TARGET_FAILED,f.DT_CROWDAGENT_TARGET_VALID=s.Module.DT_CROWDAGENT_TARGET_VALID,f.DT_CROWDAGENT_TARGET_REQUESTING=s.Module.DT_CROWDAGENT_TARGET_REQUESTING,f.DT_CROWDAGENT_TARGET_WAITING_FOR_QUEUE=s.Module.DT_CROWDAGENT_TARGET_WAITING_FOR_QUEUE,f.DT_CROWDAGENT_TARGET_WAITING_FOR_PATH=s.Module.DT_CROWDAGENT_TARGET_WAITING_FOR_PATH,f.DT_CROWDAGENT_TARGET_VELOCITY=s.Module.DT_CROWDAGENT_TARGET_VELOCITY,f.DT_COMPRESSEDTILE_FREE_DATA=s.Module.DT_COMPRESSEDTILE_FREE_DATA,f.DT_TILE_FREE_DATA=s.Module.DT_TILE_FREE_DATA}};class K{get size(){return this.raw.size}constructor(e){this.raw=e}get(e){return this.raw.get(e)}set(e,t){this.raw.set(e,t)}resize(e){this.raw.resize(e)}copy(e){this.raw.resize(e.length),this.getHeapView().set(e)}destroy(){s.destroy(this.raw)}getHeapView(){const e=this.getHeap();return new this.ArrayConstructor(e.buffer,this.raw.getDataPointer(),this.size)}toTypedArray(){const e=this.getHeapView(),t=new this.ArrayConstructor(new ArrayBuffer(this.size*e.BYTES_PER_ELEMENT),0,this.size);return t.set(e),t}}class W extends K{ArrayConstructor=Int32Array;constructor(e){super(e??new s.Module.IntArray)}getHeap(){return s.Module.HEAP32}static fromRaw(e){return new W(e)}}class z extends K{ArrayConstructor=Uint32Array;constructor(e){super(e??new s.Module.UnsignedIntArray)}getHeap(){return s.Module.HEAPU32}static fromRaw(e){return new z(e)}}class Y extends K{ArrayConstructor=Uint8Array;constructor(e){super(e??new s.Module.UnsignedCharArray)}getHeap(){return s.Module.HEAPU8}static fromRaw(e){return new Y(e)}}class k extends K{ArrayConstructor=Float32Array;constructor(e){super(e??new s.Module.FloatArray)}getHeap(){return s.Module.HEAPF32}static fromRaw(e){return new k(e)}}const ue=k,ce=W,Z=Y,je=W,m={toRaw:({x:a,y:e,z:t},r)=>r?(r.x=a,r.y=e,r.z=t,r):new s.Module.Vec3(a,e,t),fromRaw:a=>{const{x:e,y:t,z:r}=a;return{x:e,y:t,z:r}},fromArray:([a,e,t])=>({x:a,y:e,z:t}),toArray:({x:a,y:e,z:t})=>[a,e,t],lerp:(a,e,t,r={x:0,y:0,z:0})=>{r.x=a.x+(e.x-a.x)*t,r.y=a.y+(e.y-a.y)*t,r.z=a.z+(e.z-a.z)*t},copy:(a,e={x:0,y:0,z:0})=>{e.x=a.x,e.y=a.y,e.z=a.z}},v=(a,e)=>{const t=[];for(let r=0;r<e;r++)t.push(a(r));return t},L=a=>s.Detour.statusSucceed(a),Ze=a=>s.Detour.statusFailed(a),Je=a=>{if(s.Detour.statusSucceed(a))return"success";if(s.Detour.statusInProgress(a))return"in progress";if(s.Detour.statusFailed(a)){let e;const t={DT_WRONG_MAGIC:f.DT_WRONG_MAGIC,DT_WRONG_VERSION:f.DT_WRONG_VERSION,DT_OUT_OF_MEMORY:f.DT_OUT_OF_MEMORY,DT_INVALID_PARAM:f.DT_INVALID_PARAM,DT_BUFFER_TOO_SMALL:f.DT_BUFFER_TOO_SMALL,DT_OUT_OF_NODES:f.DT_OUT_OF_NODES,DT_PARTIAL_RESULT:f.DT_PARTIAL_RESULT,DT_ALREADY_OCCUPIED:f.DT_ALREADY_OCCUPIED};for(const[r,i]of Object.entries(t))if(s.Detour.statusDetail(a,i)){e=r;break}return e?`failed - ${e}`:"failed - unknown"}return"unknown"};class et{constructor(e){this.raw=e}vertBase(){return this.raw.vertBase}triBase(){return this.raw.triBase}vertCount(){return this.raw.vertCount}triCount(){return this.raw.triCount}}class tt{constructor(e){this.raw=e}ref(){return this.raw.ref}next(){return this.raw.next}edge(){return this.raw.edge}side(){return this.raw.side}bmin(){return this.raw.bmin}bmax(){return this.raw.bmax}}class rt{constructor(e){this.raw=e}bmin(){return m.fromArray(v(e=>this.raw.get_bmin(e),3))}bmax(){return m.fromArray(v(e=>this.raw.get_bmax(e),3))}i(){return this.raw.i}}class he{constructor(e){this.raw=e}pos(e){return this.raw.get_pos(e)}rad(){return this.raw.rad}poly(){return this.raw.poly}flags(){return this.raw.flags}side(){return this.raw.side}userId(){return this.raw.userId}}class st{constructor(e){this.raw=e}magic(){return this.raw.magic}version(){return this.raw.version}x(){return this.raw.x}y(){return this.raw.y}layer(){return this.raw.layer}userId(){return this.raw.userId}polyCount(){return this.raw.polyCount}vertCount(){return this.raw.vertCount}maxLinkCount(){return this.raw.maxLinkCount}detailMeshCount(){return this.raw.detailMeshCount}detailVertCount(){return this.raw.detailVertCount}detailTriCount(){return this.raw.detailTriCount}bvNodeCount(){return this.raw.bvNodeCount}offMeshConCount(){return this.raw.offMeshConCount}offMeshBase(){return this.raw.offMeshBase}walkableHeight(){return this.raw.walkableHeight}walkableRadius(){return this.raw.walkableRadius}walkableClimb(){return this.raw.walkableClimb}bmin(e){return this.raw.get_bmin(e)}bmax(e){return this.raw.get_bmax(e)}bvQuantFactor(){return this.raw.bvQuantFactor}}class J{constructor(e){this.raw=e}firstLink(){return this.raw.firstLink}verts(e){return this.raw.get_verts(e)}neis(e){return this.raw.get_neis(e)}flags(){return this.raw.flags}vertCount(){return this.raw.vertCount}areaAndType(){return this.raw.get_areaAndtype()}getType(){return this.raw.getType()}}class B{constructor(e){this.raw=e}salt(){return this.raw.salt}linksFreeList(){return this.raw.linksFreeList}header(){return s.isNull(this.raw.header)?null:new st(this.raw.header)}polys(e){return new J(this.raw.get_polys(e))}verts(e){return this.raw.get_verts(e)}links(e){return new tt(this.raw.get_links(e))}detailMeshes(e){return new et(this.raw.get_detailMeshes(e))}detailVerts(e){return this.raw.get_detailVerts(e)}detailTris(e){return this.raw.get_detailTris(e)}bvTree(e){return new rt(this.raw.get_bvTree(e))}offMeshCons(e){return new he(this.raw.get_offMeshCons(e))}data(e){return this.raw.get_data(e)}dataSize(){return this.raw.dataSize}flags(){return this.raw.flags}next(){return new B(this.raw.next)}}const de=a=>{const e=s.DetourNavMeshBuilder.createNavMeshData(a.raw);return{success:e.success,navMeshData:Y.fromRaw(e.navMeshData)}};class we{constructor(e){this.raw=e??new s.Module.dtNavMeshCreateParams}setPolyMeshCreateParams(e){s.DetourNavMeshBuilder.setPolyMeshCreateParams(this.raw,e.raw)}setPolyMeshDetailCreateParams(e){s.DetourNavMeshBuilder.setPolyMeshDetailCreateParams(this.raw,e.raw)}setOffMeshConnections(e){if(e.length<=0)return;const t=[],r=[],i=[],o=[],l=[],n=[];for(let u=0;u<e.length;u++){const d=e[u];t.push(d.startPosition.x,d.startPosition.y,d.startPosition.z),t.push(d.endPosition.x,d.endPosition.y,d.endPosition.z),r.push(d.radius),i.push(d.bidirectional?1:0),o.push(d.area??0),l.push(d.flags??1),n.push(d.userId??1e3+u)}s.DetourNavMeshBuilder.setOffMeshConnections(this.raw,e.length,t,r,i,o,l,n)}verts(e){return this.raw.get_verts(e)}setVerts(e,t){this.raw.set_verts(e,t)}vertCount(){return this.raw.vertCount}polys(e){return this.raw.get_polys(e)}setPolys(e,t){this.raw.set_polys(e,t)}polyAreas(e){return this.raw.get_polyAreas(e)}setPolyAreas(e,t){this.raw.set_polyAreas(e,t)}polyFlags(e){return this.raw.get_polyFlags(e)}setPolyFlags(e,t){this.raw.set_polyFlags(e,t)}polyCount(){return this.raw.polyCount}nvp(){return this.raw.nvp}setNvp(e){this.raw.nvp=e}detailMeshes(e){return this.raw.get_detailMeshes(e)}setDetailMeshes(e,t){this.raw.set_detailMeshes(e,t)}detailVerts(e){return this.raw.get_detailVerts(e)}setDetailVerts(e,t){this.raw.set_detailVerts(e,t)}detailVertsCount(){return this.raw.detailVertsCount}detailTris(e){return this.raw.get_detailTris(e)}setDetailTris(e,t){this.raw.set_detailTris(e,t)}detailTriCount(){return this.raw.detailTriCount}offMeshConVerts(e){return this.raw.get_offMeshConVerts(e)}offMeshConRad(e){return this.raw.get_offMeshConRad(e)}offMeshConDir(e){return this.raw.get_offMeshConDir(e)}offMeshConAreas(e){return this.raw.get_offMeshConAreas(e)}offMeshConFlags(e){return this.raw.get_offMeshConFlags(e)}offMeshConUserID(e){return this.raw.get_offMeshConUserID(e)}offMeshConCount(){return this.raw.offMeshConCount}userId(){return this.raw.userId}tileX(){return this.raw.tileX}setTileX(e){this.raw.tileX=e}tileY(){return this.raw.tileY}setTileY(e){this.raw.tileY=e}tileLayer(){return this.raw.tileLayer}setTileLayer(e){this.raw.tileLayer=e}boundsMin(){return v(e=>this.raw.get_bmin(e),3)}setBoundsMin(e){this.raw.set_bmin(0,e[0]),this.raw.set_bmin(1,e[1]),this.raw.set_bmin(2,e[2])}boundsMax(){return v(e=>this.raw.get_bmax(e),3)}setBoundsMax(e){this.raw.set_bmax(0,e[0]),this.raw.set_bmax(1,e[1]),this.raw.set_bmax(2,e[2])}walkableHeight(){return this.raw.walkableHeight}setWalkableHeight(e){this.raw.walkableHeight=e}walkableRadius(){return this.raw.walkableRadius}setWalkableRadius(e){this.raw.walkableRadius=e}walkableClimb(){return this.raw.walkableClimb}setWalkableClimb(e){this.raw.walkableClimb=e}cellSize(){return this.raw.cs}setCellSize(e){this.raw.cs=e}cellHeight(){return this.raw.ch}setCellHeight(e){this.raw.ch=e}buildBvTree(){return this.raw.buildBvTree}setBuildBvTree(e){this.raw.buildBvTree=e}}class ge{get includeFlags(){return this.raw.getIncludeFlags()}set includeFlags(e){this.raw.setIncludeFlags(e)}get excludeFlags(){return this.raw.getExcludeFlags()}set excludeFlags(e){this.raw.setExcludeFlags(e)}constructor(e){this.raw=e??new s.Module.dtQueryFilter}getAreaCost(e){return this.raw.getAreaCost(e)}setAreaCost(e,t){this.raw.setAreaCost(e,t)}}class ee{defaultQueryHalfExtents={x:1,y:1,z:1};constructor(e,t){e instanceof s.Module.NavMeshQuery?this.raw=e:(this.raw=new s.Module.NavMeshQuery,this.raw.init(e.raw,t?.maxNodes??2048)),t?.defaultQueryFilter?this.defaultFilter=t.defaultQueryFilter:(this.defaultFilter=new ge,this.defaultFilter.includeFlags=65535,this.defaultFilter.excludeFlags=0)}findNearestPoly(e,t){const r=new s.UnsignedIntRef,i=new s.Vec3,o=new s.BoolRef,l=this.raw.findNearestPoly(m.toArray(e),m.toArray(t?.halfExtents??this.defaultQueryHalfExtents),t?.filter?.raw??this.defaultFilter.raw,r,i,o),n=m.fromRaw(i);s.destroy(i);const u=r.value;s.destroy(r);const d=o.value;return s.destroy(o),{success:L(l),status:l,nearestRef:u,nearestPoint:n,isOverPoly:d}}findPolysAroundCircle(e,t,r,i){const o=i?.filter??this.defaultFilter,l=i?.maxPolys??256,n=new z,u=new z,d=new k;n.resize(l),u.resize(l),d.resize(l);const _=new s.IntRef,c=this.raw.findPolysAroundCircle(e,m.toArray(t),r,o.raw,n.raw,u.raw,d.raw,_,l),y=[...n.getHeapView()];n.destroy();const M=[...u.getHeapView()];u.destroy();const p=[...d.getHeapView()];d.destroy();const C=_.value;return s.destroy(_),{success:L(c),status:c,resultRefs:y,resultParents:M,resultCost:p,resultCount:C}}queryPolygons(e,t,r){const i=r?.filter??this.defaultFilter,o=r?.maxPolys??256,l=new z;l.resize(o);const n=new s.IntRef,u=this.raw.queryPolygons(m.toArray(e),m.toArray(t),i.raw,l.raw,n,o),d=n.value;s.destroy(n);const _=[...l.getHeapView()].slice(0,d);return l.destroy(),{success:L(u),status:u,polyRefs:_}}closestPointOnPoly(e,t){const r=new s.Vec3,i=new s.BoolRef,o=this.raw.closestPointOnPoly(e,m.toArray(t),r,i),l=m.fromRaw(r);s.destroy(r);const n=i.value;return s.destroy(i),{success:L(o),status:o,closestPoint:l,isPointOverPoly:n}}findClosestPoint(e,t){const r=t?.filter??this.defaultFilter,i=t?.halfExtents??this.defaultQueryHalfExtents,o=new s.UnsignedIntRef,l=new s.Vec3,n=new s.BoolRef,u=this.raw.findClosestPoint(m.toArray(e),m.toArray(i),r.raw,o,l,n),d=o.value;s.destroy(o);const _=m.fromRaw(l);s.destroy(l);const c=n.value;return s.destroy(n),{success:L(u),status:u,polyRef:d,point:_,isPointOverPoly:c}}findRandomPointAroundCircle(e,t,r){const i=r?.filter??this.defaultFilter,o=r?.halfExtents??this.defaultQueryHalfExtents;let l;if(r?.startRef)l=r.startRef;else{const y=this.findNearestPoly(e,{filter:i,halfExtents:o});if(!y.success)return{success:!1,status:y.status,randomPolyRef:0,randomPoint:{x:0,y:0,z:0}};l=y.nearestRef}const n=new s.UnsignedIntRef,u=new s.Vec3,d=this.raw.findRandomPointAroundCircle(l,m.toArray(e),t,i.raw,n,u),_=n.value;s.destroy(n);const c=m.fromRaw(u);return s.destroy(u),{success:L(d),status:d,randomPolyRef:_,randomPoint:c}}moveAlongSurface(e,t,r,i){const o=i?.maxVisitedSize??256,l=new s.Vec3,n=new z,u=i?.filter?.raw??this.defaultFilter.raw,d=this.raw.moveAlongSurface(e,m.toArray(t),m.toArray(r),u,l,n.raw,o),_=m.fromRaw(l);s.destroy(l);const c=[...n.getHeapView()];return n.destroy(),{success:L(d),status:d,resultPosition:_,visited:c}}findRandomPoint(e){const t=new s.UnsignedIntRef,r=new s.Vec3,i=this.raw.findRandomPoint(e?.filter?.raw??this.defaultFilter.raw,t,r),o=t.value;s.destroy(t);const l=m.fromRaw(r);return s.destroy(r),{success:L(i),status:i,randomPolyRef:o,randomPoint:l}}getPolyHeight(e,t){const r=new s.FloatRef,i=this.raw.getPolyHeight(e,m.toArray(t),r),o=r.value;return s.destroy(r),{success:L(i),status:i,height:o}}computePath(e,t,r){const i=r?.filter??this.defaultFilter,o=r?.halfExtents??this.defaultQueryHalfExtents,l=this.findNearestPoly(e,{filter:i,halfExtents:o});if(!l.success)return{success:!1,error:{name:"findNearestPoly for start position failed",status:l.status},path:[]};const n=this.findNearestPoly(t,{filter:i,halfExtents:o});if(!n.success)return{success:!1,error:{name:"findNearestPoly for end position failed",status:n.status},path:[]};const u=l.nearestRef,d=n.nearestRef,_=r?.maxPathPolys??256,c=this.findPath(u,d,e,t,{filter:i,maxPathPolys:_});if(!c.success)return{success:!1,error:{name:"findPath unsuccessful",status:c.status},path:[]};if(c.polys.size<=0)return{success:!1,error:{name:"no polygon path found"},path:[]};const y=c.polys.get(c.polys.size-1);let M={x:t.x,y:t.y,z:t.z};if(y!==d){const A=this.closestPointOnPoly(y,t);if(!A.success)return{success:!1,error:{name:"no closest point on last polygon found",status:A.status},path:[]};M=A.closestPoint}const p=r?.maxStraightPathPoints,C=this.findStraightPath(e,M,c.polys,{maxStraightPathPoints:p});if(!C.success)return{success:!1,error:{name:"findStraightPath unsuccessful",status:C.status},path:[]};const{straightPath:I,straightPathCount:w}=C,P=[];for(let A=0;A<w;A++)P.push({x:I.get(A*3),y:I.get(A*3+1),z:I.get(A*3+2)});return c.polys.destroy(),C.straightPath.destroy(),C.straightPathFlags.destroy(),C.straightPathRefs.destroy(),{success:!0,path:P}}findPath(e,t,r,i,o){const l=o?.filter??this.defaultFilter,n=o?.maxPathPolys??256,u=new z;u.resize(n);const d=this.raw.findPath(e,t,m.toArray(r),m.toArray(i),l.raw,u.raw,n);return{success:L(d),status:d,polys:u}}findStraightPath(e,t,r,i){const o=i?.maxStraightPathPoints??256,l=i?.straightPathOptions??0;let n;Array.isArray(r)?(n=new z,n.copy(r)):n=r;const u=new k;u.resize(o*3);const d=new Y;d.resize(o);const _=new z;_.resize(o);const c=new s.IntRef,y=this.raw.findStraightPath(m.toArray(e),m.toArray(t),n.raw,u.raw,d.raw,_.raw,c,o,l),M=c.value;return s.destroy(c),Array.isArray(r)&&n.destroy(),{success:L(y),status:y,straightPath:u,straightPathFlags:d,straightPathRefs:_,straightPathCount:M}}raycast(e,t,r,i){const o=new s.Module.dtRaycastHit,l=i?.raycastOptions??0,n=i?.prevRef??0,u=i?.filter?.raw??this.defaultFilter.raw,d=this.raw.raycast(e,m.toArray(t),m.toArray(r),u,l,o,n),_={success:L(d),status:d,t:o.t,hitNormal:m.fromArray(v(c=>o.get_hitNormal(c),3)),hitEdgeIndex:o.hitEdgeIndex,path:v(c=>o.get_path(c),o.pathCount),maxPath:o.maxPath,pathCost:o.pathCost};return s.destroy(o),_}destroy(){this.raw.destroy()}}const _e={radius:.5,height:1,maxAcceleration:20,maxSpeed:6,collisionQueryRange:2.5,pathOptimizationRange:0,separationWeight:0,updateFlags:7,obstacleAvoidanceType:0,queryFilterType:0,userData:0};class at{get radius(){return this.raw.params.radius}set radius(e){this.raw.params.radius=e}get height(){return this.raw.params.height}set height(e){this.raw.params.height=e}get maxAcceleration(){return this.raw.params.maxAcceleration}set maxAcceleration(e){this.raw.params.maxAcceleration=e}get maxSpeed(){return this.raw.params.maxSpeed}set maxSpeed(e){this.raw.params.maxSpeed=e}get collisionQueryRange(){return this.raw.params.collisionQueryRange}set collisionQueryRange(e){this.raw.params.collisionQueryRange=e}get pathOptimizationRange(){return this.raw.params.pathOptimizationRange}set pathOptimizationRange(e){this.raw.params.pathOptimizationRange=e}get separationWeight(){return this.raw.params.separationWeight}set separationWeight(e){this.raw.params.separationWeight=e}get updateFlags(){return this.raw.params.updateFlags}set updateFlags(e){this.raw.params.updateFlags=e}get obstacleAvoidanceType(){return this.raw.params.obstacleAvoidanceType}set obstacleAvoidanceType(e){this.raw.params.obstacleAvoidanceType=e}get queryFilterType(){return this.raw.params.queryFilterType}set queryFilterType(e){this.raw.params.queryFilterType=e}get userData(){return this.raw.params.userData}set userData(e){this.raw.params.userData=e}interpolatedPosition={x:0,y:0,z:0};constructor(e,t){this.crowd=e,this.agentIndex=t,this.raw=e.raw.getEditableAgent(t),this.interpolatedPosition=this.position()}requestMoveTarget(e){const{nearestPoint:t,nearestRef:r}=this.crowd.navMeshQuery.findNearestPoly(e,{halfExtents:this.crowd.navMeshQuery.defaultQueryHalfExtents,filter:this.crowd.navMeshQuery.defaultFilter});return this.crowd.raw.requestMoveTarget(this.agentIndex,r,m.toArray(t))}requestMoveVelocity(e){return this.crowd.raw.requestMoveVelocity(this.agentIndex,m.toArray(e))}resetMoveTarget(){this.crowd.raw.resetMoveTarget(this.agentIndex)}teleport(e){s.CrowdUtils.agentTeleport(this.crowd.raw,this.agentIndex,m.toArray(e),m.toArray(this.crowd.navMeshQuery.defaultQueryHalfExtents),this.crowd.navMeshQuery.defaultFilter.raw),m.copy(e,this.interpolatedPosition)}position(){return{x:this.raw.get_npos(0),y:this.raw.get_npos(1),z:this.raw.get_npos(2)}}velocity(){return{x:this.raw.get_vel(0),y:this.raw.get_vel(1),z:this.raw.get_vel(2)}}desiredVelocity(){return{x:this.raw.get_dvel(0),y:this.raw.get_dvel(1),z:this.raw.get_dvel(2)}}desiredVelocityObstacleAdjusted(){return{x:this.raw.get_nvel(0),y:this.raw.get_nvel(1),z:this.raw.get_nvel(2)}}state(){return this.raw.state}target(){return{x:this.raw.get_targetPos(0),y:this.raw.get_targetPos(1),z:this.raw.get_targetPos(2)}}nextTargetInPath(){return{x:this.raw.get_cornerVerts(0),y:this.raw.get_cornerVerts(1),z:this.raw.get_cornerVerts(2)}}corners(){const e=[];for(let t=0;t<this.raw.ncorners;t++)e.push({x:this.raw.get_cornerVerts(t*3),y:this.raw.get_cornerVerts(t*3+1),z:this.raw.get_cornerVerts(t*3+2)});return e}parameters(){const{params:e}=this.raw;return{radius:e.radius,height:e.height,maxAcceleration:e.maxAcceleration,maxSpeed:e.maxSpeed,collisionQueryRange:e.collisionQueryRange,pathOptimizationRange:e.pathOptimizationRange,separationWeight:e.separationWeight,updateFlags:e.updateFlags,obstacleAvoidanceType:e.obstacleAvoidanceType,queryFilterType:e.queryFilterType,userData:e.userData}}updateParameters(e){const t={...this.parameters(),...e};this.setParameters(t)}setParameters(e){const t={..._e,...e},r=new s.Module.dtCrowdAgentParams;r.radius=t.radius,r.height=t.height,r.maxAcceleration=t.maxAcceleration,r.maxSpeed=t.maxSpeed,r.collisionQueryRange=t.collisionQueryRange,r.pathOptimizationRange=t.pathOptimizationRange,r.separationWeight=t.separationWeight,r.updateFlags=t.updateFlags,r.obstacleAvoidanceType=t.obstacleAvoidanceType,r.queryFilterType=t.queryFilterType,r.userData=t.userData,this.crowd.raw.updateAgentParameters(this.agentIndex,r)}overOffMeshConnection(){return s.CrowdUtils.overOffMeshConnection(this.crowd.raw,this.agentIndex)}}class it{agents={};accumulator=0;constructor(e,{maxAgents:t,maxAgentRadius:r}){this.navMesh=e,this.raw=s.Detour.allocCrowd(),this.raw.init(t,r,e.raw.getNavMesh()),this.navMeshQuery=new ee(new s.Module.NavMeshQuery(this.raw.getNavMeshQuery()))}update(e,t,r=10){if(t===void 0)this.raw.update(e,void 0);else{this.accumulator+=t;let i=0;for(;this.accumulator>=e&&i<r;)this.raw.update(e,void 0),this.accumulator-=e,i++;const o=this.accumulator%e/e,l=this.getAgents();for(const n of l)m.lerp(n.interpolatedPosition,n.position(),o,n.interpolatedPosition)}}addAgent(e,t){const r={..._e,...t},i=new s.Module.dtCrowdAgentParams;i.radius=r.radius,i.height=r.height,i.maxAcceleration=r.maxAcceleration,i.maxSpeed=r.maxSpeed,i.collisionQueryRange=r.collisionQueryRange,i.pathOptimizationRange=r.pathOptimizationRange,i.separationWeight=r.separationWeight,i.updateFlags=r.updateFlags,i.obstacleAvoidanceType=r.obstacleAvoidanceType,i.queryFilterType=r.queryFilterType,i.userData=r.userData;const o=this.raw.addAgent(m.toArray(e),i),l=new at(this,o);return this.agents[o]=l,l}getAgent(e){const t=this.agents[e];return t||null}removeAgent(e){const t=typeof e=="number"?e:e.agentIndex;this.raw.removeAgent(t),delete this.agents[t]}getAgentCount(){return this.raw.getAgentCount()}getActiveAgentCount(){return s.CrowdUtils.getActiveAgentCount(this.raw)}getAgents(){return Object.values(this.agents)}getFilter(e){return new ge(this.raw.getEditableFilter(e))}destroy(){s.Detour.freeCrowd(this.raw)}}class nt{constructor(e){this.raw=e}tiles(e){return new B(this.raw.get_tiles(e))}tileCount(){return this.raw.tileCount}}class ot{constructor(e){this.raw=e}data(){return v(e=>this.raw.get_data(e),this.raw.dataSize)}dataSize(){return this.raw.dataSize}}class lt{constructor(e){this.raw=e}tileX(){return this.raw.tileX}tileY(){return this.raw.tileY}}class ut{constructor(e){this.raw=e}data(){return v(e=>this.raw.get_data(e),this.raw.dataSize)}dataSize(){return this.raw.dataSize}}class Q{constructor(e){this.raw=e}static create(e){const t=new s.Module.dtNavMeshParams;return t.set_orig(0,e.orig.x),t.set_orig(1,e.orig.y),t.set_orig(2,e.orig.z),t.tileWidth=e.tileWidth,t.tileHeight=e.tileHeight,t.maxTiles=e.maxTiles,t.maxPolys=e.maxPolys,new Q(t)}clone(){return Q.create({orig:{x:this.raw.get_orig(0),y:this.raw.get_orig(1),z:this.raw.get_orig(2)},tileWidth:this.raw.tileWidth,tileHeight:this.raw.tileHeight,maxTiles:this.raw.maxTiles,maxPolys:this.raw.maxPolys})}}class te{constructor(e){this.raw=e??new s.Module.NavMesh}initSolo(e){return this.raw.initSolo(e.raw)}initTiled(e){return this.raw.initTiled(e.raw)}addTile(e,t,r){const i=new s.UnsignedIntRef,o=this.raw.addTile(e.raw,t,r,i),l=i.value;return s.destroy(i),{status:o,tileRef:l}}decodePolyId(e){const t=new s.UnsignedIntRef,r=new s.UnsignedIntRef,i=new s.UnsignedIntRef;this.raw.decodePolyId(e,t,r,i);const o=t.value;s.destroy(t);const l=r.value;s.destroy(r);const n=i.value;return s.destroy(i),{tileSalt:o,tileIndex:l,tilePolygonIndex:n}}encodePolyId(e,t,r){return this.raw.encodePolyId(e,t,r)}removeTile(e){return new ot(this.raw.removeTile(e))}calcTileLoc(e){return new lt(this.raw.calcTileLoc(m.toArray(e)))}getTileAt(e,t,r){const i=this.raw.getTileAt(e,t,r);return s.isNull(i)?null:new B(i)}getTilesAt(e,t,r){return new nt(this.raw.getTilesAt(e,t,r))}getTileRefAt(e,t,r){return this.raw.getTileRefAt(e,t,r)}getTileRef(e){return this.raw.getTileRef(e.raw)}getTileByRef(e){const t=this.raw.getTileByRef(e);return s.isNull(t)?null:new B(t)}getMaxTiles(){return this.raw.getMaxTiles()}getTile(e){return new B(this.raw.getTile(e))}getTileAndPolyByRef(e){const t=this.raw.getTileAndPolyByRef(e),r=new B(t.tile),i=new J(t.poly);return{success:L(t.status),status:t.status,tile:r,poly:i}}getTileAndPolyByRefUnsafe(e){const t=this.raw.getTileAndPolyByRef(e),r=new B(t.tile),i=new J(t.poly);return{tile:r,poly:i}}isValidPolyRef(e){return this.raw.isValidPolyRef(e)}getPolyRefBase(e){return this.raw.getPolyRefBase(e.raw)}getOffMeshConnectionPolyEndPoints(e,t){const r=new s.Vec3,i=new s.Vec3,o=this.raw.getOffMeshConnectionPolyEndPoints(e,t,r,i),l=m.fromRaw(r);s.destroy(r);const n=m.fromRaw(i);return s.destroy(i),{success:L(o),status:o,start:l,end:n}}getOffMeshConnectionByRef(e){return new he(this.raw.getOffMeshConnectionByRef(e))}setPolyFlags(e,t){return this.raw.setPolyFlags(e,t)}getPolyFlags(e){const t=new s.UnsignedShortRef,r=this.raw.getPolyFlags(e,t),i=t.value;return s.destroy(t),{status:r,flags:i}}setPolyArea(e,t){return this.raw.setPolyArea(e,t)}getPolyArea(e){const t=new s.UnsignedCharRef,r=this.raw.getPolyArea(e,t),i=t.value;return s.destroy(t),{status:r,area:i}}getTileStateSize(e){return this.raw.getTileStateSize(e.raw)}storeTileState(e,t){return new ut(this.raw.storeTileState(e.raw,t))}restoreTileState(e,t,r){return this.raw.restoreTileState(e.raw,t,r)}destroy(){this.raw.destroy(),s.Module.destroy(this.raw)}}const ct=(a,e)=>{const t=[],r=[];let i=0;const o=a.getMaxTiles();for(let l=0;l<o;l++){const n=a.getTile(l),u=n.header();if(!u)continue;const d=u.polyCount();for(let _=0;_<d;++_){const c=n.polys(_);if(c.getType()===1)continue;const y=c.vertCount(),M=n.detailMeshes(_),p=M.triBase(),C=M.triCount();for(let I=0;I<C;++I){const w=(p+I)*4;for(let P=0;P<3;++P){if(n.detailTris(w+P)<y){const A=c.verts(n.detailTris(w+P))*3;t.push(n.verts(A),n.verts(A+1),n.verts(A+2))}else{const A=(M.vertBase()+n.detailTris(w+P)-c.vertCount())*3;t.push(n.detailVerts(A),n.detailVerts(A+1),n.detailVerts(A+2))}r.push(i++)}}}}return[t,r]},re={borderSize:0,tileSize:0,cs:.2,ch:.2,walkableSlopeAngle:60,walkableHeight:2,walkableClimb:2,walkableRadius:.5,maxEdgeLen:12,maxSimplificationError:1.3,minRegionArea:8,mergeRegionArea:20,maxVertsPerPoly:6,detailSampleDist:6,detailSampleMaxError:1},fe=a=>{const e={...re,...a},t=new s.Module.rcConfig;return t.borderSize=e.borderSize,t.tileSize=e.tileSize,t.cs=e.cs,t.ch=e.ch,t.walkableSlopeAngle=e.walkableSlopeAngle,t.walkableHeight=e.walkableHeight,t.walkableClimb=e.walkableClimb,t.walkableRadius=e.walkableRadius,t.maxEdgeLen=e.maxEdgeLen,t.maxSimplificationError=e.maxSimplificationError,t.minRegionArea=e.minRegionArea,t.mergeRegionArea=e.mergeRegionArea,t.maxVertsPerPoly=e.maxVertsPerPoly,t.detailSampleDist=e.detailSampleDist,t.detailSampleMaxError=e.detailSampleMaxError,t},ht=a=>{const e=new s.Module.rcConfig;return e.set_bmin(0,a.get_bmin(0)),e.set_bmin(1,a.get_bmin(1)),e.set_bmin(2,a.get_bmin(2)),e.set_bmax(0,a.get_bmax(0)),e.set_bmax(1,a.get_bmax(1)),e.set_bmax(2,a.get_bmax(2)),e.width=a.width,e.height=a.height,e.borderSize=a.borderSize,e.tileSize=a.tileSize,e.cs=a.cs,e.ch=a.ch,e.walkableSlopeAngle=a.walkableSlopeAngle,e.walkableHeight=a.walkableHeight,e.walkableClimb=a.walkableClimb,e.walkableRadius=a.walkableRadius,e.maxEdgeLen=a.maxEdgeLen,e.maxSimplificationError=a.maxSimplificationError,e.minRegionArea=a.minRegionArea,e.mergeRegionArea=a.mergeRegionArea,e.maxVertsPerPoly=a.maxVertsPerPoly,e.detailSampleDist=a.detailSampleDist,e.detailSampleMaxError=a.detailSampleMaxError,e};class se{logs=[];startTimes={};accumulatedTimes={};constructor(e=!0){const t=new s.Module.RecastBuildContextJsImpl;t.log=(r,i,o)=>{if(!this.raw.logEnabled())return;const l=i,n=new Uint8Array(s.Module.HEAPU8.buffer,l,o),u=new Uint8Array(o);u.set(n);const d=new TextDecoder().decode(u);this.log(r,d)},t.resetLog=()=>{this.resetLog()},t.startTimer=r=>{this.raw.timerEnabled()&&this.startTimer(r)},t.stopTimer=r=>{this.raw.timerEnabled()&&this.stopTimer(r)},t.getAccumulatedTime=r=>this.raw.timerEnabled()?this.getAccumulatedTime(r):-1,t.resetTimers=()=>{this.raw.timerEnabled()&&(this.startTimes={},this.accumulatedTimes={})},this.raw=new s.Module.RecastBuildContext(t),this.raw.enableTimer(e),this.raw.enableLog(e),this.resetTimers()}log(e,t){this.logs.push({category:e,msg:t})}resetLog(){this.logs=[]}startTimer(e){this.startTimes[e]=performance.now()}stopTimer(e){const r=performance.now()-this.startTimes[e];this.accumulatedTimes[e]===-1?this.accumulatedTimes[e]=r:this.accumulatedTimes[e]+=r}getAccumulatedTime(e){return this.accumulatedTimes[e]}resetTimers(){for(let e=0;e<g.RC_MAX_TIMERS;e++)this.startTimes[e]=-1,this.accumulatedTimes[e]=-1}}class dt{constructor(e){this.raw=e??new s.rcChunkyTriMesh}init(e,t,r,i){return s.ChunkyTriMeshUtils.createChunkyTriMesh(e.raw,t.raw,r,i,this.raw)}getChunksOverlappingRect(e,t,r,i){return s.ChunkyTriMeshUtils.getChunksOverlappingRect(this.raw,e,t,r.raw,i)}getNodeTris(e){return W.fromRaw(s.ChunkyTriMeshUtils.getChunkyTriMeshNodeTris(this.raw,e))}nodes(e){return this.raw.get_nodes(e)}maxTrisPerChunk(){return this.raw.maxTrisPerChunk}}class V{constructor(e){this.raw=e}smin(){return this.raw.smin}smax(){return this.raw.smax}area(){return this.raw.area}next(){return s.isNull(this.raw.next)?null:new V(this.raw.next)}}class ae{constructor(e){this.raw=e}next(){return s.isNull(this.raw.next)?null:new ae(this.raw.next)}items(e){return new V(this.raw.get_items(e))}}class wt{constructor(e){this.raw=e}width(){return this.raw.width}height(){return this.raw.height}bmin(){return m.fromArray(v(e=>this.raw.get_bmin(e),3))}bmax(){return m.fromArray(v(e=>this.raw.get_bmax(e),3))}cs(){return this.raw.cs}ch(){return this.raw.ch}spans(e){return new V(this.raw.get_spans(e))}pools(e){return new ae(this.raw.get_pools(e))}freelist(e){return new V(this.raw.get_freelist(e))}}class gt{constructor(e){this.raw=e}index(){return this.raw.get_index()}count(){return this.raw.get_count()}}class _t{constructor(e){this.raw=e}y(){return this.raw.get_y()}reg(){return this.raw.get_reg()}con(){return this.raw.get_con()}h(){return this.raw.get_h()}}class ft{constructor(e){this.raw=e}width(){return this.raw.width}height(){return this.raw.height}spanCount(){return this.raw.spanCount}walkableHeight(){return this.raw.walkableHeight}walkableClimb(){return this.raw.walkableClimb}borderSize(){return this.raw.borderSize}maxDistance(){return this.raw.maxDistance}maxRegions(){return this.raw.maxRegions}bmin(){return m.fromArray(v(e=>this.raw.get_bmin(e),3))}bmax(){return m.fromArray(v(e=>this.raw.get_bmax(e),3))}cs(){return this.raw.cs}ch(){return this.raw.ch}cells(e){return new gt(this.raw.get_cells(e))}spans(e){return new _t(this.raw.get_spans(e))}dist(e){return this.raw.get_dist(e)}areas(e){return this.raw.get_areas(e)}}class Rt{constructor(e){this.raw=e}verts(e){return this.raw.get_verts(e)}nverts(){return this.raw.nverts}rverts(e){return this.raw.get_rverts(e)}nrverts(){return this.raw.nrverts}reg(){return this.raw.reg}area(){return this.raw.area}}class Tt{constructor(e){this.raw=e}conts(e){return new Rt(this.raw.get_conts(e))}nconts(){return this.raw.nconts}bmin(){return m.fromArray(v(e=>this.raw.get_bmin(e),3))}bmax(){return m.fromArray(v(e=>this.raw.get_bmax(e),3))}cs(){return this.raw.cs}ch(){return this.raw.ch}width(){return this.raw.width}height(){return this.raw.height}borderSize(){return this.raw.borderSize}maxError(){return this.raw.maxError}}class mt{constructor(e){this.raw=e}verts(e){return this.raw.get_verts(e)}polys(e){return this.raw.get_polys(e)}regs(e){return this.raw.get_regs(e)}flags(e){return this.raw.get_flags(e)}setFlags(e,t){this.raw.set_flags(e,t)}areas(e){return this.raw.get_areas(e)}setAreas(e,t){this.raw.set_areas(e,t)}nverts(){return this.raw.nverts}npolys(){return this.raw.npolys}maxpolys(){return this.raw.maxpolys}nvp(){return this.raw.nvp}bmin(){return m.fromArray(v(e=>this.raw.get_bmin(e),3))}bmax(){return m.fromArray(v(e=>this.raw.get_bmax(e),3))}cs(){return this.raw.cs}ch(){return this.raw.ch}borderSize(){return this.raw.borderSize}maxEdgeError(){return this.raw.maxEdgeError}}class yt{constructor(e){this.raw=e}meshes(e){return this.raw.get_meshes(e)}verts(e){return this.raw.get_verts(e)}tris(e){return this.raw.get_tris(e)}nmeshes(){return this.raw.nmeshes}nverts(){return this.raw.nverts}ntris(){return this.raw.ntris}}const Re=(a,e,t)=>s.Recast.calcGridSize(a,e,t),Te=(a,e,t,r,i,o,l,n)=>s.Recast.createHeightfield(a.raw,e.raw,t,r,i,o,l,n),me=(a,e,t,r,i,o,l)=>s.Recast.markWalkableTriangles(a.raw,e,t.raw,r,i.raw,o,l.raw),ye=(a,e,t,r,i,o,l,n=1)=>s.Recast.rasterizeTriangles(a.raw,e.raw,t,r.raw,i.raw,o,l.raw,n),Ae=(a,e,t)=>s.Recast.filterLowHangingWalkableObstacles(a.raw,e,t.raw),Me=(a,e,t,r)=>s.Recast.filterLedgeSpans(a.raw,e,t,r.raw),Ee=(a,e,t)=>s.Recast.filterWalkableLowHeightSpans(a.raw,e,t.raw),pe=(a,e,t,r,i)=>s.Recast.buildCompactHeightfield(a.raw,e,t,r.raw,i.raw),Ce=(a,e,t)=>s.Recast.erodeWalkableArea(a.raw,e,t.raw),Se=(a,e)=>s.Recast.buildDistanceField(a.raw,e.raw),Ie=(a,e,t,r,i)=>s.Recast.buildRegions(a.raw,e.raw,t,r,i),De=(a,e,t,r,i,o=g.RC_CONTOUR_TESS_WALL_EDGES)=>s.Recast.buildContours(a.raw,e.raw,t,r,i.raw,o),be=(a,e,t,r)=>s.Recast.buildPolyMesh(a.raw,e.raw,t,r.raw),Pe=(a,e,t,r,i,o)=>s.Recast.buildPolyMeshDetail(a.raw,e.raw,t.raw,r,i,o.raw),xe=()=>new wt(s.Recast.allocHeightfield()),X=a=>s.Recast.freeHeightfield(a.raw),ve=()=>new ft(s.Recast.allocCompactHeightfield()),$=a=>s.Recast.freeCompactHeightfield(a.raw),Ne=()=>new Tt(s.Recast.allocContourSet()),q=a=>s.Recast.freeContourSet(a.raw),Oe=()=>new mt(s.Recast.allocPolyMesh()),Le=a=>s.Recast.freePolyMesh(a.raw),Fe=()=>new yt(s.Recast.allocPolyMeshDetail()),He=a=>s.Recast.freePolyMeshDetail(a.raw),At=(a,e)=>{const t=s.NavMeshExporter.exportNavMesh(a.raw,e?.raw),r=new Uint8Array(s.Module.HEAPU8.buffer,t.dataPointer,t.size),i=new Uint8Array(t.size);return i.set(r),s.NavMeshExporter.freeNavMeshExport(t),i},Mt=a=>At(a),Et=a=>{const e=a.length*a.BYTES_PER_ELEMENT,t=s.Module._malloc(e),r=new Uint8Array(s.Module.HEAPU8.buffer,t,e);r.set(a);const i=new s.Module.NavMeshExport;return i.dataPointer=r.byteOffset,i.size=a.length,{navMeshExport:i,dataHeap:r}},pt=a=>{const{navMeshExport:e,dataHeap:t}=Et(a),r=s.NavMeshImporter.importNavMesh(e,void 0);return s.Module._free(t.byteOffset),{navMesh:new te(r.navMesh)}},ze=(a,e)=>{const t={x:1/0,y:1/0,z:1/0},r={x:-1/0,y:-1/0,z:-1/0};for(let i=0;i<e.length;i++){const o=e[i],l=a[o*3],n=a[o*3+1],u=a[o*3+2];t.x=Math.min(t.x,l),t.y=Math.min(t.y,n),t.z=Math.min(t.z,u),r.x=Math.max(r.x,l),r.y=Math.max(r.y,n),r.z=Math.max(r.z,u)}return{bbMin:m.toArray(t),bbMax:m.toArray(r)}},Ct=a=>{let e=0,t=0;return e=+(a>65535)<<4,a>>=e,t=+(a>255)<<3,a>>=t,e|=t,t=+(a>15)<<2,a>>=t,e|=t,t=+(a>3)<<1,a>>=t,e|=t,e|=a>>1,e},St=a=>(a--,a|=a>>1,a|=a>>2,a|=a>>4,a|=a>>8,a|=a>>16,a++,a),It={...re,buildBvTree:!0},Dt=(a,e,t={},r=!1)=>{const i=new se,o={type:"solo",buildContext:i},l=()=>{r||(o.heightfield&&(X(o.heightfield),o.heightfield=void 0),o.compactHeightfield&&($(o.compactHeightfield),o.compactHeightfield=void 0),o.contourSet&&(q(o.contourSet),o.contourSet=void 0),o.polyMesh&&(Le(o.polyMesh),o.polyMesh=void 0),o.polyMeshDetail&&(He(o.polyMeshDetail),o.polyMeshDetail=void 0))},n=T=>(l(),{navMeshData:void 0,success:!1,intermediates:o,error:T}),u=a,d=e.length,_=new ue;_.copy(u);const c=e,y=e.length/3,M=new ce;M.copy(c);let p,C;if(t.bounds)p=t.bounds[0],C=t.bounds[1];else{const T=ze(a,e);p=T.bbMin,C=T.bbMax}const I={...It,...t},w=fe(I);w.minRegionArea=w.minRegionArea*w.minRegionArea,w.mergeRegionArea=w.mergeRegionArea*w.mergeRegionArea,w.detailSampleDist=w.detailSampleDist<.9?0:w.cs*w.detailSampleDist,w.detailSampleMaxError=w.ch*w.detailSampleMaxError;const P=Re(p,C,w.cs);w.width=P.width,w.height=P.height;const A=xe();if(o.heightfield=A,!Te(i,A,w.width,w.height,p,C,w.cs,w.ch))return n("Could not create heightfield");const E=new Z;if(E.resize(y),me(i,w.walkableSlopeAngle,_,d,M,y,E),!ye(i,_,d,M,E,y,A,w.walkableClimb))return n("Could not rasterize triangles");E.destroy(),_.destroy(),M.destroy(),Ae(i,w.walkableClimb,A),Me(i,w.walkableHeight,w.walkableClimb,A),Ee(i,w.walkableHeight,A);const D=ve();if(o.compactHeightfield=D,!pe(i,w.walkableHeight,w.walkableClimb,A,D))return n("Failed to build compact data");if(r||(X(A),o.heightfield=void 0),!Ce(i,w.walkableRadius,D))return n("Failed to erode walkable area");if(!Se(i,D))return n("Failed to build distance field");if(!Ie(i,D,w.borderSize,w.minRegionArea,w.mergeRegionArea))return n("Failed to build regions");const b=Ne();if(o.contourSet=b,!De(i,D,w.maxSimplificationError,w.maxEdgeLen,b,g.RC_CONTOUR_TESS_WALL_EDGES))return n("Failed to create contours");const S=Oe();if(o.polyMesh=S,!be(i,b,w.maxVertsPerPoly,S))return n("Failed to triangulate contours");const N=Fe();if(o.polyMeshDetail=N,!Pe(i,S,D,w.detailSampleDist,w.detailSampleMaxError,N))return n("Failed to build detail mesh");r||($(D),o.compactHeightfield=void 0,q(b),o.contourSet=void 0);for(let T=0;T<S.npolys();T++)S.areas(T)===g.RC_WALKABLE_AREA&&S.setAreas(T,0),S.areas(T)===0&&S.setFlags(T,1);const h=new we;h.setPolyMeshCreateParams(S),h.setPolyMeshDetailCreateParams(N),h.setWalkableHeight(w.walkableHeight*w.ch),h.setWalkableRadius(w.walkableRadius*w.cs),h.setWalkableClimb(w.walkableClimb*w.ch),h.setCellSize(w.cs),h.setCellHeight(w.ch),h.setBuildBvTree(I.buildBvTree),t.offMeshConnections&&h.setOffMeshConnections(t.offMeshConnections);const R=de(h);return R.success?(l(),{navMeshData:R.navMeshData,success:!0,intermediates:o}):n("Failed to create Detour navmesh data")},bt=(a,e,t={},r=!1)=>{if(!s.Module)throw new Error('"init" must be called before using any recast-navigation-js APIs. See: https://github.com/isaac-mason/recast-navigation-js?tab=readme-ov-file#initialization');const i=Dt(a,e,t,r);if(!i.success)return{navMesh:void 0,success:!1,intermediates:i.intermediates,error:i.error};const{navMeshData:o}=i,l=new te;return l.initSolo(o)?{success:!0,navMesh:l,intermediates:i.intermediates}:(o.destroy(),{navMesh:void 0,success:!1,intermediates:i.intermediates,error:"Failed to initialize solo NavMesh"})},Pt=({recastConfig:a,navMeshBounds:[e,t]})=>{const r=fe(a),i=Re(e,t,r.cs);r.width=i.width,r.height=i.height,r.minRegionArea=r.minRegionArea*r.minRegionArea,r.mergeRegionArea=r.mergeRegionArea*r.mergeRegionArea,r.tileSize=Math.floor(r.tileSize),r.borderSize=r.walkableRadius+3,r.width=r.tileSize+r.borderSize*2,r.height=r.tileSize+r.borderSize*2,r.detailSampleDist=r.detailSampleDist<.9?0:r.cs*r.detailSampleDist,r.detailSampleMaxError=r.ch*r.detailSampleMaxError;const o=Math.floor(r.tileSize),l=Math.floor((i.width+o-1)/o),n=Math.floor((i.height+o-1)/o),u=r.tileSize*r.cs,d=m.fromArray(e);let _=Math.min(Math.floor(Ct(St(l*n))),14);_>14&&(_=14);const c=22-_,y=1<<_,M=1<<c;return{config:r,gridSize:i,tileSize:o,tileWidth:l,tileHeight:n,tcs:u,orig:d,maxTiles:y,maxPolysPerTile:M}},Be={...re,chunkyTriMeshTrisPerChunk:256,buildBvTree:!0},xt=(a,e,t,r,i,o={},l=!1,n=new se)=>{const u={x:i.x,y:i.y},d=()=>{l||(u.compactHeightfield&&($(u.compactHeightfield),u.compactHeightfield=void 0),u.heightfield&&(X(u.heightfield),u.heightfield=void 0),u.contourSet&&(q(u.contourSet),u.contourSet=void 0),u.polyMesh&&(Le(u.polyMesh),u.polyMesh=void 0),u.polyMeshDetail&&(He(u.polyMeshDetail),u.polyMeshDetail=void 0))},_=T=>(n.log(g.RC_LOG_ERROR,T),d(),{success:!1,error:T,intermediates:u}),c=ht(t),y=[...i.bmin],M=[...i.bmax];y[0]-=c.borderSize*c.cs,y[2]-=c.borderSize*c.cs,M[0]+=c.borderSize*c.cs,M[2]+=c.borderSize*c.cs,c.set_bmin(0,y[0]),c.set_bmin(1,y[1]),c.set_bmin(2,y[2]),c.set_bmax(0,M[0]),c.set_bmax(1,M[1]),c.set_bmax(2,M[2]),n.resetTimers(),n.startTimer(g.RC_TIMER_TOTAL),n.log(g.RC_LOG_PROGRESS,`Building tile at x: ${i.x}, y: ${i.y}`),n.log(g.RC_LOG_PROGRESS,` - ${c.width} x ${c.height} cells`),n.log(g.RC_LOG_PROGRESS,` - ${a.size/3/1e3}K verts, ${e.size/3/1e3}K tris`);const p=xe();if(u.heightfield=p,!Te(n,p,c.width,c.height,y,M,c.cs,c.ch))return _("Could not create heightfield");new Z().resize(r.maxTrisPerChunk());const I=[y[0],y[2]],w=[M[0],M[2]],P=512,A=new je;A.resize(P);const E=r.getChunksOverlappingRect(I,w,A,P);if(E===0)return{success:!0,intermediates:u};for(let T=0;T<E;++T){const x=A.get(T),H=r.nodes(x).n,U=r.getNodeTris(x),F=new Z;F.resize(H),me(n,c.walkableSlopeAngle,a,e.size,U,H,F);const G=ye(n,a,e.size,U,F,H,p,c.walkableClimb);if(F.destroy(),!G)return _("Could not rasterize triangles")}Ae(n,c.walkableClimb,p),Me(n,c.walkableHeight,c.walkableClimb,p),Ee(n,c.walkableHeight,p);const D=ve();if(u.compactHeightfield=D,!pe(n,c.walkableHeight,c.walkableClimb,p,D))return _("Could not build compact heightfield");if(l||(X(u.heightfield),u.heightfield=void 0),!Ce(n,c.walkableRadius,D))return _("Could not erode walkable area");if(!Se(n,D))return _("Failed to build distance field");if(!Ie(n,D,c.borderSize,c.minRegionArea,c.mergeRegionArea))return _("Failed to build regions");const b=Ne();if(u.contourSet=b,!De(n,D,c.maxSimplificationError,c.maxEdgeLen,b,g.RC_CONTOUR_TESS_WALL_EDGES))return _("Failed to create contours");const S=Oe();if(u.polyMesh=S,!be(n,b,c.maxVertsPerPoly,S))return _("Failed to triangulate contours");const N=Fe();if(u.polyMeshDetail=N,!Pe(n,S,D,c.detailSampleDist,c.detailSampleMaxError,N))return _("Failed to build detail mesh");l||($(D),u.compactHeightfield=void 0,q(b),u.contourSet=void 0);for(let T=0;T<S.npolys();T++)S.areas(T)===g.RC_WALKABLE_AREA&&S.setAreas(T,0),S.areas(T)===0&&S.setFlags(T,1);const h=new we;h.setPolyMeshCreateParams(S),h.setPolyMeshDetailCreateParams(N),h.setWalkableHeight(c.walkableHeight*c.ch),h.setWalkableRadius(c.walkableRadius*c.cs),h.setWalkableClimb(c.walkableClimb*c.ch),h.setCellSize(c.cs),h.setCellHeight(c.ch),h.setBuildBvTree(o.buildBvTree??Be.buildBvTree),o.offMeshConnections&&h.setOffMeshConnections(o.offMeshConnections),h.setTileX(i.x),h.setTileY(i.y);const R=de(h);return R.success?(n.log(g.RC_LOG_PROGRESS,`>> Polymesh: ${S.nverts()} vertices ${S.npolys()} polygons`),{success:!0,data:R.navMeshData,intermediates:u}):_("Failed to create Detour navmesh data")},vt=(a,e,t={},r=!1)=>{if(!s.Module)throw new Error('"init" must be called before using any recast-navigation-js APIs. See: https://github.com/isaac-mason/recast-navigation-js?tab=readme-ov-file#initialization');const i=new se,o={type:"tiled",buildContext:i,chunkyTriMesh:void 0,tileIntermediates:[]},l=new te,n=a,u=new ue;u.copy(n);const d=e,_=e.length/3,c=new ce;c.copy(d);const y=()=>{u.destroy(),c.destroy(),!r&&o.chunkyTriMesh&&(o.chunkyTriMesh=void 0)},M=x=>(y(),l.destroy(),{success:!1,navMesh:void 0,intermediates:o,error:x}),p={...Be,...t};let C,I;if(t.bounds)C=t.bounds[0],I=t.bounds[1];else{const x=ze(a,e);C=x.bbMin,I=x.bbMax}const{config:w,tileWidth:P,tileHeight:A,tcs:E,orig:D,maxTiles:b,maxPolysPerTile:S}=Pt({recastConfig:p,navMeshBounds:[C,I]}),N=Q.create({orig:D,tileWidth:p.tileSize*p.cs,tileHeight:p.tileSize*p.cs,maxTiles:b,maxPolys:S});if(!l.initTiled(N))return M("Could not init nav mesh for tiled use");const h=new dt;if(o.chunkyTriMesh=h,!h.init(u,c,_,p.chunkyTriMeshTrisPerChunk))return M("Failed to build chunky triangle mesh");i.startTimer(g.RC_TIMER_TEMP);const R=[0,0,0],T=[0,0,0];for(let x=0;x<A;x++)for(let O=0;O<P;O++){R[0]=C[0]+O*E,R[1]=C[1],R[2]=C[2]+x*E,T[0]=C[0]+(O+1)*E,T[1]=I[1],T[2]=C[2]+(x+1)*E;const H={x:O,y:x,bmin:R,bmax:T},U={offMeshConnections:p.offMeshConnections,buildBvTree:p.buildBvTree},F=xt(u,c,w,h,H,U,r,i);if(o.tileIntermediates.push(F.intermediates),F.success&&F.data){l.removeTile(l.getTileRefAt(O,x,0));const G=l.addTile(F.data,f.DT_TILE_FREE_DATA,0);Ze(G.status)&&(i.log(g.RC_LOG_WARNING,`Failed to add tile to nav mesh tx: ${O}, ty: ${x}, status: ${Je(G.status)} (${G.status})`),F.data.destroy())}}return i.stopTimer(g.RC_TIMER_TEMP),r||y(),{success:!0,navMesh:l,intermediates:o}},Nt=a=>{const e=[],t=[],r={};let i=0;for(const{positions:o,indices:l}of a)for(let n=0;n<l.length;n++){const u=l[n]*3,d=o[u],_=o[u+1],c=o[u+2],y=`${d}_${_}_${c}`;let M=r[y];M||(r[y]=M=i,e.push(d,_,c),i++),t.push(M)}return[Float32Array.from(e),Uint32Array.from(t)]};new Qe;class Ot extends ke{constructor(e,t){super(),this.navMesh=e,this.navMeshGeometry=new Ve,this.navMeshMaterial=t?.navMeshMaterial?t.navMeshMaterial:new We({color:"orange",transparent:!0,opacity:.7,depthWrite:!1}),this.update(),this.mesh=new j(this.navMeshGeometry,this.navMeshMaterial),this.add(this.mesh)}update(){const[e,t]=ct(this.navMesh);this.navMeshGeometry.setAttribute("position",new ie(Float32Array.from(e),3)),this.navMeshGeometry.setIndex(new ie(Uint32Array.from(t),1)),this.navMeshGeometry.computeVertexNormals()}}const Lt=new Ye,Ue=a=>{const e=[];for(const t of a){const r=t.geometry.attributes.position;if(!r||r.itemSize!==3)continue;t.updateMatrixWorld();const i=new Float32Array(r.array);for(let l=0;l<i.length;l+=3){const n=Lt.set(i[l],i[l+1],i[l+2]);t.localToWorld(n),i[l]=n.x,i[l+1]=n.y,i[l+2]=n.z}let o=t.geometry.getIndex()?.array;if(o===void 0){const l=[];for(let n=0;n<r.count;n++)l.push(n);o=l}e.push({positions:i,indices:o})}return Nt(e)},Ft=(a,e={},t=!1)=>{const[r,i]=Ue(a);return bt(r,i,e,t)},Ht=(a,e={},t=!1)=>{const[r,i]=Ue(a);return vt(r,i,e,t)},zt=["invalid","walking","offmesh"];let oe=!1;async function nr(){oe||(await Ke(),oe=!0)}function Bt(a){const e=a.getIndex();if(e===null){const t=a.getAttribute("position").clone();for(let r=0;r+2<t.count;r+=3)for(let i=0;i<t.itemSize;i+=1){const o=t.getComponent(r+1,i);t.setComponent(r+1,i,t.getComponent(r+2,i)),t.setComponent(r+2,i,o)}a.setAttribute("position",t);return}for(let t=0;t+2<e.count;t+=3){const r=e.getX(t+1);e.setX(t+1,e.getX(t+2)),e.setX(t+2,r)}e.needsUpdate=!0}function Ut(a){const e=a.getAttribute("position"),t=a.getIndex(),r=l=>t?.getX(l)??l;let i=0;const o=t?.count??e.count;for(let l=0;l+2<o;l+=3){const n=r(l),u=r(l+1),d=r(l+2),_=e.getX(u)-e.getX(n),c=e.getZ(u)-e.getZ(n),y=e.getX(d)-e.getX(n),M=e.getZ(d)-e.getZ(n);i+=c*y-_*M}return i}function Gt(a){const e=[],t=(l,n)=>{if(n.determinant()<0){const d=l.clone().applyMatrix4(n);return Ut(d)<0&&Bt(d),e.push(d),new j(d)}const u=new j(l);return u.matrixAutoUpdate=!1,u.matrix.copy(n),u.matrixWorldNeedsUpdate=!0,u},r=[],i=new ne,o=new ne;for(const l of a){if(l.updateWorldMatrix(!0,!1),l instanceof Xe){for(let n=0;n<l.count;n+=1)l.getMatrixAt(n,i),o.multiplyMatrices(l.matrixWorld,i),r.push(t(l.geometry,o));continue}r.push(l.matrixWorld.determinant()>=0?l:t(l.geometry,l.matrixWorld))}return{meshes:r,temporaryGeometries:e}}const kt=1297302868,Vt=1,Wt=1145979222,Yt=7;function Qt(a){let e=1;for(;e<a;)e*=2;return e}function Xt(a,e){const t=a.vertices.length,r=a.polygons.length;if(t===0||r===0)throw new Error("NavMeshManager.buildFromPolygons: vertices and polygons must be non-empty");if(t>65535)throw new Error(`NavMeshManager.buildFromPolygons: ${t} vertices exceed Detour's uint16 tile index`);if(a.detailMeshes.length!==r)throw new Error(`NavMeshManager.buildFromPolygons: ${r} polygons require the same number of detail rows`);const i=a.polygons.map(h=>h.vertices.map(()=>0)),o=new Map;let l=0;for(let h=0;h<r;h+=1){const R=a.polygons[h];if(R.vertices.length<3||R.vertices.length>6)throw new Error(`NavMeshManager.buildFromPolygons: polygon ${h} has ${R.vertices.length} vertices; Detour permits 3..6`);l+=R.vertices.length;for(let T=0;T<R.vertices.length;T+=1){const x=R.vertices[T],O=R.vertices[(T+1)%R.vertices.length];if(!Number.isInteger(x)||!Number.isInteger(O)||x<0||O<0||x>=t||O>=t)throw new Error(`NavMeshManager.buildFromPolygons: polygon ${h} references an invalid vertex`);const H=`${x},${O}`;if(o.has(H))throw new Error(`NavMeshManager.buildFromPolygons: directed edge ${H} occurs more than once`);const U=o.get(`${O},${x}`);if(U===void 0)o.set(H,[h,T]);else{const[F,G]=U;i[h][T]=F+1,i[F][G]=h+1}}}for(let h=0;h<r;h+=1){const R=a.detailMeshes[h];if(R.vertexBase<0||R.vertexCount<0||R.vertexBase+R.vertexCount>a.detailVertices.length||R.triangleBase<0||R.triangleCount<0||R.triangleBase+R.triangleCount>a.detailTriangles.length||R.vertexCount>255||R.triangleCount>255)throw new Error(`NavMeshManager.buildFromPolygons: polygon ${h} has an invalid detail row`)}for(const h of a.detailTriangles)if(h.some(R=>!Number.isInteger(R)||R<0||R>255))throw new Error("NavMeshManager.buildFromPolygons: detail triangles must contain uint8 values");const n=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],u=[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY];for(const h of[...a.vertices,...a.detailVertices])for(let R=0;R<3;R+=1){const T=h[R];if(!Number.isFinite(T))throw new Error("NavMeshManager.buildFromPolygons: every vertex component must be finite");n[R]=Math.min(n[R],T),u[R]=Math.max(u[R],T)}const d=100,_=32,c=12,p=d+t*12+r*_+l*c+r*12+a.detailVertices.length*12+a.detailTriangles.length*4,C=new Uint8Array(48+p),I=new DataView(C.buffer);let w=0;const P=h=>{I.setUint8(w,h),w+=1},A=h=>{I.setUint16(w,h,!0),w+=2},E=h=>{I.setUint32(w,h,!0),w+=4},D=h=>{I.setInt32(w,h,!0),w+=4},b=h=>{I.setFloat32(w,h,!0),w+=4},S=Qt(r);E(kt),E(Vt),E(1);for(const h of n)b(h);b(Math.max(u[0]-n[0],Number.EPSILON)),b(Math.max(u[2]-n[2],Number.EPSILON)),E(1),E(S),E(S),E(p),E(Wt),E(Yt),D(0),D(0),D(0),E(0),E(r),E(t),E(l),E(r),E(a.detailVertices.length),E(a.detailTriangles.length),E(0),E(0),E(r);const N=le.navigation;b(e?.walkableHeight??N.walkableHeight),b(e?.walkableRadius??N.walkableRadius),b(e?.walkableClimb??N.walkableClimb);for(const h of n)b(h);for(const h of u)b(h);b(1/(e?.cellSize??N.cellSize));for(const h of a.vertices)for(const R of h)b(R);for(let h=0;h<r;h+=1){const R=a.polygons[h];E(4294967295);for(let T=0;T<6;T+=1)A(R.vertices[T]??0);for(let T=0;T<6;T+=1)A(i[h]?.[T]??0);A(R.flags??1),P(R.vertices.length),P((R.area??0)&63)}w+=l*c;for(const h of a.detailMeshes)E(h.vertexBase),E(h.triangleBase),P(h.vertexCount),P(h.triangleCount),A(0);for(const h of a.detailVertices)for(const R of h)b(R);for(const h of a.detailTriangles)for(const R of h)P(R);if(w!==C.length)throw new Error(`NavMeshManager.buildFromPolygons: encoded ${w} bytes into a ${C.length}-byte allocation`);return C}class or{navMesh=null;query=null;crowd=null;helper=null;buildFromMeshes(e,t){const r=le.navigation,i=Gt(e),o=i.meshes.reduce((u,d)=>{const _=d.geometry.getIndex(),c=d.geometry.getAttribute("position").count;return u+Math.floor((_?.count??c)/3)},0),l={cs:t?.cellSize??r.cellSize,ch:t?.cellHeight??r.cellHeight,walkableSlopeAngle:t?.walkableSlopeAngle??r.walkableSlopeAngle,walkableHeight:t?.walkableHeight??r.walkableHeight,walkableClimb:t?.walkableClimb??r.walkableClimb,walkableRadius:t?.walkableRadius??r.walkableRadius,maxEdgeLen:t?.maxEdgeLen??r.maxEdgeLen,maxSimplificationError:t?.maxSimplificationError??r.maxSimplificationError,minRegionArea:t?.minRegionArea??r.minRegionArea,mergeRegionArea:t?.mergeRegionArea??r.mergeRegionArea,maxVertsPerPoly:6,detailSampleDist:6,detailSampleMaxError:1};let n;try{n=t?.tiled===!0||i.meshes.length>256||o>1e4?Ht(i.meshes,{...l,tileSize:t?.tileSize??256}):Ft(i.meshes,l)}finally{for(const u of i.temporaryGeometries)u.dispose()}return!n.success||!n.navMesh?!1:(this.destroyRecast(),this.navMesh=n.navMesh,this.query=new ee(this.navMesh),!0)}buildFromPolygons(e,t){try{return this.loadFromData(Xt(e,t)),!0}catch{return!1}}destroyRecast(){this.helper&&(this.helper.parent?.remove(this.helper),this.helper.dispose?.(),this.helper=null),this.crowd&&(this.crowd.destroy(),this.crowd=null),this.query&&(this.query.destroy(),this.query=null),this.navMesh&&(this.navMesh.destroy(),this.navMesh=null)}hasNavMesh(){return this.navMesh!==null}findPath(e,t){if(!this.query)throw new Error("NavMeshManager.findPath: no navmesh has been built, so no path can be queried. Build one first (buildFromMeshes/importNavMesh) — gate on hasNavMesh() if the caller can run before a bake.");const r=this.query.computePath(e,t);if(!r.success&&r.error)throw new Error(`NavMeshManager.findPath: recast could not complete the query (${r.error.name}${r.error.status===void 0?"":`, status ${r.error.status}`}).`);return r.path}createCrowd(e){if(!this.navMesh)throw new Error("Build navmesh first");return this.crowd=new it(this.navMesh,{maxAgents:e,maxAgentRadius:.6}),this.crowd}updateCrowd(e){this.crowd?.update(e)}getCrowdAgents(){return this.crowd?this.crowd.getAgents().map(e=>{const t=e.interpolatedPosition,r=e.velocity(),i=e.target(),o=zt[e.state()]??"invalid",l=o==="invalid"?[]:e.corners().map(n=>({x:n.x,y:n.y,z:n.z}));return{position:{x:t.x,y:t.y,z:t.z},velocity:{x:r.x,y:r.y,z:r.z},radius:e.radius,height:e.height,state:o,target:{x:i.x,y:i.y,z:i.z},corners:l}}):[]}getDebugMesh(e){return this.navMesh?(this.helper||(this.helper=new Ot(this.navMesh),e.add(this.helper)),this.helper):null}exportData(){if(!this.navMesh)throw new Error("No navmesh to export");return Mt(this.navMesh)}loadFromData(e){const{navMesh:t}=pt(e);this.destroyRecast(),this.navMesh=t,this.query=new ee(this.navMesh)}dispose(e){this.helper&&e.remove(this.helper),this.destroyRecast()}}export{or as NavMeshManager,nr as initNavigation};
1
+ import{_ as Ge}from"./index-wjn2vkB8.js";import"./three.module-BLhyNg0e.js";import{cW as ke,N as Ve,cp as We,co as j,M as ie,fo as Ye,_ as Qe,cm as ne,bu as Xe}from"./three.core-3arARmh6.js";import{DEFAULTS as le}from"./defaults-DKiBJCPN.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";const $e=["Recast","Detour","DetourNavMeshBuilder","DetourTileCacheBuilder","NavMeshImporter","NavMeshExporter","CrowdUtils","ChunkyTriMeshUtils","RecastDebugDraw","DetourDebugDraw"],qe=["rcConfig","rcContext","dtNavMeshParams","dtNavMeshCreateParams","RecastLinearAllocator","RecastFastLZCompressor","rcChunkyTriMesh","dtTileCacheParams","dtTileCacheLayerHeader","Vec3","BoolRef","IntRef","UnsignedIntRef","UnsignedCharRef","UnsignedShortRef","FloatRef","IntArray","UnsignedIntArray","UnsignedCharArray","UnsignedShortArray","FloatArray"],s={isNull:a=>s.Module.getPointer(a)===0,destroy:a=>{s.Module.destroy(a)}},g={},f={},Ke=async a=>{if(s.Module===void 0){{const e=(await Ge(async()=>{const{default:t}=await import("./recast-navigation.wasm-compat-Dsoa_MD-.js");return{default:t}},[])).default;s.Module=await e()}for(const e of $e)s[e]=new s.Module[e];for(const e of qe)s[e]=s.Module[e];g.RC_BORDER_REG=s.Recast.BORDER_REG,g.RC_MULTIPLE_REGS=s.Recast.MULTIPLE_REGS,g.RC_BORDER_VERTEX=s.Recast.BORDER_VERTEX,g.RC_AREA_BORDER=s.Recast.AREA_BORDER,g.RC_CONTOUR_REG_MASK=s.Recast.CONTOUR_REG_MASK,g.RC_MESH_NULL_IDX=s.Recast.MESH_NULL_IDX,g.RC_NULL_AREA=s.Recast.NULL_AREA,g.RC_WALKABLE_AREA=s.Recast.WALKABLE_AREA,g.RC_NOT_CONNECTED=s.Recast.NOT_CONNECTED,g.RC_CONTOUR_TESS_WALL_EDGES=s.Module.RC_CONTOUR_TESS_WALL_EDGES,g.RC_CONTOUR_TESS_AREA_EDGES=s.Module.RC_CONTOUR_TESS_AREA_EDGES,g.RC_LOG_PROGRESS=s.Module.RC_LOG_PROGRESS,g.RC_LOG_WARNING=s.Module.RC_LOG_WARNING,g.RC_LOG_ERROR=s.Module.RC_LOG_ERROR,g.RC_TIMER_TOTAL=s.Module.RC_TIMER_TOTAL,g.RC_TIMER_TEMP=s.Module.RC_TIMER_TEMP,g.RC_TIMER_RASTERIZE_TRIANGLES=s.Module.RC_TIMER_RASTERIZE_TRIANGLES,g.RC_TIMER_BUILD_COMPACTHEIGHTFIELD=s.Module.RC_TIMER_BUILD_COMPACTHEIGHTFIELD,g.RC_TIMER_BUILD_CONTOURS=s.Module.RC_TIMER_BUILD_CONTOURS,g.RC_TIMER_BUILD_CONTOURS_TRACE=s.Module.RC_TIMER_BUILD_CONTOURS_TRACE,g.RC_TIMER_BUILD_CONTOURS_SIMPLIFY=s.Module.RC_TIMER_BUILD_CONTOURS_SIMPLIFY,g.RC_TIMER_FILTER_BORDER=s.Module.RC_TIMER_FILTER_BORDER,g.RC_TIMER_FILTER_WALKABLE=s.Module.RC_TIMER_FILTER_WALKABLE,g.RC_TIMER_MEDIAN_AREA=s.Module.RC_TIMER_MEDIAN_AREA,g.RC_TIMER_FILTER_LOW_OBSTACLES=s.Module.RC_TIMER_FILTER_LOW_OBSTACLES,g.RC_TIMER_BUILD_POLYMESH=s.Module.RC_TIMER_BUILD_POLYMESH,g.RC_TIMER_MERGE_POLYMESH=s.Module.RC_TIMER_MERGE_POLYMESH,g.RC_TIMER_ERODE_AREA=s.Module.RC_TIMER_ERODE_AREA,g.RC_TIMER_MARK_BOX_AREA=s.Module.RC_TIMER_MARK_BOX_AREA,g.RC_TIMER_MARK_CYLINDER_AREA=s.Module.RC_TIMER_MARK_CYLINDER_AREA,g.RC_TIMER_MARK_CONVEXPOLY_AREA=s.Module.RC_TIMER_MARK_CONVEXPOLY_AREA,g.RC_TIMER_BUILD_DISTANCEFIELD=s.Module.RC_TIMER_BUILD_DISTANCEFIELD,g.RC_TIMER_BUILD_DISTANCEFIELD_DIST=s.Module.RC_TIMER_BUILD_DISTANCEFIELD_DIST,g.RC_TIMER_BUILD_DISTANCEFIELD_BLUR=s.Module.RC_TIMER_BUILD_DISTANCEFIELD_BLUR,g.RC_TIMER_BUILD_REGIONS=s.Module.RC_TIMER_BUILD_REGIONS,g.RC_TIMER_BUILD_REGIONS_WATERSHED=s.Module.RC_TIMER_BUILD_REGIONS_WATERSHED,g.RC_TIMER_BUILD_REGIONS_EXPAND=s.Module.RC_TIMER_BUILD_REGIONS_EXPAND,g.RC_TIMER_BUILD_REGIONS_FLOOD=s.Module.RC_TIMER_BUILD_REGIONS_FLOOD,g.RC_TIMER_BUILD_REGIONS_FILTER=s.Module.RC_TIMER_BUILD_REGIONS_FILTER,g.RC_TIMER_BUILD_LAYERS=s.Module.RC_TIMER_BUILD_LAYERS,g.RC_TIMER_BUILD_POLYMESHDETAIL=s.Module.RC_TIMER_BUILD_POLYMESHDETAIL,g.RC_TIMER_MERGE_POLYMESHDETAIL=s.Module.RC_TIMER_MERGE_POLYMESHDETAIL,g.RC_MAX_TIMERS=s.Module.RC_MAX_TIMERS,f.DT_FAILURE=s.Detour.FAILURE,f.DT_SUCCESS=s.Detour.SUCCESS,f.DT_IN_PROGRESS=s.Detour.IN_PROGRESS,f.DT_STATUS_DETAIL_MASK=s.Detour.STATUS_DETAIL_MASK,f.DT_WRONG_MAGIC=s.Detour.WRONG_MAGIC,f.DT_WRONG_VERSION=s.Detour.WRONG_VERSION,f.DT_OUT_OF_MEMORY=s.Detour.OUT_OF_MEMORY,f.DT_INVALID_PARAM=s.Detour.INVALID_PARAM,f.DT_BUFFER_TOO_SMALL=s.Detour.BUFFER_TOO_SMALL,f.DT_OUT_OF_NODES=s.Detour.OUT_OF_NODES,f.DT_PARTIAL_RESULT=s.Detour.PARTIAL_RESULT,f.DT_ALREADY_OCCUPIED=s.Detour.ALREADY_OCCUPIED,f.DT_VERTS_PER_POLYGON=s.Detour.VERTS_PER_POLYGON,f.DT_NAVMESH_MAGIC=s.Detour.NAVMESH_MAGIC,f.DT_NAVMESH_VERSION=s.Detour.NAVMESH_VERSION,f.DT_NAVMESH_STATE_MAGIC=s.Detour.NAVMESH_STATE_MAGIC,f.DT_NAVMESH_STATE_VERSION=s.Detour.NAVMESH_STATE_VERSION,f.DT_TILECACHE_MAGIC=s.Detour.TILECACHE_MAGIC,f.DT_TILECACHE_VERSION=s.Detour.TILECACHE_VERSION,f.DT_TILECACHE_NULL_AREA=s.Detour.TILECACHE_NULL_AREA,f.DT_TILECACHE_WALKABLE_AREA=s.Detour.TILECACHE_WALKABLE_AREA,f.DT_TILECACHE_NULL_IDX=s.Detour.TILECACHE_NULL_IDX,f.DT_NULL_LINK=s.Detour.NULL_LINK,f.DT_NULL_LINK=s.Detour.NULL_LINK,f.DT_EXT_LINK=s.Detour.EXT_LINK,f.DT_OFFMESH_CON_BIDIR=s.Detour.OFFMESH_CON_BIDIR,f.DT_STRAIGHTPATH_START=s.Module.DT_STRAIGHTPATH_START,f.DT_STRAIGHTPATH_END=s.Module.DT_STRAIGHTPATH_END,f.DT_STRAIGHTPATH_OFFMESH_CONNECTION=s.Module.DT_STRAIGHTPATH_OFFMESH_CONNECTION,f.DT_STRAIGHTPATH_AREA_CROSSINGS=s.Module.DT_STRAIGHTPATH_AREA_CROSSINGS,f.DT_STRAIGHTPATH_ALL_CROSSINGS=s.Module.DT_STRAIGHTPATH_ALL_CROSSINGS,f.DT_FINDPATH_ANY_ANGLE=s.Module.DT_FINDPATH_ANY_ANGLE,f.DT_RAYCAST_USE_COSTS=s.Module.DT_RAYCAST_USE_COSTS,f.DT_CROWDAGENT_STATE_INVALID=s.Module.DT_CROWDAGENT_STATE_INVALID,f.DT_CROWDAGENT_STATE_WALKING=s.Module.DT_CROWDAGENT_STATE_WALKING,f.DT_CROWDAGENT_STATE_OFFMESH=s.Module.DT_CROWDAGENT_STATE_OFFMESH,f.DT_CROWDAGENT_TARGET_NONE=s.Module.DT_CROWDAGENT_TARGET_NONE,f.DT_CROWDAGENT_TARGET_FAILED=s.Module.DT_CROWDAGENT_TARGET_FAILED,f.DT_CROWDAGENT_TARGET_VALID=s.Module.DT_CROWDAGENT_TARGET_VALID,f.DT_CROWDAGENT_TARGET_REQUESTING=s.Module.DT_CROWDAGENT_TARGET_REQUESTING,f.DT_CROWDAGENT_TARGET_WAITING_FOR_QUEUE=s.Module.DT_CROWDAGENT_TARGET_WAITING_FOR_QUEUE,f.DT_CROWDAGENT_TARGET_WAITING_FOR_PATH=s.Module.DT_CROWDAGENT_TARGET_WAITING_FOR_PATH,f.DT_CROWDAGENT_TARGET_VELOCITY=s.Module.DT_CROWDAGENT_TARGET_VELOCITY,f.DT_COMPRESSEDTILE_FREE_DATA=s.Module.DT_COMPRESSEDTILE_FREE_DATA,f.DT_TILE_FREE_DATA=s.Module.DT_TILE_FREE_DATA}};class K{get size(){return this.raw.size}constructor(e){this.raw=e}get(e){return this.raw.get(e)}set(e,t){this.raw.set(e,t)}resize(e){this.raw.resize(e)}copy(e){this.raw.resize(e.length),this.getHeapView().set(e)}destroy(){s.destroy(this.raw)}getHeapView(){const e=this.getHeap();return new this.ArrayConstructor(e.buffer,this.raw.getDataPointer(),this.size)}toTypedArray(){const e=this.getHeapView(),t=new this.ArrayConstructor(new ArrayBuffer(this.size*e.BYTES_PER_ELEMENT),0,this.size);return t.set(e),t}}class W extends K{ArrayConstructor=Int32Array;constructor(e){super(e??new s.Module.IntArray)}getHeap(){return s.Module.HEAP32}static fromRaw(e){return new W(e)}}class z extends K{ArrayConstructor=Uint32Array;constructor(e){super(e??new s.Module.UnsignedIntArray)}getHeap(){return s.Module.HEAPU32}static fromRaw(e){return new z(e)}}class Y extends K{ArrayConstructor=Uint8Array;constructor(e){super(e??new s.Module.UnsignedCharArray)}getHeap(){return s.Module.HEAPU8}static fromRaw(e){return new Y(e)}}class k extends K{ArrayConstructor=Float32Array;constructor(e){super(e??new s.Module.FloatArray)}getHeap(){return s.Module.HEAPF32}static fromRaw(e){return new k(e)}}const ue=k,ce=W,Z=Y,je=W,m={toRaw:({x:a,y:e,z:t},r)=>r?(r.x=a,r.y=e,r.z=t,r):new s.Module.Vec3(a,e,t),fromRaw:a=>{const{x:e,y:t,z:r}=a;return{x:e,y:t,z:r}},fromArray:([a,e,t])=>({x:a,y:e,z:t}),toArray:({x:a,y:e,z:t})=>[a,e,t],lerp:(a,e,t,r={x:0,y:0,z:0})=>{r.x=a.x+(e.x-a.x)*t,r.y=a.y+(e.y-a.y)*t,r.z=a.z+(e.z-a.z)*t},copy:(a,e={x:0,y:0,z:0})=>{e.x=a.x,e.y=a.y,e.z=a.z}},v=(a,e)=>{const t=[];for(let r=0;r<e;r++)t.push(a(r));return t},L=a=>s.Detour.statusSucceed(a),Ze=a=>s.Detour.statusFailed(a),Je=a=>{if(s.Detour.statusSucceed(a))return"success";if(s.Detour.statusInProgress(a))return"in progress";if(s.Detour.statusFailed(a)){let e;const t={DT_WRONG_MAGIC:f.DT_WRONG_MAGIC,DT_WRONG_VERSION:f.DT_WRONG_VERSION,DT_OUT_OF_MEMORY:f.DT_OUT_OF_MEMORY,DT_INVALID_PARAM:f.DT_INVALID_PARAM,DT_BUFFER_TOO_SMALL:f.DT_BUFFER_TOO_SMALL,DT_OUT_OF_NODES:f.DT_OUT_OF_NODES,DT_PARTIAL_RESULT:f.DT_PARTIAL_RESULT,DT_ALREADY_OCCUPIED:f.DT_ALREADY_OCCUPIED};for(const[r,i]of Object.entries(t))if(s.Detour.statusDetail(a,i)){e=r;break}return e?`failed - ${e}`:"failed - unknown"}return"unknown"};class et{constructor(e){this.raw=e}vertBase(){return this.raw.vertBase}triBase(){return this.raw.triBase}vertCount(){return this.raw.vertCount}triCount(){return this.raw.triCount}}class tt{constructor(e){this.raw=e}ref(){return this.raw.ref}next(){return this.raw.next}edge(){return this.raw.edge}side(){return this.raw.side}bmin(){return this.raw.bmin}bmax(){return this.raw.bmax}}class rt{constructor(e){this.raw=e}bmin(){return m.fromArray(v(e=>this.raw.get_bmin(e),3))}bmax(){return m.fromArray(v(e=>this.raw.get_bmax(e),3))}i(){return this.raw.i}}class he{constructor(e){this.raw=e}pos(e){return this.raw.get_pos(e)}rad(){return this.raw.rad}poly(){return this.raw.poly}flags(){return this.raw.flags}side(){return this.raw.side}userId(){return this.raw.userId}}class st{constructor(e){this.raw=e}magic(){return this.raw.magic}version(){return this.raw.version}x(){return this.raw.x}y(){return this.raw.y}layer(){return this.raw.layer}userId(){return this.raw.userId}polyCount(){return this.raw.polyCount}vertCount(){return this.raw.vertCount}maxLinkCount(){return this.raw.maxLinkCount}detailMeshCount(){return this.raw.detailMeshCount}detailVertCount(){return this.raw.detailVertCount}detailTriCount(){return this.raw.detailTriCount}bvNodeCount(){return this.raw.bvNodeCount}offMeshConCount(){return this.raw.offMeshConCount}offMeshBase(){return this.raw.offMeshBase}walkableHeight(){return this.raw.walkableHeight}walkableRadius(){return this.raw.walkableRadius}walkableClimb(){return this.raw.walkableClimb}bmin(e){return this.raw.get_bmin(e)}bmax(e){return this.raw.get_bmax(e)}bvQuantFactor(){return this.raw.bvQuantFactor}}class J{constructor(e){this.raw=e}firstLink(){return this.raw.firstLink}verts(e){return this.raw.get_verts(e)}neis(e){return this.raw.get_neis(e)}flags(){return this.raw.flags}vertCount(){return this.raw.vertCount}areaAndType(){return this.raw.get_areaAndtype()}getType(){return this.raw.getType()}}class B{constructor(e){this.raw=e}salt(){return this.raw.salt}linksFreeList(){return this.raw.linksFreeList}header(){return s.isNull(this.raw.header)?null:new st(this.raw.header)}polys(e){return new J(this.raw.get_polys(e))}verts(e){return this.raw.get_verts(e)}links(e){return new tt(this.raw.get_links(e))}detailMeshes(e){return new et(this.raw.get_detailMeshes(e))}detailVerts(e){return this.raw.get_detailVerts(e)}detailTris(e){return this.raw.get_detailTris(e)}bvTree(e){return new rt(this.raw.get_bvTree(e))}offMeshCons(e){return new he(this.raw.get_offMeshCons(e))}data(e){return this.raw.get_data(e)}dataSize(){return this.raw.dataSize}flags(){return this.raw.flags}next(){return new B(this.raw.next)}}const de=a=>{const e=s.DetourNavMeshBuilder.createNavMeshData(a.raw);return{success:e.success,navMeshData:Y.fromRaw(e.navMeshData)}};class we{constructor(e){this.raw=e??new s.Module.dtNavMeshCreateParams}setPolyMeshCreateParams(e){s.DetourNavMeshBuilder.setPolyMeshCreateParams(this.raw,e.raw)}setPolyMeshDetailCreateParams(e){s.DetourNavMeshBuilder.setPolyMeshDetailCreateParams(this.raw,e.raw)}setOffMeshConnections(e){if(e.length<=0)return;const t=[],r=[],i=[],o=[],l=[],n=[];for(let u=0;u<e.length;u++){const d=e[u];t.push(d.startPosition.x,d.startPosition.y,d.startPosition.z),t.push(d.endPosition.x,d.endPosition.y,d.endPosition.z),r.push(d.radius),i.push(d.bidirectional?1:0),o.push(d.area??0),l.push(d.flags??1),n.push(d.userId??1e3+u)}s.DetourNavMeshBuilder.setOffMeshConnections(this.raw,e.length,t,r,i,o,l,n)}verts(e){return this.raw.get_verts(e)}setVerts(e,t){this.raw.set_verts(e,t)}vertCount(){return this.raw.vertCount}polys(e){return this.raw.get_polys(e)}setPolys(e,t){this.raw.set_polys(e,t)}polyAreas(e){return this.raw.get_polyAreas(e)}setPolyAreas(e,t){this.raw.set_polyAreas(e,t)}polyFlags(e){return this.raw.get_polyFlags(e)}setPolyFlags(e,t){this.raw.set_polyFlags(e,t)}polyCount(){return this.raw.polyCount}nvp(){return this.raw.nvp}setNvp(e){this.raw.nvp=e}detailMeshes(e){return this.raw.get_detailMeshes(e)}setDetailMeshes(e,t){this.raw.set_detailMeshes(e,t)}detailVerts(e){return this.raw.get_detailVerts(e)}setDetailVerts(e,t){this.raw.set_detailVerts(e,t)}detailVertsCount(){return this.raw.detailVertsCount}detailTris(e){return this.raw.get_detailTris(e)}setDetailTris(e,t){this.raw.set_detailTris(e,t)}detailTriCount(){return this.raw.detailTriCount}offMeshConVerts(e){return this.raw.get_offMeshConVerts(e)}offMeshConRad(e){return this.raw.get_offMeshConRad(e)}offMeshConDir(e){return this.raw.get_offMeshConDir(e)}offMeshConAreas(e){return this.raw.get_offMeshConAreas(e)}offMeshConFlags(e){return this.raw.get_offMeshConFlags(e)}offMeshConUserID(e){return this.raw.get_offMeshConUserID(e)}offMeshConCount(){return this.raw.offMeshConCount}userId(){return this.raw.userId}tileX(){return this.raw.tileX}setTileX(e){this.raw.tileX=e}tileY(){return this.raw.tileY}setTileY(e){this.raw.tileY=e}tileLayer(){return this.raw.tileLayer}setTileLayer(e){this.raw.tileLayer=e}boundsMin(){return v(e=>this.raw.get_bmin(e),3)}setBoundsMin(e){this.raw.set_bmin(0,e[0]),this.raw.set_bmin(1,e[1]),this.raw.set_bmin(2,e[2])}boundsMax(){return v(e=>this.raw.get_bmax(e),3)}setBoundsMax(e){this.raw.set_bmax(0,e[0]),this.raw.set_bmax(1,e[1]),this.raw.set_bmax(2,e[2])}walkableHeight(){return this.raw.walkableHeight}setWalkableHeight(e){this.raw.walkableHeight=e}walkableRadius(){return this.raw.walkableRadius}setWalkableRadius(e){this.raw.walkableRadius=e}walkableClimb(){return this.raw.walkableClimb}setWalkableClimb(e){this.raw.walkableClimb=e}cellSize(){return this.raw.cs}setCellSize(e){this.raw.cs=e}cellHeight(){return this.raw.ch}setCellHeight(e){this.raw.ch=e}buildBvTree(){return this.raw.buildBvTree}setBuildBvTree(e){this.raw.buildBvTree=e}}class ge{get includeFlags(){return this.raw.getIncludeFlags()}set includeFlags(e){this.raw.setIncludeFlags(e)}get excludeFlags(){return this.raw.getExcludeFlags()}set excludeFlags(e){this.raw.setExcludeFlags(e)}constructor(e){this.raw=e??new s.Module.dtQueryFilter}getAreaCost(e){return this.raw.getAreaCost(e)}setAreaCost(e,t){this.raw.setAreaCost(e,t)}}class ee{defaultQueryHalfExtents={x:1,y:1,z:1};constructor(e,t){e instanceof s.Module.NavMeshQuery?this.raw=e:(this.raw=new s.Module.NavMeshQuery,this.raw.init(e.raw,t?.maxNodes??2048)),t?.defaultQueryFilter?this.defaultFilter=t.defaultQueryFilter:(this.defaultFilter=new ge,this.defaultFilter.includeFlags=65535,this.defaultFilter.excludeFlags=0)}findNearestPoly(e,t){const r=new s.UnsignedIntRef,i=new s.Vec3,o=new s.BoolRef,l=this.raw.findNearestPoly(m.toArray(e),m.toArray(t?.halfExtents??this.defaultQueryHalfExtents),t?.filter?.raw??this.defaultFilter.raw,r,i,o),n=m.fromRaw(i);s.destroy(i);const u=r.value;s.destroy(r);const d=o.value;return s.destroy(o),{success:L(l),status:l,nearestRef:u,nearestPoint:n,isOverPoly:d}}findPolysAroundCircle(e,t,r,i){const o=i?.filter??this.defaultFilter,l=i?.maxPolys??256,n=new z,u=new z,d=new k;n.resize(l),u.resize(l),d.resize(l);const _=new s.IntRef,c=this.raw.findPolysAroundCircle(e,m.toArray(t),r,o.raw,n.raw,u.raw,d.raw,_,l),y=[...n.getHeapView()];n.destroy();const M=[...u.getHeapView()];u.destroy();const p=[...d.getHeapView()];d.destroy();const C=_.value;return s.destroy(_),{success:L(c),status:c,resultRefs:y,resultParents:M,resultCost:p,resultCount:C}}queryPolygons(e,t,r){const i=r?.filter??this.defaultFilter,o=r?.maxPolys??256,l=new z;l.resize(o);const n=new s.IntRef,u=this.raw.queryPolygons(m.toArray(e),m.toArray(t),i.raw,l.raw,n,o),d=n.value;s.destroy(n);const _=[...l.getHeapView()].slice(0,d);return l.destroy(),{success:L(u),status:u,polyRefs:_}}closestPointOnPoly(e,t){const r=new s.Vec3,i=new s.BoolRef,o=this.raw.closestPointOnPoly(e,m.toArray(t),r,i),l=m.fromRaw(r);s.destroy(r);const n=i.value;return s.destroy(i),{success:L(o),status:o,closestPoint:l,isPointOverPoly:n}}findClosestPoint(e,t){const r=t?.filter??this.defaultFilter,i=t?.halfExtents??this.defaultQueryHalfExtents,o=new s.UnsignedIntRef,l=new s.Vec3,n=new s.BoolRef,u=this.raw.findClosestPoint(m.toArray(e),m.toArray(i),r.raw,o,l,n),d=o.value;s.destroy(o);const _=m.fromRaw(l);s.destroy(l);const c=n.value;return s.destroy(n),{success:L(u),status:u,polyRef:d,point:_,isPointOverPoly:c}}findRandomPointAroundCircle(e,t,r){const i=r?.filter??this.defaultFilter,o=r?.halfExtents??this.defaultQueryHalfExtents;let l;if(r?.startRef)l=r.startRef;else{const y=this.findNearestPoly(e,{filter:i,halfExtents:o});if(!y.success)return{success:!1,status:y.status,randomPolyRef:0,randomPoint:{x:0,y:0,z:0}};l=y.nearestRef}const n=new s.UnsignedIntRef,u=new s.Vec3,d=this.raw.findRandomPointAroundCircle(l,m.toArray(e),t,i.raw,n,u),_=n.value;s.destroy(n);const c=m.fromRaw(u);return s.destroy(u),{success:L(d),status:d,randomPolyRef:_,randomPoint:c}}moveAlongSurface(e,t,r,i){const o=i?.maxVisitedSize??256,l=new s.Vec3,n=new z,u=i?.filter?.raw??this.defaultFilter.raw,d=this.raw.moveAlongSurface(e,m.toArray(t),m.toArray(r),u,l,n.raw,o),_=m.fromRaw(l);s.destroy(l);const c=[...n.getHeapView()];return n.destroy(),{success:L(d),status:d,resultPosition:_,visited:c}}findRandomPoint(e){const t=new s.UnsignedIntRef,r=new s.Vec3,i=this.raw.findRandomPoint(e?.filter?.raw??this.defaultFilter.raw,t,r),o=t.value;s.destroy(t);const l=m.fromRaw(r);return s.destroy(r),{success:L(i),status:i,randomPolyRef:o,randomPoint:l}}getPolyHeight(e,t){const r=new s.FloatRef,i=this.raw.getPolyHeight(e,m.toArray(t),r),o=r.value;return s.destroy(r),{success:L(i),status:i,height:o}}computePath(e,t,r){const i=r?.filter??this.defaultFilter,o=r?.halfExtents??this.defaultQueryHalfExtents,l=this.findNearestPoly(e,{filter:i,halfExtents:o});if(!l.success)return{success:!1,error:{name:"findNearestPoly for start position failed",status:l.status},path:[]};const n=this.findNearestPoly(t,{filter:i,halfExtents:o});if(!n.success)return{success:!1,error:{name:"findNearestPoly for end position failed",status:n.status},path:[]};const u=l.nearestRef,d=n.nearestRef,_=r?.maxPathPolys??256,c=this.findPath(u,d,e,t,{filter:i,maxPathPolys:_});if(!c.success)return{success:!1,error:{name:"findPath unsuccessful",status:c.status},path:[]};if(c.polys.size<=0)return{success:!1,error:{name:"no polygon path found"},path:[]};const y=c.polys.get(c.polys.size-1);let M={x:t.x,y:t.y,z:t.z};if(y!==d){const A=this.closestPointOnPoly(y,t);if(!A.success)return{success:!1,error:{name:"no closest point on last polygon found",status:A.status},path:[]};M=A.closestPoint}const p=r?.maxStraightPathPoints,C=this.findStraightPath(e,M,c.polys,{maxStraightPathPoints:p});if(!C.success)return{success:!1,error:{name:"findStraightPath unsuccessful",status:C.status},path:[]};const{straightPath:I,straightPathCount:w}=C,P=[];for(let A=0;A<w;A++)P.push({x:I.get(A*3),y:I.get(A*3+1),z:I.get(A*3+2)});return c.polys.destroy(),C.straightPath.destroy(),C.straightPathFlags.destroy(),C.straightPathRefs.destroy(),{success:!0,path:P}}findPath(e,t,r,i,o){const l=o?.filter??this.defaultFilter,n=o?.maxPathPolys??256,u=new z;u.resize(n);const d=this.raw.findPath(e,t,m.toArray(r),m.toArray(i),l.raw,u.raw,n);return{success:L(d),status:d,polys:u}}findStraightPath(e,t,r,i){const o=i?.maxStraightPathPoints??256,l=i?.straightPathOptions??0;let n;Array.isArray(r)?(n=new z,n.copy(r)):n=r;const u=new k;u.resize(o*3);const d=new Y;d.resize(o);const _=new z;_.resize(o);const c=new s.IntRef,y=this.raw.findStraightPath(m.toArray(e),m.toArray(t),n.raw,u.raw,d.raw,_.raw,c,o,l),M=c.value;return s.destroy(c),Array.isArray(r)&&n.destroy(),{success:L(y),status:y,straightPath:u,straightPathFlags:d,straightPathRefs:_,straightPathCount:M}}raycast(e,t,r,i){const o=new s.Module.dtRaycastHit,l=i?.raycastOptions??0,n=i?.prevRef??0,u=i?.filter?.raw??this.defaultFilter.raw,d=this.raw.raycast(e,m.toArray(t),m.toArray(r),u,l,o,n),_={success:L(d),status:d,t:o.t,hitNormal:m.fromArray(v(c=>o.get_hitNormal(c),3)),hitEdgeIndex:o.hitEdgeIndex,path:v(c=>o.get_path(c),o.pathCount),maxPath:o.maxPath,pathCost:o.pathCost};return s.destroy(o),_}destroy(){this.raw.destroy()}}const _e={radius:.5,height:1,maxAcceleration:20,maxSpeed:6,collisionQueryRange:2.5,pathOptimizationRange:0,separationWeight:0,updateFlags:7,obstacleAvoidanceType:0,queryFilterType:0,userData:0};class at{get radius(){return this.raw.params.radius}set radius(e){this.raw.params.radius=e}get height(){return this.raw.params.height}set height(e){this.raw.params.height=e}get maxAcceleration(){return this.raw.params.maxAcceleration}set maxAcceleration(e){this.raw.params.maxAcceleration=e}get maxSpeed(){return this.raw.params.maxSpeed}set maxSpeed(e){this.raw.params.maxSpeed=e}get collisionQueryRange(){return this.raw.params.collisionQueryRange}set collisionQueryRange(e){this.raw.params.collisionQueryRange=e}get pathOptimizationRange(){return this.raw.params.pathOptimizationRange}set pathOptimizationRange(e){this.raw.params.pathOptimizationRange=e}get separationWeight(){return this.raw.params.separationWeight}set separationWeight(e){this.raw.params.separationWeight=e}get updateFlags(){return this.raw.params.updateFlags}set updateFlags(e){this.raw.params.updateFlags=e}get obstacleAvoidanceType(){return this.raw.params.obstacleAvoidanceType}set obstacleAvoidanceType(e){this.raw.params.obstacleAvoidanceType=e}get queryFilterType(){return this.raw.params.queryFilterType}set queryFilterType(e){this.raw.params.queryFilterType=e}get userData(){return this.raw.params.userData}set userData(e){this.raw.params.userData=e}interpolatedPosition={x:0,y:0,z:0};constructor(e,t){this.crowd=e,this.agentIndex=t,this.raw=e.raw.getEditableAgent(t),this.interpolatedPosition=this.position()}requestMoveTarget(e){const{nearestPoint:t,nearestRef:r}=this.crowd.navMeshQuery.findNearestPoly(e,{halfExtents:this.crowd.navMeshQuery.defaultQueryHalfExtents,filter:this.crowd.navMeshQuery.defaultFilter});return this.crowd.raw.requestMoveTarget(this.agentIndex,r,m.toArray(t))}requestMoveVelocity(e){return this.crowd.raw.requestMoveVelocity(this.agentIndex,m.toArray(e))}resetMoveTarget(){this.crowd.raw.resetMoveTarget(this.agentIndex)}teleport(e){s.CrowdUtils.agentTeleport(this.crowd.raw,this.agentIndex,m.toArray(e),m.toArray(this.crowd.navMeshQuery.defaultQueryHalfExtents),this.crowd.navMeshQuery.defaultFilter.raw),m.copy(e,this.interpolatedPosition)}position(){return{x:this.raw.get_npos(0),y:this.raw.get_npos(1),z:this.raw.get_npos(2)}}velocity(){return{x:this.raw.get_vel(0),y:this.raw.get_vel(1),z:this.raw.get_vel(2)}}desiredVelocity(){return{x:this.raw.get_dvel(0),y:this.raw.get_dvel(1),z:this.raw.get_dvel(2)}}desiredVelocityObstacleAdjusted(){return{x:this.raw.get_nvel(0),y:this.raw.get_nvel(1),z:this.raw.get_nvel(2)}}state(){return this.raw.state}target(){return{x:this.raw.get_targetPos(0),y:this.raw.get_targetPos(1),z:this.raw.get_targetPos(2)}}nextTargetInPath(){return{x:this.raw.get_cornerVerts(0),y:this.raw.get_cornerVerts(1),z:this.raw.get_cornerVerts(2)}}corners(){const e=[];for(let t=0;t<this.raw.ncorners;t++)e.push({x:this.raw.get_cornerVerts(t*3),y:this.raw.get_cornerVerts(t*3+1),z:this.raw.get_cornerVerts(t*3+2)});return e}parameters(){const{params:e}=this.raw;return{radius:e.radius,height:e.height,maxAcceleration:e.maxAcceleration,maxSpeed:e.maxSpeed,collisionQueryRange:e.collisionQueryRange,pathOptimizationRange:e.pathOptimizationRange,separationWeight:e.separationWeight,updateFlags:e.updateFlags,obstacleAvoidanceType:e.obstacleAvoidanceType,queryFilterType:e.queryFilterType,userData:e.userData}}updateParameters(e){const t={...this.parameters(),...e};this.setParameters(t)}setParameters(e){const t={..._e,...e},r=new s.Module.dtCrowdAgentParams;r.radius=t.radius,r.height=t.height,r.maxAcceleration=t.maxAcceleration,r.maxSpeed=t.maxSpeed,r.collisionQueryRange=t.collisionQueryRange,r.pathOptimizationRange=t.pathOptimizationRange,r.separationWeight=t.separationWeight,r.updateFlags=t.updateFlags,r.obstacleAvoidanceType=t.obstacleAvoidanceType,r.queryFilterType=t.queryFilterType,r.userData=t.userData,this.crowd.raw.updateAgentParameters(this.agentIndex,r)}overOffMeshConnection(){return s.CrowdUtils.overOffMeshConnection(this.crowd.raw,this.agentIndex)}}class it{agents={};accumulator=0;constructor(e,{maxAgents:t,maxAgentRadius:r}){this.navMesh=e,this.raw=s.Detour.allocCrowd(),this.raw.init(t,r,e.raw.getNavMesh()),this.navMeshQuery=new ee(new s.Module.NavMeshQuery(this.raw.getNavMeshQuery()))}update(e,t,r=10){if(t===void 0)this.raw.update(e,void 0);else{this.accumulator+=t;let i=0;for(;this.accumulator>=e&&i<r;)this.raw.update(e,void 0),this.accumulator-=e,i++;const o=this.accumulator%e/e,l=this.getAgents();for(const n of l)m.lerp(n.interpolatedPosition,n.position(),o,n.interpolatedPosition)}}addAgent(e,t){const r={..._e,...t},i=new s.Module.dtCrowdAgentParams;i.radius=r.radius,i.height=r.height,i.maxAcceleration=r.maxAcceleration,i.maxSpeed=r.maxSpeed,i.collisionQueryRange=r.collisionQueryRange,i.pathOptimizationRange=r.pathOptimizationRange,i.separationWeight=r.separationWeight,i.updateFlags=r.updateFlags,i.obstacleAvoidanceType=r.obstacleAvoidanceType,i.queryFilterType=r.queryFilterType,i.userData=r.userData;const o=this.raw.addAgent(m.toArray(e),i),l=new at(this,o);return this.agents[o]=l,l}getAgent(e){const t=this.agents[e];return t||null}removeAgent(e){const t=typeof e=="number"?e:e.agentIndex;this.raw.removeAgent(t),delete this.agents[t]}getAgentCount(){return this.raw.getAgentCount()}getActiveAgentCount(){return s.CrowdUtils.getActiveAgentCount(this.raw)}getAgents(){return Object.values(this.agents)}getFilter(e){return new ge(this.raw.getEditableFilter(e))}destroy(){s.Detour.freeCrowd(this.raw)}}class nt{constructor(e){this.raw=e}tiles(e){return new B(this.raw.get_tiles(e))}tileCount(){return this.raw.tileCount}}class ot{constructor(e){this.raw=e}data(){return v(e=>this.raw.get_data(e),this.raw.dataSize)}dataSize(){return this.raw.dataSize}}class lt{constructor(e){this.raw=e}tileX(){return this.raw.tileX}tileY(){return this.raw.tileY}}class ut{constructor(e){this.raw=e}data(){return v(e=>this.raw.get_data(e),this.raw.dataSize)}dataSize(){return this.raw.dataSize}}class Q{constructor(e){this.raw=e}static create(e){const t=new s.Module.dtNavMeshParams;return t.set_orig(0,e.orig.x),t.set_orig(1,e.orig.y),t.set_orig(2,e.orig.z),t.tileWidth=e.tileWidth,t.tileHeight=e.tileHeight,t.maxTiles=e.maxTiles,t.maxPolys=e.maxPolys,new Q(t)}clone(){return Q.create({orig:{x:this.raw.get_orig(0),y:this.raw.get_orig(1),z:this.raw.get_orig(2)},tileWidth:this.raw.tileWidth,tileHeight:this.raw.tileHeight,maxTiles:this.raw.maxTiles,maxPolys:this.raw.maxPolys})}}class te{constructor(e){this.raw=e??new s.Module.NavMesh}initSolo(e){return this.raw.initSolo(e.raw)}initTiled(e){return this.raw.initTiled(e.raw)}addTile(e,t,r){const i=new s.UnsignedIntRef,o=this.raw.addTile(e.raw,t,r,i),l=i.value;return s.destroy(i),{status:o,tileRef:l}}decodePolyId(e){const t=new s.UnsignedIntRef,r=new s.UnsignedIntRef,i=new s.UnsignedIntRef;this.raw.decodePolyId(e,t,r,i);const o=t.value;s.destroy(t);const l=r.value;s.destroy(r);const n=i.value;return s.destroy(i),{tileSalt:o,tileIndex:l,tilePolygonIndex:n}}encodePolyId(e,t,r){return this.raw.encodePolyId(e,t,r)}removeTile(e){return new ot(this.raw.removeTile(e))}calcTileLoc(e){return new lt(this.raw.calcTileLoc(m.toArray(e)))}getTileAt(e,t,r){const i=this.raw.getTileAt(e,t,r);return s.isNull(i)?null:new B(i)}getTilesAt(e,t,r){return new nt(this.raw.getTilesAt(e,t,r))}getTileRefAt(e,t,r){return this.raw.getTileRefAt(e,t,r)}getTileRef(e){return this.raw.getTileRef(e.raw)}getTileByRef(e){const t=this.raw.getTileByRef(e);return s.isNull(t)?null:new B(t)}getMaxTiles(){return this.raw.getMaxTiles()}getTile(e){return new B(this.raw.getTile(e))}getTileAndPolyByRef(e){const t=this.raw.getTileAndPolyByRef(e),r=new B(t.tile),i=new J(t.poly);return{success:L(t.status),status:t.status,tile:r,poly:i}}getTileAndPolyByRefUnsafe(e){const t=this.raw.getTileAndPolyByRef(e),r=new B(t.tile),i=new J(t.poly);return{tile:r,poly:i}}isValidPolyRef(e){return this.raw.isValidPolyRef(e)}getPolyRefBase(e){return this.raw.getPolyRefBase(e.raw)}getOffMeshConnectionPolyEndPoints(e,t){const r=new s.Vec3,i=new s.Vec3,o=this.raw.getOffMeshConnectionPolyEndPoints(e,t,r,i),l=m.fromRaw(r);s.destroy(r);const n=m.fromRaw(i);return s.destroy(i),{success:L(o),status:o,start:l,end:n}}getOffMeshConnectionByRef(e){return new he(this.raw.getOffMeshConnectionByRef(e))}setPolyFlags(e,t){return this.raw.setPolyFlags(e,t)}getPolyFlags(e){const t=new s.UnsignedShortRef,r=this.raw.getPolyFlags(e,t),i=t.value;return s.destroy(t),{status:r,flags:i}}setPolyArea(e,t){return this.raw.setPolyArea(e,t)}getPolyArea(e){const t=new s.UnsignedCharRef,r=this.raw.getPolyArea(e,t),i=t.value;return s.destroy(t),{status:r,area:i}}getTileStateSize(e){return this.raw.getTileStateSize(e.raw)}storeTileState(e,t){return new ut(this.raw.storeTileState(e.raw,t))}restoreTileState(e,t,r){return this.raw.restoreTileState(e.raw,t,r)}destroy(){this.raw.destroy(),s.Module.destroy(this.raw)}}const ct=(a,e)=>{const t=[],r=[];let i=0;const o=a.getMaxTiles();for(let l=0;l<o;l++){const n=a.getTile(l),u=n.header();if(!u)continue;const d=u.polyCount();for(let _=0;_<d;++_){const c=n.polys(_);if(c.getType()===1)continue;const y=c.vertCount(),M=n.detailMeshes(_),p=M.triBase(),C=M.triCount();for(let I=0;I<C;++I){const w=(p+I)*4;for(let P=0;P<3;++P){if(n.detailTris(w+P)<y){const A=c.verts(n.detailTris(w+P))*3;t.push(n.verts(A),n.verts(A+1),n.verts(A+2))}else{const A=(M.vertBase()+n.detailTris(w+P)-c.vertCount())*3;t.push(n.detailVerts(A),n.detailVerts(A+1),n.detailVerts(A+2))}r.push(i++)}}}}return[t,r]},re={borderSize:0,tileSize:0,cs:.2,ch:.2,walkableSlopeAngle:60,walkableHeight:2,walkableClimb:2,walkableRadius:.5,maxEdgeLen:12,maxSimplificationError:1.3,minRegionArea:8,mergeRegionArea:20,maxVertsPerPoly:6,detailSampleDist:6,detailSampleMaxError:1},fe=a=>{const e={...re,...a},t=new s.Module.rcConfig;return t.borderSize=e.borderSize,t.tileSize=e.tileSize,t.cs=e.cs,t.ch=e.ch,t.walkableSlopeAngle=e.walkableSlopeAngle,t.walkableHeight=e.walkableHeight,t.walkableClimb=e.walkableClimb,t.walkableRadius=e.walkableRadius,t.maxEdgeLen=e.maxEdgeLen,t.maxSimplificationError=e.maxSimplificationError,t.minRegionArea=e.minRegionArea,t.mergeRegionArea=e.mergeRegionArea,t.maxVertsPerPoly=e.maxVertsPerPoly,t.detailSampleDist=e.detailSampleDist,t.detailSampleMaxError=e.detailSampleMaxError,t},ht=a=>{const e=new s.Module.rcConfig;return e.set_bmin(0,a.get_bmin(0)),e.set_bmin(1,a.get_bmin(1)),e.set_bmin(2,a.get_bmin(2)),e.set_bmax(0,a.get_bmax(0)),e.set_bmax(1,a.get_bmax(1)),e.set_bmax(2,a.get_bmax(2)),e.width=a.width,e.height=a.height,e.borderSize=a.borderSize,e.tileSize=a.tileSize,e.cs=a.cs,e.ch=a.ch,e.walkableSlopeAngle=a.walkableSlopeAngle,e.walkableHeight=a.walkableHeight,e.walkableClimb=a.walkableClimb,e.walkableRadius=a.walkableRadius,e.maxEdgeLen=a.maxEdgeLen,e.maxSimplificationError=a.maxSimplificationError,e.minRegionArea=a.minRegionArea,e.mergeRegionArea=a.mergeRegionArea,e.maxVertsPerPoly=a.maxVertsPerPoly,e.detailSampleDist=a.detailSampleDist,e.detailSampleMaxError=a.detailSampleMaxError,e};class se{logs=[];startTimes={};accumulatedTimes={};constructor(e=!0){const t=new s.Module.RecastBuildContextJsImpl;t.log=(r,i,o)=>{if(!this.raw.logEnabled())return;const l=i,n=new Uint8Array(s.Module.HEAPU8.buffer,l,o),u=new Uint8Array(o);u.set(n);const d=new TextDecoder().decode(u);this.log(r,d)},t.resetLog=()=>{this.resetLog()},t.startTimer=r=>{this.raw.timerEnabled()&&this.startTimer(r)},t.stopTimer=r=>{this.raw.timerEnabled()&&this.stopTimer(r)},t.getAccumulatedTime=r=>this.raw.timerEnabled()?this.getAccumulatedTime(r):-1,t.resetTimers=()=>{this.raw.timerEnabled()&&(this.startTimes={},this.accumulatedTimes={})},this.raw=new s.Module.RecastBuildContext(t),this.raw.enableTimer(e),this.raw.enableLog(e),this.resetTimers()}log(e,t){this.logs.push({category:e,msg:t})}resetLog(){this.logs=[]}startTimer(e){this.startTimes[e]=performance.now()}stopTimer(e){const r=performance.now()-this.startTimes[e];this.accumulatedTimes[e]===-1?this.accumulatedTimes[e]=r:this.accumulatedTimes[e]+=r}getAccumulatedTime(e){return this.accumulatedTimes[e]}resetTimers(){for(let e=0;e<g.RC_MAX_TIMERS;e++)this.startTimes[e]=-1,this.accumulatedTimes[e]=-1}}class dt{constructor(e){this.raw=e??new s.rcChunkyTriMesh}init(e,t,r,i){return s.ChunkyTriMeshUtils.createChunkyTriMesh(e.raw,t.raw,r,i,this.raw)}getChunksOverlappingRect(e,t,r,i){return s.ChunkyTriMeshUtils.getChunksOverlappingRect(this.raw,e,t,r.raw,i)}getNodeTris(e){return W.fromRaw(s.ChunkyTriMeshUtils.getChunkyTriMeshNodeTris(this.raw,e))}nodes(e){return this.raw.get_nodes(e)}maxTrisPerChunk(){return this.raw.maxTrisPerChunk}}class V{constructor(e){this.raw=e}smin(){return this.raw.smin}smax(){return this.raw.smax}area(){return this.raw.area}next(){return s.isNull(this.raw.next)?null:new V(this.raw.next)}}class ae{constructor(e){this.raw=e}next(){return s.isNull(this.raw.next)?null:new ae(this.raw.next)}items(e){return new V(this.raw.get_items(e))}}class wt{constructor(e){this.raw=e}width(){return this.raw.width}height(){return this.raw.height}bmin(){return m.fromArray(v(e=>this.raw.get_bmin(e),3))}bmax(){return m.fromArray(v(e=>this.raw.get_bmax(e),3))}cs(){return this.raw.cs}ch(){return this.raw.ch}spans(e){return new V(this.raw.get_spans(e))}pools(e){return new ae(this.raw.get_pools(e))}freelist(e){return new V(this.raw.get_freelist(e))}}class gt{constructor(e){this.raw=e}index(){return this.raw.get_index()}count(){return this.raw.get_count()}}class _t{constructor(e){this.raw=e}y(){return this.raw.get_y()}reg(){return this.raw.get_reg()}con(){return this.raw.get_con()}h(){return this.raw.get_h()}}class ft{constructor(e){this.raw=e}width(){return this.raw.width}height(){return this.raw.height}spanCount(){return this.raw.spanCount}walkableHeight(){return this.raw.walkableHeight}walkableClimb(){return this.raw.walkableClimb}borderSize(){return this.raw.borderSize}maxDistance(){return this.raw.maxDistance}maxRegions(){return this.raw.maxRegions}bmin(){return m.fromArray(v(e=>this.raw.get_bmin(e),3))}bmax(){return m.fromArray(v(e=>this.raw.get_bmax(e),3))}cs(){return this.raw.cs}ch(){return this.raw.ch}cells(e){return new gt(this.raw.get_cells(e))}spans(e){return new _t(this.raw.get_spans(e))}dist(e){return this.raw.get_dist(e)}areas(e){return this.raw.get_areas(e)}}class Rt{constructor(e){this.raw=e}verts(e){return this.raw.get_verts(e)}nverts(){return this.raw.nverts}rverts(e){return this.raw.get_rverts(e)}nrverts(){return this.raw.nrverts}reg(){return this.raw.reg}area(){return this.raw.area}}class Tt{constructor(e){this.raw=e}conts(e){return new Rt(this.raw.get_conts(e))}nconts(){return this.raw.nconts}bmin(){return m.fromArray(v(e=>this.raw.get_bmin(e),3))}bmax(){return m.fromArray(v(e=>this.raw.get_bmax(e),3))}cs(){return this.raw.cs}ch(){return this.raw.ch}width(){return this.raw.width}height(){return this.raw.height}borderSize(){return this.raw.borderSize}maxError(){return this.raw.maxError}}class mt{constructor(e){this.raw=e}verts(e){return this.raw.get_verts(e)}polys(e){return this.raw.get_polys(e)}regs(e){return this.raw.get_regs(e)}flags(e){return this.raw.get_flags(e)}setFlags(e,t){this.raw.set_flags(e,t)}areas(e){return this.raw.get_areas(e)}setAreas(e,t){this.raw.set_areas(e,t)}nverts(){return this.raw.nverts}npolys(){return this.raw.npolys}maxpolys(){return this.raw.maxpolys}nvp(){return this.raw.nvp}bmin(){return m.fromArray(v(e=>this.raw.get_bmin(e),3))}bmax(){return m.fromArray(v(e=>this.raw.get_bmax(e),3))}cs(){return this.raw.cs}ch(){return this.raw.ch}borderSize(){return this.raw.borderSize}maxEdgeError(){return this.raw.maxEdgeError}}class yt{constructor(e){this.raw=e}meshes(e){return this.raw.get_meshes(e)}verts(e){return this.raw.get_verts(e)}tris(e){return this.raw.get_tris(e)}nmeshes(){return this.raw.nmeshes}nverts(){return this.raw.nverts}ntris(){return this.raw.ntris}}const Re=(a,e,t)=>s.Recast.calcGridSize(a,e,t),Te=(a,e,t,r,i,o,l,n)=>s.Recast.createHeightfield(a.raw,e.raw,t,r,i,o,l,n),me=(a,e,t,r,i,o,l)=>s.Recast.markWalkableTriangles(a.raw,e,t.raw,r,i.raw,o,l.raw),ye=(a,e,t,r,i,o,l,n=1)=>s.Recast.rasterizeTriangles(a.raw,e.raw,t,r.raw,i.raw,o,l.raw,n),Ae=(a,e,t)=>s.Recast.filterLowHangingWalkableObstacles(a.raw,e,t.raw),Me=(a,e,t,r)=>s.Recast.filterLedgeSpans(a.raw,e,t,r.raw),Ee=(a,e,t)=>s.Recast.filterWalkableLowHeightSpans(a.raw,e,t.raw),pe=(a,e,t,r,i)=>s.Recast.buildCompactHeightfield(a.raw,e,t,r.raw,i.raw),Ce=(a,e,t)=>s.Recast.erodeWalkableArea(a.raw,e,t.raw),Se=(a,e)=>s.Recast.buildDistanceField(a.raw,e.raw),Ie=(a,e,t,r,i)=>s.Recast.buildRegions(a.raw,e.raw,t,r,i),De=(a,e,t,r,i,o=g.RC_CONTOUR_TESS_WALL_EDGES)=>s.Recast.buildContours(a.raw,e.raw,t,r,i.raw,o),be=(a,e,t,r)=>s.Recast.buildPolyMesh(a.raw,e.raw,t,r.raw),Pe=(a,e,t,r,i,o)=>s.Recast.buildPolyMeshDetail(a.raw,e.raw,t.raw,r,i,o.raw),xe=()=>new wt(s.Recast.allocHeightfield()),X=a=>s.Recast.freeHeightfield(a.raw),ve=()=>new ft(s.Recast.allocCompactHeightfield()),$=a=>s.Recast.freeCompactHeightfield(a.raw),Ne=()=>new Tt(s.Recast.allocContourSet()),q=a=>s.Recast.freeContourSet(a.raw),Oe=()=>new mt(s.Recast.allocPolyMesh()),Le=a=>s.Recast.freePolyMesh(a.raw),Fe=()=>new yt(s.Recast.allocPolyMeshDetail()),He=a=>s.Recast.freePolyMeshDetail(a.raw),At=(a,e)=>{const t=s.NavMeshExporter.exportNavMesh(a.raw,e?.raw),r=new Uint8Array(s.Module.HEAPU8.buffer,t.dataPointer,t.size),i=new Uint8Array(t.size);return i.set(r),s.NavMeshExporter.freeNavMeshExport(t),i},Mt=a=>At(a),Et=a=>{const e=a.length*a.BYTES_PER_ELEMENT,t=s.Module._malloc(e),r=new Uint8Array(s.Module.HEAPU8.buffer,t,e);r.set(a);const i=new s.Module.NavMeshExport;return i.dataPointer=r.byteOffset,i.size=a.length,{navMeshExport:i,dataHeap:r}},pt=a=>{const{navMeshExport:e,dataHeap:t}=Et(a),r=s.NavMeshImporter.importNavMesh(e,void 0);return s.Module._free(t.byteOffset),{navMesh:new te(r.navMesh)}},ze=(a,e)=>{const t={x:1/0,y:1/0,z:1/0},r={x:-1/0,y:-1/0,z:-1/0};for(let i=0;i<e.length;i++){const o=e[i],l=a[o*3],n=a[o*3+1],u=a[o*3+2];t.x=Math.min(t.x,l),t.y=Math.min(t.y,n),t.z=Math.min(t.z,u),r.x=Math.max(r.x,l),r.y=Math.max(r.y,n),r.z=Math.max(r.z,u)}return{bbMin:m.toArray(t),bbMax:m.toArray(r)}},Ct=a=>{let e=0,t=0;return e=+(a>65535)<<4,a>>=e,t=+(a>255)<<3,a>>=t,e|=t,t=+(a>15)<<2,a>>=t,e|=t,t=+(a>3)<<1,a>>=t,e|=t,e|=a>>1,e},St=a=>(a--,a|=a>>1,a|=a>>2,a|=a>>4,a|=a>>8,a|=a>>16,a++,a),It={...re,buildBvTree:!0},Dt=(a,e,t={},r=!1)=>{const i=new se,o={type:"solo",buildContext:i},l=()=>{r||(o.heightfield&&(X(o.heightfield),o.heightfield=void 0),o.compactHeightfield&&($(o.compactHeightfield),o.compactHeightfield=void 0),o.contourSet&&(q(o.contourSet),o.contourSet=void 0),o.polyMesh&&(Le(o.polyMesh),o.polyMesh=void 0),o.polyMeshDetail&&(He(o.polyMeshDetail),o.polyMeshDetail=void 0))},n=T=>(l(),{navMeshData:void 0,success:!1,intermediates:o,error:T}),u=a,d=e.length,_=new ue;_.copy(u);const c=e,y=e.length/3,M=new ce;M.copy(c);let p,C;if(t.bounds)p=t.bounds[0],C=t.bounds[1];else{const T=ze(a,e);p=T.bbMin,C=T.bbMax}const I={...It,...t},w=fe(I);w.minRegionArea=w.minRegionArea*w.minRegionArea,w.mergeRegionArea=w.mergeRegionArea*w.mergeRegionArea,w.detailSampleDist=w.detailSampleDist<.9?0:w.cs*w.detailSampleDist,w.detailSampleMaxError=w.ch*w.detailSampleMaxError;const P=Re(p,C,w.cs);w.width=P.width,w.height=P.height;const A=xe();if(o.heightfield=A,!Te(i,A,w.width,w.height,p,C,w.cs,w.ch))return n("Could not create heightfield");const E=new Z;if(E.resize(y),me(i,w.walkableSlopeAngle,_,d,M,y,E),!ye(i,_,d,M,E,y,A,w.walkableClimb))return n("Could not rasterize triangles");E.destroy(),_.destroy(),M.destroy(),Ae(i,w.walkableClimb,A),Me(i,w.walkableHeight,w.walkableClimb,A),Ee(i,w.walkableHeight,A);const D=ve();if(o.compactHeightfield=D,!pe(i,w.walkableHeight,w.walkableClimb,A,D))return n("Failed to build compact data");if(r||(X(A),o.heightfield=void 0),!Ce(i,w.walkableRadius,D))return n("Failed to erode walkable area");if(!Se(i,D))return n("Failed to build distance field");if(!Ie(i,D,w.borderSize,w.minRegionArea,w.mergeRegionArea))return n("Failed to build regions");const b=Ne();if(o.contourSet=b,!De(i,D,w.maxSimplificationError,w.maxEdgeLen,b,g.RC_CONTOUR_TESS_WALL_EDGES))return n("Failed to create contours");const S=Oe();if(o.polyMesh=S,!be(i,b,w.maxVertsPerPoly,S))return n("Failed to triangulate contours");const N=Fe();if(o.polyMeshDetail=N,!Pe(i,S,D,w.detailSampleDist,w.detailSampleMaxError,N))return n("Failed to build detail mesh");r||($(D),o.compactHeightfield=void 0,q(b),o.contourSet=void 0);for(let T=0;T<S.npolys();T++)S.areas(T)===g.RC_WALKABLE_AREA&&S.setAreas(T,0),S.areas(T)===0&&S.setFlags(T,1);const h=new we;h.setPolyMeshCreateParams(S),h.setPolyMeshDetailCreateParams(N),h.setWalkableHeight(w.walkableHeight*w.ch),h.setWalkableRadius(w.walkableRadius*w.cs),h.setWalkableClimb(w.walkableClimb*w.ch),h.setCellSize(w.cs),h.setCellHeight(w.ch),h.setBuildBvTree(I.buildBvTree),t.offMeshConnections&&h.setOffMeshConnections(t.offMeshConnections);const R=de(h);return R.success?(l(),{navMeshData:R.navMeshData,success:!0,intermediates:o}):n("Failed to create Detour navmesh data")},bt=(a,e,t={},r=!1)=>{if(!s.Module)throw new Error('"init" must be called before using any recast-navigation-js APIs. See: https://github.com/isaac-mason/recast-navigation-js?tab=readme-ov-file#initialization');const i=Dt(a,e,t,r);if(!i.success)return{navMesh:void 0,success:!1,intermediates:i.intermediates,error:i.error};const{navMeshData:o}=i,l=new te;return l.initSolo(o)?{success:!0,navMesh:l,intermediates:i.intermediates}:(o.destroy(),{navMesh:void 0,success:!1,intermediates:i.intermediates,error:"Failed to initialize solo NavMesh"})},Pt=({recastConfig:a,navMeshBounds:[e,t]})=>{const r=fe(a),i=Re(e,t,r.cs);r.width=i.width,r.height=i.height,r.minRegionArea=r.minRegionArea*r.minRegionArea,r.mergeRegionArea=r.mergeRegionArea*r.mergeRegionArea,r.tileSize=Math.floor(r.tileSize),r.borderSize=r.walkableRadius+3,r.width=r.tileSize+r.borderSize*2,r.height=r.tileSize+r.borderSize*2,r.detailSampleDist=r.detailSampleDist<.9?0:r.cs*r.detailSampleDist,r.detailSampleMaxError=r.ch*r.detailSampleMaxError;const o=Math.floor(r.tileSize),l=Math.floor((i.width+o-1)/o),n=Math.floor((i.height+o-1)/o),u=r.tileSize*r.cs,d=m.fromArray(e);let _=Math.min(Math.floor(Ct(St(l*n))),14);_>14&&(_=14);const c=22-_,y=1<<_,M=1<<c;return{config:r,gridSize:i,tileSize:o,tileWidth:l,tileHeight:n,tcs:u,orig:d,maxTiles:y,maxPolysPerTile:M}},Be={...re,chunkyTriMeshTrisPerChunk:256,buildBvTree:!0},xt=(a,e,t,r,i,o={},l=!1,n=new se)=>{const u={x:i.x,y:i.y},d=()=>{l||(u.compactHeightfield&&($(u.compactHeightfield),u.compactHeightfield=void 0),u.heightfield&&(X(u.heightfield),u.heightfield=void 0),u.contourSet&&(q(u.contourSet),u.contourSet=void 0),u.polyMesh&&(Le(u.polyMesh),u.polyMesh=void 0),u.polyMeshDetail&&(He(u.polyMeshDetail),u.polyMeshDetail=void 0))},_=T=>(n.log(g.RC_LOG_ERROR,T),d(),{success:!1,error:T,intermediates:u}),c=ht(t),y=[...i.bmin],M=[...i.bmax];y[0]-=c.borderSize*c.cs,y[2]-=c.borderSize*c.cs,M[0]+=c.borderSize*c.cs,M[2]+=c.borderSize*c.cs,c.set_bmin(0,y[0]),c.set_bmin(1,y[1]),c.set_bmin(2,y[2]),c.set_bmax(0,M[0]),c.set_bmax(1,M[1]),c.set_bmax(2,M[2]),n.resetTimers(),n.startTimer(g.RC_TIMER_TOTAL),n.log(g.RC_LOG_PROGRESS,`Building tile at x: ${i.x}, y: ${i.y}`),n.log(g.RC_LOG_PROGRESS,` - ${c.width} x ${c.height} cells`),n.log(g.RC_LOG_PROGRESS,` - ${a.size/3/1e3}K verts, ${e.size/3/1e3}K tris`);const p=xe();if(u.heightfield=p,!Te(n,p,c.width,c.height,y,M,c.cs,c.ch))return _("Could not create heightfield");new Z().resize(r.maxTrisPerChunk());const I=[y[0],y[2]],w=[M[0],M[2]],P=512,A=new je;A.resize(P);const E=r.getChunksOverlappingRect(I,w,A,P);if(E===0)return{success:!0,intermediates:u};for(let T=0;T<E;++T){const x=A.get(T),H=r.nodes(x).n,U=r.getNodeTris(x),F=new Z;F.resize(H),me(n,c.walkableSlopeAngle,a,e.size,U,H,F);const G=ye(n,a,e.size,U,F,H,p,c.walkableClimb);if(F.destroy(),!G)return _("Could not rasterize triangles")}Ae(n,c.walkableClimb,p),Me(n,c.walkableHeight,c.walkableClimb,p),Ee(n,c.walkableHeight,p);const D=ve();if(u.compactHeightfield=D,!pe(n,c.walkableHeight,c.walkableClimb,p,D))return _("Could not build compact heightfield");if(l||(X(u.heightfield),u.heightfield=void 0),!Ce(n,c.walkableRadius,D))return _("Could not erode walkable area");if(!Se(n,D))return _("Failed to build distance field");if(!Ie(n,D,c.borderSize,c.minRegionArea,c.mergeRegionArea))return _("Failed to build regions");const b=Ne();if(u.contourSet=b,!De(n,D,c.maxSimplificationError,c.maxEdgeLen,b,g.RC_CONTOUR_TESS_WALL_EDGES))return _("Failed to create contours");const S=Oe();if(u.polyMesh=S,!be(n,b,c.maxVertsPerPoly,S))return _("Failed to triangulate contours");const N=Fe();if(u.polyMeshDetail=N,!Pe(n,S,D,c.detailSampleDist,c.detailSampleMaxError,N))return _("Failed to build detail mesh");l||($(D),u.compactHeightfield=void 0,q(b),u.contourSet=void 0);for(let T=0;T<S.npolys();T++)S.areas(T)===g.RC_WALKABLE_AREA&&S.setAreas(T,0),S.areas(T)===0&&S.setFlags(T,1);const h=new we;h.setPolyMeshCreateParams(S),h.setPolyMeshDetailCreateParams(N),h.setWalkableHeight(c.walkableHeight*c.ch),h.setWalkableRadius(c.walkableRadius*c.cs),h.setWalkableClimb(c.walkableClimb*c.ch),h.setCellSize(c.cs),h.setCellHeight(c.ch),h.setBuildBvTree(o.buildBvTree??Be.buildBvTree),o.offMeshConnections&&h.setOffMeshConnections(o.offMeshConnections),h.setTileX(i.x),h.setTileY(i.y);const R=de(h);return R.success?(n.log(g.RC_LOG_PROGRESS,`>> Polymesh: ${S.nverts()} vertices ${S.npolys()} polygons`),{success:!0,data:R.navMeshData,intermediates:u}):_("Failed to create Detour navmesh data")},vt=(a,e,t={},r=!1)=>{if(!s.Module)throw new Error('"init" must be called before using any recast-navigation-js APIs. See: https://github.com/isaac-mason/recast-navigation-js?tab=readme-ov-file#initialization');const i=new se,o={type:"tiled",buildContext:i,chunkyTriMesh:void 0,tileIntermediates:[]},l=new te,n=a,u=new ue;u.copy(n);const d=e,_=e.length/3,c=new ce;c.copy(d);const y=()=>{u.destroy(),c.destroy(),!r&&o.chunkyTriMesh&&(o.chunkyTriMesh=void 0)},M=x=>(y(),l.destroy(),{success:!1,navMesh:void 0,intermediates:o,error:x}),p={...Be,...t};let C,I;if(t.bounds)C=t.bounds[0],I=t.bounds[1];else{const x=ze(a,e);C=x.bbMin,I=x.bbMax}const{config:w,tileWidth:P,tileHeight:A,tcs:E,orig:D,maxTiles:b,maxPolysPerTile:S}=Pt({recastConfig:p,navMeshBounds:[C,I]}),N=Q.create({orig:D,tileWidth:p.tileSize*p.cs,tileHeight:p.tileSize*p.cs,maxTiles:b,maxPolys:S});if(!l.initTiled(N))return M("Could not init nav mesh for tiled use");const h=new dt;if(o.chunkyTriMesh=h,!h.init(u,c,_,p.chunkyTriMeshTrisPerChunk))return M("Failed to build chunky triangle mesh");i.startTimer(g.RC_TIMER_TEMP);const R=[0,0,0],T=[0,0,0];for(let x=0;x<A;x++)for(let O=0;O<P;O++){R[0]=C[0]+O*E,R[1]=C[1],R[2]=C[2]+x*E,T[0]=C[0]+(O+1)*E,T[1]=I[1],T[2]=C[2]+(x+1)*E;const H={x:O,y:x,bmin:R,bmax:T},U={offMeshConnections:p.offMeshConnections,buildBvTree:p.buildBvTree},F=xt(u,c,w,h,H,U,r,i);if(o.tileIntermediates.push(F.intermediates),F.success&&F.data){l.removeTile(l.getTileRefAt(O,x,0));const G=l.addTile(F.data,f.DT_TILE_FREE_DATA,0);Ze(G.status)&&(i.log(g.RC_LOG_WARNING,`Failed to add tile to nav mesh tx: ${O}, ty: ${x}, status: ${Je(G.status)} (${G.status})`),F.data.destroy())}}return i.stopTimer(g.RC_TIMER_TEMP),r||y(),{success:!0,navMesh:l,intermediates:o}},Nt=a=>{const e=[],t=[],r={};let i=0;for(const{positions:o,indices:l}of a)for(let n=0;n<l.length;n++){const u=l[n]*3,d=o[u],_=o[u+1],c=o[u+2],y=`${d}_${_}_${c}`;let M=r[y];M||(r[y]=M=i,e.push(d,_,c),i++),t.push(M)}return[Float32Array.from(e),Uint32Array.from(t)]};new Qe;class Ot extends ke{constructor(e,t){super(),this.navMesh=e,this.navMeshGeometry=new Ve,this.navMeshMaterial=t?.navMeshMaterial?t.navMeshMaterial:new We({color:"orange",transparent:!0,opacity:.7,depthWrite:!1}),this.update(),this.mesh=new j(this.navMeshGeometry,this.navMeshMaterial),this.add(this.mesh)}update(){const[e,t]=ct(this.navMesh);this.navMeshGeometry.setAttribute("position",new ie(Float32Array.from(e),3)),this.navMeshGeometry.setIndex(new ie(Uint32Array.from(t),1)),this.navMeshGeometry.computeVertexNormals()}}const Lt=new Ye,Ue=a=>{const e=[];for(const t of a){const r=t.geometry.attributes.position;if(!r||r.itemSize!==3)continue;t.updateMatrixWorld();const i=new Float32Array(r.array);for(let l=0;l<i.length;l+=3){const n=Lt.set(i[l],i[l+1],i[l+2]);t.localToWorld(n),i[l]=n.x,i[l+1]=n.y,i[l+2]=n.z}let o=t.geometry.getIndex()?.array;if(o===void 0){const l=[];for(let n=0;n<r.count;n++)l.push(n);o=l}e.push({positions:i,indices:o})}return Nt(e)},Ft=(a,e={},t=!1)=>{const[r,i]=Ue(a);return bt(r,i,e,t)},Ht=(a,e={},t=!1)=>{const[r,i]=Ue(a);return vt(r,i,e,t)},zt=["invalid","walking","offmesh"];let oe=!1;async function nr(){oe||(await Ke(),oe=!0)}function Bt(a){const e=a.getIndex();if(e===null){const t=a.getAttribute("position").clone();for(let r=0;r+2<t.count;r+=3)for(let i=0;i<t.itemSize;i+=1){const o=t.getComponent(r+1,i);t.setComponent(r+1,i,t.getComponent(r+2,i)),t.setComponent(r+2,i,o)}a.setAttribute("position",t);return}for(let t=0;t+2<e.count;t+=3){const r=e.getX(t+1);e.setX(t+1,e.getX(t+2)),e.setX(t+2,r)}e.needsUpdate=!0}function Ut(a){const e=a.getAttribute("position"),t=a.getIndex(),r=l=>t?.getX(l)??l;let i=0;const o=t?.count??e.count;for(let l=0;l+2<o;l+=3){const n=r(l),u=r(l+1),d=r(l+2),_=e.getX(u)-e.getX(n),c=e.getZ(u)-e.getZ(n),y=e.getX(d)-e.getX(n),M=e.getZ(d)-e.getZ(n);i+=c*y-_*M}return i}function Gt(a){const e=[],t=(l,n)=>{if(n.determinant()<0){const d=l.clone().applyMatrix4(n);return Ut(d)<0&&Bt(d),e.push(d),new j(d)}const u=new j(l);return u.matrixAutoUpdate=!1,u.matrix.copy(n),u.matrixWorldNeedsUpdate=!0,u},r=[],i=new ne,o=new ne;for(const l of a){if(l.updateWorldMatrix(!0,!1),l instanceof Xe){for(let n=0;n<l.count;n+=1)l.getMatrixAt(n,i),o.multiplyMatrices(l.matrixWorld,i),r.push(t(l.geometry,o));continue}r.push(l.matrixWorld.determinant()>=0?l:t(l.geometry,l.matrixWorld))}return{meshes:r,temporaryGeometries:e}}const kt=1297302868,Vt=1,Wt=1145979222,Yt=7;function Qt(a){let e=1;for(;e<a;)e*=2;return e}function Xt(a,e){const t=a.vertices.length,r=a.polygons.length;if(t===0||r===0)throw new Error("NavMeshManager.buildFromPolygons: vertices and polygons must be non-empty");if(t>65535)throw new Error(`NavMeshManager.buildFromPolygons: ${t} vertices exceed Detour's uint16 tile index`);if(a.detailMeshes.length!==r)throw new Error(`NavMeshManager.buildFromPolygons: ${r} polygons require the same number of detail rows`);const i=a.polygons.map(h=>h.vertices.map(()=>0)),o=new Map;let l=0;for(let h=0;h<r;h+=1){const R=a.polygons[h];if(R.vertices.length<3||R.vertices.length>6)throw new Error(`NavMeshManager.buildFromPolygons: polygon ${h} has ${R.vertices.length} vertices; Detour permits 3..6`);l+=R.vertices.length;for(let T=0;T<R.vertices.length;T+=1){const x=R.vertices[T],O=R.vertices[(T+1)%R.vertices.length];if(!Number.isInteger(x)||!Number.isInteger(O)||x<0||O<0||x>=t||O>=t)throw new Error(`NavMeshManager.buildFromPolygons: polygon ${h} references an invalid vertex`);const H=`${x},${O}`;if(o.has(H))throw new Error(`NavMeshManager.buildFromPolygons: directed edge ${H} occurs more than once`);const U=o.get(`${O},${x}`);if(U===void 0)o.set(H,[h,T]);else{const[F,G]=U;i[h][T]=F+1,i[F][G]=h+1}}}for(let h=0;h<r;h+=1){const R=a.detailMeshes[h];if(R.vertexBase<0||R.vertexCount<0||R.vertexBase+R.vertexCount>a.detailVertices.length||R.triangleBase<0||R.triangleCount<0||R.triangleBase+R.triangleCount>a.detailTriangles.length||R.vertexCount>255||R.triangleCount>255)throw new Error(`NavMeshManager.buildFromPolygons: polygon ${h} has an invalid detail row`)}for(const h of a.detailTriangles)if(h.some(R=>!Number.isInteger(R)||R<0||R>255))throw new Error("NavMeshManager.buildFromPolygons: detail triangles must contain uint8 values");const n=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],u=[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY];for(const h of[...a.vertices,...a.detailVertices])for(let R=0;R<3;R+=1){const T=h[R];if(!Number.isFinite(T))throw new Error("NavMeshManager.buildFromPolygons: every vertex component must be finite");n[R]=Math.min(n[R],T),u[R]=Math.max(u[R],T)}const d=100,_=32,c=12,p=d+t*12+r*_+l*c+r*12+a.detailVertices.length*12+a.detailTriangles.length*4,C=new Uint8Array(48+p),I=new DataView(C.buffer);let w=0;const P=h=>{I.setUint8(w,h),w+=1},A=h=>{I.setUint16(w,h,!0),w+=2},E=h=>{I.setUint32(w,h,!0),w+=4},D=h=>{I.setInt32(w,h,!0),w+=4},b=h=>{I.setFloat32(w,h,!0),w+=4},S=Qt(r);E(kt),E(Vt),E(1);for(const h of n)b(h);b(Math.max(u[0]-n[0],Number.EPSILON)),b(Math.max(u[2]-n[2],Number.EPSILON)),E(1),E(S),E(S),E(p),E(Wt),E(Yt),D(0),D(0),D(0),E(0),E(r),E(t),E(l),E(r),E(a.detailVertices.length),E(a.detailTriangles.length),E(0),E(0),E(r);const N=le.navigation;b(e?.walkableHeight??N.walkableHeight),b(e?.walkableRadius??N.walkableRadius),b(e?.walkableClimb??N.walkableClimb);for(const h of n)b(h);for(const h of u)b(h);b(1/(e?.cellSize??N.cellSize));for(const h of a.vertices)for(const R of h)b(R);for(let h=0;h<r;h+=1){const R=a.polygons[h];E(4294967295);for(let T=0;T<6;T+=1)A(R.vertices[T]??0);for(let T=0;T<6;T+=1)A(i[h]?.[T]??0);A(R.flags??1),P(R.vertices.length),P((R.area??0)&63)}w+=l*c;for(const h of a.detailMeshes)E(h.vertexBase),E(h.triangleBase),P(h.vertexCount),P(h.triangleCount),A(0);for(const h of a.detailVertices)for(const R of h)b(R);for(const h of a.detailTriangles)for(const R of h)P(R);if(w!==C.length)throw new Error(`NavMeshManager.buildFromPolygons: encoded ${w} bytes into a ${C.length}-byte allocation`);return C}class or{navMesh=null;query=null;crowd=null;helper=null;buildFromMeshes(e,t){const r=le.navigation,i=Gt(e),o=i.meshes.reduce((u,d)=>{const _=d.geometry.getIndex(),c=d.geometry.getAttribute("position").count;return u+Math.floor((_?.count??c)/3)},0),l={cs:t?.cellSize??r.cellSize,ch:t?.cellHeight??r.cellHeight,walkableSlopeAngle:t?.walkableSlopeAngle??r.walkableSlopeAngle,walkableHeight:t?.walkableHeight??r.walkableHeight,walkableClimb:t?.walkableClimb??r.walkableClimb,walkableRadius:t?.walkableRadius??r.walkableRadius,maxEdgeLen:t?.maxEdgeLen??r.maxEdgeLen,maxSimplificationError:t?.maxSimplificationError??r.maxSimplificationError,minRegionArea:t?.minRegionArea??r.minRegionArea,mergeRegionArea:t?.mergeRegionArea??r.mergeRegionArea,maxVertsPerPoly:6,detailSampleDist:6,detailSampleMaxError:1};let n;try{n=t?.tiled===!0||i.meshes.length>256||o>1e4?Ht(i.meshes,{...l,tileSize:t?.tileSize??256}):Ft(i.meshes,l)}finally{for(const u of i.temporaryGeometries)u.dispose()}return!n.success||!n.navMesh?!1:(this.destroyRecast(),this.navMesh=n.navMesh,this.query=new ee(this.navMesh),!0)}buildFromPolygons(e,t){try{return this.loadFromData(Xt(e,t)),!0}catch{return!1}}destroyRecast(){this.helper&&(this.helper.parent?.remove(this.helper),this.helper.dispose?.(),this.helper=null),this.crowd&&(this.crowd.destroy(),this.crowd=null),this.query&&(this.query.destroy(),this.query=null),this.navMesh&&(this.navMesh.destroy(),this.navMesh=null)}hasNavMesh(){return this.navMesh!==null}findPath(e,t){if(!this.query)throw new Error("NavMeshManager.findPath: no navmesh has been built, so no path can be queried. Build one first (buildFromMeshes/importNavMesh) — gate on hasNavMesh() if the caller can run before a bake.");const r=this.query.computePath(e,t);if(!r.success&&r.error)throw new Error(`NavMeshManager.findPath: recast could not complete the query (${r.error.name}${r.error.status===void 0?"":`, status ${r.error.status}`}).`);return r.path}createCrowd(e){if(!this.navMesh)throw new Error("Build navmesh first");return this.crowd=new it(this.navMesh,{maxAgents:e,maxAgentRadius:.6}),this.crowd}updateCrowd(e){this.crowd?.update(e)}getCrowdAgents(){return this.crowd?this.crowd.getAgents().map(e=>{const t=e.interpolatedPosition,r=e.velocity(),i=e.target(),o=zt[e.state()]??"invalid",l=o==="invalid"?[]:e.corners().map(n=>({x:n.x,y:n.y,z:n.z}));return{position:{x:t.x,y:t.y,z:t.z},velocity:{x:r.x,y:r.y,z:r.z},radius:e.radius,height:e.height,state:o,target:{x:i.x,y:i.y,z:i.z},corners:l}}):[]}getDebugMesh(e){return this.navMesh?(this.helper||(this.helper=new Ot(this.navMesh),e.add(this.helper)),this.helper):null}exportData(){if(!this.navMesh)throw new Error("No navmesh to export");return Mt(this.navMesh)}loadFromData(e){const{navMesh:t}=pt(e);this.destroyRecast(),this.navMesh=t,this.query=new ee(this.navMesh)}dispose(e){this.helper&&e.remove(this.helper),this.destroyRecast()}}export{or as NavMeshManager,nr as initNavigation};
@@ -1 +1 @@
1
- import{a5 as e}from"./index-Cr9NTnJp.js";import{d as t,a as i,n as a,b as s}from"./navmesh-workflow-store-Cmnm57TB.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";const b="workspace.menu",k={menu:"debug",items:[{id:"navmesh-bake",label:()=>s()?"Rebake NavMesh":"Bake NavMesh",testId:"navmesh-bake",disabled:()=>a()||!e().navigation?.bake,execute:t},{id:"navmesh-clear",label:"Clear NavMesh",testId:"navmesh-clear",disabled:()=>a()||!s()||!e().navigation?.clear,execute:i}]};export{k as menu,b as point};
1
+ import{a5 as e}from"./index-wjn2vkB8.js";import{d as t,a as i,n as a,b as s}from"./navmesh-workflow-store-Cmnm57TB.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";const b="workspace.menu",k={menu:"debug",items:[{id:"navmesh-bake",label:()=>s()?"Rebake NavMesh":"Bake NavMesh",testId:"navmesh-bake",disabled:()=>a()||!e().navigation?.bake,execute:t},{id:"navmesh-clear",label:"Clear NavMesh",testId:"navmesh-clear",disabled:()=>a()||!s()||!e().navigation?.clear,execute:i}]};export{k as menu,b as point};
@@ -1 +1 @@
1
- import{r as n,a5 as u}from"./index-Cr9NTnJp.js";import{getUserData as H}from"./user-data-CODoGZqA.js";import{N as B,c as A,e as $,f as s,m as L,r as f,n as S}from"./navmesh-workflow-store-Cmnm57TB.js";import{b as h}from"./three-contract-Dkt6PmWY.js";import{h as T}from"./host-hierarchy-objects-BV3WqU2w.js";import{a as m,s as g}from"./viewport-door-AsLxGhLN.js";import{cp as V,el as R}from"./three.core-3arARmh6.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"./object-marks-BnvSuCTt.js";function _(){let l=null;const p=new V({color:3900150,transparent:!0,opacity:.5,depthWrite:!1});function b(a){a.traverse(e=>{e.isMesh&&(e.material=p)})}function w(a){const e=new Set;for(const[o,r]of T()?.objects()??new Map)H(r,"navRole")===a&&e.add(o);return e}function v(){g("navmesh",null)}function k(){const a=u().navigation,e=a?h(a):null;if(e!==l&&(l=e,v()),!e){f();return}let o=!1;try{o=e.hasNavMesh()}catch(c){n().console.error(`Navigation adapter failed to report its state: ${c}`,"navigation")}if(!o){f();return}L();const r=m()?.scene;if(!r)return;let i=null;try{i=e.debugMesh(r)}catch(c){n().console.error(`Navigation adapter failed to create its debug mesh: ${c}`,"navigation")}i&&(b(i),g("navmesh",i))}const N=async()=>{if(S())return;$(),await new Promise(t=>requestAnimationFrame(()=>t(null)));const a=u().navigation,e=a?h(a):void 0;if(!e){const t="The mounted game has no NavigationAdapter";n().console.warn(`${t} — nothing can be baked`,"navigation"),s(t);return}if(!e.bake){const t="The mounted NavigationAdapter is inspect-only and does not support baking";n().console.warn(t,"navigation"),s(t);return}const o=w("walkable");if(o.size===0){n().console.warn("No walkable meshes found — give the floors `userData={{ navRole: 'walkable' }}` (and blockers `'obstacle'`) where they are written","navigation"),s("No walkable-tagged entities in the scene");return}const r=[];for(const t of[...o,...w("obstacle")]){const y=(T()?.objects()??new Map).get(t);y&&y.traverse(E=>{E.isMesh&&r.push(E)})}if(r.length===0){n().console.error("NavMesh bake failed: the walkable-tagged entities have no meshes","navigation"),s("Walkable entities have no meshes");return}let i=!1;try{i=e.bake(r)}catch(t){n().console.error(`NavMesh bake failed: ${t}`,"navigation"),s(`Bake failed: ${t}`);return}if(!i){n().console.error("NavMesh bake failed","navigation"),s("Bake failed (recast rejected the input geometry)");return}l=e;const c=m()?.scene,d=c?e.debugMesh(c):null;d&&(b(d),g("navmesh",d)),s(null)},M=()=>{const a=u().navigation,e=a?h(a):void 0;if(!e){n().console.warn("The mounted game has no NavigationAdapter to clear","navigation");return}if(!e.clear){n().console.warn("The mounted NavigationAdapter is inspect-only and does not support clearing","navigation");return}try{e.clear(m()?.scene??new R)}catch(o){n().console.error(`NavMesh clear failed: ${o}`,"navigation");return}v(),f()};window.addEventListener(B,N),window.addEventListener(A,M);const j=n().systems.subscribe(k);return k(),()=>{window.removeEventListener(B,N),window.removeEventListener(A,M),j(),v(),p.dispose()}}const Y="workspace.service";function Z(){return _()}export{Y as point,Z as start};
1
+ import{r as n,a5 as u}from"./index-wjn2vkB8.js";import{getUserData as H}from"./user-data-CODoGZqA.js";import{N as B,c as A,e as $,f as s,m as L,r as f,n as S}from"./navmesh-workflow-store-Cmnm57TB.js";import{b as h}from"./three-contract-Dkt6PmWY.js";import{h as T}from"./host-hierarchy-objects-BV3WqU2w.js";import{a as m,s as g}from"./viewport-door-DNJf5Mej.js";import{cp as V,el as R}from"./three.core-3arARmh6.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"./object-marks-BnvSuCTt.js";function _(){let l=null;const p=new V({color:3900150,transparent:!0,opacity:.5,depthWrite:!1});function b(a){a.traverse(e=>{e.isMesh&&(e.material=p)})}function w(a){const e=new Set;for(const[o,r]of T()?.objects()??new Map)H(r,"navRole")===a&&e.add(o);return e}function v(){g("navmesh",null)}function k(){const a=u().navigation,e=a?h(a):null;if(e!==l&&(l=e,v()),!e){f();return}let o=!1;try{o=e.hasNavMesh()}catch(c){n().console.error(`Navigation adapter failed to report its state: ${c}`,"navigation")}if(!o){f();return}L();const r=m()?.scene;if(!r)return;let i=null;try{i=e.debugMesh(r)}catch(c){n().console.error(`Navigation adapter failed to create its debug mesh: ${c}`,"navigation")}i&&(b(i),g("navmesh",i))}const N=async()=>{if(S())return;$(),await new Promise(t=>requestAnimationFrame(()=>t(null)));const a=u().navigation,e=a?h(a):void 0;if(!e){const t="The mounted game has no NavigationAdapter";n().console.warn(`${t} — nothing can be baked`,"navigation"),s(t);return}if(!e.bake){const t="The mounted NavigationAdapter is inspect-only and does not support baking";n().console.warn(t,"navigation"),s(t);return}const o=w("walkable");if(o.size===0){n().console.warn("No walkable meshes found — give the floors `userData={{ navRole: 'walkable' }}` (and blockers `'obstacle'`) where they are written","navigation"),s("No walkable-tagged entities in the scene");return}const r=[];for(const t of[...o,...w("obstacle")]){const y=(T()?.objects()??new Map).get(t);y&&y.traverse(E=>{E.isMesh&&r.push(E)})}if(r.length===0){n().console.error("NavMesh bake failed: the walkable-tagged entities have no meshes","navigation"),s("Walkable entities have no meshes");return}let i=!1;try{i=e.bake(r)}catch(t){n().console.error(`NavMesh bake failed: ${t}`,"navigation"),s(`Bake failed: ${t}`);return}if(!i){n().console.error("NavMesh bake failed","navigation"),s("Bake failed (recast rejected the input geometry)");return}l=e;const c=m()?.scene,d=c?e.debugMesh(c):null;d&&(b(d),g("navmesh",d)),s(null)},M=()=>{const a=u().navigation,e=a?h(a):void 0;if(!e){n().console.warn("The mounted game has no NavigationAdapter to clear","navigation");return}if(!e.clear){n().console.warn("The mounted NavigationAdapter is inspect-only and does not support clearing","navigation");return}try{e.clear(m()?.scene??new R)}catch(o){n().console.error(`NavMesh clear failed: ${o}`,"navigation");return}v(),f()};window.addEventListener(B,N),window.addEventListener(A,M);const j=n().systems.subscribe(k);return k(),()=>{window.removeEventListener(B,N),window.removeEventListener(A,M),j(),v(),p.dispose()}}const Y="workspace.service";function Z(){return _()}export{Y as point,Z as start};
@@ -0,0 +1 @@
1
+ import{i as t}from"./game-network-gqU0qk9j.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-wjn2vkB8.js";import"./index-nmcBqr7Y.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./native-debug-module-D0TMOJ5J.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry--ZkoQWOO.js";import"./contract-system-adapters-StvC0uNq.js";import"./game-contract-seams-DYi5-NnM.js";import"./seeded-random-BMF_UDMF.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-CSKXil-5.js";import"./capability-coverage-Ctnmu2LE.js";import"./edit-mode-authoring-B8NE5TIR.js";import"./json-history-resource-DWPJt2Bk.js";import"./binding-resolver-B6upIc33.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-DBqdRLI4.js";import"./canvas-entry-runtime-BURQgaLB.js";import"./three-ingest-runtime-DOUKRBrc.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./active-ingest-gUx8jeyJ.js";import"./ingest-source-persistence-D7jtuLEB.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-CGYHAB1r.js";import"./mounted-authoring-CRGnDIkF.js";import"./entity-object-BqQBOLh4.js";import"./user-data-C2bC2Cok.js";import"./workspace-arrangement-coA4mYU_.js";import"./three-contract-Dkt6PmWY.js";import"./three-C0qVNsOS.js";import"./editor-layers-B2mwHrrn.js";import"./component-instance-root-DjA11g2U.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-C92rm99z.js";import"./source-persistence-backend-iG_P2f_a.js";import"./three-projection-core-BOq13mz-.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./r3f-physics-binding-DSD0HHLc.js";import"./deferred-ingest-play-CmJi6tql.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-CQtYfgx9.js";import"./board-guides-DnI_fMSm.js";import"./relative-import-specifier-BiEpXss5.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-Cl65lNby.js";import"./inference-diagnostics-dZd7OUSj.js";import"./writer-tw6EcuVO.js";import"./three-state-B6NLTszJ.js";import"./editor-shell-store-V7HfbGqh.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-DNJf5Mej.js";import"./game-surface-defaults-D8S4cRxi.js";const zt="workspace.service";function At(){t()}export{zt as point,At as start};
@@ -0,0 +1 @@
1
+ import{a as t}from"./jsx-runtime-DPjLkJKQ.js";import{r as B,ep as C,af as o,en as c,a0 as k,aR as Q,aM as O,dy as D,eF as Z,eY as tt}from"./index-wjn2vkB8.js";import{N as et}from"./game-network-gqU0qk9j.js";import{r as f}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./index-OZVqp6xS.js";import"./index-Da9JhEvW.js";import"./native-debug-module-D0TMOJ5J.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry--ZkoQWOO.js";import"./contract-system-adapters-StvC0uNq.js";import"./game-contract-seams-DYi5-NnM.js";import"./seeded-random-BMF_UDMF.js";import"./game-audio-BeCyd0Ha.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./events-156d8d12.esm-CYeuVCYr.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./index-bQE2NA0D.js";import"./live-project-verbs-CSKXil-5.js";import"./capability-coverage-Ctnmu2LE.js";import"./edit-mode-authoring-B8NE5TIR.js";import"./json-history-resource-DWPJt2Bk.js";import"./binding-resolver-B6upIc33.js";import"./adapter-surface-Y37Nzcyw.js";import"./structural-signature-Dc7skRiy.js";import"./webgl-frame-capture-DdJkM2mi.js";import"./realm-services-DBqdRLI4.js";import"./canvas-entry-runtime-BURQgaLB.js";import"./three-ingest-runtime-DOUKRBrc.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-BHA-cdrW.js";import"./editor-presentation-activity-CqJH4G9t.js";import"./active-ingest-gUx8jeyJ.js";import"./ingest-source-persistence-D7jtuLEB.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-CGYHAB1r.js";import"./mounted-authoring-CRGnDIkF.js";import"./entity-object-BqQBOLh4.js";import"./user-data-C2bC2Cok.js";import"./workspace-arrangement-coA4mYU_.js";import"./three-contract-Dkt6PmWY.js";import"./three-C0qVNsOS.js";import"./editor-layers-B2mwHrrn.js";import"./component-instance-root-DjA11g2U.js";import"./viewport-editor-controls-BYaAZ_Ku.js";import"./three-authoring-adapter-C92rm99z.js";import"./source-persistence-backend-iG_P2f_a.js";import"./three-projection-core-BOq13mz-.js";import"./body-marks-C1LxJtQb.js";import"./user-data-CODoGZqA.js";import"./object-marks-BnvSuCTt.js";import"./structural-ids-BOo2BRoY.js";import"./object3d-authoring-subject-XccsO0xG.js";import"./r3f-physics-binding-DSD0HHLc.js";import"./deferred-ingest-play-CmJi6tql.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-CQtYfgx9.js";import"./board-guides-DnI_fMSm.js";import"./relative-import-specifier-BiEpXss5.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-Cl65lNby.js";import"./inference-diagnostics-dZd7OUSj.js";import"./writer-tw6EcuVO.js";import"./three-state-B6NLTszJ.js";import"./editor-shell-store-V7HfbGqh.js";import"./output-pass-HurwNl0G.js";import"./viewport-door-DNJf5Mej.js";import"./game-surface-defaults-D8S4cRxi.js";function nt(e){return e?{connectionState:e.getConnectionState?.(),roomInfo:e.getRoomInfo?.(),stats:e.getReplicationStats?.()}:null}function st(e){return e?{stateTree:typeof e.getStateSnapshot=="function",messageLog:typeof e.messageEvents=="function",rates:typeof e.getRates=="function",conditioning:typeof e.getConditioning=="function"&&typeof e.setConditioning=="function",connection:typeof e.getConnectionState=="function",room:typeof e.getRoomInfo=="function",stats:typeof e.getReplicationStats=="function",identity:typeof e.getPlayerIdentity=="function",identitySettable:typeof e.setPlayerIdentity=="function",traffic:typeof e.getTrafficByType=="function",send:typeof e.sendMessage=="function",ping:typeof e.ping=="function",server:typeof e.inspectServer=="function",entityTraffic:typeof e.getTrafficByEntity=="function",recording:typeof e.isRecording=="function"&&typeof e.setRecording=="function"}:null}class _{constructor(n=500){this.capacity=n}entries=[];lastSeq=0;paused=!1;pull(n){if(this.paused||!n?.messageEvents)return 0;const s=n.messageEvents(this.lastSeq);if(s.length===0)return 0;for(const i of s)this.entries.push(i),i.seq>this.lastSeq&&(this.lastSeq=i.seq);return this.entries.length>this.capacity&&this.entries.splice(0,this.entries.length-this.capacity),s.length}get all(){return this.entries}clear(){this.entries=[]}}function it(e,n){const s=n.trim().toLowerCase();return s?e.filter(i=>i.type.toLowerCase().includes(s)):[...e]}class P{constructor(n=60){this.capacity=n}values=[];push(n){this.values.push(n),this.values.length>this.capacity&&this.values.shift()}get data(){return this.values}get latest(){return this.values.length>0?this.values[this.values.length-1]:null}}class V{msgsIn=new P;msgsOut=new P;bytesIn=new P;bytesOut=new P;sample(n){this.msgsIn.push(n.msgsInPerSec),this.msgsOut.push(n.msgsOutPerSec),n.bytesInPerSec!==void 0&&this.bytesIn.push(n.bytesInPerSec),n.bytesOutPerSec!==void 0&&this.bytesOut.push(n.bytesOutPerSec)}}function ot(e,n,s,i=1){if(e.length<2)return"";const a=Math.max(1,...e),l=s-i*2,u=n/(e.length-1);return e.map((y,S)=>{const v=S*u,h=i+l*(1-y/a);return`${v.toFixed(1)},${h.toFixed(1)}`}).join(" ")}const rt={disconnected:o.content.muted,connecting:o.semantic.warning,connected:o.semantic.success,error:o.semantic.danger},R={fontFamily:o.typography.mono,fontSize:C.base};function T({children:e,testId:n}){return t.jsx("div",{"data-testid":n,style:{padding:c[4],color:o.content.muted,fontSize:C.base,fontStyle:"italic"},children:e})}function lt(e){return e!==null&&typeof e=="object"}function at(e){return typeof e=="string"?`"${e}"`:typeof e=="number"?Number.isInteger(e)?String(e):e.toFixed(3):String(e)}function K({type:e}){return e?t.jsx("span",{"data-testid":"net-tree-type",style:{color:o.content.dim,marginLeft:6},children:e}):null}function H({name:e,value:n,depth:s,path:i=[],edit:a,remove:l,typeOf:u}){const[y,S]=f.useState(s===0),[v,h]=f.useState(null),[x,m]=f.useState(null),d={...R,paddingLeft:8+s*14,lineHeight:"18px",whiteSpace:"nowrap"};if(!lt(n)){const j=a&&(typeof n=="number"||typeof n=="string"||typeof n=="boolean"),$=p=>{h(null),a?.(i,p).then(()=>m(null),I=>m(I instanceof Error?I.message:String(I)))},E=p=>{if(typeof n=="number"){const I=Number(p);return Number.isFinite(I)?I:n}return p};return t.jsxs("div",{style:d,"data-testid":"net-tree-leaf","data-path":i.join("."),children:[t.jsx("span",{style:{color:o.content.primary},children:e}),t.jsx("span",{style:{color:o.content.muted},children:": "}),v!==null?t.jsx(O,{"data-testid":"net-tree-edit",autoFocus:!0,value:v,onChange:p=>h(p.target.value),onKeyDown:p=>{p.key==="Enter"&&$(E(v)),p.key==="Escape"&&h(null)},onBlur:()=>h(null),style:{width:120}}):t.jsx("span",{"data-testid":j?"net-tree-value":void 0,title:j?typeof n=="boolean"?"Click to toggle on the server":"Click to edit on the server":void 0,style:{color:o.content.primary,cursor:j?"text":void 0},onClick:j?()=>typeof n=="boolean"?$(!n):h(String(n)):void 0,children:at(n)}),t.jsx(K,{type:i.length>0?u?.(i):null}),l&&i.length>0?t.jsx("button",{type:"button","data-testid":"net-tree-delete",title:"Delete this key on the server","aria-label":`Delete ${i.join(".")} on the server`,onClick:()=>l(i).then(()=>m(null),p=>m(p instanceof Error?p.message:String(p))),style:{marginLeft:8,border:0,background:"transparent",color:o.content.muted,cursor:"pointer"},children:"×"}):null,x?t.jsxs("span",{style:{color:o.semantic.danger},children:[" ",x]}):null]})}const g=Object.entries(n);return t.jsxs("div",{children:[t.jsxs("div",{style:{...d,cursor:"pointer",userSelect:"none"},"data-testid":"net-tree-branch","data-expanded":y||void 0,onClick:()=>S(j=>!j),children:[t.jsx("span",{style:{color:o.content.muted,display:"inline-block",width:12},children:t.jsx(Z,{direction:y?"down":"right"})}),t.jsx("span",{style:{color:o.content.primary},children:e}),t.jsxs("span",{style:{color:o.content.dim},children:[" ",Array.isArray(n)?`[${g.length}]`:`{${g.length}}`]}),t.jsx(K,{type:i.length>0?u?.(i):null}),x?t.jsxs("span",{style:{color:o.semantic.danger},children:[" ",x]}):null,l&&i.length>0?t.jsx("button",{type:"button","data-testid":"net-tree-delete",title:"Delete this key on the server","aria-label":`Delete ${i.join(".")} on the server`,onClick:j=>{j.stopPropagation(),l(i).then(()=>m(null),$=>m($ instanceof Error?$.message:String($)))},style:{marginLeft:8,border:0,background:"transparent",color:o.content.muted,cursor:"pointer"},children:"×"}):null]}),y&&g.map(([j,$])=>t.jsx(H,{name:j,value:$,depth:s+1,path:s===0?[j]:[...i,j],edit:a,remove:l,typeOf:u},j))]})}const U=96,G=22,dt=f.memo(function({points:n,color:s}){return t.jsx("svg",{width:U,height:G,style:{display:"block",background:o.surface.inset,borderRadius:o.shape.small},role:"img","aria-label":"rate sparkline",children:n&&t.jsx("polyline",{points:n,fill:"none",stroke:s,strokeWidth:1.2})})});function F({label:e,series:n,unit:s,color:i,testId:a}){const l=n.latest;return t.jsxs("div",{"data-testid":a,style:{display:"flex",flexDirection:"column",gap:c[1]},children:[t.jsxs("div",{style:{fontSize:C.sm,color:o.content.muted},children:[e," ",t.jsx("span",{style:{color:o.content.primary,fontFamily:o.typography.mono},children:l===null?"n/a":`${l}${s}`})]}),t.jsx(dt,{points:ot(n.data,U,G),color:i})]})}function ct({event:e}){const n=e.direction==="in"?o.semantic.success:o.accent.default;return t.jsxs("div",{"data-testid":"net-log-row","data-direction":e.direction,style:{...R,display:"grid",gridTemplateColumns:"64px 24px 1fr 56px",gap:c[2],lineHeight:"17px",padding:`0 ${c[4]}`,opacity:e.dropped?.55:1},children:[t.jsxs("span",{style:{color:o.content.dim},children:[(e.time/1e3).toFixed(2),"s"]}),t.jsx("span",{style:{color:n},children:e.direction==="in"?"↓in":"↑out"}),t.jsxs("span",{style:{color:o.content.primary,textDecoration:e.dropped?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis"},children:[e.type,e.dropped?" (dropped)":""]}),t.jsx("span",{style:{color:o.content.muted,textAlign:"right"},children:e.size!==void 0?`${e.size} B`:"—"})]})}function pt({adapter:e}){const[n,s]=f.useState(()=>e.getConditioning?.()??{latencyMs:0,jitterMs:0,packetLoss:0}),i=e.getConditioningLimits?.()??{},a=l=>{s(l),e.setConditioning?.(l)};return t.jsxs("div",{"data-testid":"net-conditioner",style:{display:"flex",gap:c[4],alignItems:"center",padding:`${c[2]} ${c[4]}`},children:[t.jsx("span",{style:{fontSize:C.sm,color:o.content.muted},children:"Conditioner"}),t.jsx(D,{label:"latency ms",value:n.latencyMs,step:10,testId:"net-cond-latency",onChange:l=>a({...n,latencyMs:Math.max(0,l)})}),t.jsx(D,{label:"jitter ms",value:n.jitterMs,step:5,testId:"net-cond-jitter",onChange:l=>a({...n,jitterMs:Math.max(0,l)})}),i.packetLoss?t.jsx("span",{"data-testid":"net-cond-loss-absent",title:i.packetLoss,style:{fontSize:C.sm,color:o.content.muted},children:"loss: not simulated"}):t.jsx(D,{label:"loss %",value:n.packetLoss*100,step:5,testId:"net-cond-loss",onChange:l=>a({...n,packetLoss:Math.min(1,Math.max(0,l/100))})})]})}function ut({adapter:e,settable:n}){const[s,i]=f.useState(()=>e.getPlayerIdentity?.()?.name??""),a=()=>{const l=s.trim();l&&e.setPlayerIdentity?.({name:l})};return t.jsxs("div",{"data-testid":"net-identity",style:{display:"flex",gap:c[4],alignItems:"center",padding:`${c[2]} ${c[4]}`},children:[t.jsx("span",{style:{fontSize:C.sm,color:o.content.muted},children:"Player name"}),n?t.jsx(O,{"data-testid":"net-identity-name",value:s,onChange:l=>i(l.target.value),onBlur:a,onKeyDown:l=>{l.key==="Enter"&&l.currentTarget.blur()},style:{width:140}}):t.jsx("span",{"data-testid":"net-identity-name",style:{...R,color:o.content.primary},children:s||"—"})]})}function yt({view:e,caps:n,rates:s}){return t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:c[6],alignItems:"center",padding:`${c[2]} ${c[4]}`,borderBottom:`1px solid ${o.boundary.default}`},children:[e.connectionState!==void 0?t.jsxs("span",{"data-testid":"net-connection-state",style:{color:rt[e.connectionState]},children:["● ",e.connectionState]}):t.jsx(T,{testId:"net-connection-state-absent",children:"Connection state not provided by this adapter."}),e.roomInfo===void 0?t.jsx(T,{testId:"net-room-absent",children:"Room info not provided by this adapter."}):e.roomInfo?t.jsxs("span",{style:{...R,color:o.content.primary},children:[e.roomInfo.roomName," · ",e.roomInfo.roomId," · session ",e.roomInfo.sessionId]}):t.jsx("span",{style:{color:o.content.muted},children:"no room"}),e.stats?t.jsxs("span",{style:{color:o.content.muted},children:["entities ",t.jsx("span",{style:{color:o.content.primary},children:e.stats.entities})]}):t.jsx(T,{testId:"net-stats-absent",children:"Replication stats not provided by this adapter."}),n.rates?t.jsxs("div",{"data-testid":"net-sparklines",style:{display:"flex",gap:c[5]},children:[t.jsx(F,{label:"msgs in",unit:"/s",series:s.msgsIn,color:o.semantic.success,testId:"net-rate-msgs-in"}),t.jsx(F,{label:"msgs out",unit:"/s",series:s.msgsOut,color:o.accent.default,testId:"net-rate-msgs-out"}),t.jsx(F,{label:"bytes in",unit:" B/s",series:s.bytesIn,color:o.semantic.success,testId:"net-rate-bytes-in"}),t.jsx(F,{label:"bytes out",unit:" B/s",series:s.bytesOut,color:o.accent.default,testId:"net-rate-bytes-out"})]}):t.jsx(T,{testId:"net-rates-absent",children:"Rates not provided by this adapter."})]})}const W=et,J="networkMessageDraft";function mt(){const[,e]=f.useReducer(p=>p+1,0),n=f.useRef(new _),s=f.useRef(new V),i=f.useRef(null),[a,l]=f.useState(!1),[u,y]=f.useState(""),[S,v]=f.useState(()=>B().projectLocalState.read(W)??!1),[h,x]=f.useState(()=>B().projectLocalState.read(J)??{type:"message_type",payload:"{}"}),m=p=>{B().projectLocalState.write(J,p),x(p)};f.useEffect(()=>{const p=()=>{const M=B().systems.inspectedNetworking()??null;return M!==i.current&&(i.current=M,n.current=new _,n.current.paused=a,s.current=new V),M},I=()=>{const M=p();n.current.pull(M),e()};I();const L=setInterval(I,250),w=setInterval(()=>{const r=p()?.getRates?.();r&&s.current.sample(r)},1e3),N=B().systems.inspectedNetworking()?.subscribe(()=>e());return()=>{clearInterval(L),clearInterval(w),N?.()}},[a]);const d=i.current??B().systems.inspectedNetworking()??null,g=st(d);if(!d||!g)return t.jsxs("div",{"data-testid":"network-inspector-empty",style:{padding:c[8],color:o.content.muted,fontSize:C.md,lineHeight:"18px"},children:[t.jsx("div",{style:{color:o.content.primary,marginBottom:c[2]},children:"No networking adapter is registered."}),"Games expose replication state to this inspector by registering a"," ",t.jsx("code",{style:R,children:"NetworkingAdapter"})," during setup:"," ",t.jsx("code",{style:R,children:"ctx.registerSystemAdapter?.('networking', adapter)"})," — see the third-person-arena example. Single-player games register none; there is nothing to inspect."]});const j=nt(d),$=g.stateTree?d.getStateSnapshot?.():void 0,E=it(n.current.all,u);return t.jsxs("div",{"data-testid":"network-inspector",className:"volter-content-frost",style:{flex:1,minHeight:0,display:"flex",flexDirection:"column",fontSize:C.md},children:[t.jsx(yt,{view:j,caps:g,rates:s.current}),g.identity?t.jsx(ut,{adapter:d,settable:g.identitySettable},d.getPlayerIdentity?.()?.name??""):null,g.conditioning?t.jsx(pt,{adapter:d}):t.jsx(T,{testId:"net-conditioner-absent",children:"Link conditioning not provided by this adapter."}),g.server?t.jsx(vt,{adapter:d,ownSession:j.roomInfo?.sessionId??null,ownRoom:j.roomInfo?.roomId??null,draft:h,setDraft:m}):null,g.recording||g.traffic?t.jsxs("div",{"data-testid":"net-profiler-bar",style:{display:"flex",gap:c[3],alignItems:"center",padding:c[2],borderBottom:`1px solid ${o.boundary.default}`},children:[g.recording?t.jsx(t.Fragment,{children:t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-recording","aria-pressed":d.isRecording?.()===!0,onClick:()=>{d.setRecording?.(!d.isRecording?.()),e()},children:d.isRecording?.()?"Stop":"Start"})}):null,t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-log-clear",onClick:()=>{n.current.clear(),d.clearTraffic?.(),e()},children:"Clear"}),g.recording?t.jsxs("label",{style:{display:"flex",gap:c[1],alignItems:"center",whiteSpace:"nowrap"},children:[t.jsx(Q,{"data-testid":"net-autostart",checked:S,onChange:p=>{const I=p.currentTarget.checked;B().projectLocalState.write(W,I),v(I)}}),"Autostart"]}):null]}):null,g.traffic?t.jsx(bt,{rows:d.getTrafficByType?.()??[]}):null,g.entityTraffic?t.jsx(ht,{rows:d.getTrafficByEntity?.()??[]}):null,g.send?t.jsx(St,{adapter:d,ping:g.ping,draft:h,setDraft:m}):null,t.jsxs("div",{style:{flex:1,minHeight:0,display:"flex"},children:[t.jsx("div",{"data-testid":"net-state-tree",style:{flex:1,minWidth:0,overflow:"auto",borderRight:`1px solid ${o.boundary.default}`,padding:`${c[2]} 0`},children:g.stateTree?$!=null?t.jsx(H,{name:"state",value:$,depth:0,edit:d.editServerState?(p,I)=>d.editServerState(p,I):void 0,remove:d.deleteServerState?p=>d.deleteServerState(p):void 0,typeOf:d.stateFieldType?p=>d.stateFieldType(p):void 0}):t.jsx(T,{children:"Not connected — no replicated state to show."}):t.jsx(T,{testId:"net-tree-absent",children:"Replicated-state snapshot not provided by this adapter."})}),t.jsx("div",{"data-testid":"net-message-log",style:{flex:1,minWidth:0,display:"flex",flexDirection:"column"},children:g.messageLog?t.jsxs(t.Fragment,{children:[t.jsxs("div",{style:{display:"flex",gap:c[3],alignItems:"center",padding:c[2]},children:[g.recording?null:t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-log-pause",onClick:()=>{const p=!a;n.current.paused=p,l(p)},children:a?"Resume":"Pause"}),t.jsx(O,{"data-testid":"net-log-filter",placeholder:"Filter by type",value:u,onChange:p=>y(p.target.value),style:{flex:1,minWidth:60}}),t.jsxs("span",{style:{fontSize:C.sm,color:o.content.muted},children:[E.length,"/",n.current.all.length]})]}),t.jsx("div",{style:{flex:1,minHeight:0,overflow:"auto"},children:E.length===0?t.jsx(T,{children:"No messages captured yet."}):E.map(p=>t.jsx(ct,{event:p},p.seq))})]}):t.jsx(T,{testId:"net-log-absent",children:"Message log not provided by this adapter."})})]})]})}function ht({rows:e}){const n={padding:`0 ${c[3]}`,textAlign:"right",whiteSpace:"nowrap"};return t.jsx("div",{"data-testid":"net-entity-traffic",style:{maxHeight:132,overflow:"auto",borderBottom:`1px solid ${o.boundary.default}`},children:e.length===0?t.jsx(T,{children:"No state patches yet."}):t.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:C.sm,...R},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{color:o.content.muted},children:[t.jsx("th",{style:{...n,textAlign:"left"},children:"Entity"}),t.jsx("th",{style:n,title:"Syncs in - out, as Godot pairs them: the state patches that changed it, and none out, because a Colyseus client sends no state",children:"Count"}),t.jsx("th",{style:n,title:"Field changes those patches carried",children:"Changes"}),t.jsx("th",{style:n,title:"Size in - out: the size range of the patches that carried it (they carried other entities too), and none out",children:"Size"})]})}),t.jsx("tbody",{children:e.map(s=>t.jsxs("tr",{"data-testid":"net-entity-traffic-row",children:[t.jsx("td",{style:{...n,textAlign:"left"},children:s.path}),t.jsx("td",{style:n,children:`${s.syncs} - 0`}),t.jsx("td",{style:n,children:s.changes}),t.jsx("td",{style:n,children:`${s.patchBytesMin===s.patchBytesMax?`${s.patchBytesMin} B`:`${s.patchBytesMin}…${s.patchBytesMax} B`} - 0 B`})]},s.path))})]})})}function gt(e){try{return JSON.parse(e)}catch{return e}}function xt({text:e,onChange:n}){const[s,i]=f.useState("tree");let a;try{a=e.trim()===""?{}:JSON.parse(e)}catch{a=void 0}const l=u=>n(JSON.stringify(u));return t.jsxs("div",{"data-testid":"net-payload-editor",style:{display:"flex",flexDirection:"column",gap:c[1]},children:[t.jsx("div",{style:{display:"flex",gap:c[1]},children:["tree","text"].map(u=>t.jsx(k,{type:"button",variant:"ghost","aria-pressed":s===u,"data-testid":`net-payload-view-${u}`,onClick:()=>i(u),children:u==="tree"?"Tree":"Text"},u))}),s==="text"||a===void 0?t.jsxs(t.Fragment,{children:[t.jsx(tt,{"data-testid":"net-send-dialog-payload",rows:6,value:e,onChange:u=>n(u.target.value),style:R}),a===void 0?t.jsx("span",{style:{color:o.content.muted},children:"Not JSON yet, so the tree cannot show it."}):null]}):t.jsx("div",{style:{...R,fontSize:C.sm},children:t.jsx(X,{value:a,onChange:l,depth:0})})]})}function X({value:e,onChange:n,depth:s}){const[i,a]=f.useState(""),[l,u]=f.useState(""),y={paddingLeft:s*12};if(e!==null&&typeof e=="object"){const S=Array.isArray(e),v=S?e.map((m,d)=>[String(d),m]):Object.entries(e),h=(m,d)=>{n(S?e.map((g,j)=>String(j)===m?d:g):{...e,[m]:d})},x=m=>{n(S?e.filter((d,g)=>String(g)!==m):Object.fromEntries(Object.entries(e).filter(([d])=>d!==m)))};return t.jsxs("div",{"data-testid":"net-payload-branch",children:[v.map(([m,d])=>t.jsxs("div",{style:y,children:[t.jsxs("span",{style:{color:o.content.muted},children:[m,": "]}),d!==null&&typeof d=="object"?t.jsx("span",{style:{color:o.content.muted},children:Array.isArray(d)?"[":"{"}):null,t.jsx("button",{type:"button","data-testid":"net-payload-remove",title:`Remove ${m}`,onClick:()=>x(m),style:{background:"none",border:0,color:o.content.muted,cursor:"pointer"},children:"×"}),d!==null&&typeof d=="object"?t.jsx(X,{value:d,onChange:g=>h(m,g),depth:s+1}):t.jsx(q,{value:d,onChange:g=>h(m,g)})]},m)),t.jsxs("div",{style:{...y,display:"flex",gap:c[1]},children:[S?null:t.jsx(O,{"data-testid":"net-payload-new-key",placeholder:"key",value:i,onChange:m=>a(m.target.value),style:{width:90}}),t.jsx(O,{"data-testid":"net-payload-new-value",placeholder:"value",value:l,onChange:m=>u(m.target.value),style:{width:110}}),t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-payload-add",disabled:!S&&i.trim()==="",onClick:()=>{const m=gt(l);n(S?[...e,m]:{...e,[i.trim()]:m}),a(""),u("")},children:"Add"})]})]})}return t.jsx(q,{value:e,onChange:n})}function q({value:e,onChange:n}){const s=e===null?"null":typeof e=="number"?"number":typeof e=="boolean"?"boolean":"string",i=s==="string"?String(e):JSON.stringify(e),[a,l]=f.useState(i);f.useEffect(()=>l(i),[i]);const u=(y,S)=>{if(y==="null")return null;if(y==="boolean")return S.trim()==="true";if(y==="number"){const v=Number(S);return Number.isFinite(v)?v:0}return S};return t.jsxs("span",{style:{display:"inline-flex",gap:4},children:[s==="boolean"?t.jsx("input",{type:"checkbox","data-testid":"net-payload-leaf-boolean",checked:e===!0,onChange:y=>n(y.currentTarget.checked)}):s==="null"?t.jsx("span",{style:{color:o.content.muted},children:"null"}):t.jsx(O,{"data-testid":"net-payload-leaf",value:a,onChange:y=>l(y.target.value),onBlur:()=>n(u(s,a)),onKeyDown:y=>{y.key==="Enter"&&n(u(s,a))},style:{width:120}}),t.jsx("select",{"data-testid":"net-payload-leaf-type","aria-label":"Value type",value:s,onChange:y=>n(u(y.currentTarget.value,a)),children:["string","number","boolean","null"].map(y=>t.jsx("option",{value:y,children:y},y))})]})}const ft=[["name","Name"],["roomId","Room"],["clients","Clients"],["locked","Locked"],["elapsedMs","Elapsed"]];function jt(e,n){const s=i=>{const a=i[n.key];return typeof a=="number"?a:typeof a=="boolean"?Number(a):String(a)};return[...e].sort((i,a)=>{const l=s(i),u=s(a),y=l<u?-1:l>u?1:0;return n.descending?-y:y})}function bt({rows:e}){const n={padding:`0 ${c[3]}`,textAlign:"right",whiteSpace:"nowrap"},s=i=>i>=1024?`${(i/1024).toFixed(1)} KiB`:`${i} B`;return t.jsx("div",{"data-testid":"net-traffic",style:{maxHeight:132,overflow:"auto",borderBottom:`1px solid ${o.boundary.default}`},children:e.length===0?t.jsx(T,{children:"No traffic yet."}):t.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:C.sm,...R},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{color:o.content.muted},children:[t.jsx("th",{style:{...n,textAlign:"left"},children:"Type"}),t.jsx("th",{style:n,children:"In"}),t.jsx("th",{style:n,children:"Bytes in"}),t.jsx("th",{style:n,children:"Out"}),t.jsx("th",{style:n,children:"Bytes out"})]})}),t.jsx("tbody",{children:e.map(i=>t.jsxs("tr",{"data-testid":"net-traffic-row",children:[t.jsx("td",{style:{...n,textAlign:"left"},children:i.type}),t.jsx("td",{style:n,children:i.countIn||"-"}),t.jsx("td",{style:n,children:i.countIn?s(i.bytesIn):"-"}),t.jsx("td",{style:n,children:i.countOut||"-"}),t.jsx("td",{style:n,children:i.countOut?s(i.bytesOut):"-"})]},i.type))})]})})}function Y(e){if(e.type.trim()==="")throw new Error("Name the message type first.");return{type:e.type,payload:e.payload.trim()===""?void 0:JSON.parse(e.payload)}}function St({adapter:e,ping:n,draft:s,setDraft:i}){const[a,l]=f.useState(null),u=()=>{l("…"),e.ping?.().then(h=>l(`${h} ms`),h=>l(h instanceof Error?h.message:String(h)))},[y,S]=f.useState(null),v=()=>{try{const h=Y(s);e.sendMessage?.(h.type,h.payload),S(null)}catch(h){S(h instanceof Error?h.message:String(h))}};return t.jsxs("div",{"data-testid":"net-send",style:{display:"flex",gap:c[2],alignItems:"center",padding:c[2]},children:[t.jsx(O,{"data-testid":"net-send-type",placeholder:"Message type",value:s.type,onChange:h=>i({...s,type:h.target.value}),style:{width:140}}),t.jsx(O,{"data-testid":"net-send-payload",placeholder:'Payload (JSON), e.g. {"x": 1}',value:s.payload,onChange:h=>i({...s,payload:h.target.value}),style:{flex:1,minWidth:80}}),t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-send-button",disabled:s.type.trim()==="",onClick:v,children:"Send as this client"}),n?t.jsxs(t.Fragment,{children:[t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-ping",onClick:u,children:"Ping"}),a?t.jsx("span",{"data-testid":"net-rtt",style:{fontSize:C.sm,...R},children:a}):null]}):null,y?t.jsx("span",{"data-testid":"net-send-error",style:{color:o.semantic.danger,fontSize:C.sm},children:y}):null]})}function vt({adapter:e,ownSession:n,ownRoom:s,draft:i,setDraft:a}){const[l,u]=f.useState(null),[y,S]=f.useState(null),[v,h]=f.useState("clients"),[x,m]=f.useState(void 0),[d,g]=f.useState(void 0),[j,$]=f.useState({key:"elapsedMs",descending:!0}),[E,p]=f.useState(null);f.useEffect(()=>{let r=!0;const b=()=>{e.inspectServer?.(d).then(A=>{r&&m(A)},A=>{r&&p(A instanceof Error?A.message:String(A))})};b();const z=setInterval(b,2e3);return()=>{r=!1,clearInterval(z)}},[e,d]);const I=r=>{try{r()?.then(()=>p(null),b=>p(b instanceof Error?b.message:String(b)))}catch(b){p(b instanceof Error?b.message:String(b))}},L=r=>`${Math.round(r/1e3)} s`,w={padding:`0 ${c[3]}`,whiteSpace:"nowrap"};if(x===void 0)return null;if(x===null)return t.jsx(T,{testId:"net-server-absent",children:"The room server serves no Monitor view (its `server` configuration sets VOLTER_ROOM_MONITOR=1)."});const N=x.room?.roomId,M=(r,b,z)=>t.jsx(k,{type:"button",variant:"ghost","data-testid":r,onClick:()=>I(z),children:b});return t.jsxs("div",{"data-testid":"net-server",style:{padding:`${c[2]} 0`,borderBottom:`1px solid ${o.boundary.default}`,fontSize:C.sm},children:[t.jsxs("div",{"data-testid":"net-server-summary",style:{padding:`0 ${c[3]}`,color:o.content.muted},children:["Server · ",x.rooms.length," room",x.rooms.length===1?"":"s"," · ",x.connections," ","connection",x.connections===1?"":"s",x.cpuPercent!==null?` · CPU ${x.cpuPercent.toFixed(0)}%`:"",x.memory?` · memory ${Math.round(x.memory.usedMb)} / ${Math.round(x.memory.totalMb)} MB`:"",x.room?` · state ${x.room.stateBytes} B`:""]}),t.jsxs("table",{style:{borderCollapse:"collapse",...R},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{color:o.content.muted},children:[ft.map(([r,b])=>t.jsxs("th",{"data-testid":`net-server-sort-${r}`,"aria-sort":j.key===r?j.descending?"descending":"ascending":"none",style:{...w,textAlign:"left",cursor:"pointer",fontWeight:"normal"},onClick:()=>$({key:r,descending:j.key===r?!j.descending:!1}),children:[b,j.key===r?j.descending?" ▾":" ▴":""]},r)),t.jsx("th",{style:w})]})}),t.jsx("tbody",{children:jt(x.rooms,j).map(r=>t.jsxs("tr",{"data-testid":"net-server-room","data-inspected":r.roomId===N||void 0,children:[t.jsx("td",{style:w,children:r.name}),t.jsx("td",{style:w,children:r.roomId}),t.jsxs("td",{style:w,children:[r.clients,r.maxClients!==null?` / ${r.maxClients}`:""," clients"]}),t.jsx("td",{style:w,children:r.locked?"locked":"open"}),t.jsx("td",{style:w,children:L(r.elapsedMs)}),t.jsxs("td",{style:w,children:[r.roomId===N?t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-server-broadcast",onClick:()=>{S(null),u({sessionId:null})},children:"Broadcast"}):t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-server-inspect",onClick:()=>g(r.roomId),children:"Inspect"}),M("net-server-dispose","Dispose",()=>e.disposeRoom?.(r.roomId))]})]},r.roomId))})]}),l?t.jsxs("div",{"data-testid":"net-send-dialog",role:"group","aria-labelledby":"net-send-dialog-title",style:{margin:c[2],padding:c[3],border:`1px solid ${o.boundary.default}`,borderRadius:4},children:[t.jsx("div",{id:"net-send-dialog-title",style:{color:o.content.primary,marginBottom:c[2]},children:l.sessionId?`Send message to client (${l.sessionId})`:"Broadcast message to all clients"}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:c[2]},children:[t.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:c[1]},children:[t.jsx("span",{style:{color:o.content.muted},children:"Message type"}),t.jsx(O,{"data-testid":"net-send-dialog-type",value:i.type,onChange:r=>a({...i,type:r.target.value})})]}),t.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:c[1]},children:[t.jsx("span",{style:{color:o.content.muted},children:"Message payload (JSON)"}),t.jsx(xt,{text:i.payload,onChange:r=>a({...i,payload:r})})]}),y?t.jsx("span",{"data-testid":"net-send-dialog-error",children:y}):null]}),t.jsxs("div",{style:{display:"flex",gap:c[2],justifyContent:"flex-end",marginTop:c[2]},children:[t.jsx(k,{type:"button",variant:"ghost",onClick:()=>u(null),children:"Cancel"}),t.jsx(k,{type:"button","data-testid":"net-send-dialog-send",onClick:()=>{const r=l;(async()=>{try{const b=Y(i);await(r.sessionId?e.sendToClient?.(r.sessionId,b.type,b.payload,N):e.broadcast?.(b.type,b.payload,N)),S(null),u(null)}catch(b){S(b instanceof Error?b.message:String(b))}})()},children:"Send"})]})]}):null,x.room?t.jsxs("div",{"data-testid":"net-server-room-view",style:{padding:`${c[2]} 0`},children:[t.jsx("div",{role:"tablist",style:{display:"flex",gap:c[2],padding:`0 ${c[3]}`},children:[["clients",`Clients (${x.room.clients.length})`],["state","State"]].map(([r,b])=>t.jsx(k,{type:"button",variant:"ghost",role:"tab","aria-selected":v===r,"data-testid":`net-server-tab-${r}`,onClick:()=>h(r),children:b},r))}),v==="clients"?t.jsx("table",{style:{borderCollapse:"collapse",...R},children:t.jsx("tbody",{children:x.room.clients.map(r=>t.jsxs("tr",{"data-testid":"net-server-client",children:[t.jsx("td",{style:w,children:"client"}),t.jsxs("td",{style:w,children:[r.sessionId,r.sessionId===n?" (this client)":""]}),t.jsx("td",{style:w,children:L(r.elapsedMs)}),t.jsxs("td",{style:w,colSpan:3,children:[t.jsx(k,{type:"button",variant:"ghost","data-testid":"net-server-send",onClick:()=>{S(null),u({sessionId:r.sessionId})},children:"Send"}),M("net-server-disconnect","Disconnect",()=>e.disconnectClient?.(r.sessionId,N))]})]},r.sessionId))})}):x.room.state!==void 0?t.jsx("div",{"data-testid":"net-server-room-state",children:t.jsx(H,{name:`room ${x.room.roomId}${x.room.roomId===s?" (this client’s room)":""}`,value:x.room.state,depth:0,edit:e.editServerState?(r,b)=>e.editServerState(r,b,N):void 0,remove:e.deleteServerState?r=>e.deleteServerState(r,N):void 0})}):t.jsx(T,{children:"The server sent no state for this room."})]}):null,E?t.jsx(T,{children:E}):null]})}const Ge="workspace.utility",Xe="Network",Ye=25,Qe=()=>B().systems.inspectedNetworking()!==null;function Ze(){return t.jsx(mt,{})}export{Qe as available,Ze as default,Ye as order,Ge as point,Xe as title};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Object3DDocumentToolbar-CvnSLDPI.js","assets/jsx-runtime-DPjLkJKQ.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-Cr9NTnJp.js","assets/index-nmcBqr7Y.js","assets/index-D_NuPfjr.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-CPiRKiDC.css","assets/asset-preview-CQfnI2cX.js","assets/editor-layers-CGX7iCSP.js","assets/workspace-arrangement-dkubzCff.js","assets/renderer-ownership-BovSEcLv.js","assets/hierarchy-marks-CndAXtie.js","assets/studio-environment-B--4k2mN.js","assets/user-data-BXFD1jg-.js","assets/KTX2Loader-CaqVE6nY.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/GLTFLoader-KeoruJgS.js","assets/BufferGeometryUtils-B22h7jo4.js","assets/environment-Dg-YaLsA.js","assets/RoomEnvironment-BkknvS_I.js","assets/EXRLoader-CITMBvGd.js","assets/HDRLoader-BTGuGhVo.js","assets/bitmap-label-Ct4k6ehY.js","assets/model-inspection-CuVwNVvv.js","assets/viewport-door-AsLxGhLN.js","assets/ViewportShadingMenu-S2lADFJg.js"])))=>i.map(i=>d[i]);
2
- import{aF as f,aG as p,aH as l,aI as m,aJ as D,_ as g}from"./index-Cr9NTnJp.js";import{r as b}from"./index-nmcBqr7Y.js";const v=b.lazy(()=>g(()=>import("./Object3DDocumentToolbar-CvnSLDPI.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30])).then(e=>({default:e.Object3DDocumentToolbar}))),o=new Map,a=new Map;let s=0;const c=new Set;function i(){s++;for(const e of c)e()}function O(e,t={}){o.set(e.documentId,e);const r=f(e),n=p(e.documentId,{...w(e),...t});return i(),()=>{n(),r(),o.get(e.documentId)===e&&(o.delete(e.documentId),i())}}const d=([e,t,r])=>({x:e,y:t,z:r});function w(e){return{read:()=>{const t=e.cameraPose(),r=e.presentation();return{camera:{position:d(t.position),target:d(t.target),...t.fov?{fov:t.fov}:{}},diagnostic:r.skeleton?"skeleton":r.mode,grid:D(e.documentId)}},setDiagnostic:t=>{if(t==="preview"||t==="rendered"){const r=l(e.documentId)?.stageKind;if(!r||m(r)?.modes?.[t]?.lighting===void 0)return!1}return e.setSkeleton(t==="skeleton"),e.setBounds(t==="bounds"),e.setMode(t==="skeleton"||t==="bounds"?"solid":t),!0},setCamera:t=>(typeof t!="string"?e.setCameraPose(t.position,t.target,t.fov):t==="perspective"?(e.setProjection("perspective"),e.frame()):e.setViewPreset(t),!0),frame:t=>t==="selection"?e.frameSelection():(e.frame(),!0),selection:{read:()=>e.selection(),apply:t=>e.select(t)},idsNamed:t=>{const r=[];return e.root.traverse(n=>{if(n.name!==t)return;const u=e.idForObject(n);u&&r.push(u)}),r},setTransformMode:t=>e.viewport.setTransformMode(t),capture:t=>e.captureImage(t??512),prepare:()=>S(e.documentId),HeaderControls:v}}function P(e){return o.get(e)??null}function I(e,t){return a.set(e,t),()=>{a.get(e)===t&&a.delete(e)}}async function S(e){await a.get(e)?.()}function V(){return[...o.values()]}function _(e){return c.add(e),()=>c.delete(e)}function k(){return s}export{P as a,V as b,O as c,k as o,I as r,_ as s};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Object3DDocumentToolbar-B6BaAth8.js","assets/jsx-runtime-DPjLkJKQ.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-wjn2vkB8.js","assets/index-nmcBqr7Y.js","assets/index-D_NuPfjr.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-CPiRKiDC.css","assets/asset-preview-BD4OZrEp.js","assets/editor-layers-B2mwHrrn.js","assets/workspace-arrangement-coA4mYU_.js","assets/renderer-ownership-BovSEcLv.js","assets/hierarchy-marks-CSQMtCBU.js","assets/studio-environment-Cso4y0lE.js","assets/user-data-C2bC2Cok.js","assets/KTX2Loader-CaqVE6nY.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/GLTFLoader-KeoruJgS.js","assets/BufferGeometryUtils-B22h7jo4.js","assets/environment-Dg-YaLsA.js","assets/RoomEnvironment-BkknvS_I.js","assets/EXRLoader-CITMBvGd.js","assets/HDRLoader-BTGuGhVo.js","assets/bitmap-label-Ct4k6ehY.js","assets/model-inspection-DM9bxnjs.js","assets/viewport-door-DNJf5Mej.js","assets/ViewportShadingMenu-zMKOlcUM.js"])))=>i.map(i=>d[i]);
2
+ import{aF as f,aG as p,aH as l,aI as m,aJ as D,_ as g}from"./index-wjn2vkB8.js";import{r as b}from"./index-nmcBqr7Y.js";const v=b.lazy(()=>g(()=>import("./Object3DDocumentToolbar-B6BaAth8.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30])).then(e=>({default:e.Object3DDocumentToolbar}))),o=new Map,a=new Map;let s=0;const c=new Set;function i(){s++;for(const e of c)e()}function O(e,t={}){o.set(e.documentId,e);const r=f(e),n=p(e.documentId,{...w(e),...t});return i(),()=>{n(),r(),o.get(e.documentId)===e&&(o.delete(e.documentId),i())}}const d=([e,t,r])=>({x:e,y:t,z:r});function w(e){return{read:()=>{const t=e.cameraPose(),r=e.presentation();return{camera:{position:d(t.position),target:d(t.target),...t.fov?{fov:t.fov}:{}},diagnostic:r.skeleton?"skeleton":r.mode,grid:D(e.documentId)}},setDiagnostic:t=>{if(t==="preview"||t==="rendered"){const r=l(e.documentId)?.stageKind;if(!r||m(r)?.modes?.[t]?.lighting===void 0)return!1}return e.setSkeleton(t==="skeleton"),e.setBounds(t==="bounds"),e.setMode(t==="skeleton"||t==="bounds"?"solid":t),!0},setCamera:t=>(typeof t!="string"?e.setCameraPose(t.position,t.target,t.fov):t==="perspective"?(e.setProjection("perspective"),e.frame()):e.setViewPreset(t),!0),frame:t=>t==="selection"?e.frameSelection():(e.frame(),!0),selection:{read:()=>e.selection(),apply:t=>e.select(t)},idsNamed:t=>{const r=[];return e.root.traverse(n=>{if(n.name!==t)return;const u=e.idForObject(n);u&&r.push(u)}),r},setTransformMode:t=>e.viewport.setTransformMode(t),capture:t=>e.captureImage(t??512),prepare:()=>S(e.documentId),HeaderControls:v}}function P(e){return o.get(e)??null}function I(e,t){return a.set(e,t),()=>{a.get(e)===t&&a.delete(e)}}async function S(e){await a.get(e)?.()}function V(){return[...o.values()]}function _(e){return c.add(e),()=>c.delete(e)}function k(){return s}export{P as a,V as b,O as c,k as o,I as r,_ as s};
@@ -1,2 +1,2 @@
1
- import{ay as i}from"./index-Cr9NTnJp.js";import"./writer-tw6EcuVO.js";import{p as h,a as M,r as $}from"./r3f-physics-binding-oippu1v_.js";const x=["position","rotation","scale"],O={"@react-three/rapier":{RigidBody:{root:"single",rootTag:"group",transformProps:[...x]}}},z={"@react-three/rapier":{RigidBodyProps:"group"}};function _(t){const n=new Map;for(const r of t.statements){if(!i.isImportDeclaration(r)||!i.isStringLiteral(r.moduleSpecifier))continue;const e=z[r.moduleSpecifier.text],o=r.importClause?.namedBindings;if(!(!e||!o||!i.isNamedImports(o)))for(const s of o.elements){const a=s.propertyName?.text??s.name.text,l=e[a];l&&n.set(s.name.text,l)}}return n}function D(t){return t?Object.values(O).some(n=>Object.values(n).includes(t)):!1}function j(t,n){return O[t]?.[n]}function Z(t){const n=new Map;if(!i.isStringLiteral(t.moduleSpecifier))return n;const r=t.importClause?.namedBindings;if(!r||!i.isNamedImports(r))return n;for(const e of r.elements){const o=j(t.moduleSpecifier.text,e.propertyName?.text??e.name.text);o&&n.set(e.name.text,o)}return n}function ct(t,n){const r=h(n,t),e=new Map;for(const o of r.statements)if(i.isImportDeclaration(o))for(const[s,a]of Z(o))e.set(s,a);return e}function P(t){let n=t;for(;i.isParenthesizedExpression(n)||i.isAsExpression(n)||i.isSatisfiesExpression(n);)n=n.expression;return n}function k(t){if(!i.isBlock(t))return P(t);const n=t.statements.filter(i.isReturnStatement);if(!(n.length!==1||!n[0]?.expression))return P(n[0].expression)}function K(t,n,r){for(const[e,o]of r)if(o===n&&new RegExp(`\\b${e}\\b`).test(t))return!0;return!1}function b(t,n,r,e,o,s=new Set){if(!t)return!1;const a=t.getText(r),l=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\bThreeElements\\s*\\[\\s*['"]${l}['"]\\s*\\]`).test(a)||K(a,n,o))return!0;if(i.isTypeReferenceNode(t)&&i.isIdentifier(t.typeName)){const u=t.typeName.text;if(s.has(u))return!1;const f=e.get(u);return f?(s.add(u),b(f.type,n,f.sf,e,o,s)):!1}for(const[u,f]of e){if(s.has(u)||!new RegExp(`\\b${u}\\b`).test(a))continue;const p=new Set(s).add(u);if(b(f.type,n,f.sf,e,o,p))return!0}return!1}function L(t){if(i.isJsxSelfClosingElement(t))return t;if(i.isJsxElement(t))return t.openingElement}function U(t,n){return t==="multiple"||n==="multiple"?"multiple":t==="unknown"||n==="unknown"?"unknown":t+n>=2?"multiple":t+n}function I(t,n,r){const o=(i.isJsxElement(t)?t.openingElement:t).tagName.getText(n);if(!/^[A-Z]/.test(o))return B(o)?0:1;const s=r.get(o);return!s||s.root==="unknown"?"unknown":s.root==="non-spatial"?0:s.root==="multiple"?"multiple":1}function V(t,n,r){if(!i.isPropertyAccessExpression(t.expression)||t.expression.name.text!=="map")return;const e=t.arguments[0];if(!e||!i.isArrowFunction(e)&&!i.isFunctionExpression(e))return"unknown";const o=k(e.body);if(!o)return"unknown";const s=v(o,n,r);return s===0?0:s==="unknown"?"unknown":"multiple"}function v(t,n,r){const e=P(t);return e.kind===i.SyntaxKind.NullKeyword||e.kind===i.SyntaxKind.FalseKeyword?0:i.isJsxFragment(e)?y(e,n,r):i.isJsxElement(e)||i.isJsxSelfClosingElement(e)?I(e,n,r):i.isCallExpression(e)?V(e,n,r)??"unknown":"unknown"}function W(t,n,r){return i.isJsxText(t)?t.text.trim()===""?0:"unknown":i.isJsxExpression(t)?t.expression?v(t.expression,n,r):0:i.isJsxElement(t)||i.isJsxSelfClosingElement(t)?I(t,n,r):i.isJsxFragment(t)?y(t,n,r):"unknown"}function y(t,n,r){let e=0;for(const o of t.children)e=U(e,W(o,n,r));return e}function q(t,n,r){const e=y(t,n,r);return e===0?{root:"non-spatial",transformProps:[]}:e==="multiple"?{root:"multiple",transformProps:[]}:{root:"unknown",transformProps:[]}}function B(t){return/^[A-Z]/.test(t)?!1:/(Material|Geometry|Attribute)$/.test(t)||t==="fog"||t==="fogExp2"||t==="color"}function G(t){return x.includes(t)}function F(t){return G(t)||t==="visible"}function Y(t,n,r,e,o){const s={standardRootProps:b(t?.type,n,r,e,o),localBindingByProp:new Map};if(!t)return s;if(i.isIdentifier(t.name))return s.wholePropsName=t.name.text,s;if(!i.isObjectBindingPattern(t.name))return s;for(const a of t.name.elements){if(a.dotDotDotToken&&i.isIdentifier(a.name)){s.restPropsName=a.name.text;continue}if(!i.isIdentifier(a.name))continue;const l=a.propertyName?.getText(r)??a.name.text;F(l)&&s.localBindingByProp.set(l,a.name.text)}return s}function H(t,n,r){if(!t)return!1;const e=t.getText(r).replace(/\s+/g,""),o=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`^(React\\.)?(Parameters<typeof${o}>\\[0\\]|ComponentProps(WithoutRef|WithRef)?<typeof${o}>)`).test(e)}function Q(t,n){return!n.standardRootProps||!i.isIdentifier(t.expression)?!1:t.expression.text===n.wholePropsName||t.expression.text===n.restPropsName}function X(t,n,r){const e=t.name.getText(r);if(!F(e)||!t.initializer||!i.isJsxExpression(t.initializer))return;const o=t.initializer.expression;if(!o)return;const s=n.localBindingByProp.get(e);if(s&&i.isIdentifier(o)&&o.text===s||n.wholePropsName&&i.isPropertyAccessExpression(o)&&i.isIdentifier(o.expression)&&o.expression.text===n.wholePropsName&&o.name.text===e)return e}function tt(t,n,r){const e=new Set;for(const s of t.attributes.properties){if(i.isJsxSpreadAttribute(s)){if(Q(s,n)){for(const l of x)e.add(l);e.add("visible")}continue}const a=X(s,n,r);a&&e.add(a)}return[...x,"visible"].filter(s=>e.has(s))}const nt=/\b([A-Za-z_$][\w$]*)\.current\??\.(?:position|rotation|quaternion|scale)(?:\??\.[xyzw]+)?\s*(?:[+\-*/]?=|\??\.(?:set|setScalar|copy|add|sub|multiply|lerp|slerp|fromArray)\s*\()/g;function et(t,n){const r=new Set,e=o=>{if(i.isCallExpression(o)&&/(^|\.)useFrame$/.test(o.expression.getText(n)))for(const s of o.getText(n).matchAll(nt))r.add(s[1]);i.forEachChild(o,e)};return e(t),r}function rt(t,n,r){if(n.length>0)return{};const e=$(t);return e&&r.has(e)?{simulationOwnedTransform:!0}:{}}function ot(t,n,r,e,o,s,a,l){const u=k(n);if(!u)return{root:"unknown",transformProps:[]};if(u.kind===i.SyntaxKind.NullKeyword)return{root:"non-spatial",transformProps:[]};if(i.isJsxFragment(u))return q(u,r,s);if(!i.isJsxElement(u)&&!i.isJsxSelfClosingElement(u))return{root:"unknown",transformProps:[]};const f=L(u);if(!f)return{root:"unknown",transformProps:[]};const p=f.tagName.getText(r);if(B(p))return{root:"non-spatial",transformProps:[]};const c=/^[A-Z]/.test(p)?s.get(p):void 0;if(/^[A-Z]/.test(p)&&!c)return{root:"unknown",transformProps:[]};if(c&&c.root!=="single")return c;const d=c?.rootTag??p,g=l.get(f),E=g?.apiDriven??[],T=(g?.forwarded??[]).filter(m=>!E.includes(m)),R=Y(t[0],d,r,e,o),A=!R.standardRootProps&&c&&H(t[0]?.type,p,r)?{...R,standardRootProps:!0}:R,N=tt(f,A,r),S=x.filter(m=>N.includes(m)||T.includes(m)),w=c?S.filter(m=>c.transformProps.includes(m)):S,J=N.includes("visible")&&(!c||c.visibleProp===!0);if(D(c)&&w.length===0)return{root:"unknown",transformProps:[]};const C=w.filter(m=>T.includes(m));return{root:"single",rootTag:d,transformProps:w,...C.length>0?{bodyForwarded:C}:{},...J?{visibleProp:!0}:{},...rt(f,w,a),...E.length>0?{simulationOwnedTransform:!0}:{}}}function it(t){return i.isFunctionDeclaration(t)&&t.name&&t.body?/^[A-Z]/.test(t.name.text)?[{name:t.name.text,parameters:t.parameters,body:t.body}]:[]:i.isVariableStatement(t)?t.declarationList.declarations.flatMap(n=>!i.isIdentifier(n.name)||!/^[A-Z]/.test(n.name.text)||!n.initializer||!i.isArrowFunction(n.initializer)&&!i.isFunctionExpression(n.initializer)?[]:[{name:n.name.text,parameters:n.initializer.parameters,body:n.initializer.body}]):[]}function st(t,n=new Map,r=new Map){const e=new Map(r);for(const f of t.statements)i.isTypeAliasDeclaration(f)&&e.set(f.name.text,{type:f.type,sf:t});const o=_(t),s=t.statements.flatMap(it),a=et(t,t),l=M(t),u=new Map(n);for(let f=0;f<=s.length;f+=1){let p=!1;for(const c of s){const d=ot(c.parameters,c.body,t,e,o,u,a,l),g=u.get(c.name);JSON.stringify(g)!==JSON.stringify(d)&&(u.set(c.name,d),p=!0)}if(!p)break}return u}function lt(t,n,r=new Map,e=new Map){const o=h(n,t);return st(o,r,e)}function pt(t,n,r){let e=0,o=1;for(;o<n;){const s=t.indexOf(`
1
+ import{ay as i}from"./index-wjn2vkB8.js";import"./writer-tw6EcuVO.js";import{p as h,a as M,r as $}from"./r3f-physics-binding-DSD0HHLc.js";const x=["position","rotation","scale"],O={"@react-three/rapier":{RigidBody:{root:"single",rootTag:"group",transformProps:[...x]}}},z={"@react-three/rapier":{RigidBodyProps:"group"}};function _(t){const n=new Map;for(const r of t.statements){if(!i.isImportDeclaration(r)||!i.isStringLiteral(r.moduleSpecifier))continue;const e=z[r.moduleSpecifier.text],o=r.importClause?.namedBindings;if(!(!e||!o||!i.isNamedImports(o)))for(const s of o.elements){const a=s.propertyName?.text??s.name.text,l=e[a];l&&n.set(s.name.text,l)}}return n}function D(t){return t?Object.values(O).some(n=>Object.values(n).includes(t)):!1}function j(t,n){return O[t]?.[n]}function Z(t){const n=new Map;if(!i.isStringLiteral(t.moduleSpecifier))return n;const r=t.importClause?.namedBindings;if(!r||!i.isNamedImports(r))return n;for(const e of r.elements){const o=j(t.moduleSpecifier.text,e.propertyName?.text??e.name.text);o&&n.set(e.name.text,o)}return n}function ct(t,n){const r=h(n,t),e=new Map;for(const o of r.statements)if(i.isImportDeclaration(o))for(const[s,a]of Z(o))e.set(s,a);return e}function P(t){let n=t;for(;i.isParenthesizedExpression(n)||i.isAsExpression(n)||i.isSatisfiesExpression(n);)n=n.expression;return n}function k(t){if(!i.isBlock(t))return P(t);const n=t.statements.filter(i.isReturnStatement);if(!(n.length!==1||!n[0]?.expression))return P(n[0].expression)}function K(t,n,r){for(const[e,o]of r)if(o===n&&new RegExp(`\\b${e}\\b`).test(t))return!0;return!1}function b(t,n,r,e,o,s=new Set){if(!t)return!1;const a=t.getText(r),l=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\bThreeElements\\s*\\[\\s*['"]${l}['"]\\s*\\]`).test(a)||K(a,n,o))return!0;if(i.isTypeReferenceNode(t)&&i.isIdentifier(t.typeName)){const u=t.typeName.text;if(s.has(u))return!1;const f=e.get(u);return f?(s.add(u),b(f.type,n,f.sf,e,o,s)):!1}for(const[u,f]of e){if(s.has(u)||!new RegExp(`\\b${u}\\b`).test(a))continue;const p=new Set(s).add(u);if(b(f.type,n,f.sf,e,o,p))return!0}return!1}function L(t){if(i.isJsxSelfClosingElement(t))return t;if(i.isJsxElement(t))return t.openingElement}function U(t,n){return t==="multiple"||n==="multiple"?"multiple":t==="unknown"||n==="unknown"?"unknown":t+n>=2?"multiple":t+n}function I(t,n,r){const o=(i.isJsxElement(t)?t.openingElement:t).tagName.getText(n);if(!/^[A-Z]/.test(o))return B(o)?0:1;const s=r.get(o);return!s||s.root==="unknown"?"unknown":s.root==="non-spatial"?0:s.root==="multiple"?"multiple":1}function V(t,n,r){if(!i.isPropertyAccessExpression(t.expression)||t.expression.name.text!=="map")return;const e=t.arguments[0];if(!e||!i.isArrowFunction(e)&&!i.isFunctionExpression(e))return"unknown";const o=k(e.body);if(!o)return"unknown";const s=v(o,n,r);return s===0?0:s==="unknown"?"unknown":"multiple"}function v(t,n,r){const e=P(t);return e.kind===i.SyntaxKind.NullKeyword||e.kind===i.SyntaxKind.FalseKeyword?0:i.isJsxFragment(e)?y(e,n,r):i.isJsxElement(e)||i.isJsxSelfClosingElement(e)?I(e,n,r):i.isCallExpression(e)?V(e,n,r)??"unknown":"unknown"}function W(t,n,r){return i.isJsxText(t)?t.text.trim()===""?0:"unknown":i.isJsxExpression(t)?t.expression?v(t.expression,n,r):0:i.isJsxElement(t)||i.isJsxSelfClosingElement(t)?I(t,n,r):i.isJsxFragment(t)?y(t,n,r):"unknown"}function y(t,n,r){let e=0;for(const o of t.children)e=U(e,W(o,n,r));return e}function q(t,n,r){const e=y(t,n,r);return e===0?{root:"non-spatial",transformProps:[]}:e==="multiple"?{root:"multiple",transformProps:[]}:{root:"unknown",transformProps:[]}}function B(t){return/^[A-Z]/.test(t)?!1:/(Material|Geometry|Attribute)$/.test(t)||t==="fog"||t==="fogExp2"||t==="color"}function G(t){return x.includes(t)}function F(t){return G(t)||t==="visible"}function Y(t,n,r,e,o){const s={standardRootProps:b(t?.type,n,r,e,o),localBindingByProp:new Map};if(!t)return s;if(i.isIdentifier(t.name))return s.wholePropsName=t.name.text,s;if(!i.isObjectBindingPattern(t.name))return s;for(const a of t.name.elements){if(a.dotDotDotToken&&i.isIdentifier(a.name)){s.restPropsName=a.name.text;continue}if(!i.isIdentifier(a.name))continue;const l=a.propertyName?.getText(r)??a.name.text;F(l)&&s.localBindingByProp.set(l,a.name.text)}return s}function H(t,n,r){if(!t)return!1;const e=t.getText(r).replace(/\s+/g,""),o=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`^(React\\.)?(Parameters<typeof${o}>\\[0\\]|ComponentProps(WithoutRef|WithRef)?<typeof${o}>)`).test(e)}function Q(t,n){return!n.standardRootProps||!i.isIdentifier(t.expression)?!1:t.expression.text===n.wholePropsName||t.expression.text===n.restPropsName}function X(t,n,r){const e=t.name.getText(r);if(!F(e)||!t.initializer||!i.isJsxExpression(t.initializer))return;const o=t.initializer.expression;if(!o)return;const s=n.localBindingByProp.get(e);if(s&&i.isIdentifier(o)&&o.text===s||n.wholePropsName&&i.isPropertyAccessExpression(o)&&i.isIdentifier(o.expression)&&o.expression.text===n.wholePropsName&&o.name.text===e)return e}function tt(t,n,r){const e=new Set;for(const s of t.attributes.properties){if(i.isJsxSpreadAttribute(s)){if(Q(s,n)){for(const l of x)e.add(l);e.add("visible")}continue}const a=X(s,n,r);a&&e.add(a)}return[...x,"visible"].filter(s=>e.has(s))}const nt=/\b([A-Za-z_$][\w$]*)\.current\??\.(?:position|rotation|quaternion|scale)(?:\??\.[xyzw]+)?\s*(?:[+\-*/]?=|\??\.(?:set|setScalar|copy|add|sub|multiply|lerp|slerp|fromArray)\s*\()/g;function et(t,n){const r=new Set,e=o=>{if(i.isCallExpression(o)&&/(^|\.)useFrame$/.test(o.expression.getText(n)))for(const s of o.getText(n).matchAll(nt))r.add(s[1]);i.forEachChild(o,e)};return e(t),r}function rt(t,n,r){if(n.length>0)return{};const e=$(t);return e&&r.has(e)?{simulationOwnedTransform:!0}:{}}function ot(t,n,r,e,o,s,a,l){const u=k(n);if(!u)return{root:"unknown",transformProps:[]};if(u.kind===i.SyntaxKind.NullKeyword)return{root:"non-spatial",transformProps:[]};if(i.isJsxFragment(u))return q(u,r,s);if(!i.isJsxElement(u)&&!i.isJsxSelfClosingElement(u))return{root:"unknown",transformProps:[]};const f=L(u);if(!f)return{root:"unknown",transformProps:[]};const p=f.tagName.getText(r);if(B(p))return{root:"non-spatial",transformProps:[]};const c=/^[A-Z]/.test(p)?s.get(p):void 0;if(/^[A-Z]/.test(p)&&!c)return{root:"unknown",transformProps:[]};if(c&&c.root!=="single")return c;const d=c?.rootTag??p,g=l.get(f),E=g?.apiDriven??[],T=(g?.forwarded??[]).filter(m=>!E.includes(m)),R=Y(t[0],d,r,e,o),A=!R.standardRootProps&&c&&H(t[0]?.type,p,r)?{...R,standardRootProps:!0}:R,N=tt(f,A,r),S=x.filter(m=>N.includes(m)||T.includes(m)),w=c?S.filter(m=>c.transformProps.includes(m)):S,J=N.includes("visible")&&(!c||c.visibleProp===!0);if(D(c)&&w.length===0)return{root:"unknown",transformProps:[]};const C=w.filter(m=>T.includes(m));return{root:"single",rootTag:d,transformProps:w,...C.length>0?{bodyForwarded:C}:{},...J?{visibleProp:!0}:{},...rt(f,w,a),...E.length>0?{simulationOwnedTransform:!0}:{}}}function it(t){return i.isFunctionDeclaration(t)&&t.name&&t.body?/^[A-Z]/.test(t.name.text)?[{name:t.name.text,parameters:t.parameters,body:t.body}]:[]:i.isVariableStatement(t)?t.declarationList.declarations.flatMap(n=>!i.isIdentifier(n.name)||!/^[A-Z]/.test(n.name.text)||!n.initializer||!i.isArrowFunction(n.initializer)&&!i.isFunctionExpression(n.initializer)?[]:[{name:n.name.text,parameters:n.initializer.parameters,body:n.initializer.body}]):[]}function st(t,n=new Map,r=new Map){const e=new Map(r);for(const f of t.statements)i.isTypeAliasDeclaration(f)&&e.set(f.name.text,{type:f.type,sf:t});const o=_(t),s=t.statements.flatMap(it),a=et(t,t),l=M(t),u=new Map(n);for(let f=0;f<=s.length;f+=1){let p=!1;for(const c of s){const d=ot(c.parameters,c.body,t,e,o,u,a,l),g=u.get(c.name);JSON.stringify(g)!==JSON.stringify(d)&&(u.set(c.name,d),p=!0)}if(!p)break}return u}function lt(t,n,r=new Map,e=new Map){const o=h(n,t);return st(o,r,e)}function pt(t,n,r){let e=0,o=1;for(;o<n;){const s=t.indexOf(`
2
2
  `,e);if(s===-1)return t.length;e=s+1,o+=1}return e+r}export{lt as a,ct as b,pt as l};
@@ -1 +1 @@
1
- import{Vec3Schema as a}from"./tuples-uyiMYXrv.js";import{dY as c,t as i,bA as e,bz as o,u as n,by as s,w as t,v as p}from"./index-Cr9NTnJp.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";const b=i({type:t("ConstantValue"),value:e()}),h=i({type:t("IntervalValue"),a:e(),b:e()}),u=i({p0:e(),p1:e(),p2:e(),p3:e()}),f=i({type:t("PiecewiseBezier"),functions:n(i({function:u,start:e()}))}),r=c("type",[b,h,f]).describe("Numeric value: constant, random interval, or bezier curve"),l=i({r:e(),g:e(),b:e(),a:e()}),v=i({r:e(),g:e(),b:e()}),y=i({type:t("CLinearFunction"),subType:t("Color"),keys:n(i({value:v,pos:e()}))}),S=i({type:t("CLinearFunction"),subType:t("Number"),keys:n(i({value:e(),pos:e()}))}),g=i({type:t("ConstantColor"),color:l}),C=i({type:t("ColorRange"),a:l,b:l}),d=i({type:t("Gradient"),color:y,alpha:S}),w=i({type:t("RandomColorBetweenGradient"),gradient1:d,gradient2:d}),m=c("type",[g,C,d,w]).describe("Color generator: constant, range, gradient, or random between gradients"),B=i({type:t("point")}),L=i({type:t("sphere"),radius:e().optional().describe("Sphere radius"),arc:e().optional().describe("Arc angle in radians (2π = full sphere)"),thickness:e().optional().describe("Shell thickness 0–1 (1 = solid, 0 = surface only)")}),O=i({type:t("hemisphere"),radius:e().optional().describe("Hemisphere radius"),arc:e().optional().describe("Arc angle in radians"),thickness:e().optional().describe("Shell thickness 0–1")}),x=i({type:t("cone"),radius:e().optional().describe("Cone base radius"),arc:e().optional().describe("Arc angle in radians"),thickness:e().optional().describe("Shell thickness 0–1"),angle:e().optional().describe("Cone opening angle in radians")}),F=i({type:t("circle"),radius:e().optional().describe("Circle radius"),arc:e().optional().describe("Arc angle in radians"),thickness:e().optional().describe("Ring thickness 0–1")}),P=i({type:t("donut"),radius:e().optional().describe("Donut major radius"),arc:e().optional().describe("Arc angle in radians"),thickness:e().optional().describe("Ring thickness 0–1"),donutRadius:e().optional().describe("Donut tube (minor) radius")}),R=i({type:t("rectangle"),width:e().optional().describe("Rectangle width"),height:e().optional().describe("Rectangle height"),thickness:e().optional().describe("Extrusion depth 0–1")}),T=i({type:t("grid"),width:e().optional().describe("Grid total width"),height:e().optional().describe("Grid total height"),column:e().int().optional().describe("Number of columns"),row:e().int().optional().describe("Number of rows")}),G=c("type",[B,L,O,x,F,P,R,T]).describe("Particle emitter shape"),k=i({type:t("ApplyForce"),direction:a.describe("Force direction vector"),magnitude:r.describe("Force magnitude")}),z=i({type:t("ColorOverLife"),color:m.describe("Color curve over particle lifetime")}),E=i({type:t("SizeOverLife"),size:r.describe("Size curve over particle lifetime")}),A=i({type:t("SpeedOverLife"),speed:r.describe("Speed multiplier curve over lifetime")}),N=i({type:t("RotationOverLife"),angularVelocity:r.describe("Angular velocity in radians/sec")}),D=i({type:t("ForceOverLife"),x:r.describe("Force along X axis over lifetime"),y:r.describe("Force along Y axis over lifetime"),z:r.describe("Force along Z axis over lifetime")}),I=i({type:t("OrbitOverLife"),orbitSpeed:r.describe("Orbit speed over lifetime"),axis:a.optional().describe("Orbit axis. Defaults to [0, 1, 0]")}),V=i({type:t("Noise"),frequency:r.describe("Noise frequency"),power:r.describe("Noise amplitude"),positionAmount:r.optional().describe("Position displacement amount"),rotationAmount:r.optional().describe("Rotation displacement amount")}),H=i({type:t("TurbulenceField"),scale:a.describe("Turbulence field scale"),octaves:e().int().describe("Noise octave count"),velocityMultiplier:a.describe("Velocity multiplier per axis"),timeScale:a.describe("Time scale per axis")}),M=i({type:t("FrameOverLife"),frame:r.describe("Sprite sheet frame index over lifetime")}),W=i({type:t("LimitSpeedOverLife"),speed:r.describe("Maximum speed over lifetime"),dampen:e().describe("Damping factor when speed exceeds limit (0–1)")}),j=i({type:t("ChangeEmitDirection"),angle:r.describe("Angle deviation from original emit direction")}),q=i({type:t("GravityForce"),center:a.describe("Gravity center point"),magnitude:e().describe("Gravity force strength")}),U=i({type:t("WidthOverLength"),width:r.describe("Trail width over trail length")}),Y=c("type",[k,z,E,A,N,D,I,V,H,M,W,j,q,U]).describe("Particle behavior applied over lifetime"),X=s(["billboard","stretchedBillboard","mesh","trail","horizontalBillboard","verticalBillboard"]).describe("How particles are rendered"),Z=i({wrap:s(["clamp","repeat","mirror"]).optional().describe("How UVs outside [0,1] address the sprite image (three wrapS/wrapT)"),filter:s(["linear","nearest"]).optional().describe("Texel interpolation — nearest keeps a pixel-art sprite crisp"),mipmaps:o().optional().describe("Generate and sample a mip chain"),anisotropy:e().optional().describe("Anisotropic filtering samples, for sprites viewed at grazing angles")}).describe("Sprite texture sampler state"),_=i({type:s(["basic","standard"]).optional().describe("Particle material shading model"),color:p().optional().describe("Particle color as CSS hex string"),map:p().optional().describe("Path to particle sprite texture"),mapSampler:Z.optional().describe("Sampler state applied to the sprite texture named by `map`"),blending:s(["normal","additive"]).optional().describe("Blending mode (additive for glowing/fire effects)"),transparent:o().optional().describe("Enable transparency"),depthWrite:o().optional().describe("Write to depth buffer (disable for additive effects)"),side:s(["front","back","double"]).optional().describe("Which face sides to render")}).describe("Particle material settings"),J=i({time:e().describe("Time offset in seconds within the emission cycle"),count:r.describe("Number of particles to emit"),cycle:e().optional().describe("Burst repeat interval in seconds"),interval:e().optional().describe("Delay between burst repetitions"),probability:e().optional().describe("Chance of burst firing (0–1)")}).describe("Timed particle burst"),ne=i({autoDestroy:o().optional().describe("Destroy the particle system when all particles have died"),looping:o().optional().describe("Continuously emit particles"),prewarm:o().optional().describe("Simulate one full cycle on start so particles appear immediately"),duration:e().optional().describe("Total emission duration in seconds"),shape:G.optional().describe("Emitter shape that defines where particles spawn"),startLife:r.optional().describe("Initial particle lifetime in seconds"),startSpeed:r.optional().describe("Initial particle speed"),startSize:r.optional().describe("Initial particle size"),startRotation:r.optional().describe("Initial particle rotation in radians"),startColor:m.optional().describe("Initial particle color"),startLength:r.optional().describe("Initial trail length (trail render mode only)"),startTileIndex:r.optional().describe("Initial sprite sheet tile index"),emissionOverTime:r.optional().describe("Particles emitted per second"),emissionOverDistance:r.optional().describe("Particles emitted per unit of emitter movement"),emissionBursts:n(J).optional().describe("Timed burst emissions"),behaviors:n(Y).optional().describe("Behaviors applied to particles over their lifetime"),renderMode:X.optional().describe("How particles are rendered (billboard, trail, mesh, etc.)"),worldSpace:o().optional().describe("Simulate particles in world space instead of local space"),renderOrder:e().optional().describe("Render order for sorting (higher = rendered later)"),uTileCount:e().int().optional().describe("Horizontal tile count in sprite sheet"),vTileCount:e().int().optional().describe("Vertical tile count in sprite sheet"),blendTiles:o().optional().describe("Blend between sprite sheet tiles for smooth animation"),softParticles:o().optional().describe("Enable soft particle depth fading"),softFarFade:e().optional().describe("Far fade distance for soft particles"),softNearFade:e().optional().describe("Near fade distance for soft particles"),material:_.describe("Particle material settings")}).describe("Particle system configuration");export{Y as BehaviorSchema,m as ColorGeneratorSchema,G as EmitterShapeSchema,ne as ParticlesDescriptorSchema,X as RenderModeSchema,r as ValueGeneratorSchema};
1
+ import{Vec3Schema as a}from"./tuples-ChC18dWq.js";import{dY as c,t as i,bA as e,bz as o,u as n,by as s,w as t,v as p}from"./index-wjn2vkB8.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";const b=i({type:t("ConstantValue"),value:e()}),h=i({type:t("IntervalValue"),a:e(),b:e()}),u=i({p0:e(),p1:e(),p2:e(),p3:e()}),f=i({type:t("PiecewiseBezier"),functions:n(i({function:u,start:e()}))}),r=c("type",[b,h,f]).describe("Numeric value: constant, random interval, or bezier curve"),l=i({r:e(),g:e(),b:e(),a:e()}),v=i({r:e(),g:e(),b:e()}),y=i({type:t("CLinearFunction"),subType:t("Color"),keys:n(i({value:v,pos:e()}))}),S=i({type:t("CLinearFunction"),subType:t("Number"),keys:n(i({value:e(),pos:e()}))}),g=i({type:t("ConstantColor"),color:l}),C=i({type:t("ColorRange"),a:l,b:l}),d=i({type:t("Gradient"),color:y,alpha:S}),w=i({type:t("RandomColorBetweenGradient"),gradient1:d,gradient2:d}),m=c("type",[g,C,d,w]).describe("Color generator: constant, range, gradient, or random between gradients"),B=i({type:t("point")}),L=i({type:t("sphere"),radius:e().optional().describe("Sphere radius"),arc:e().optional().describe("Arc angle in radians (2π = full sphere)"),thickness:e().optional().describe("Shell thickness 0–1 (1 = solid, 0 = surface only)")}),O=i({type:t("hemisphere"),radius:e().optional().describe("Hemisphere radius"),arc:e().optional().describe("Arc angle in radians"),thickness:e().optional().describe("Shell thickness 0–1")}),x=i({type:t("cone"),radius:e().optional().describe("Cone base radius"),arc:e().optional().describe("Arc angle in radians"),thickness:e().optional().describe("Shell thickness 0–1"),angle:e().optional().describe("Cone opening angle in radians")}),F=i({type:t("circle"),radius:e().optional().describe("Circle radius"),arc:e().optional().describe("Arc angle in radians"),thickness:e().optional().describe("Ring thickness 0–1")}),P=i({type:t("donut"),radius:e().optional().describe("Donut major radius"),arc:e().optional().describe("Arc angle in radians"),thickness:e().optional().describe("Ring thickness 0–1"),donutRadius:e().optional().describe("Donut tube (minor) radius")}),R=i({type:t("rectangle"),width:e().optional().describe("Rectangle width"),height:e().optional().describe("Rectangle height"),thickness:e().optional().describe("Extrusion depth 0–1")}),T=i({type:t("grid"),width:e().optional().describe("Grid total width"),height:e().optional().describe("Grid total height"),column:e().int().optional().describe("Number of columns"),row:e().int().optional().describe("Number of rows")}),G=c("type",[B,L,O,x,F,P,R,T]).describe("Particle emitter shape"),k=i({type:t("ApplyForce"),direction:a.describe("Force direction vector"),magnitude:r.describe("Force magnitude")}),z=i({type:t("ColorOverLife"),color:m.describe("Color curve over particle lifetime")}),E=i({type:t("SizeOverLife"),size:r.describe("Size curve over particle lifetime")}),A=i({type:t("SpeedOverLife"),speed:r.describe("Speed multiplier curve over lifetime")}),N=i({type:t("RotationOverLife"),angularVelocity:r.describe("Angular velocity in radians/sec")}),D=i({type:t("ForceOverLife"),x:r.describe("Force along X axis over lifetime"),y:r.describe("Force along Y axis over lifetime"),z:r.describe("Force along Z axis over lifetime")}),I=i({type:t("OrbitOverLife"),orbitSpeed:r.describe("Orbit speed over lifetime"),axis:a.optional().describe("Orbit axis. Defaults to [0, 1, 0]")}),V=i({type:t("Noise"),frequency:r.describe("Noise frequency"),power:r.describe("Noise amplitude"),positionAmount:r.optional().describe("Position displacement amount"),rotationAmount:r.optional().describe("Rotation displacement amount")}),H=i({type:t("TurbulenceField"),scale:a.describe("Turbulence field scale"),octaves:e().int().describe("Noise octave count"),velocityMultiplier:a.describe("Velocity multiplier per axis"),timeScale:a.describe("Time scale per axis")}),M=i({type:t("FrameOverLife"),frame:r.describe("Sprite sheet frame index over lifetime")}),W=i({type:t("LimitSpeedOverLife"),speed:r.describe("Maximum speed over lifetime"),dampen:e().describe("Damping factor when speed exceeds limit (0–1)")}),j=i({type:t("ChangeEmitDirection"),angle:r.describe("Angle deviation from original emit direction")}),q=i({type:t("GravityForce"),center:a.describe("Gravity center point"),magnitude:e().describe("Gravity force strength")}),U=i({type:t("WidthOverLength"),width:r.describe("Trail width over trail length")}),Y=c("type",[k,z,E,A,N,D,I,V,H,M,W,j,q,U]).describe("Particle behavior applied over lifetime"),X=s(["billboard","stretchedBillboard","mesh","trail","horizontalBillboard","verticalBillboard"]).describe("How particles are rendered"),Z=i({wrap:s(["clamp","repeat","mirror"]).optional().describe("How UVs outside [0,1] address the sprite image (three wrapS/wrapT)"),filter:s(["linear","nearest"]).optional().describe("Texel interpolation — nearest keeps a pixel-art sprite crisp"),mipmaps:o().optional().describe("Generate and sample a mip chain"),anisotropy:e().optional().describe("Anisotropic filtering samples, for sprites viewed at grazing angles")}).describe("Sprite texture sampler state"),_=i({type:s(["basic","standard"]).optional().describe("Particle material shading model"),color:p().optional().describe("Particle color as CSS hex string"),map:p().optional().describe("Path to particle sprite texture"),mapSampler:Z.optional().describe("Sampler state applied to the sprite texture named by `map`"),blending:s(["normal","additive"]).optional().describe("Blending mode (additive for glowing/fire effects)"),transparent:o().optional().describe("Enable transparency"),depthWrite:o().optional().describe("Write to depth buffer (disable for additive effects)"),side:s(["front","back","double"]).optional().describe("Which face sides to render")}).describe("Particle material settings"),J=i({time:e().describe("Time offset in seconds within the emission cycle"),count:r.describe("Number of particles to emit"),cycle:e().optional().describe("Burst repeat interval in seconds"),interval:e().optional().describe("Delay between burst repetitions"),probability:e().optional().describe("Chance of burst firing (0–1)")}).describe("Timed particle burst"),ne=i({autoDestroy:o().optional().describe("Destroy the particle system when all particles have died"),looping:o().optional().describe("Continuously emit particles"),prewarm:o().optional().describe("Simulate one full cycle on start so particles appear immediately"),duration:e().optional().describe("Total emission duration in seconds"),shape:G.optional().describe("Emitter shape that defines where particles spawn"),startLife:r.optional().describe("Initial particle lifetime in seconds"),startSpeed:r.optional().describe("Initial particle speed"),startSize:r.optional().describe("Initial particle size"),startRotation:r.optional().describe("Initial particle rotation in radians"),startColor:m.optional().describe("Initial particle color"),startLength:r.optional().describe("Initial trail length (trail render mode only)"),startTileIndex:r.optional().describe("Initial sprite sheet tile index"),emissionOverTime:r.optional().describe("Particles emitted per second"),emissionOverDistance:r.optional().describe("Particles emitted per unit of emitter movement"),emissionBursts:n(J).optional().describe("Timed burst emissions"),behaviors:n(Y).optional().describe("Behaviors applied to particles over their lifetime"),renderMode:X.optional().describe("How particles are rendered (billboard, trail, mesh, etc.)"),worldSpace:o().optional().describe("Simulate particles in world space instead of local space"),renderOrder:e().optional().describe("Render order for sorting (higher = rendered later)"),uTileCount:e().int().optional().describe("Horizontal tile count in sprite sheet"),vTileCount:e().int().optional().describe("Vertical tile count in sprite sheet"),blendTiles:o().optional().describe("Blend between sprite sheet tiles for smooth animation"),softParticles:o().optional().describe("Enable soft particle depth fading"),softFarFade:e().optional().describe("Far fade distance for soft particles"),softNearFade:e().optional().describe("Near fade distance for soft particles"),material:_.describe("Particle material settings")}).describe("Particle system configuration");export{Y as BehaviorSchema,m as ColorGeneratorSchema,G as EmitterShapeSchema,ne as ParticlesDescriptorSchema,X as RenderModeSchema,r as ValueGeneratorSchema};