@volter/game-editor 0.5.65 → 0.5.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BUNDLED_NOTICES +1962 -363
- package/catalog/entries/bake.json +0 -1
- package/catalog/entries/blender.json +2 -2
- package/catalog/entries/reflections.json +2 -4
- package/catalog/project-source/src/lib/bake/asset-seed.ts +1 -2
- package/catalog/project-source/src/lib/bake/clip-layering.ts +3 -4
- package/catalog/project-source/src/lib/bake/gltf-bake.ts +1 -1
- package/catalog/project-source/src/lib/bake/params.ts +3 -5
- package/catalog/project-source/src/lib/bake/rest-relative-animation.ts +2 -3
- package/dist/.vite/manifest.json +2406 -2182
- package/dist/assets/{AssetBudgetPanel-J9--TZPU.js → AssetBudgetPanel-csYWK2H4.js} +8 -8
- package/dist/assets/{AudioViewer-CR7333fe.js → AudioViewer-BH_LUYs5.js} +1 -1
- package/dist/assets/{BVHLoader-6bQIXhMX.js → BVHLoader-Jkzh8hMf.js} +1 -1
- package/dist/assets/BufferGeometryUtils-CAbuTPOA.js +1 -0
- package/dist/assets/{CCDIKSolver-CD7vLpsK.js → CCDIKSolver-D4NvkJ8d.js} +1 -1
- package/dist/assets/{CSS3DRenderer-CL7ABLVK.js → CSS3DRenderer-CAS2WZZy.js} +1 -1
- package/dist/assets/CanvasSceneViewport-BlsRTk-X.js +1 -0
- package/dist/assets/ColladaLoader-DxYB89DA.js +3 -0
- package/dist/assets/{ColorInput-DQBNrW-K.js → ColorInput-CPQNsDf1.js} +1 -1
- package/dist/assets/{ConvexGeometry-CAzXlPVG.js → ConvexGeometry-Dinf-sev.js} +1 -1
- package/dist/assets/{ConvexHull-BINCESFp.js → ConvexHull-CrJ8FY-w.js} +1 -1
- package/dist/assets/{DecalGeometry-160KRdfg.js → DecalGeometry-owkbefLa.js} +1 -1
- package/dist/assets/EffectComposer-BHDH-NLz.js +1 -0
- package/dist/assets/EntityModelDocument-DuQivdvc.js +1 -0
- package/dist/assets/EnvironmentAssetDocument-CnTEMn3A.js +1 -0
- package/dist/assets/FBXLoader-BMUbIhtE.js +1 -0
- package/dist/assets/Fbo-DrK7CWlB.js +1 -0
- package/dist/assets/{FontLoader-CvGoVI5a.js → FontLoader-BR_K6Baw.js} +2 -2
- package/dist/assets/GLTFExporter-BZqAQJbw.js +1 -0
- package/dist/assets/{GameplaySessionTimeline-B52W3FVZ.js → GameplaySessionTimeline-Crqwv2fP.js} +1 -1
- package/dist/assets/Gltf-7cVbZUzT.js +2 -0
- package/dist/assets/ImageViewer-BkFie7Hm.js +1 -0
- package/dist/assets/InspectorObjectPreview-Dl3tyJBn.js +1 -0
- package/dist/assets/JsonAssetDocument-BUFzubHM.js +2 -0
- package/dist/assets/{LineSegments2-CsOpKSiM.js → LineSegments2-Cicm_Hu1.js} +2 -2
- package/dist/assets/LiveModuleDocument-C3OQxiba.js +1 -0
- package/dist/assets/LutAssetDocument-DVzd1RZ9.js +1 -0
- package/dist/assets/{MTLLoader-_Xzd4_0p.js → MTLLoader-Bg_grNiT.js} +2 -2
- package/dist/assets/{MarchingCubes-Bsp4wrzd.js → MarchingCubes-a78AL3HB.js} +1 -1
- package/dist/assets/MeshBVH-BCSLNEeP.js +1 -0
- package/dist/assets/ModelAssetDocument-pN84goRT.js +1 -0
- package/dist/assets/{NonThreeAuthoringBootstrap-C3woOMxX.js → NonThreeAuthoringBootstrap-BKNejRiW.js} +1 -1
- package/dist/assets/{OBJLoader-BhIC6Hwo.js → OBJLoader-BiwzVj5b.js} +2 -2
- package/dist/assets/Object3DDocumentToolbar-D5Bg5FEf.js +1 -0
- package/dist/assets/Object3DDocumentViewport-DFHqru3a.js +2 -0
- package/dist/assets/Object3DPreview-BTtZ-41z.js +2 -0
- package/dist/assets/OnlineAssetDetail-BAqozdAp.js +1 -0
- package/dist/assets/{OrbitControls-DLpayAaK.js → OrbitControls-CzKVCORl.js} +1 -1
- package/dist/assets/{OrbitControls-CM3bPray.js → OrbitControls-CzTRRI7x.js} +1 -1
- package/dist/assets/{OrthographicCamera-bQozawrh.js → OrthographicCamera-CSDDsvu7.js} +1 -1
- package/dist/assets/{PLYLoader-DYQqs5Ik.js → PLYLoader-QxrxxMpE.js} +2 -2
- package/dist/assets/{PerspectiveCamera-CQ2lh01o.js → PerspectiveCamera-DzD_NfVh.js} +1 -1
- package/dist/assets/PlayBar-qVJpgwJt.js +2 -0
- package/dist/assets/QuarksAssetDocument-B4vBlUsS.js +2 -0
- package/dist/assets/RGBELoader-WQ7xZofE.js +1 -0
- package/dist/assets/RectAreaLightUniformsLib-CwcuoVqt.js +1 -0
- package/dist/assets/{RenderPass-DPrn-Uky.js → RenderPass-C_CeQNdh.js} +1 -1
- package/dist/assets/{ResolutionPicker-C67vs1F3.js → ResolutionPicker-DpHVJxn5.js} +1 -1
- package/dist/assets/RootSelectionOverlay-BxvsunO4.js +1 -0
- package/dist/assets/{RoundedBox-BDGBg6QZ.js → RoundedBox-B_cZ0NFy.js} +1 -1
- package/dist/assets/{RoundedBoxGeometry-CyUuYPfW.js → RoundedBoxGeometry-Y4rcSIvX.js} +1 -1
- package/dist/assets/STLLoader-Bej_Nkpr.js +1 -0
- package/dist/assets/{SelectionBox-D_75KrNW.js → SelectionBox-Cn9vm7f9.js} +1 -1
- package/dist/assets/ShaderAssetDocument-Dx2x8CLr.js +12 -0
- package/dist/assets/{ShaderPass-QYRpPuFJ.js → ShaderPass-qtkA7CQ8.js} +1 -1
- package/dist/assets/{ShadowEditor-DkImwu1Y.js → ShadowEditor-BEIUkrHL.js} +1 -1
- package/dist/assets/SimplifyModifier-D2EesGr2.js +1 -0
- package/dist/assets/{SkeletonUtils-Cps8GOC6.js → SkeletonUtils-C8ayciDc.js} +1 -1
- package/dist/assets/{Sky-CQKCgYDs.js → Sky-BBpnAJZV.js} +1 -1
- package/dist/assets/SourceAssetViewer-BpMbbuy6.js +1 -0
- package/dist/assets/StageHost-lB8f---y.js +2 -0
- package/dist/assets/{StoryPreviewMount-DjyxRCXu.js → StoryPreviewMount-BIfxmkYh.js} +1 -1
- package/dist/assets/{TDSLoader-D_T8XJ81.js → TDSLoader-rHl5Uwc0.js} +1 -1
- package/dist/assets/{TextGeometry-DOWAEUV0.js → TextGeometry-BRHSufuM.js} +1 -1
- package/dist/assets/ThreeBoardDocument-BHV92Ia3.js +2 -0
- package/dist/assets/{ThreeIsolationSceneContent-C8C8whSF.js → ThreeIsolationSceneContent-BqtgDHBK.js} +1 -1
- package/dist/assets/{ToolObject3DPreview-BRoDWe4Q.js → ToolObject3DPreview-CcaPJTyH.js} +1 -1
- package/dist/assets/Toolbar-keHcSvDD.js +1 -0
- package/dist/assets/{TrackballControls-DfznuQTh.js → TrackballControls-Cce-6Ff5.js} +1 -1
- package/dist/assets/{TransientHint-BB1fwrvK.js → TransientHint-Dlslh3oX.js} +1 -1
- package/dist/assets/{UnrealBloomPass-CR-cS_K5.js → UnrealBloomPass-DiseEiFK.js} +2 -2
- package/dist/assets/{VideoViewer-C6kocgIU.js → VideoViewer-naGSXHd6.js} +1 -1
- package/dist/assets/ViewportShadingMenu-C7Hdhtca.js +1 -0
- package/dist/assets/{active-ingest-CT6jSGhr.js → active-ingest-DEgq9JiA.js} +3 -3
- package/dist/assets/{animation-clock-CnjZqfJp.js → animation-clock-lTIb6nk3.js} +1 -1
- package/dist/assets/animation-mixers.service-2O2rVwQf.js +1 -0
- package/dist/assets/asset-budget-asset.menu-9NhdHAC9.js +1 -0
- package/dist/assets/asset-budget.action-yg6-luUJ.js +1 -0
- package/dist/assets/asset-budget.document-B46_VFqa.js +1 -0
- package/dist/assets/asset-budget.menu-DuH07N-e.js +1 -0
- package/dist/assets/{asset-editor-persistence-BBaONOJt.js → asset-editor-persistence-BVtzjadu.js} +1 -1
- package/dist/assets/{asset-loaders-BOy5Ss8k.js → asset-loaders-BxG1LykH.js} +2 -2
- package/dist/assets/{assets-BuSoGjBX.js → assets-Do88ZdV_.js} +1 -1
- package/dist/assets/{audio-unlock.service-CfUgUQVy.js → audio-unlock.service-BJH0mWvX.js} +1 -1
- package/dist/assets/{audio.utility-C6K6jem8.js → audio.utility-Cp4aVYFU.js} +1 -1
- package/dist/assets/autoplay.service-FxpRy7Ev.js +1 -0
- package/dist/assets/{babylon-authoring-adapter-CL02gWDn.js → babylon-authoring-adapter-B_8iE8fK.js} +1 -1
- package/dist/assets/{binding-resolver-Dsh-6Vor.js → binding-resolver-BWwG10zJ.js} +2 -2
- package/dist/assets/blender-emscripten-engine-CEsWgnR7.js +2 -0
- package/dist/assets/{blender-node-editor.document-iIDkB9sI.js → blender-node-editor.document-DTgwy8KC.js} +1 -1
- package/dist/assets/blender-properties-tab-DWSJpkxq.js +3 -0
- package/dist/assets/blender-runtime-host-OGjPjTrG.js +4 -0
- package/dist/assets/{blender-runtime-skin-DyQ9B6CR.js → blender-runtime-skin-DymtXlpt.js} +37 -39
- package/dist/assets/blender-runtime.document-CzH2ohHR.js +8 -0
- package/dist/assets/{blender-timeline.document-77fx96N7.js → blender-timeline.document-BRy_QPHt.js} +1 -1
- package/dist/assets/{blender-uv-editor.document-fsT7B4gV.js → blender-uv-editor.document-D-AbUCqz.js} +1 -1
- package/dist/assets/{blender-version.status-o6dBm3n6.js → blender-version.status-B7flzX_7.js} +1 -1
- package/dist/assets/{blender-wali-engine-wTOcrOMC.js → blender-wali-engine-D3iKpzn9.js} +1 -1
- package/dist/assets/blender.command-BVHtgTQy.js +1 -0
- package/dist/assets/blender.environment-CG-pC7sk.js +1 -0
- package/dist/assets/{blender.style-Dcem5f_T.js → blender.style-CxfbTFcE.js} +1 -1
- package/dist/assets/{board-guides-DziKSTss.js → board-guides-C3usUZZk.js} +1 -1
- package/dist/assets/body-marks-D8iaje6y.js +1 -0
- package/dist/assets/bridge.command-BF9u6r0A.js +3 -0
- package/dist/assets/browserAll-38aBu-cf.js +1 -0
- package/dist/assets/{build-profiles.document-kW8iw8Xj.js → build-profiles.document-DO7oNRuo.js} +2 -2
- package/dist/assets/{build-progress.status-BNRLytg2.js → build-progress.status-COeNVhYd.js} +1 -1
- package/dist/assets/{build-session-C_sg3CEn.js → build-session-IWIriS5P.js} +1 -1
- package/dist/assets/{build.action-lYjTLb7K.js → build.action-DlkFvZf6.js} +1 -1
- package/dist/assets/{build.command-DIGgUPU_.js → build.command-DPqQIYj_.js} +1 -1
- package/dist/assets/{build.header-CKajx5U3.js → build.header-CNLG-pV8.js} +1 -1
- package/dist/assets/{build.menu-BdU0QXny.js → build.menu-hUlH6loi.js} +1 -1
- package/dist/assets/{build.service-CbBAyeu3.js → build.service-C86Td3_9.js} +1 -1
- package/dist/assets/{camera-KEsKvOL7.js → camera-CKbyBXMe.js} +1 -1
- package/dist/assets/camera-authoring-Ci3KnE-W.js +1 -0
- package/dist/assets/{camera-runtime.inspector-B7unX4g1.js → camera-runtime.inspector-DdR3P2BF.js} +1 -1
- package/dist/assets/canvas-entry-runtime-E5YjSgre.js +2 -0
- package/dist/assets/canvas-preview-frames-CiAx7dpV.js +1 -0
- package/dist/assets/{capability-coverage-Czas4C18.js → capability-coverage-CfUeULDN.js} +5 -5
- package/dist/assets/city-EkhAOo5s.exr +0 -0
- package/dist/assets/{collaboration-presence-DLoZ7EA3.js → collaboration-presence-CSLFNT7m.js} +1 -1
- package/dist/assets/{collider-Bw0mXlsW.js → collider-DRSaLRM9.js} +1 -1
- package/dist/assets/{component-board.service-DCwcUssB.js → component-board.service-B7Sv8b7m.js} +2 -2
- package/dist/assets/component-board.service-B8UHw8dn.js +2 -0
- package/dist/assets/component-contracts.service-LFGekycZ.js +1 -0
- package/dist/assets/{component-verbs.command-7xzfjGMZ.js → component-verbs.command-D4SvFjfG.js} +1 -1
- package/dist/assets/component-verbs.service-TGvWxf2b.js +1 -0
- package/dist/assets/{config-CEZk921y.js → config-DB_RH-hO.js} +3 -3
- package/dist/assets/{configurations-DTBMdaTL.js → configurations-C2qgJNnW.js} +1 -1
- package/dist/assets/{connection.status-BifnQdOs.js → connection.status-CG7X2brL.js} +1 -1
- package/dist/assets/{console-bridge-CHcb-xk5.js → console-bridge-B5Ltae37.js} +1 -1
- package/dist/assets/{constraint-De8f1Uiq.js → constraint-C_Jj7dXy.js} +1 -1
- package/dist/assets/constraints.inspector-D6QZJS4b.js +1 -0
- package/dist/assets/courtyard-DqlebbpC.exr +0 -0
- package/dist/assets/coverage.service-Clo86874.js +3 -0
- package/dist/assets/{create-runtime-CVCc1BDx.js → create-runtime-lmA910XT.js} +1 -1
- package/dist/assets/{curve-7Q79VgU4.js → curve-6-TR6dNb.js} +1 -1
- package/dist/assets/{data-asset-4hjS642k.js → data-asset-BNbd309U.js} +1 -1
- package/dist/assets/{data-ref-CQI28C0D.js → data-ref-Dvmd7eb1.js} +1 -1
- package/dist/assets/{debug-bridge-CCohG-d-.js → debug-bridge-BUNhgyY6.js} +1 -1
- package/dist/assets/{debug-registry-Dgvitx8M.js → debug-registry-B3Cnne3x.js} +1 -1
- package/dist/assets/deferred-ingest-play-7V8OrW3e.js +2 -0
- package/dist/assets/design-time-layers-g9VS6amb.js +1 -0
- package/dist/assets/design-time-mount.service-HtMr_vBd.js +2 -0
- package/dist/assets/design-time-react-mount-Dx6fJ-Hg.js +1 -0
- package/dist/assets/{directional-shadow-fit-BVkOKAv2.js → directional-shadow-fit-Cjz_Eg2b.js} +1 -1
- package/dist/assets/{document-preview-three-Kbg2GCLm.js → document-preview-three-C3y0syYQ.js} +1 -1
- package/dist/assets/{dom-authoring-adapter-CY8C7f4T.js → dom-authoring-adapter-CEeFyatF.js} +1 -1
- package/dist/assets/{draco3d-BBUTcNkz.js → draco3d-FKy0apkb.js} +1 -1
- package/dist/assets/drei-asset-caches-jJoHXbTj.js +2 -0
- package/dist/assets/{edit-mode-audio.service-Bzetwd5B.js → edit-mode-audio.service-DZTnrW6t.js} +1 -1
- package/dist/assets/edit-mode-authoring-D_BiHCQj.js +1 -0
- package/dist/assets/{edit-mode-networking.service-YCX6RRb_.js → edit-mode-networking.service-BzMI2VxO.js} +1 -1
- package/dist/assets/editor-api-Bzmo0o8_.js +1 -0
- package/dist/assets/{entry-adjudication-Cq8Yeb74.js → entry-adjudication-BYy7TXOB.js} +1 -1
- package/dist/assets/{events-156d8d12.esm-ErOhDXXB.js → events-156d8d12.esm-C734MYnx.js} +7 -7
- package/dist/assets/{extend-B-eOccUm.js → extend-CLG0ymiX.js} +1 -1
- package/dist/assets/forest-P_CQY3b_.exr +0 -0
- package/dist/assets/fork-menu-De7HU6_H.js +1 -0
- package/dist/assets/{frame-debugger-store-D1Mf_5up.js → frame-debugger-store-BZgIOlU6.js} +1 -1
- package/dist/assets/{game-DHOZVb-7.js → game-D5EJoILQ.js} +1 -1
- package/dist/assets/{game-contract-seams-a5YXejOu.js → game-contract-seams-TCpIMmHP.js} +1 -1
- package/dist/assets/{game-css-scope-transform-Eng4wS8E.js → game-css-scope-transform-NbpajQr-.js} +1 -1
- package/dist/assets/game-document.service-6eRlrI-d.js +1 -0
- package/dist/assets/game-eval.command-hKnSMlX0.js +2 -0
- package/dist/assets/{game-input-seams-CIQdetRw.js → game-input-seams-BC6xhZy3.js} +1 -1
- package/dist/assets/{game-module-access-B2mFxv-i.js → game-module-access-ry3xb1Ix.js} +1 -1
- package/dist/assets/{gameplay-export-BoKXm51x.js → gameplay-export-DiLQuPpn.js} +1 -1
- package/dist/assets/gameplay-replay-Bsre-1K8.js +1 -0
- package/dist/assets/{gameplay-rng-trap-CTNhm-UW.js → gameplay-rng-trap-BhRx_CtU.js} +1 -1
- package/dist/assets/gameplay.command-BqiyGn-I.js +1 -0
- package/dist/assets/{generation-jobs-BQrXbGp_.js → generation-jobs-BYcpgeGk.js} +1 -1
- package/dist/assets/generation.service-O81IqA-6.js +1 -0
- package/dist/assets/{generations-DzUogZsM.js → generations-CsGQ3twi.js} +1 -1
- package/dist/assets/{generations.status-CgOUBCum.js → generations.status-C3YU0_ml.js} +1 -1
- package/dist/assets/godot.style-DxJaFWOP.js +1 -0
- package/dist/assets/godot.view-BFsHk8b2.js +1 -0
- package/dist/assets/{hosted-asset-materialization-CiIvWkGU.js → hosted-asset-materialization-Bk-plQF6.js} +2 -2
- package/dist/assets/{ibl-override-material-BlmCxFKq.js → ibl-override-material-BhbGwgS1.js} +1 -1
- package/dist/assets/{index-mjWQmGhM.js → index-0n9eSzwT.js} +1 -1
- package/dist/assets/index-B4bmKkgY.css +1 -0
- package/dist/assets/index-BLo2LE8C.js +3404 -0
- package/dist/assets/index-BWW4-DBH.js +1 -0
- package/dist/assets/index-CLcsjKUs.js +1 -0
- package/dist/assets/index-CU5YUq-x.js +134 -0
- package/dist/assets/{index-DUpHH6JR.js → index-Cb6o_Td_.js} +1 -1
- package/dist/assets/index-Ckxb31Yz.js +1500 -0
- package/dist/assets/index-CnpsJMao.js +1 -0
- package/dist/assets/index-Cr23XhNm.js +1 -0
- package/dist/assets/index-DO1rWQ_r.js +487 -0
- package/dist/assets/{index-BcCBqgM_.js → index-DUh02lTr.js} +1 -1
- package/dist/assets/index-DXEHfb0b.js +1 -0
- package/dist/assets/{index-V1R-e5Bd.js → index-wRCvCebM.js} +1 -1
- package/dist/assets/{inference-diagnostics-Dhmtfbq_.js → inference-diagnostics-YW0yJkKx.js} +1 -1
- package/dist/assets/{ingest-BbYMC2vQ.js → ingest-BlQnR7s3.js} +1 -1
- package/dist/assets/ingest-boot-viewport-uG9jQ1zm.js +1 -0
- package/dist/assets/ingest-siblings-DRQXSWax.js +1 -0
- package/dist/assets/{ingest-source-persistence-C_6Hiyra.js → ingest-source-persistence-DH6ioCOu.js} +1 -1
- package/dist/assets/{ingest.service-BTDnQfM1.js → ingest.service-GeaWMaZX.js} +1 -1
- package/dist/assets/{input-manager-DH_hGW6d.js → input-manager-Cxx3RJgG.js} +1 -1
- package/dist/assets/{input-router-BNQvtIqw.js → input-router-FzxO5ld6.js} +1 -1
- package/dist/assets/{inspect-BZfi3mmo.js → inspect-BRgDdtVk.js} +1 -1
- package/dist/assets/instances.command-CFOMPSj3.js +1 -0
- package/dist/assets/{instruments-CKR02Y8I.js → instruments-IKn-vvNb.js} +1 -1
- package/dist/assets/interior-Bo_lba15.exr +0 -0
- package/dist/assets/{json-history-resource-BbxllWfV.js → json-history-resource-r-9q_hxP.js} +1 -1
- package/dist/assets/{light-D-_wsKTq.js → light-CFAor97k.js} +1 -1
- package/dist/assets/light-camera-factory-D1sgz3YB.js +1 -0
- package/dist/assets/live-mixers-BRkRHd6g.js +1 -0
- package/dist/assets/{loader-CaF_I7Yt.js → loader-BbMsvIxP.js} +1 -1
- package/dist/assets/machine.document-CgmsOh-s.js +24 -0
- package/dist/assets/machines.finder-nxiCgQc2.js +1 -0
- package/dist/assets/matcap-texture-Dh65bX5V.js +1 -0
- package/dist/assets/{material-CpAdjDxn.js → material-D5kXEZWQ.js} +1 -1
- package/dist/assets/{material-factory-Bz6h__6g.js → material-factory-0Qb0VuZ5.js} +1 -1
- package/dist/assets/material-preview.view-DqNcpd_b.js +1 -0
- package/dist/assets/{mesh-B3WPtNKO.js → mesh-BKPgNTwh.js} +1 -1
- package/dist/assets/{mesh-shadow-CZnXrw_l.js → mesh-shadow-BDQP4mHs.js} +1 -1
- package/dist/assets/model-asset-sections.service-DWPLmkqa.js +1 -0
- package/dist/assets/model-inspection-Cxfg_Fei.js +1 -0
- package/dist/assets/model.layout-BpZE1W9V.js +1 -0
- package/dist/assets/{models.finder-G2jQgIRu.js → models.finder-DHW17ZEa.js} +1 -1
- package/dist/assets/module-mode-CRfHyIMS.js +2 -0
- package/dist/assets/mount-canvas-ingest-root-BZZ8M3Lu.js +2 -0
- package/dist/assets/mount-dom-ingest-root-D1GV6Jjt.js +2 -0
- package/dist/assets/{mount-game-6t9cKNo4.js → mount-game-F9e76auh.js} +1 -1
- package/dist/assets/mount-ingest-root-B5D-Lmmk.js +2 -0
- package/dist/assets/{mount-manifest-CGVxhmAw.js → mount-manifest-cYRhgHfo.js} +1 -1
- package/dist/assets/mount-three-ingest-root-BNnouaBn.js +1 -0
- package/dist/assets/{mounted-authoring-Dmg5xmhP.js → mounted-authoring-TIN5EnCb.js} +1 -1
- package/dist/assets/{mounted-story-viewport-source-DjP6RA9U.js → mounted-story-viewport-source-CAlEmE0_.js} +1 -1
- package/dist/assets/{native-debug-module-CWicoSGD.js → native-debug-module-j-MekcLS.js} +1 -1
- package/dist/assets/{navigation-CIiCx-SM.js → navigation-DmR1BDVo.js} +1 -1
- package/dist/assets/{navmesh.menu-CAKiH8PW.js → navmesh.menu-FhL1pGx1.js} +1 -1
- package/dist/assets/{navmesh.service-jgDWlgj1.js → navmesh.service-usyDeJlm.js} +1 -1
- package/dist/assets/{network.utility-CEu5nHf7.js → network.utility-BPh4hTmh.js} +1 -1
- package/dist/assets/night-CvV4Gybt.exr +0 -0
- package/dist/assets/{object3d-authoring-subject-CH5sI2oP.js → object3d-authoring-subject-CyE4rQ2A.js} +1 -1
- package/dist/assets/oid-transform-BOqL6YH6.js +2 -0
- package/dist/assets/{particles-Y626p22p.js → particles-C47L-dda.js} +1 -1
- package/dist/assets/particles-factory-CRqPLdS7.js +1 -0
- package/dist/assets/pixi-authoring-adapter-C5Ikqj5-.js +1 -0
- package/dist/assets/{pixi-live-write-target-DuWydlWb.js → pixi-live-write-target-OWBk79dp.js} +1 -1
- package/dist/assets/pixi-primitive-D5igywJ_.js +1 -0
- package/dist/assets/pixi-react-root-factory-9lZ0Yz-n.js +1 -0
- package/dist/assets/play-mode-DomOvQie.js +22 -0
- package/dist/assets/play.command-DoqjH-Pp.js +2 -0
- package/dist/assets/{playtest-BXIL1JEF.js → playtest-BnFenMBW.js} +1 -1
- package/dist/assets/{pose-guard-6Osb2cFu.js → pose-guard-Bb3gZOzk.js} +1 -1
- package/dist/assets/{product-DFhyARJj.js → product-CTDJoVo5.js} +1 -1
- package/dist/assets/{profiler.action-CaXJDp3t.js → profiler.action-C_OFGkDw.js} +1 -1
- package/dist/assets/{profiler.menu-BIMF6Bi4.js → profiler.menu-BJbnVoo4.js} +1 -1
- package/dist/assets/{profiler.utility-BExw9wBO.js → profiler.utility-qpfhuwRw.js} +1 -1
- package/dist/assets/project-authoring-session-BV-MM8Fl.js +2 -0
- package/dist/assets/{project-provenance-BoP3nrle.js → project-provenance-4ldz-EOG.js} +1 -1
- package/dist/assets/{properties-bone-constraints.inspector-ByT6p7S-.js → properties-bone-constraints.inspector-C-ByIdg1.js} +1 -1
- package/dist/assets/{properties-bone.inspector-z4qJwKO5.js → properties-bone.inspector-CXY0xCQB.js} +1 -1
- package/dist/assets/{properties-collection.inspector-D0_3ijWU.js → properties-collection.inspector-DIfkZAel.js} +1 -1
- package/dist/assets/{properties-constraints.inspector-CESzjuls.js → properties-constraints.inspector-BaunL5nT.js} +1 -1
- package/dist/assets/{properties-data.inspector-hG8Wgyzb.js → properties-data.inspector-DQD-jfO2.js} +1 -1
- package/dist/assets/{properties-material.inspector-CzY0JCQ6.js → properties-material.inspector-A0HZ4SX6.js} +1 -1
- package/dist/assets/{properties-modifiers.inspector-3dDhwf7g.js → properties-modifiers.inspector-GUnVhVwZ.js} +1 -1
- package/dist/assets/{properties-object.inspector-CiarfxkT.js → properties-object.inspector-Chsfa4Xa.js} +1 -1
- package/dist/assets/{properties-output.inspector-DKJxmKSD.js → properties-output.inspector-U7ZmD0Me.js} +1 -1
- package/dist/assets/{properties-particles.inspector-CCEdYWGm.js → properties-particles.inspector-umkW-OlI.js} +1 -1
- package/dist/assets/{properties-physics.inspector-B2c0KUyA.js → properties-physics.inspector-CLVBlWwL.js} +1 -1
- package/dist/assets/{properties-render.inspector-Bcm0HLRW.js → properties-render.inspector-D0u9taKy.js} +1 -1
- package/dist/assets/{properties-scene.inspector-PIM_eTb_.js → properties-scene.inspector-JwGCZQAx.js} +1 -1
- package/dist/assets/{properties-texture.inspector-CgFlnyr8.js → properties-texture.inspector-B1vC28pw.js} +1 -1
- package/dist/assets/{properties-view-layer.inspector-DGjF_Aqo.js → properties-view-layer.inspector-BuUKyBFp.js} +1 -1
- package/dist/assets/{properties-world.inspector-CrMvaRvB.js → properties-world.inspector-VXUj4dT4.js} +1 -1
- package/dist/assets/r3f-design-session-qJ2v5SrB.js +2 -0
- package/dist/assets/r3f-physics-binding-C8OqNRG2.js +1 -0
- package/dist/assets/{r3f-root-factory-z9llD1OU.js → r3f-root-factory-DjGnbU4n.js} +1 -1
- package/dist/assets/r3f-source-authoring-adapter-CG9heazM.js +12 -0
- package/dist/assets/{rapier-physics-bridge-CMoeVo3Y.js → rapier-physics-bridge-B-EK7KYV.js} +1 -1
- package/dist/assets/react-inspector.service-DWeXDHJq.js +1 -0
- package/dist/assets/{react-root-CEz5NTck.js → react-root-DGLRLr-F.js} +1 -1
- package/dist/assets/react-story-board-CSqHY0Cg.js +1 -0
- package/dist/assets/{react-three-fiber.esm-CycrbDlA.js → react-three-fiber.esm-BxIoqVh1.js} +1 -1
- package/dist/assets/{react-three-rapier.esm-CEfKpvxT.js → react-three-rapier.esm-BYzLhdSV.js} +1 -1
- package/dist/assets/react-world-authoring-adapter-BMT9kLWU.js +1 -0
- package/dist/assets/{realm-services-CobQsq_X.js → realm-services-D25JHoqD.js} +1 -1
- package/dist/assets/{reflection-probe-Don-M3Fj.js → reflection-probe-CqXWlicu.js} +1 -1
- package/dist/assets/{reflection-probe-capture.inspector-CmFUoJCx.js → reflection-probe-capture.inspector-B7Qa30vB.js} +1 -1
- package/dist/assets/regions-DWeEBnE2.js +1 -0
- package/dist/assets/{register-render-vitals-BiZk29b2.js → register-render-vitals-BO7x64kR.js} +1 -1
- package/dist/assets/{registry-02YZjMNp.js → registry-DlTluc4x.js} +1 -1
- package/dist/assets/{render-audio-control-vMRlePWb.js → render-audio-control-DCa_bOBI.js} +1 -1
- package/dist/assets/{render-batch-system-0vq7p0VC.js → render-batch-system-CzCp9YKM.js} +1 -1
- package/dist/assets/{render-control-Df3yTiyr.js → render-control-BNQr1eNO.js} +1 -1
- package/dist/assets/{render-env-D2IV2x5k.js → render-env-emvlfeTG.js} +1 -1
- package/dist/assets/{render-features-CPQ_e568.js → render-features-COF7MSQ9.js} +1 -1
- package/dist/assets/{render-settings-Bw4W9SYF.js → render-settings-C_kIMq8Y.js} +1 -1
- package/dist/assets/{resolve-three-SZE_WWUM.js → resolve-three-C-nx-QdA.js} +13 -13
- package/dist/assets/{root-seam-contract-Z0VWX3Bk.js → root-seam-contract-C7GOxf5x.js} +1 -1
- package/dist/assets/{run-ticks-settled-C4ksViyA.js → run-ticks-settled-B0cTtmhQ.js} +1 -1
- package/dist/assets/{scene-capture-CGYF-Viw.js → scene-capture-CLOc7GXc.js} +1 -1
- package/dist/assets/{scene-capture-BQKzU0NT.js → scene-capture-D10Nxkvp.js} +1 -1
- package/dist/assets/scene-document.service-B7kAVTko.js +2 -0
- package/dist/assets/{scene-framing-Cat0GtyJ.js → scene-framing-50N7SKuX.js} +1 -1
- package/dist/assets/{scene-index-B6BZOHMk.js → scene-index-Bce459yu.js} +1 -1
- package/dist/assets/{scene-query-C7_N-TpI.js → scene-query-IUZhw6pA.js} +1 -1
- package/dist/assets/{schema-kl9-2B_J.js → schema-Iy-mbzll.js} +1 -1
- package/dist/assets/sculpt.layout-D-K5cLw6.js +1 -0
- package/dist/assets/{seeded-random-i3mtgBKZ.js → seeded-random-CN0scLZj.js} +1 -1
- package/dist/assets/{session-CZ5JPg-z.js → session-CsR0lApe.js} +24 -15
- package/dist/assets/{setup-audio-S8GQF91f.js → setup-audio-BJ18gvXZ.js} +1 -1
- package/dist/assets/setup-particles-B6H-GbAA.js +1 -0
- package/dist/assets/{setup-physics-BeZ7-LKD.js → setup-physics-GugbTT0J.js} +1 -1
- package/dist/assets/{setup-renderer-DVXaSGin.js → setup-renderer-wt_a-p8r.js} +20 -20
- package/dist/assets/shading.layout-CZZHKBer.js +1 -0
- package/dist/assets/{sim-clock-CLflx7kg.js → sim-clock-DEfbb_-P.js} +1 -1
- package/dist/assets/{soft-particle-depth-DGvfQDi1.js → soft-particle-depth-CKUS1j0Y.js} +1 -1
- package/dist/assets/source-object3d-authoring-adapter-CfHQLFAL.js +1 -0
- package/dist/assets/{source-persistence-backend-C-aR-B_Y.js → source-persistence-backend-_-JMEXxE.js} +1 -1
- package/dist/assets/{spark-renderer-lifecycle-ynWESJcv.js → spark-renderer-lifecycle-9mnMW3Z4.js} +1 -1
- package/dist/assets/{spark.module-4pXQoz5d.js → spark.module-CXth-y_a.js} +1 -1
- package/dist/assets/stage-keyboard-C0FdDLOQ.js +1 -0
- package/dist/assets/stage-overlay-set-CwhCzbOy.js +1 -0
- package/dist/assets/stage-presence-markers-DVMDKiB-.js +1 -0
- package/dist/assets/stage-transform-tools-B09Z7v0o.js +1 -0
- package/dist/assets/standard-viewport-dressing-GUUr6GuK.js +20 -0
- package/dist/assets/{state-watch.action-BOvQR2qt.js → state-watch.action-CgF8qoFC.js} +1 -1
- package/dist/assets/{state-watch.menu-CNLvDeeY.js → state-watch.menu-CIMncESW.js} +1 -1
- package/dist/assets/{state-watch.utility-Bg1tTTQU.js → state-watch.utility-zTHkUALC.js} +1 -1
- package/dist/assets/static-batch-advisor-DqfXWRUq.js +1 -0
- package/dist/assets/story-capture-COQgezzl.js +1 -0
- package/dist/assets/story-documents-DQ0KORmd.js +3 -0
- package/dist/assets/story-documents.service-DOSaqPqv.js +1 -0
- package/dist/assets/story-documents.service-Gb7oUkbg.js +1 -0
- package/dist/assets/{story-media-presence-BHzk2IV5.js → story-media-presence-nW3zJqKv.js} +1 -1
- package/dist/assets/story-pixi-preview-COPTEsHo.js +1 -0
- package/dist/assets/story-presentation-CxADj5oz.js +1 -0
- package/dist/assets/{story-three-preview-BHEDZzcl.js → story-three-preview-C9W__8Or.js} +2 -2
- package/dist/assets/{structural-ids-Dc-7rEwi.js → structural-ids-CblajJQK.js} +1 -1
- package/dist/assets/studio-CysTBGIb.exr +0 -0
- package/dist/assets/sunrise-Dj0psFrf.exr +0 -0
- package/dist/assets/sunset-Bw3x2Bot.exr +0 -0
- package/dist/assets/{surface-state-DaxyruCj.js → surface-state-BAUJu6GY.js} +1 -1
- package/dist/assets/{system-runner-DkOjxEBt.js → system-runner-D_DtVrer.js} +1 -1
- package/dist/assets/team-playtest.service--79O6xkx.js +1 -0
- package/dist/assets/{three-CDSueJyJ.js → three-DSsr_Lvp.js} +1 -1
- package/dist/assets/{three-authoring-adapter-CmSQ3Vui.js → three-authoring-adapter-Yqsank46.js} +1 -1
- package/dist/assets/three-authoring.service-BDos-bRt.js +2 -0
- package/dist/assets/{three-ingest-runtime-QzDYk6tU.js → three-ingest-runtime-DWijtqQ8.js} +1 -1
- package/dist/assets/{three-projection-core-BmKMZ-nf.js → three-projection-core-kubBTx0s.js} +1 -1
- package/dist/assets/three-story-model-BraQFA9h.js +1 -0
- package/dist/assets/three-viewport-presentation-BL7Uc2i6.js +1 -0
- package/dist/assets/{three.module-D396a9Mn.js → three.module-IFn-4i31.js} +1 -1
- package/dist/assets/three.quarks.esm-CRKGjKAH.js +1039 -0
- package/dist/assets/transform-mode-request-Cu7ewbtr.js +1 -0
- package/dist/assets/{transform-writer-BhBBTx33.js → transform-writer-DXxrI4t7.js} +1 -1
- package/dist/assets/transport.header-CeND8Vzh.js +1 -0
- package/dist/assets/{trigger-volume-BNK2XzPL.js → trigger-volume-BCVRS3NM.js} +1 -1
- package/dist/assets/{tuples-CIQ4Bn1U.js → tuples-DKDGrN1t.js} +1 -1
- package/dist/assets/ui-board-document-DD2CAEAo.js +2 -0
- package/dist/assets/unity.style-vCmLw4gI.js +1 -0
- package/dist/assets/unity.view-DIn2S6Do.js +1 -0
- package/dist/assets/unreal.style-BQn-HhOX.js +1 -0
- package/dist/assets/unreal.view-adNBETZK.js +1 -0
- package/dist/assets/user-data-CZqsJDk-.js +1 -0
- package/dist/assets/{utility-view-state-BHypxA33.js → utility-view-state-DYJY8V8O.js} +1 -1
- package/dist/assets/uv-editing.layout-A8RA-cbM.js +1 -0
- package/dist/assets/{vgai-shared-three-Bc5PvpLM.js → vgai-shared-three-D_RAEumG.js} +1 -1
- package/dist/assets/{viewport-root-presentation-CWsE56K6.js → viewport-root-presentation-C9M98VNM.js} +1 -1
- package/dist/assets/{viewport-shading-BuA88e_A.js → viewport-shading-BzcvgJhK.js} +1 -1
- package/dist/assets/viewport-shading-boundary-CBvvzS-p.js +84 -0
- package/dist/assets/{viewport-surface-status-B3om4Kcf.js → viewport-surface-status-BFmnWp7z.js} +1 -1
- package/dist/assets/voxel-surface-ROWYug7H.js +1 -0
- package/dist/assets/webgl-frame-capture-CRKX73E9.js +1 -0
- package/dist/assets/webworkerAll-CehoCtFb.js +1 -0
- package/dist/assets/{worker-UrMcrc5_.js → worker-B7zhIsFh.js} +2 -2
- package/dist/assets/world-documents-DErHq15h.js +1 -0
- package/dist/assets/world-root-stage-binding-BIymcQ4K.js +1 -0
- package/dist/assets/{world-state-BWG-IcOd.js → world-state-ZGDGY_Xl.js} +1 -1
- package/dist/assets/{writer-B-KovzkA.js → writer-BPbm4_my.js} +5 -5
- package/dist/assets/xstate-animation-binding-Cvd4JbEY.js +1 -0
- package/dist/assets/{xstate-animation-meta-Q3u9zh_m.js → xstate-animation-meta-B3OZR8Q2.js} +1 -1
- package/dist/vgai-shared-three.json +1 -1
- package/dist-node/cli.js +317 -73
- package/dist-node/create.js +59 -19
- package/package.json +16 -13
- package/src/index.ts +6 -0
- package/template/.agents/skills/vgai-3d-models/SKILL.md +3 -3
- package/template/.agents/skills/vgai-threejs-authoring/SKILL.md +4 -9
- package/template/.claude/skills/vgai-3d-models/SKILL.md +3 -3
- package/template/.claude/skills/vgai-threejs-authoring/SKILL.md +4 -9
- package/template/.github/skills/vgai-3d-models/SKILL.md +3 -3
- package/template/.github/skills/vgai-threejs-authoring/SKILL.md +4 -9
- package/template/AGENTS.md +1 -1
- package/template/check-idioms.ts +4 -5
- package/template/package.json +9 -9
- package/template/tsconfig.json +1 -0
- package/template/vgai.adapter.ts +1 -0
- package/template-dotfiles/gitignore +2 -0
- package/workbench/src/media/game-cover.css +1 -1
- package/catalog/project-source/src/lib/bake/mesh-slice.ts +0 -157
- package/dist/assets/BufferGeometryUtils-Nz37EVXf.js +0 -1
- package/dist/assets/CanvasSceneViewport-Bpi6gVTC.js +0 -1
- package/dist/assets/ColladaLoader-aVOPIsCh.js +0 -3
- package/dist/assets/EXRLoader-Cdans_oJ.js +0 -1
- package/dist/assets/EffectComposer-DQxfsXBZ.js +0 -1
- package/dist/assets/EntityModelDocument-Ccvw66N9.js +0 -1
- package/dist/assets/EnvironmentAssetDocument-Dg-Qq6O6.js +0 -1
- package/dist/assets/FBXLoader-B4MoUtAn.js +0 -1
- package/dist/assets/Fbo-Dz-Soul3.js +0 -1
- package/dist/assets/GLTFExporter-HgrCle4L.js +0 -1
- package/dist/assets/Gltf-UHVWKz65.js +0 -2
- package/dist/assets/HDRLoader-THU88oVD.js +0 -5
- package/dist/assets/ImageViewer-Tn7s_MnW.js +0 -1
- package/dist/assets/InspectorObjectPreview-CVejvLRg.js +0 -1
- package/dist/assets/JsonAssetDocument-C7VGcLhu.js +0 -3
- package/dist/assets/MeshBVH-BiDHDcu-.js +0 -1
- package/dist/assets/ModelAssetDocument-F5GACirk.js +0 -1
- package/dist/assets/Object3DDocumentViewport-DB7T0NTl.js +0 -2
- package/dist/assets/Object3DPreview-DL8oi7Xs.js +0 -2
- package/dist/assets/OnlineAssetDetail-C6z9RvYK.js +0 -2
- package/dist/assets/PlayBar-BR-Vg3Jb.js +0 -2
- package/dist/assets/RGBELoader-BgBcQv8j.js +0 -1
- package/dist/assets/RectAreaLightUniformsLib-CMMoWfll.js +0 -1
- package/dist/assets/RootSelectionOverlay-BZPlxmXU.js +0 -1
- package/dist/assets/STLLoader-Dyv3lsxY.js +0 -1
- package/dist/assets/SimplifyModifier-C8ayvRzd.js +0 -1
- package/dist/assets/SourceAssetViewer-2SWQoUut.js +0 -12
- package/dist/assets/StageHost-BN-IoTef.js +0 -2
- package/dist/assets/ThreeBoardDocument-CVncZyIq.js +0 -2
- package/dist/assets/asset-budget-asset.menu-Di3KiQCd.js +0 -1
- package/dist/assets/asset-budget.action-DCzzcuTh.js +0 -1
- package/dist/assets/asset-budget.document-BWU8wnVW.js +0 -1
- package/dist/assets/asset-budget.menu-BGZpT_31.js +0 -1
- package/dist/assets/autoplay.service-BZBGNSvt.js +0 -1
- package/dist/assets/blender-emscripten-engine-9ZIRYNhe.js +0 -2
- package/dist/assets/blender-properties-tab-C5CyPydi.js +0 -3
- package/dist/assets/blender-runtime-host-BpBwGv7r.js +0 -4
- package/dist/assets/blender-runtime.document-lIYhhPtv.js +0 -8
- package/dist/assets/blender.command-BtJeWk-A.js +0 -1
- package/dist/assets/body-marks-h_xDxiDE.js +0 -1
- package/dist/assets/bridge.command-o5gDNEwa.js +0 -3
- package/dist/assets/browserAll-DeWblVez.js +0 -1
- package/dist/assets/canvas-entry-runtime-SfBxaR9M.js +0 -2
- package/dist/assets/component-board.service-DidCyM4O.js +0 -2
- package/dist/assets/component-verbs.service-Bv9jId3q.js +0 -1
- package/dist/assets/constraints.inspector-B9U9Yj-u.js +0 -1
- package/dist/assets/coverage.service-VTX5Mcsx.js +0 -3
- package/dist/assets/deferred-ingest-play-DCJi_Pgu.js +0 -2
- package/dist/assets/design-time-layers-wYgOTgni.js +0 -1
- package/dist/assets/design-time-mount.service-BzY21e1F.js +0 -2
- package/dist/assets/design-time-react-mount-DM9WLrF2.js +0 -1
- package/dist/assets/edit-mode-authoring-B47TfLqu.js +0 -1
- package/dist/assets/editor-api-BoJIcyZG.js +0 -1
- package/dist/assets/fflate.module-DPuTF8aG.js +0 -6
- package/dist/assets/fork-menu-BoVyw2Wu.js +0 -1
- package/dist/assets/game-document.service-DbRfx2V0.js +0 -1
- package/dist/assets/game-eval.command-D-7Dxbj_.js +0 -2
- package/dist/assets/gameplay-replay-e5umMlXv.js +0 -1
- package/dist/assets/gameplay.command-DxcVYX6F.js +0 -1
- package/dist/assets/generation.service-CDIgObuw.js +0 -1
- package/dist/assets/index-96FBF1Oj.js +0 -1
- package/dist/assets/index-BAWkB0dv.js +0 -1
- package/dist/assets/index-BDnS2b6S.js +0 -1
- package/dist/assets/index-BjTCPEQ7.js +0 -134
- package/dist/assets/index-CVCb_ImQ.js +0 -1
- package/dist/assets/index-CZd9o7Lu.js +0 -1
- package/dist/assets/index-D2fNXpHa.css +0 -1
- package/dist/assets/index-GIL7oGEO.js +0 -4894
- package/dist/assets/index-OrYXPk3Z.js +0 -487
- package/dist/assets/ingest-boot-viewport-D5rI_Kk_.js +0 -1
- package/dist/assets/ingest-siblings-Bop2kqVl.js +0 -1
- package/dist/assets/instances.command-D6UkZNO8.js +0 -1
- package/dist/assets/light-camera-factory-CWbbe9gI.js +0 -1
- package/dist/assets/live-behaviors-Bxq49Maz.js +0 -1
- package/dist/assets/matcap-texture-CVfalpWT.js +0 -1
- package/dist/assets/model-asset-sections.service-CHhFS3ZX.js +0 -1
- package/dist/assets/model.layout-BJUEQYUI.js +0 -1
- package/dist/assets/module-mode-DVBLT9d-.js +0 -2
- package/dist/assets/mount-canvas-ingest-root-DDuAWf_C.js +0 -2
- package/dist/assets/mount-dom-ingest-root-D_EiBgpn.js +0 -2
- package/dist/assets/mount-ingest-root-glv2SSWf.js +0 -2
- package/dist/assets/mount-three-ingest-root-hrUt9VVU.js +0 -1
- package/dist/assets/particles-factory-DnLOHXT8.js +0 -1
- package/dist/assets/pasteboard-materialize-BqSS4QzV.js +0 -20
- package/dist/assets/pasteboard.action-DU3UHtJG.js +0 -2
- package/dist/assets/pixi-authoring-adapter-CjibysC3.js +0 -1
- package/dist/assets/pixi-primitive-DlWbUPN9.js +0 -1
- package/dist/assets/pixi-react-root-factory-DYsznYRQ.js +0 -1
- package/dist/assets/play-mode-BFU2PCkG.js +0 -22
- package/dist/assets/play.command-BpqqLqkq.js +0 -2
- package/dist/assets/project-authoring-session-Bnt6icLr.js +0 -2
- package/dist/assets/r3f-design-session-D-4yyDO9.js +0 -2
- package/dist/assets/r3f-physics-binding-BBo8oma9.js +0 -1
- package/dist/assets/r3f-source-authoring-adapter-w6Bc60K-.js +0 -13
- package/dist/assets/react-inspector.service-B_neRnSK.js +0 -1
- package/dist/assets/react-story-board-BDDwiE2H.js +0 -1
- package/dist/assets/react-world-authoring-adapter-DmrwM3py.js +0 -1
- package/dist/assets/runtime-inspection-l2iFQSsg.js +0 -1
- package/dist/assets/scene-document.service-qkDjUrlP.js +0 -2
- package/dist/assets/sculpt.layout-zJF55yCR.js +0 -1
- package/dist/assets/setup-particles-GCXlnkj_.js +0 -1
- package/dist/assets/shading.layout-DULYZV6M.js +0 -1
- package/dist/assets/source-object3d-authoring-adapter-B-L6Ha6f.js +0 -1
- package/dist/assets/stage-invalidation-DBg3C3Ta.js +0 -1
- package/dist/assets/stage-keyboard-n-5kKH-m.js +0 -1
- package/dist/assets/stage-overlay-set-B9zp2sLB.js +0 -1
- package/dist/assets/stage-presence-markers-DiGI6A45.js +0 -1
- package/dist/assets/standard-viewport-dressing-CzjAe_0A.js +0 -7
- package/dist/assets/static-batch-advisor-B13QEH7d.js +0 -1
- package/dist/assets/story-capture-_gC8dXV-.js +0 -1
- package/dist/assets/story-documents--TDLaPeL.js +0 -3
- package/dist/assets/story-documents.service-BiS_YbNQ.js +0 -1
- package/dist/assets/story-documents.service-CxOPYJ2j.js +0 -1
- package/dist/assets/story-pixi-preview-BUrOJZXS.js +0 -1
- package/dist/assets/story-presentation-j2AVN-mK.js +0 -1
- package/dist/assets/team-playtest.service-DqOinFVA.js +0 -1
- package/dist/assets/three-authoring.service-iuHLwtf1.js +0 -2
- package/dist/assets/three-viewport-presentation-QBQpSdMh.js +0 -1
- package/dist/assets/three.quarks.esm-B1C61jGo.js +0 -1039
- package/dist/assets/transport.header-B-6HQlU2.js +0 -1
- package/dist/assets/ui-board-document-Bwtt--xp.js +0 -2
- package/dist/assets/use-live-actor-state-DErbWQWF.js +0 -1
- package/dist/assets/user-data-BB2Of6Ht.js +0 -1
- package/dist/assets/uv-editing.layout-BEKHxmHw.js +0 -1
- package/dist/assets/viewport-shading-boundary-B_-_gABg.js +0 -82
- package/dist/assets/voxel-surface-DtcsSWRL.js +0 -1
- package/dist/assets/webgl-frame-capture-FlF9zQmW.js +0 -1
- package/dist/assets/webworkerAll-CM2o_dnz.js +0 -1
- package/dist/assets/world-documents-147tiFZe.js +0 -1
- package/dist/assets/world-root-stage-binding-vwTrtBz6.js +0 -1
- package/dist/assets/xstate-animation-binding-Brd0NST6.js +0 -1
- package/dist/assets/xstate-behavior.action-B8UluFBK.js +0 -1
- package/dist/assets/xstate-behavior.document-CKAsE45I.js +0 -1
- package/dist/assets/xstate-behavior.inspector-vJJyuifc.js +0 -1
- package/dist/assets/xstate-behavior.menu-BXbPICIh.js +0 -1
- package/dist/assets/xstate-inspection-BsZv8LS9.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/create-runtime-CVCc1BDx.js","assets/adapter-surface-Y37Nzcyw.js","assets/binding-Bmxqznjk.js","assets/index-GIL7oGEO.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/three.module-D396a9Mn.js","assets/index-D2fNXpHa.css","assets/assets-BuSoGjBX.js","assets/loader-CaF_I7Yt.js","assets/setup-renderer-DVXaSGin.js","assets/index-BcCBqgM_.js","assets/defaults-DKiBJCPN.js","assets/render-settings-Bw4W9SYF.js","assets/render-features-CPQ_e568.js","assets/game-loop-CZvXlY00.js","assets/frame-pacing-D5acoOzO.js","assets/debug-registry-Dgvitx8M.js","assets/game-DHOZVb-7.js","assets/loop-gate-report-N52EWFGD.js","assets/system-slot-E2mEdiih.js","assets/user-data-BB2Of6Ht.js","assets/object-marks-DwvIEBOK.js","assets/seeded-random-i3mtgBKZ.js","assets/render-seed-DF4JHy7P.js","assets/sim-clock-CLflx7kg.js","assets/system-runner-DkOjxEBt.js","assets/performance-profiler-D_Jey87L.js","assets/input-manager-DH_hGW6d.js","assets/asset-parse-error-BHMwBRU3.js","assets/binding-identity-DcTpbvyg.js","assets/prompt-labels-DSMdM2_B.js","assets/schema-kl9-2B_J.js","assets/gameplay-rng-trap-CTNhm-UW.js","assets/state-bridge-DLP1jLRW.js","assets/input-router-BNQvtIqw.js","assets/render-control-Df3yTiyr.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{y as v,z as R,aj as _,V as n,bw as A,bv as b,aF as I,bW as P,bX as M,bY as y,bZ as w,b_ as S,_ as C,b$ as F,c0 as $}from"./index-GIL7oGEO.js";import{m as j}from"./capability-coverage-Czas4C18.js";import{r as E}from"./binding-resolver-Dsh-6Vor.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"./three.module-D396a9Mn.js";import"./game-contract-seams-a5YXejOu.js";import"./native-debug-module-CWicoSGD.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-Dgvitx8M.js";import"./playtest-BXIL1JEF.js";import"./adapter-surface-Y37Nzcyw.js";import"./entry-adjudication-Cq8Yeb74.js";import"./r3f-root-factory-z9llD1OU.js";import"./register-render-vitals-BiZk29b2.js";import"./render-census-BrQX_CXv.js";import"./structural-signature-0w-i_ats.js";import"./render-vitals-BZ5HtvMi.js";import"./static-batch-advisor-B13QEH7d.js";import"./webgl-frame-capture-FlF9zQmW.js";import"./world-state-BWG-IcOd.js";import"./frame-selector-cache-cCeUbcjG.js";import"./dev-build-gDYrq68M.js";import"./game-input-seams-CIQdetRw.js";import"./seeded-random-i3mtgBKZ.js";import"./render-seed-DF4JHy7P.js";import"./frame-delta-D2nsw_Ht.js";import"./events-156d8d12.esm-ErOhDXXB.js";import"./index-bQE2NA0D.js";import"./realm-services-CobQsq_X.js";import"./canvas-entry-runtime-SfBxaR9M.js";import"./three-ingest-runtime-QzDYk6tU.js";import"./EffectComposer-DQxfsXBZ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-QYRpPuFJ.js";import"./CSS3DRenderer-CL7ABLVK.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-CEz5NTck.js";let m=null;function g(){return m!==null}function G(t,e){return t.selection?t:{...t,selection:{get:()=>[...e.selectedEntityIds],set:o=>e.selectMultiple(o)}}}function k(){const t=m;if(t){m=null,M(null),y(null),w(),t.store.setPlayState("stopped");try{t.stop()}catch{}delete window.__vgaiModule,n.log("Module adapter mode stopped","adapter")}}async function D(t,e,o,i,r,p){const{createGameRuntime:u}=await C(async()=>{const{createGameRuntime:l}=await import("./create-runtime-CVCc1BDx.js");return{createGameRuntime:l}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42])),a=await E({...t,roots:[e]},o);return{session:await u({container:i,roots:a,width:r,height:p}),specs:a}}async function L(t,e,o,i){await P();const r=S();if(!r){n.error("Game container not mounted — cannot auto-mount module adapter","adapter");return}t.setPlayState("playing"),n.log(`Mounting custom adapter module for world "${o.id}" (kind: ${o.surface})`,"adapter");const p=r.clientWidth||800,u=r.clientHeight||600,{session:a,specs:d}=await D(e,o,i,r,p,u),s=a.game.roots[0].mounted,f=d[0].adapter.id;m={store:t,stop:()=>a.stop()};let c;s.authoring?c=G(s.authoring,t):c=F(t,`${f} (no authoring surface)`),M(c),y(s.systems??{}),t.setActiveViewportTab("play"),t.notifyIngestEdit(),w();const h=j(s);window.__vgaiModule={worldId:o.id,adapterId:f,reach:h}}async function St(t){const e=await v().catch(()=>null);if(e&&R(e).length>0)return!1;const o=e?_(e)[0]:void 0;if(o===void 0||o.adapter.type!=="module")return!1;const i=I();if(!i)return n.error("Manifest declares a { module } world but no project is open — cannot auto-mount","adapter"),!0;try{await L(t,e,o,i.rootPath)}catch(r){n.error(`Manifest { module } auto-mount failed: ${r}`,"adapter"),A({worldId:o.id,kind:o.surface,identity:o.adapter.identity,message:b(r)})}return!0}$({id:"module",priority:2,mounted:g,playing:g,stop:k,instanceContainer:()=>null});export{L as enterModuleModeFromManifestRoot,k as exitModuleMode,g as isModuleModeActive,D as mountModuleRootRuntime,St as tryManifestModuleRoute,G as withStoreSelection};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-GIL7oGEO.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/three.module-D396a9Mn.js","assets/index-D2fNXpHa.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{E as z,d$ as pe,eC as me,d7 as A,d9 as he,gm as ge,eR as fe,gp as ye,gq as ve,gr as be,gs as Se,gt as we,gu as Ce,b_ as J,V as h,bW as xe,jU as M,_ as W,kJ as Ee,kK as Ae,bX as K,bZ as X,aF as Ie,j as ke,bY as Re}from"./index-GIL7oGEO.js";import{m as I}from"./capability-coverage-Czas4C18.js";import{n as Pe}from"./after-paint-CB4bz1-e.js";import{BabylonAuthoringAdapter as _e}from"./babylon-authoring-adapter-CL02gWDn.js";import{a as k,R as Y,s as je,c as De,C as $e,D as R,G as Me,B as Te,H as T,E as B,S as Ge,j as q,k as Q,l as Z,r as ee,p as te,o as ne,T as Le,K as se,u as Be}from"./active-ingest-CT6jSGhr.js";import{c as Fe,a as Oe}from"./json-history-resource-BbxllWfV.js";import{PixiAuthoringAdapter as Ne}from"./pixi-authoring-adapter-CjibysC3.js";import{createLiveCanvasWriteTarget as We}from"./pixi-live-write-target-DuWydlWb.js";import{a as He}from"./source-persistence-backend-C-aR-B_Y.js";import{resolveCanvasPixiForEditor as Ue}from"./canvas-entry-runtime-SfBxaR9M.js";import{p as Ve}from"./playtest-BXIL1JEF.js";import{mountIngestGame2D as ze,INGEST_GAME_2D_LOAD_ERROR_NAME as Je}from"./ingest-BbYMC2vQ.js";import{createPhysics2DRegistry as Ke}from"./physics-registry-B2Jkp8e6.js";import{f as Xe,b as re,g as Ye,e as ie,w as qe,j as Qe}from"./resolve-three-SZE_WWUM.js";import{composePhysicsAdapters2D as Ze,createPhysicsAdapter2D as et}from"./system-adapters-rIC8FSGP.js";import{s as tt}from"./mount-ingest-root-glv2SSWf.js";import{landIngestBootInEdit as ae}from"./ingest-boot-viewport-D5rI_Kk_.js";import{a as S}from"./jsx-runtime-DPjLkJKQ.js";import{i as nt,C as H,b as st,c as rt}from"./CanvasSceneViewport-Bpi6gVTC.js";import{R as it}from"./RootSelectionOverlay-BZPlxmXU.js";import{e as at,S as ot}from"./surface-state-DaxyruCj.js";import{r as y}from"./index-nmcBqr7Y.js";import{b as ct,e as dt,g as lt}from"./registry-02YZjMNp.js";import"./index-CtzuWnCS.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-CinJrH5C.js";import"./index-D_NuPfjr.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./three.module-D396a9Mn.js";import"./game-contract-seams-a5YXejOu.js";import"./ingest-source-persistence-C_6Hiyra.js";import"./authoring-CgcOFhGS.js";import"./pixi-transform-channels-VjdohT11.js";import"./scene-capture-CGYF-Viw.js";import"./dom-authoring-adapter-CY8C7f4T.js";import"./react-world-authoring-adapter-DmrwM3py.js";import"./board-guides-DziKSTss.js";import"./writer-B-KovzkA.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-BZfi3mmo.js";import"./inference-diagnostics-Dhmtfbq_.js";import"./debug-registry-Dgvitx8M.js";import"./webgl-frame-capture-FlF9zQmW.js";import"./TransientHint-BB1fwrvK.js";import"./eyedropper-session-bjPXnfeX.js";import"./react-story-board-BDDwiE2H.js";import"./viewport-pick-context-DkawXbEi.js";function ut(t){if(typeof t?.game?.scene?.getScenes=="function")return t.game;const e=t?.Phaser?.GAMES;return Array.isArray(e)?e.find(n=>typeof n?.scene?.getScenes=="function")??null:null}function pt(t){const e=t?.__vgaiBabylon?.engines,n=Array.isArray(e)?e:t?.BABYLON?.Engine?.Instances;return Array.isArray(n)?[...n].reverse().find(s=>Array.isArray(s?.scenes)&&s.scenes.length>0)??null:null}function mt(t){return[0,0,Math.sin(t/2),Math.cos(t/2)]}function ht(t){return 2*Math.atan2(t[2],t[3])}function gt(t){return encodeURIComponent(t||"unnamed")}function ft(t){return Array.isArray(t.list)?t.list:[]}class yt{constructor(e,n){this.game=e,this.store=n}capabilities={transform:!0,inspectorFields:!0,persist:!1};provenance={source:"foreign",label:"live-only",detail:"Live Phaser scene/display lists projected directly — edits apply to native game objects for this session only."};persistence={...Fe(),destination:"live-only (not saved)"};indexed=new Map;listeners=new Set;refresh(){this.reindex();let e=0,n=0;for(const s of this.indexed.values())s.kind==="scene"?e++:n++;return{scenes:e,objects:n}}scenes(){const e=this.game.scene?.getScenes;if(typeof e!="function")return[];const n=e.call(this.game.scene,!0);return Array.isArray(n)?n:[]}reindex(){this.indexed.clear();for(const[e,n]of this.scenes().entries()){const s=n.sys?.settings?.key||`Scene ${e+1}`,r=`phaser:scene:${e}:${gt(s)}`,a=Array.isArray(n.children?.list)?n.children.list:[],o={id:r,label:s,role:"root",kind:"phaser-scene",typeLabel:"Phaser.Scene",parentId:null,childIds:[]};this.indexed.set(r,{kind:"scene",scene:n,node:o}),o.childIds=a.map((i,c)=>this.indexObject(i,r,`${e}/${c}`))}}indexObject(e,n,s){const r=e.type||e.constructor?.name||"GameObject",a=e.name||r,o=`phaser:object:${s}`,i={id:o,label:a,role:"entity",kind:`phaser-${r.toLowerCase()}`,typeLabel:r,parentId:n,childIds:[]};return this.indexed.set(o,{kind:"object",object:e,node:i}),i.childIds=ft(e).map((c,p)=>this.indexObject(c,o,`${s}/${p}`)),o}hierarchy={roots:()=>(this.reindex(),[...this.indexed.values()].filter(e=>e.kind==="scene").map(e=>e.node)),node:e=>(this.reindex(),this.indexed.get(e)?.node??null)};selection={get:()=>[...this.store.selectedEntityIds],set:e=>{this.store.selectMultiple(e),this.notify()}};transforms={dimensions:e=>(this.reindex(),this.indexed.get(e)?.kind==="object"?"2d":null),get:e=>{this.reindex();const n=this.indexed.get(e);if(!n||n.kind!=="object")return{position:[0,0,0],rotation:[0,0,0,1],scale:[1,1,1]};const s=n.object;return{position:[s.x??0,s.y??0,s.depth??0],rotation:mt(s.rotation??0),scale:[s.scaleX??1,s.scaleY??1,1]}},beginEdit:e=>{},apply:(e,n)=>{this.reindex();const s=this.indexed.get(e);!s||s.kind!=="object"||(s.object.x=n.position[0],s.object.y=n.position[1],s.object.depth=n.position[2],s.object.rotation=ht(n.rotation),s.object.scaleX=n.scale[0],s.object.scaleY=n.scale[1],this.notify())},endEdit:e=>{}};inspector={properties:e=>{this.reindex();const n=this.indexed.get(e);return n?n.kind==="scene"?[{path:"key",label:"Scene key",type:"string",readonly:!0}]:[{path:"type",label:"Type",type:"string",readonly:!0},{path:"name",label:"Name",type:"string"},{path:"active",label:"Active",type:"boolean"},{path:"visible",label:"Visible",type:"boolean"},{path:"alpha",label:"Alpha",type:"number"},{path:"depth",label:"Depth",type:"number"}]:[]},get:(e,n)=>{this.reindex();const s=this.indexed.get(e);if(s)return s.kind==="scene"?n==="key"?s.scene.sys?.settings?.key:void 0:n==="type"?s.object.type||s.object.constructor?.name:s.object[n]},set:(e,n,s)=>{this.reindex();const r=this.indexed.get(e);!r||r.kind!=="object"||n==="type"||(r.object[n]=s,this.notify())}};subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}dispose(){this.listeners.clear(),this.indexed.clear()}notify(){for(const e of this.listeners)e();this.store.notifyIngestEdit()}}function vt(t){return We({physics:t.physics,persistence:He({history:t.history,writer:t.writer})})}const bt=1500,St=1e4;function wt(t,e){const n=e.settleGraceMs??bt,s=e.deadlineMs??St;let r=null,a=null;const o=i=>{e.isHeld()&&(r??=i,a===null&&e.currentScene()===t&&(a=i),e.render(),!(a!==null&&i-a>=n)&&(a===null&&i-r>=s||e.schedule(o)))};e.schedule(o)}function Ct(t,e){const n=k();if(n?.kind!=="canvas"||!n.session.adapter)return()=>{};const s=z()?.scenes;if(s&&pe(s))return()=>{};const r=n.worldId;me({id:A,title:"Scene",kind:"world",workspaceRole:"authored-subject",provenance:{rootId:r},Content:e,closeable:!1,presentation:()=>({kind:"world",id:r}),onActivate:()=>t.setActiveViewportTab("edit")}),he(A);const a=ge(r,A);return()=>{a(),fe(A,{discardDirty:!0})}}function xt(){const t=z()?.scenes;if(!t?.default)return;const e=t.entries.find(r=>r.id===t.default),n=e?.source?.export??e?.id;return n?(Y()?.storiesFor("")??[]).find(r=>r.label===n||r.id===n)?.id:void 0}function Et({active:t,adapter:e,documentId:n,store:s,worldId:r,contractSceneId:a}){const o=y.useRef(null),c=y.useRef(ye()).current;y.useSyncExternalStore(s.subscribe,s.getSnapshot);const p=y.useSyncExternalStore(ve,be),v=y.useSyncExternalStore(Se,we),m=k(),b=e.hierarchy.roots(),P=new Set(e.rects?.emptyContainers?.().map(l=>l.id)??[]),w=b.some(l=>!P.has(l.id)),E=at({surface:"Ingest scene",rootIds:[r],phase:m?.kind==="canvas"&&m.worldId===r&&m.session.hostEl?"ready":"loading",content:m?.kind!=="canvas"||m.worldId!==r||!m.session.hostEl?"unknown":w?"present":"empty",readiness:p,failures:v});return y.useEffect(()=>Ce(n,()=>({adapter:e,nodeId:[...s.selectedEntityIds].find(l=>e.hierarchy.node(l))??null})),[e,n,s]),y.useEffect(()=>{const l=o.current;if(l)return nt(l,c)},[c]),y.useEffect(()=>{if(!t)return;const l=o.current,g=k(),f=g?.kind==="canvas"?g.session.hostEl:void 0;if(!(!l||!f))return l.appendChild(f),()=>{const C=J();C&&f.parentElement===l&&C.appendChild(f)}},[t]),y.useEffect(()=>{if(!t)return;const l=a??xt();if(!l)return;const g=Y();g&&g.goToScene(l)},[t,a]),S.jsxs("div",{ref:o,"data-testid":"world-document:ingest-canvas-scene","data-vgai-backdrop-color":t?H:void 0,"data-vgai-backdrop-policy":t?"dark-frost":void 0,style:{position:"absolute",inset:0,overflow:"hidden",pointerEvents:"auto",backgroundColor:H,touchAction:"none"},children:[S.jsx(st,{view:c}),S.jsx(it,{adapter:e,view:c,transformModeAware:!0}),S.jsx(ot,{explanation:E,testId:"ingest-canvas-surface-status",style:{zIndex:20}}),S.jsx(rt,{active:t,adapter:e,containerRef:o,view:c})]})}function oe(t){const e=k();if(e?.kind!=="canvas"||!e.session.adapter)return()=>{};const n=e.session.adapter,s=e.worldId;return Ct(t,a=>S.jsx(Et,{...a,adapter:n,store:t,worldId:s}))}function At(t,e){const{adapter:n}=t;if(n.type!=="ingest")throw new Error(`resolveIngest2DDescriptor: world "${t.id}" is not an { ingest } world.`);if(!t.entry)throw new Error(`resolveIngest2DDescriptor: world "${t.id}" has no \`entry\` — an ingest root mounts the game's own entry module.`);const s=Xe(e);return{id:t.id,name:t.id,description:t.description??"",...n.captureTimeoutMs!==void 0?{captureTimeoutMs:n.captureTimeoutMs}:{},load:re(s.entry(t.entry),n.contractShim===void 0?void 0:s.module(n.contractShim))}}function U(t,e){const n=lt(t,e),s=dt[n];if(!s)throw new Error(`canvas ingest discovery: "${t}"'s module "${e}" did not match any game module (looked for glob key "${n}").`);return s}function It({folderId:t,manifest:e,root:n}){const{adapter:s}=n;if(!n.entry)throw new Error(`canvas ingest discovery: "${t}" has no \`entry\` — an ingest root mounts the game's own entry module.`);return{...{id:n.id,name:e.name,description:n.description??"",...s.captureTimeoutMs!==void 0?{captureTimeoutMs:s.captureTimeoutMs}:{}},load:re(U(t,n.entry),s.contractShim===void 0?void 0:U(t,s.contractShim))}}let G=null;function kt(){return G||(G=ct("canvas").map(It).sort((t,e)=>t.id.localeCompare(e.id))),G}function Rt(t){return kt().find(e=>e.id===t)}const Pt="this game imports the host's pixi directly, in the editor's own realm";function ce(t,e,n){const s=R()?.systems;let r=null;const{systems:a,renderDebug:o,debugCollisions:i}=qe({contractSystems:s,surface:"canvas",...n?{physics:n}:{},...e?{canvasRuntime:{renderer:e}}:{},setRenderPassHooks:c=>{r?.(),r=c?Qe(e,c):null}});Re(a),h.log(s?`canvas ingest: "${t}" declares the vgai game contract — ${s.commands?.length??0} commands, ${s.state?.length??0} state providers`:`canvas ingest: "${t}" declares no vgai game contract — game.commands()/game.state() have nothing to answer and will refuse by naming that`,"ingest");for(const c of i)h.error(`canvas ingest: "${t}" — ${c}; it will refuse`,"ingest");return e&&h.log(o?`canvas ingest: "${t}" render debugging is live — the Frame debugger captures through the game's own Pixi renderer (draws are unattributed: Pixi's batcher merges display objects, so no display object is the author of a draw)`:`canvas ingest: "${t}" has no render-debug capability — its renderer exposes no real WebGL2 context, or no prerender/postrender runners to bracket`,"ingest"),{wiring:o,uninstall:()=>r?.()}}function _t(t,e){return e instanceof Error&&e.name===Je?`canvas ingest: game "${t}" never ran — its own modules failed to load, so nothing could render and there is no canvas runtime in the realm to recognize (${e})`:`canvas ingest: game "${t}" mounted no recognized canvas runtime — the host's pixi captured no frame, and the realm holds no Phaser game or Babylon.js engine on their own public registries either (${e})`}function jt(t,e){const n=t?.canvas;return n instanceof Node&&e.contains(n)}function de(){return ke(Ve(R()?.systems,"canvas").bound.physics)}function L(t,e){const n=ut(e);if(n)return{runtime:"phaser",adapter:new yt(n,t),mechanism:"this game runs its own Phaser instance in the editor's own realm; the host reads that live game’s active scenes and display lists"};const s=pt(e);return s?{runtime:"babylon",adapter:new _e(s,t),mechanism:"this game runs its own Babylon.js engine in the editor's own realm; the host reads that live engine’s scenes and root nodes"}:null}function V(t,e,n,s,r){const a=r.adapter;a.refresh();const o=ie({primary:a,worldId:n,hostEl:s,store:t}),i=se(),c=()=>i?{loop:null,reason:"the same-realm loop gate holds this game’s scheduling, but no probe has measured that control on this route"}:{loop:null,reason:Le},p=q(i?{setPaused:m=>{m?i.hold():i.release()}}:{pauseGap:`${r.runtime} exposes no host-controlled loop gate`});let v=()=>{};Q({kind:"canvas",session:{store:t,adapter:a,hostEl:s,lifecycle:p,loop:c,dispose:()=>{v(),a.dispose(),B(),s.remove()}},siblings:[],worldId:n}),v=oe(t),Z(()=>t.playState==="playing"&&t.activeViewportTab==="play"),K(o),ce(e.name,void 0,de()),ae(t),t.notifyIngestEdit(),X(),ee({reach:I({authoring:o}),reachMechanism:r.mechanism,loop:c}),h.log(`canvas ingest: recognized ${r.runtime} in the realm and captured "${e.name}"`,"ingest"),te("__vgaiIngest2D",{gameId:n,...ne(o),runtime:r.runtime,get reflected(){return a.refresh()},...p.setPaused?{setPaused:p.setPaused}:{},reach:I({authoring:o}),adapter:o,store:t})}async function Dt(t,e,n){De(),await xe();const s=J();if(!s){h.error("Game container not mounted — cannot ingest (canvas)","ingest");return}t.setPlayState("playing"),h.log(`Ingesting unmodified PixiJS game: ${e.name}`,"ingest");const r=$e(R());r.malformed!==null&&h.error(`Ingest game "${e.id}" ${r.malformed} — the host is measuring readiness instead.`,"ingest");const a=r.ready===null?"measured-wait":"contract-ready",o=r.ready===null?"measured":"declared";M({rootId:e.id,mechanism:a,source:o,state:"waiting"});const i=document.createElement("div");i.id="container",i.style.cssText=`position:absolute;inset:0;width:100%;height:100%;overflow:hidden;background:#000;${Me}`,s.appendChild(i),Te(i);{const{markGameCssScope:u}=await W(async()=>{const{markGameCssScope:D}=await import("./index-GIL7oGEO.js").then($=>$.tW);return{markGameCssScope:D}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]));u(i);const d=Ie();if(d){const{ensureScopedGameStyles:D}=await W(async()=>{const{ensureScopedGameStyles:$}=await import("./index-GIL7oGEO.js").then(ue=>ue.tX);return{ensureScopedGameStyles:$}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]));await D(d.rootPath)}}window.__vgaiMountCold=!0;const c=await Ue();let p;try{const u=await ze(c,e,{...e.captureTimeoutMs!==void 0?{captureTimeoutMs:e.captureTimeoutMs}:{},acceptCapture:({renderer:d})=>jt(d,i),onWait:d=>tt(e.id,d),preferStructuralRuntime:async()=>{const d=T();return await d.__vgaiBabylon?.ready,L(t,d)!==null}});if(u===null){const d=L(t,T());if(d){V(t,e,n,i,d);return}throw new Error(`canvas ingest: game "${e.id}" reported a structural runtime, but it disappeared before dispatch`)}p=u}catch(u){const d=L(t,T());if(d){V(t,e,n,i,d);return}throw B(),i.remove(),M({rootId:e.id,mechanism:a,source:o,state:"failed",failure:r.ready===null?"no-readiness-declaration":"declared-ready-never-resolved"}),new Error(_t(e.id,u))}const v=p.stage;for(let u=0;u<90&&(v.children?.length??0)===0;u++)await Pe();const m=p.capture.captured?.app,b=m?.canvas;b&&(Ye(b),b.parentElement!==i&&i.appendChild(b));const P=Ee(m?[m]:[]),w=de(),E=et(Ke()),l=w?Ze([w,E]):E,g=Ge(R(),{onSwitchAccepted:u=>wt(u,{isHeld:()=>!Be(),currentScene:()=>g?.active("")??null,render:()=>m?.render(),schedule:d=>requestAnimationFrame(d)})}),f=new Ne(v,t,{pixi:c,journal:Oe(n),target:vt({physics:l,history:t.projectHistory}),...g?{stories:g}:{},surface:()=>m?.canvas??null,capturePreview:(u,d)=>Ae(u,{...d,pixi:c})}),C=f.refresh(),x=ie({primary:f,worldId:n,hostEl:i,store:t});let _=null,F=()=>{};const O=se(),N=q({setPaused:u=>{p.setPaused(u),u?O?.hold():O?.release()}});Q({kind:"canvas",session:{store:t,adapter:f,hostEl:i,lifecycle:N,dispose:()=>{F(),_?.uninstall(),_?.wiring?.dispose(),P(),p.dispose(),B(),i.remove()}},siblings:[],worldId:n}),F=oe(t),Z(()=>t.playState==="playing"&&t.activeViewportTab==="play"),K(x),_=ce(e.name,p.capture.captured?.renderer,w?l:null),ae(t),t.notifyIngestEdit(),X();let j="measured";if(r.ready)try{await r.ready(),j="declared"}catch(u){h.error(`Ingest game "${e.id}" declared \`window.vgaiGame.ready\` and it REJECTED (${String(u)}) — the frame was already captured, so the host fell back to the measured settle wait. This root now reports readiness as measured.`,"ingest")}M({rootId:e.id,mechanism:j==="declared"?"contract-ready":"measured-wait",source:j,state:"ready"}),ee({reach:I({authoring:x}),reachMechanism:Pt,loop:()=>({loop:null,reason:"the host stops and starts the captured PixiJS Application ticker directly, but no probe has measured whether that holds everything this game schedules"})}),h.log(`pixi ingest: captured "${e.name}" (${C.count} nodes, ${C.sprites} sprites)`,"ingest"),te("__vgaiIngest2D",{gameId:n,...ne(x),drawCount:()=>p.capture.getDrawCount(),get reflected(){return f.refresh()},setPaused:N.setPaused,reach:I({authoring:x}),adapter:x,store:t})}function le(t,e,n){return je(()=>Dt(t,e,n))}async function Rn(t,e,n){const s=At(e,n);return le(t,s,e.id)}async function Pn(t,e){const n=Rt(e);if(!n){h.error(`Unknown pixi ingest game: ${e}`,"ingest");return}return le(t,n,e)}export{le as mountCanvasIngestRoot,Pn as mountCanvasIngestRootById,Rn as mountCanvasIngestRootFromManifest};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/create-runtime-CVCc1BDx.js","assets/adapter-surface-Y37Nzcyw.js","assets/binding-Bmxqznjk.js","assets/index-GIL7oGEO.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/three.module-D396a9Mn.js","assets/index-D2fNXpHa.css","assets/assets-BuSoGjBX.js","assets/loader-CaF_I7Yt.js","assets/setup-renderer-DVXaSGin.js","assets/index-BcCBqgM_.js","assets/defaults-DKiBJCPN.js","assets/render-settings-Bw4W9SYF.js","assets/render-features-CPQ_e568.js","assets/game-loop-CZvXlY00.js","assets/frame-pacing-D5acoOzO.js","assets/debug-registry-Dgvitx8M.js","assets/game-DHOZVb-7.js","assets/loop-gate-report-N52EWFGD.js","assets/system-slot-E2mEdiih.js","assets/user-data-BB2Of6Ht.js","assets/object-marks-DwvIEBOK.js","assets/seeded-random-i3mtgBKZ.js","assets/render-seed-DF4JHy7P.js","assets/sim-clock-CLflx7kg.js","assets/system-runner-DkOjxEBt.js","assets/performance-profiler-D_Jey87L.js","assets/input-manager-DH_hGW6d.js","assets/asset-parse-error-BHMwBRU3.js","assets/binding-identity-DcTpbvyg.js","assets/prompt-labels-DSMdM2_B.js","assets/schema-kl9-2B_J.js","assets/gameplay-rng-trap-CTNhm-UW.js","assets/state-bridge-DLP1jLRW.js","assets/input-router-BNQvtIqw.js","assets/render-control-Df3yTiyr.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{bW as f,V as s,_ as I,bX as y,bY as v,bZ as w,b_ as R}from"./index-GIL7oGEO.js";import{m as $}from"./capability-coverage-Czas4C18.js";import{r as E}from"./binding-resolver-Dsh-6Vor.js";import{s as j,j as G,k as A,l as P,p as b,m as H,c as D,r as O,n as N,o as C}from"./active-ingest-CT6jSGhr.js";import{a as T}from"./json-history-resource-BbxllWfV.js";import{D as V}from"./dom-authoring-adapter-CY8C7f4T.js";import{landIngestBootInEdit as M}from"./ingest-boot-viewport-D5rI_Kk_.js";import{b as L}from"./registry-02YZjMNp.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"./three.module-D396a9Mn.js";import"./game-contract-seams-a5YXejOu.js";import"./native-debug-module-CWicoSGD.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-Dgvitx8M.js";import"./playtest-BXIL1JEF.js";import"./adapter-surface-Y37Nzcyw.js";import"./entry-adjudication-Cq8Yeb74.js";import"./r3f-root-factory-z9llD1OU.js";import"./register-render-vitals-BiZk29b2.js";import"./render-census-BrQX_CXv.js";import"./structural-signature-0w-i_ats.js";import"./render-vitals-BZ5HtvMi.js";import"./static-batch-advisor-B13QEH7d.js";import"./webgl-frame-capture-FlF9zQmW.js";import"./world-state-BWG-IcOd.js";import"./frame-selector-cache-cCeUbcjG.js";import"./dev-build-gDYrq68M.js";import"./game-input-seams-CIQdetRw.js";import"./seeded-random-i3mtgBKZ.js";import"./render-seed-DF4JHy7P.js";import"./frame-delta-D2nsw_Ht.js";import"./events-156d8d12.esm-ErOhDXXB.js";import"./index-bQE2NA0D.js";import"./realm-services-CobQsq_X.js";import"./canvas-entry-runtime-SfBxaR9M.js";import"./three-ingest-runtime-QzDYk6tU.js";import"./EffectComposer-DQxfsXBZ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-QYRpPuFJ.js";import"./CSS3DRenderer-CL7ABLVK.js";import"./relative-path-guard-GiM7Lsz8.js";import"./react-root-CEz5NTck.js";import"./ingest-source-persistence-C_6Hiyra.js";import"./react-world-authoring-adapter-DmrwM3py.js";import"./board-guides-DziKSTss.js";import"./writer-B-KovzkA.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-BZfi3mmo.js";import"./inference-diagnostics-Dhmtfbq_.js";function W({folderId:t,manifest:e,root:o}){if(!o.entry)throw new Error(`dom ingest discovery: "${t}" has no \`entry\` — a dom ingest root's \`entry\` must point at the host-shim module in the same folder (D-N2).`);return{folderId:t,manifest:e,worldId:o.id}}let h=null;function x(){return h||(h=L("dom").map(W).sort((t,e)=>t.folderId.localeCompare(e.folderId))),h}function F(t){return x().find(e=>e.folderId===t)}function q(t){return typeof __VGAI_ENGINE_ROOT__!="string"||!__VGAI_ENGINE_ROOT__?void 0:`${__VGAI_ENGINE_ROOT__.endsWith("/")?__VGAI_ENGINE_ROOT__.slice(0,-1):__VGAI_ENGINE_ROOT__}/packages/editor/src/ingest/games/${t}`}const z="this world mounts in the host's native React runtime, so the editor is limited only by what its authoring adapter provides";function k(t){return{reach:$({authoring:t}),reachMechanism:z,loop:H}}async function B(t,e){const o=F(e);if(!o){s.error(`Unknown react ingest game: ${e}`,"ingest");return}const u=q(e);if(!u){s.error(`React ingest "${e}": no __VGAI_ENGINE_ROOT__ available to resolve its entry`,"ingest");return}await f();const n=R();if(!n){s.error("Game container not mounted — cannot ingest (react)","ingest");return}D(),t.setPlayState("playing"),s.log(`Ingesting unmodified native-React game: ${o.manifest.name}`,"ingest"),window.__vgaiMountCold=!0;const{createGameRuntime:g}=await I(async()=>{const{createGameRuntime:a}=await import("./create-runtime-CVCc1BDx.js");return{createGameRuntime:a}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42])),d=await E(o.manifest,u),l=n.clientWidth,_=n.clientHeight,r=await g({container:n,roots:d,width:l,height:_}),m=r.game.roots[0].reactRoot(),i=new V(m,t,{journal:T(e)}),c=G({setPaused:a=>a?r.game.play.pause():r.game.play.resume()});A({kind:"dom",session:{store:t,lifecycle:c,stop:()=>r.stop(),adapter:i},siblings:[],worldId:e}),P(()=>t.playState==="playing"&&t.activeViewportTab==="play"),y(i),v({}),M(t),t.notifyIngestEdit(),w();const p=k(i);O(p),b("__vgaiIngestReact",{gameId:e,worldId:o.worldId,...C(i),noAuthoring:!1,reach:p.reach,domEvidence:()=>N(m,i),setPausedPresent:typeof c.setPaused=="function"})}async function Xt(t,e,o,u){await f();const n=R();if(!n){s.error("Game container not mounted — cannot ingest (react)","ingest");return}D(),t.setPlayState("playing"),s.log(`Ingesting unmodified native-React game (external folder): ${o.id}`,"ingest"),window.__vgaiMountCold=!0;const{createGameRuntime:g}=await I(async()=>{const{createGameRuntime:a}=await import("./create-runtime-CVCc1BDx.js");return{createGameRuntime:a}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42])),d=await E({...e,roots:[o]},u),l=n.clientWidth,_=n.clientHeight,r=await g({container:n,roots:d,width:l,height:_}),m=r.game.roots[0].reactRoot(),i=new V(m,t,{journal:T(o.id)}),c=G({setPaused:a=>a?r.game.play.pause():r.game.play.resume()});A({kind:"dom",session:{store:t,lifecycle:c,stop:()=>r.stop(),adapter:i},siblings:[],worldId:o.id}),P(()=>t.playState==="playing"&&t.activeViewportTab==="play"),y(i),v({}),M(t),t.notifyIngestEdit(),w();const p=k(i);O(p),b("__vgaiIngestReact",{worldId:o.id,...C(i),noAuthoring:!1,reach:p.reach,domEvidence:()=>N(m,i),setPausedPresent:typeof c.setPaused=="function"})}function Yt(t,e){return j(()=>B(t,e))}export{Yt as mountDomIngestRoot,Xt as mountDomIngestRootFromManifest};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mount-canvas-ingest-root-DDuAWf_C.js","assets/index-GIL7oGEO.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/three.module-D396a9Mn.js","assets/index-D2fNXpHa.css","assets/capability-coverage-Czas4C18.js","assets/game-contract-seams-a5YXejOu.js","assets/after-paint-CB4bz1-e.js","assets/babylon-authoring-adapter-CL02gWDn.js","assets/json-history-resource-BbxllWfV.js","assets/source-persistence-backend-C-aR-B_Y.js","assets/ingest-source-persistence-C_6Hiyra.js","assets/active-ingest-CT6jSGhr.js","assets/playtest-BXIL1JEF.js","assets/pixi-authoring-adapter-CjibysC3.js","assets/authoring-CgcOFhGS.js","assets/pixi-transform-channels-VjdohT11.js","assets/pixi-live-write-target-DuWydlWb.js","assets/canvas-entry-runtime-SfBxaR9M.js","assets/ingest-BbYMC2vQ.js","assets/scene-capture-CGYF-Viw.js","assets/resolve-three-SZE_WWUM.js","assets/dom-authoring-adapter-CY8C7f4T.js","assets/react-world-authoring-adapter-DmrwM3py.js","assets/board-guides-DziKSTss.js","assets/writer-B-KovzkA.js","assets/story-arg-descriptors-Ek86ExX7.js","assets/inspect-BZfi3mmo.js","assets/inference-diagnostics-Dhmtfbq_.js","assets/debug-registry-Dgvitx8M.js","assets/webgl-frame-capture-FlF9zQmW.js","assets/physics-registry-B2Jkp8e6.js","assets/system-adapters-rIC8FSGP.js","assets/ingest-boot-viewport-D5rI_Kk_.js","assets/CanvasSceneViewport-Bpi6gVTC.js","assets/RootSelectionOverlay-BZPlxmXU.js","assets/eyedropper-session-bjPXnfeX.js","assets/react-story-board-BDDwiE2H.js","assets/viewport-pick-context-DkawXbEi.js","assets/TransientHint-BB1fwrvK.js","assets/surface-state-DaxyruCj.js","assets/registry-02YZjMNp.js","assets/mount-dom-ingest-root-D_EiBgpn.js","assets/binding-resolver-Dsh-6Vor.js","assets/native-debug-module-CWicoSGD.js","assets/native-entry-surface-BE8LJNdu.js","assets/adapter-surface-Y37Nzcyw.js","assets/entry-adjudication-Cq8Yeb74.js","assets/r3f-root-factory-z9llD1OU.js","assets/register-render-vitals-BiZk29b2.js","assets/render-census-BrQX_CXv.js","assets/structural-signature-0w-i_ats.js","assets/render-vitals-BZ5HtvMi.js","assets/static-batch-advisor-B13QEH7d.js","assets/world-state-BWG-IcOd.js","assets/frame-selector-cache-cCeUbcjG.js","assets/dev-build-gDYrq68M.js","assets/game-input-seams-CIQdetRw.js","assets/seeded-random-i3mtgBKZ.js","assets/render-seed-DF4JHy7P.js","assets/frame-delta-D2nsw_Ht.js","assets/events-156d8d12.esm-ErOhDXXB.js","assets/index-bQE2NA0D.js","assets/realm-services-CobQsq_X.js","assets/three-ingest-runtime-QzDYk6tU.js","assets/EffectComposer-DQxfsXBZ.js","assets/CopyShader-BzTUYzf6.js","assets/ShaderPass-QYRpPuFJ.js","assets/CSS3DRenderer-CL7ABLVK.js","assets/relative-path-guard-GiM7Lsz8.js","assets/react-root-CEz5NTck.js","assets/mount-three-ingest-root-hrUt9VVU.js","assets/scene-framing-Cat0GtyJ.js","assets/mount-readiness-Ds0HvvLH.js","assets/loop-gate-report-N52EWFGD.js","assets/three-authoring-adapter-CmSQ3Vui.js","assets/three-projection-core-BmKMZ-nf.js","assets/three-CDSueJyJ.js","assets/body-marks-h_xDxiDE.js","assets/user-data-BB2Of6Ht.js","assets/object-marks-DwvIEBOK.js","assets/structural-ids-Dc-7rEwi.js","assets/object3d-authoring-subject-CH5sI2oP.js","assets/rapier-physics-adapter-CaZqWLu0.js","assets/r3f-physics-binding-BBo8oma9.js","assets/scene-capture-BQKzU0NT.js","assets/ingest-siblings-Bop2kqVl.js","assets/mounted-authoring-Dmg5xmhP.js","assets/crash-null-boundary-v3a0uEgw.js","assets/module-mode-DVBLT9d-.js","assets/deferred-ingest-play-DCJi_Pgu.js","assets/edit-mode-authoring-B47TfLqu.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{f$ as S,aF as d,_ as s,y as k,g0 as C,V as u,g1 as L,bv as c,b_ as g,z as F,bw as y,eh as m,g2 as T,bX as D,fD as O,x as V,bZ as j,g3 as $}from"./index-GIL7oGEO.js";import{q as x,t as W,g as _,u as z,a as B,v as N,c as q,w as K,x as G,i as H,y as X}from"./active-ingest-CT6jSGhr.js";let M=null;const Z=new Set;function J(){for(const t of Z)t()}function ct(t,n){M=n?{worldId:t,window:n}:null,J(),S()}function Q(){const t=M;if(!t)return null;const n=t.window.isHidden(),o=t.window.isSuspended(),e=t.window.suspensionReason();return{worldId:t.worldId,budgetMs:t.window.budgetMs,elapsedVisibleMs:Math.round(t.window.elapsedVisibleMs()),hidden:n,suspended:o,suspensionReason:e,reason:e==="hidden"?"waiting for first visible frame — tab is hidden (a hidden tab cannot render, so the capture window is parked, not counting down; bring the tab to the foreground)":e==="unfocused"?"waiting for the browser to resume frame presentation — the editor window is unfocused (WebKit can suspend requestAnimationFrame in this state, so the capture window is parked; focus the editor window)":e==="page-suspended"?"waiting for the browser to restore the suspended editor page — the capture window is parked, not counting down":o?"waiting for the browser to resume frame presentation — the capture window is parked":"waiting for the game's first rendered frame"}}function R(){const t=B();if(!t)return null;const n=t.kind==="three"?t.session.mount:void 0,o=t.kind==="canvas"?t.session.loop?.():void 0,e=x(n?.realmLoopVerdict?.())??o?.loop??null,r=n?.realmLoopVerdict?.()?.reason??o?.reason??null;return{worldId:t.worldId,kind:t.kind,playing:z(),loop:e,loopReason:r,canStep:_()?.canStep??!1,coverage:W()}}const U=()=>s(()=>import("./mount-canvas-ingest-root-DDuAWf_C.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48])),Y=()=>s(()=>import("./mount-dom-ingest-root-D_EiBgpn.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,8,9,10,11,12,13,50,51,52,36,20,53,54,55,56,57,58,59,60,37,61,62,63,64,65,66,67,68,69,70,25,71,72,73,74,75,76,77,19,18,16,29,30,31,32,33,34,35,40,48])),tt=()=>s(()=>import("./mount-three-ingest-root-hrUt9VVU.js"),__vite__mapDeps([78,12,1,2,3,4,5,6,7,8,9,10,11,13,19,18,20,79,28,16,29,30,31,32,33,34,35,36,37,71,72,73,74,75,80,81,82,17,83,84,45,85,86,87,88,89,90,91,92,40,48]));function b(...t){return U().then(n=>n.mountCanvasIngestRootFromManifest(...t))}function v(...t){return Y().then(n=>n.mountDomIngestRootFromManifest(...t))}function P(...t){return tt().then(n=>n.mountThreeIngestRootFromManifest(...t))}V(t=>{j()});$(()=>({ingest:R(),ingestCaptureWait:Q()}));function l(t,n){u.error(`Ingest mount failed for "${n.worldId}" (${n.identity}): ${n.message}`,"ingest"),q(),N(),t.setPlayState("stopped"),y(n),t.notifyIngestEdit()}async function et(){try{return await k()}catch(t){return C(t)||u.error(`Ingest routing: this project's ${L} could not be read, so no root was mounted from it — ${c(t)}`,"ingest"),null}}function f(t){return F(t)}function p(t){const n=t.map(e=>`"${e.id}"`).join(", "),o=`a composite manifest declares exactly ONE ingest world in this slice — found ${t.length}: ${n}.`;u.error(`Manifest composite ingest route: ${o}`,"ingest");for(const e of t)y({worldId:e.id,kind:e.surface,identity:e.adapter.identity,message:o})}async function w(t,n,o,e,r){const{mountIngestSiblings:a}=await s(async()=>{const{mountIngestSiblings:E}=await import("./ingest-siblings-Bop2kqVl.js");return{mountIngestSiblings:E}},__vite__mapDeps([93,1,2,3,4,5,6,7,8,9,10,11,94,21,22,17,18,16,23,24,25,95,70,61,36,62,71,72,73,74,75,77,29,30,31,32,33,34,35,38,39,82,83,84,45,85,86,87,88,89,90,91,96,12,13,50,51,52,20,53,54,55,56,57,58,59,60,37,63,64,65,66,67,68,69,76])),i=await a(t,n,o,e,r);return K(i),i}function I(t,n,o){if(o.length===0)return;const e=O();if(!e)return;const a=[...e instanceof m?e.childAdapters().map(i=>({worldId:i.worldId,kind:i.kind,adapter:i.adapter,role:i.role,zOrder:i.zOrder,...i.label!==void 0?{label:i.label}:{},...i.parentRootId!==void 0?{parentRootId:i.parentRootId}:{}})):[{worldId:n.id,kind:n.surface,adapter:e}],...o.map(i=>({worldId:i.worldId,kind:T(t,i.worldId)?.surface??"unknown",adapter:i.authoring}))];D(new m(a))}async function nt(t,n){if(!n)return!1;const o=f(n);if(o.length===0)return!1;if(o.length>1)return p(o),!0;const e=o[0];if(e.adapter.identity!=="ingest-three")return!1;const r=d();if(!r)return u.error("Manifest declares an ingest-three world but no project is open — cannot auto-ingest","ingest"),!0;try{await P(t,e,r.rootPath);const a=g();if(a){const i=await w(n,e.id,a,r.rootPath,t);I(n,e,i)}}catch(a){l(t,{worldId:e.id,kind:e.surface,identity:e.adapter.identity,message:c(a)})}return!0}async function ot(t,n){if(!n)return!1;const o=f(n);if(o.length===0)return!1;if(o.length>1)return p(o),!0;const e=o[0];if(e.adapter.identity!=="ingest-pixi")return!1;const r=d();if(!r)return u.error("Manifest declares an ingest-pixi world but no project is open — cannot auto-ingest","ingest"),!0;try{await b(t,e,r.rootPath);const a=g();if(a){const i=await w(n,e.id,a,r.rootPath,t);I(n,e,i)}}catch(a){l(t,{worldId:e.id,kind:e.surface,identity:e.adapter.identity,message:c(a)})}return!0}async function rt(t,n){if(!n)return!1;const o=f(n);if(o.length===0)return!1;if(o.length>1)return p(o),!0;const e=o[0];if(e.adapter.identity!=="ingest-react")return!1;const r=d();if(!r)return u.error("Manifest declares an ingest-react world but no project is open — cannot auto-ingest","ingest"),!0;try{await v(t,n,e,r.rootPath);const a=g();if(a){const i=await w(n,e.id,a,r.rootPath,t);I(n,e,i)}}catch(a){l(t,{worldId:e.id,kind:e.surface,identity:e.adapter.identity,message:c(a)})}return!0}function it(t){return at(t,()=>st(t))}const h=new WeakMap;function at(t,n){let o=h.get(t);o||(o=new Map,h.set(t,o));const e=d()?.rootPath??"",r=o.get(e);if(r)return r;const a=n();return o.set(e,a),a}async function A(t){const{tryManifestModuleRoute:n}=await s(async()=>{const{tryManifestModuleRoute:e}=await import("./module-mode-DVBLT9d-.js");return{tryManifestModuleRoute:e}},__vite__mapDeps([96,1,2,3,4,5,6,7,8,9,10,11,12,13,50,51,52,36,20,53,54,55,56,57,58,59,60,37,61,62,63,64,65,66,67,68,69,70,25,71,72,73,74,75,76,77]));if(await n(t))return;const o=await et();await nt(t,o)||await ot(t,o)||await rt(t,o)}async function st(t){const{deferredIngestPlayActive:n,ingestMountIsDeferredToPlay:o}=await s(async()=>{const{deferredIngestPlayActive:e,ingestMountIsDeferredToPlay:r}=await import("./deferred-ingest-play-DCJi_Pgu.js");return{deferredIngestPlayActive:e,ingestMountIsDeferredToPlay:r}},__vite__mapDeps([97,1,2,3,4,5,6,7,8,9,10,11,98,19,13,12,18,20]));if(await o()){if(n())return;const{landIngestBootInEdit:e}=await s(async()=>{const{landIngestBootInEdit:r}=await import("./ingest-boot-viewport-D5rI_Kk_.js");return{landIngestBootInEdit:r}},__vite__mapDeps([40,1,2,3,4,5,6,7,8,9,10,11,19,13,12,18,20]));e(t);return}await A(t)}const gt=Object.freeze(Object.defineProperty({__proto__:null,activeIngestKind:G,autoLaunchIngest:it,getIngestPlayControl:_,ingestStatusFacet:R,isIngestActive:H,launchIngestRoutes:A,mountCanvasIngestRootFromManifest:b,mountDomIngestRootFromManifest:v,mountThreeIngestRootFromManifest:P,unmountThreeIngestRoot:X},Symbol.toStringTag,{value:"Module"}));export{it as a,gt as m,ct as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{m as Y}from"./capability-coverage-Czas4C18.js";import{V as h,aC as Z,aE as Q,jT as ee,jU as k,jV as j,jW as te,aF as D,jX as re,jY as ne,jZ as oe,j_ as se,fJ as ae,j$ as ie,bW as ce,b_ as de,bX as ue,bY as le,bZ as me}from"./index-GIL7oGEO.js";import{A as fe,G as pe,B as he,C as ge,D as v,E as W,F as ye,H as we,I as be,J as ve,K as M,L as Se,s as Ie,c as Re,M as Ee,j as ke,k as $e,l as Ce,N as Me,u as Pe,y as Le,z as Ge,O as Te,r as Ae,P as je,Q as De,p as We,o as Oe}from"./active-ingest-CT6jSGhr.js";import{p as _e}from"./scene-framing-Cat0GtyJ.js";import{w as ze,c as U,h as Fe,i as Ue,a as Ve,b as He,r as xe,e as Ne}from"./resolve-three-SZE_WWUM.js";import{s as Be}from"./ingest-source-persistence-C_6Hiyra.js";import{a as O}from"./json-history-resource-BbxllWfV.js";import{r as qe}from"./three-ingest-runtime-QzDYk6tU.js";import{describeMountFailure as Je}from"./mount-readiness-Ds0HvvLH.js";import{formatLoopGateMessage as Ke}from"./loop-gate-report-N52EWFGD.js";import{a as Xe,s as Ye}from"./three-authoring-adapter-CmSQ3Vui.js";import{installSceneCapture as Ze}from"./scene-capture-BQKzU0NT.js";import{s as Qe}from"./mount-ingest-root-glv2SSWf.js";import{landIngestBootInEdit as et}from"./ingest-boot-viewport-D5rI_Kk_.js";import{b as tt,c as _,e as rt,g as V}from"./registry-02YZjMNp.js";import"./game-contract-seams-a5YXejOu.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"./three.module-D396a9Mn.js";import"./playtest-BXIL1JEF.js";import"./dom-authoring-adapter-CY8C7f4T.js";import"./react-world-authoring-adapter-DmrwM3py.js";import"./board-guides-DziKSTss.js";import"./writer-B-KovzkA.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-BZfi3mmo.js";import"./inference-diagnostics-Dhmtfbq_.js";import"./debug-registry-Dgvitx8M.js";import"./webgl-frame-capture-FlF9zQmW.js";import"./EffectComposer-DQxfsXBZ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-QYRpPuFJ.js";import"./CSS3DRenderer-CL7ABLVK.js";import"./source-persistence-backend-C-aR-B_Y.js";import"./three-projection-core-BmKMZ-nf.js";import"./three-CDSueJyJ.js";import"./viewport-pick-context-DkawXbEi.js";import"./body-marks-h_xDxiDE.js";import"./user-data-BB2Of6Ht.js";import"./object-marks-DwvIEBOK.js";import"./structural-ids-Dc-7rEwi.js";import"./object3d-authoring-subject-CH5sI2oP.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./r3f-physics-binding-BBo8oma9.js";const nt="contract-hierarchy:group:",I="contract-hierarchy:render-tree";function H(t){return`${nt}${encodeURIComponent(t)}`}function z(t){return{id:H(t.id),label:t.label,secondaryLabel:`${t.count} ${t.count===1?"item":"items"}`,role:"folder",kind:"group",parentId:null,childIds:[]}}function ot(t){if(!Array.isArray(t))throw new Error("hierarchy() did not return an array");const e=new Set;for(const r of t){if(typeof r!="object"||r===null||typeof r.id!="string"||r.id.trim().length===0||typeof r.label!="string"||r.label.trim().length===0||typeof r.count!="number"||!Number.isInteger(r.count)||r.count<0)throw new Error("hierarchy() returned an invalid { id, label, count } group");if(e.has(r.id))throw new Error(`hierarchy() returned duplicate id "${r.id}"`);e.add(r.id)}return t}function st(t,e){if(!e)return t;let r=!1;const o=()=>{try{return ot(e())}catch(a){return r||(r=!0,h.warn(`Ignored invalid game-contract hierarchy: ${a instanceof Error?a.message:String(a)}`,"ingest")),[]}},n=()=>{const a=o(),i=t.hierarchy.roots();return a.length===0?i:[...a.map(z),{id:I,label:"Rendered objects",secondaryLabel:"live tree",role:"folder",kind:"group",parentId:null,childIds:i.map(d=>d.id)}]},s=a=>{const i=o(),d=i.find(w=>H(w.id)===a);if(d)return z(d);if(i.length>0&&a===I){const w=t.hierarchy.roots();return{id:I,label:"Rendered objects",secondaryLabel:"live tree",role:"folder",kind:"group",parentId:null,childIds:w.map(g=>g.id)}}const p=t.hierarchy.node(a);return i.length>0&&p?.parentId===null?{...p,parentId:I}:p},l=new Proxy(t.hierarchy,{get(a,i){if(i==="roots")return n;if(i==="node")return s;const d=Reflect.get(a,i,a);return typeof d=="function"?d.bind(a):d}}),m=a=>{const i=t.subscribe?.(a),d=e.subscribe?.(a);return()=>{i?.(),d?.()}};return new Proxy(t,{get(a,i){if(i==="hierarchy")return l;if(i==="subscribe")return m;const d=Reflect.get(a,i,a);return typeof d=="function"?d.bind(a):d}})}const at="vgaiDomStub";let F=null;function x(t){for(const e of fe())if(e.surface.contains(t))return e;return null}function it(){if(F!==null||typeof Element>"u")return;const t=Element.prototype,e=t.requestPointerLock;typeof e=="function"&&(F=e,t.requestPointerLock=function(r){const o=x(this);return o&&!o.gate()?(console.error("Ingested game requested pointer lock while its input gate is closed — refused. A game only captures the mouse while play is running AND the Game tab is active (the same predicate that gates its keyboard listeners); the editor viewport owns pointer lock otherwise. See packages/editor/src/ingest/game-pointer-lock.ts."),Promise.reject(new Error("pointer lock refused: game input gate is closed"))):e.call(this,r)})}function N(){if(typeof document>"u")return;const t=document.pointerLockElement;t&&x(t)&&document.exitPointerLock()}function ct(t,e,r,o,n={}){let s=null;return{setPaused(l){if(!l){o.resume(),n.realmGate?.release();return}o.pause(),n.realmGate?.hold(),be({gate:n.realmGate??null,progress:()=>e.info?.render.frame??t.getDrawCount(),...n.verifyWindowMs!==void 0?{windowMs:n.verifyWindowMs}:{},...n.sleep!==void 0?{sleep:n.sleep}:{}}).then(m=>{s=m,n.onVerdict?.(m),m.loop!=="gated"&&console.warn(Ke({worldId:r,reason:t.getAnimationLoop(e)?m.reason:`${m.reason} (this game also never called renderer.setAnimationLoop)`}))})},lastVerdict:()=>s}}function dt(t){let e=0;return t.traverse(r=>{ae(r)!==void 0&&e++}),e}async function ut(t,e=2500,r=o=>new Promise(n=>setTimeout(n,o))){const o=performance.now();for(;;){const n=dt(t);if(n>0)return n;if(performance.now()-o>=e)return 0;await r(100)}}function lt(t,e){const r=e.replace(/\\/g,"/"),o=r.startsWith("/")?"":t.replace(/\\/g,"/"),n=[];for(const s of`${o}/${r}`.split("/"))s===""||s==="."||(s===".."?n.pop():n.push(s));return`/${n.join("/")}`}function mt(t,e){if(!t)return[];const r=t.replace(/\\/g,"/").replace(/\/+$/,""),o=new Set([r]);for(const n of e??[]){const s=lt(r,n),l=s.slice(0,s.lastIndexOf("/"));l&&o.add(l)}return[...o]}function ft(t,e){if(!t||e.length===0)return!1;for(const r of Object.values(t)){const o=r?.file;if(typeof o!="string")continue;const n=o.replace(/\\/g,"/");if(e.some(s=>n===s||n.startsWith(`${s}/`)))return!0}return!1}function pt(t){return t.servedStampedSource||t.graphStamps>0?"oid-source":"structural"}async function ht(){if(!await re())return null;try{return await ne().index?.()??null}catch{return null}}function gt(t){return h.getEntries().filter(e=>e.level==="error"&&e.source==="runtime"&&e.timestamp>=t).slice(-10).map(e=>e.count>1?`${e.message} (×${e.count})`:e.message)}async function yt(t,e,r){if(r)try{return await r(),"declared"}catch(o){h.error(`Ingest game "${t}" declared \`window.vgaiGame.ready\` and it REJECTED (${String(o)}) — the world was already captured, so the host fell back to the measured settle wait. This root now reports readiness as measured.`,"ingest")}return await wt(e),"measured"}async function wt(t,e=5e3){const r=performance.now();let o=-1,n=0;return new Promise(s=>{const l=()=>{const m=t.children.length;if(n=m===o?n+1:0,o=m,n>=3||performance.now()-r>e)return s();setTimeout(l,120)};l()})}function bt(t,e){const r=we(),o=v()?.root??r.__vgaiGameRoot,n=o instanceof HTMLElement&&o.contains(e)?o:e;return n.contains(t)?t:(n.parentElement!==t&&t.contains(n)||(U(n),n.parentElement!==t&&t.appendChild(n)),n)}async function vt(t,e,r,o={}){const n=document.createElement("div");n.id="container",n.style.cssText=`position:absolute;inset:0;width:100%;height:100%;overflow:hidden;${pe}`,r.appendChild(n);const s=he(n);Z(n);const l=D();l&&await Q(l.rootPath);const m=[];for(const c of e.domStubs??[]){if(document.getElementById(c))continue;const f=document.createElement("div");f.id=c,f.style.display="none",f.dataset[at]="",n.appendChild(f),m.push(f)}const a=await qe(),i=a.three,d=Ze(i,a.EffectComposer,{isHostRenderer:ie,additionalRendererCtors:[a.CSS3DRenderer],declaredScene:()=>{const c=Se(v());return c.malformed!==null&&h.error(`Ingest game "${e.id}" ${c.malformed} — falling back to the MEASURED first-render adoption.`,"ingest"),c.world},onWorldAdoption:ee(e.id)});if(e.assets){const c=e.assets;i.DefaultLoadingManager.setURLModifier(f=>{for(const y of Object.keys(c))if(f.includes(y))return c[y];return f})}window.__vgaiMountCold=!0;const p=Date.now();await e.load();const w=o.captureTimeoutMs??1e4,g=ge(v());g.malformed!==null&&h.error(`Ingest game "${e.id}" ${g.malformed} — the host is measuring readiness instead.`,"ingest");const b=g.ready===null?"measured":"declared";k({rootId:e.id,mechanism:g.ready===null?"measured-wait":"contract-ready",source:b,state:"waiting"});let u;try{u=await d.waitForCapture({timeoutMs:w,onWait:c=>Qe(e.id,c)})}catch(c){d.uninstall(),i.DefaultLoadingManager.setURLModifier(y=>y);for(const y of m)y.remove();W(),n.remove(),j(e.id);const f=Je({gameId:e.id,timeoutMs:w,readinessSource:b,pageErrors:gt(p),cause:String(c)});throw k({rootId:e.id,mechanism:g.ready===null?"measured-wait":"contract-ready",source:b,state:"failed",failure:f.kind}),new Error(f.message)}const R=bt(n,u.renderer.domElement),S=ye(v());S.malformed!==null&&h.error(`Ingest game "${e.id}" ${S.malformed} — the host is using the captured renderer’s canvas instead.`,"ingest"),te(e.id,S.canvas??u.renderer.domElement,S.canvas?"declared":"measured"),it();const P=await yt(e.id,u.scene,g.ready);k({rootId:e.id,mechanism:P==="declared"?"contract-ready":"measured-wait",source:P,state:"ready"});const E={pause:()=>u.renderer.setAnimationLoop?.(null),resume:()=>{const c=d.getAnimationLoop(u.renderer);c&&u.renderer.setAnimationLoop?.(c)}};Be(e.dataWriter??null);const q=mt(D()?.rootPath,e.sourceModules),L=ft(await ht(),q),J=L?0:await ut(u.scene),G=pt({servedStampedSource:L,graphStamps:J})==="oid-source"?Xe(t,u.scene,{worldId:e.id,loop:E,camera:u.camera,journal:O(e.id)}):Ye(t,u.scene,{loop:E,camera:u.camera,journal:O(e.id)}),T=ct(d,u.renderer,e.id,E,{realmGate:M(),onVerdict:()=>t.notifyIngestEdit()}),{systems:A,renderDebug:K,debugCollisions:X}=ze({contractSystems:v()?.systems,surface:"three",runtime:u,setRenderPassHooks:c=>d.setRenderPassHooks(c)});for(const c of X)h.error(`Ingest game "${e.id}" — ${c}; it will refuse`,"ingest");return{game:{kind:"three",scene:u.scene,camera:u.camera,drivesOwnLoop:!0,...Object.keys(A).length>0?{systems:A}:{},setPaused:c=>T.setPaused(c),resize:(c,f)=>{if(s.gameResizesItself){s.dispatchResize();return}const y=Fe(c,f);u.renderer.setSize(y.width,y.height,!1),d.resizeComposers(y.width,y.height),U(R)},dispose:()=>{d.setRenderPassHooks(null),ve(),K?.dispose();try{u.renderer.setAnimationLoop?.(null),u.renderer.dispose?.()}catch{}d.uninstall(),i.DefaultLoadingManager.setURLModifier(c=>c);for(const c of m)c.remove();N(),W(),oe(e.id),se(e.id),j(e.id),n.remove()},authoring:G},authoring:G,hostEl:n,capture:d,scene:u.scene,realmLoopVerdict:()=>T.lastVerdict()}}function St(t,e){const r={};for(const[o,n]of Object.entries(e)){const s=V(t,n),l=_[s];if(!l)throw new Error(`ingest discovery: "${t}"'s asset "${n}" did not match any served asset (looked for glob key "${s}" — available: ${Object.keys(_).join(", ")})`);r[o]=l}return r}function $(t,e){const r=V(t,e),o=rt[r];if(!o)throw new Error(`ingest discovery: "${t}"'s module "${e}" did not match any game module (looked for glob key "${r}").`);return o}function It({folderId:t,manifest:e,root:r}){const{adapter:o}=r;if(!r.entry)throw new Error(`ingest discovery: "${t}" has no \`entry\` — an ingest root mounts the game's own entry module.`);return{...{id:r.id,name:e.name,description:r.description??"",gameVersion:e.version,sourceModules:Ve(r.entry,r.world?.entry),...Ue(o.dataWriter,s=>$(t,s)),...o.assets!==void 0?{assets:St(t,o.assets)}:{},...o.domStubs!==void 0?{domStubs:o.domStubs}:{},...o.captureTimeoutMs!==void 0?{captureTimeoutMs:o.captureTimeoutMs}:{}},load:He($(t,r.entry),o.contractShim===void 0?void 0:$(t,o.contractShim))}}let C=null;function Rt(){return C||(C=tt("three").map(It).sort((t,e)=>t.id.localeCompare(e.id))),C}function Et(t){return Rt().find(e=>e.id===t)}function kt(t){return t==="devtools-observer"?"this game runs its OWN copy of three; the host reached its renderer through three's `__THREE_DEVTOOLS__` observation seam":"this game imports the host's three directly, in the editor's own realm"}function $t(t){const{store:e,session:r,sessionId:o}=t,n=r.mount;if(!n)return;const s=n.authoring,l=Ge(),m=st(s,l?.systems?.hierarchy),a=Ne({primary:m,worldId:o,hostEl:n.hostEl,...l?.root?{declaredRoot:l.root}:{},store:e}),i=n.scene,d=new ResizeObserver(()=>{const u=t.gameContainer.getBoundingClientRect();u.width>0&&u.height>0&&n.game.resize?.(u.width,u.height)});d.observe(t.gameContainer),r.resizeObserver=d;const p=s.refresh(),w=s.measureWriteReach();h.log(`Captured live scene (${i.children.length} top-level children, ${n.capture.getDrawCount()} draws); ingested ${p.count} objects (${p.meshes} meshes, ${p.lights} lights`+(p.instancedMeshes>0?`, incl. ${p.instancedMeshes} InstancedMesh drawing ${p.instances} units`:"")+`); ${w.addressable} of ${w.total} have a source address — edits go to ${w.destination}`,"ingest"),Te(o,n.realmLoopVerdict?.()??void 0),ue(a),le(n.game.systems??{}),e.enterPlayScene(i,void 0,s.objectMapSnapshot()),e.focusOnScene(()=>_e(n.capture.captured?.camera,i)),et(e),e.notifyIngestEdit(),me();const g=Y({authoring:a});Ae({reach:g,reachMechanism:kt(n.capture.capturedVia),loop:()=>je(n),writeReach:()=>s.measureWriteReach()});const b={gameId:o,...Oe(a),drawCount:()=>n.capture.getDrawCount(),get reflected(){return s.refresh()},get sceneChildren(){return i.children.length},reach:g,resize:(u,R)=>n.game.resize?.(u,R),...r.lifecycle.setPaused?{setPaused:r.lifecycle.setPaused}:{}};De(b,n),We("__vgaiIngest",b)}async function Ct(t,e,r){Re(),Ee(r),await ce();const o=de();if(!o){h.error("Game container not mounted — cannot ingest","ingest");return}t.setPlayState("playing"),h.log(`Ingesting unmodified game: ${e.name}`,"ingest");const n=()=>t.playState==="playing"&&t.activeViewportTab==="play";try{const s={captureTimeoutMs:e.captureTimeoutMs},l=await vt(t,e,o,s),m=l.game.setPaused,a={store:t,mount:l,lifecycle:ke(m?{setPaused:i=>m(i),step:()=>M()?.step(1),canStep:()=>l.realmLoopVerdict?.()?.loop==="gated"&&M()!==null}:{pauseGap:"the captured Three root exposes no mounted setPaused capability"})};$e({kind:"three",session:a,siblings:[],worldId:r}),Ce(n),a.inputGateUnsubscribe=t.subscribe(()=>{n()||N()}),Me(Pe()),$t({store:t,session:a,gameContainer:o,sessionId:r})}catch(s){throw h.error(`Ingest failed: ${s}`,"ingest"),Le(),s}}function B(t,e,r){return Ie(()=>Ct(t,e,r))}async function kr(t,e){const r=Et(e);if(!r){h.error(`Unknown ingest game: ${e}`,"ingest");return}return B(t,r,e)}async function $r(t,e,r){const o=xe(e,r);return B(t,o,e.id)}export{B as mountThreeIngestRoot,kr as mountThreeIngestRootById,$r as mountThreeIngestRootFromManifest};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{R as l,P as w,G as g,a as O,D as L,C as y,b as T,H as C,S as F,c as b,V as M,d as B,W as D,e as P,f as c,g as R,L as k,F as E,T as x,N as z,O as N,h as G,i as I,j as A,k as W,l as V,A as _}from"./three.quarks.esm-B1C61jGo.js";import{armSoftParticleDepth as $,disarmSoftParticleDepth as H}from"./soft-particle-depth-DGvfQDi1.js";import{textureLoader as J}from"./loader-CaF_I7Yt.js";import{bM as q,b7 as K,ao as Q,ap as U,aq as X,F as Y,z as Z,a1 as j,j as ee,bB as ie,a2 as re,am as te,k as d,a5 as h,by as ne,av as ae}from"./three.module-D396a9Mn.js";import"./index-GIL7oGEO.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 oe={billboard:l.BillBoard,stretchedBillboard:l.StretchedBillBoard,mesh:l.Mesh,trail:l.Trail,horizontalBillboard:l.HorizontalBillBoard,verticalBillboard:l.VerticalBillBoard},f={clamp:te,repeat:re,mirror:ie},se={"linear/mips":ae,"linear/no-mips":d,"nearest/mips":ne,"nearest/no-mips":h},m=new Map;function le(e,i){const n=i===void 0?e:`${e}\0${JSON.stringify(i)}`,r=m.get(n);if(r)return r;const a=J.load(e);return a.colorSpace=ee,i!==void 0&&ce(a,i),m.set(n,a),a}function ce(e,i){if(i.wrap!==void 0&&(e.wrapS=f[i.wrap],e.wrapT=f[i.wrap]),i.filter!==void 0||i.mipmaps!==void 0){const n=i.filter??"linear",r=i.mipmaps===!1?"no-mips":"mips";i.filter!==void 0&&(e.magFilter=n==="linear"?d:h),e.minFilter=se[`${n}/${r}`]}i.mipmaps!==void 0&&(e.generateMipmaps=i.mipmaps),i.anisotropy!==void 0&&(e.anisotropy=i.anisotropy)}function s(e){const i={};for(const[n,r]of Object.entries(e))r!==void 0&&(i[n]=r);return i}function v(e){switch(e.type){case"point":return new b;case"sphere":return new F(s({radius:e.radius,arc:e.arc,thickness:e.thickness}));case"hemisphere":return new C(s({radius:e.radius,arc:e.arc,thickness:e.thickness}));case"cone":return new T(s({radius:e.radius,arc:e.arc,thickness:e.thickness,angle:e.angle}));case"circle":return new y(s({radius:e.radius,arc:e.arc,thickness:e.thickness}));case"donut":return new L(s({radius:e.radius,arc:e.arc,thickness:e.thickness,donutRadius:e.donutRadius}));case"rectangle":return new O(s({width:e.width,height:e.height,thickness:e.thickness}));case"grid":return new g(s({width:e.width,height:e.height,column:e.column,row:e.row}))}}function t(e){return M(e)}function u(e){return B(e)}function S(e){switch(e.type){case"ApplyForce":return new _(new c(e.direction[0],e.direction[1],e.direction[2]),t(e.magnitude));case"ColorOverLife":return new V(u(e.color));case"SizeOverLife":return new W(t(e.size));case"SpeedOverLife":return new A(t(e.speed));case"RotationOverLife":return new I(t(e.angularVelocity));case"ForceOverLife":return new G(t(e.x),t(e.y),t(e.z));case"OrbitOverLife":return new N(t(e.orbitSpeed),e.axis?new c(e.axis[0],e.axis[1],e.axis[2]):void 0);case"Noise":return new z(t(e.frequency),t(e.power),e.positionAmount?t(e.positionAmount):void 0,e.rotationAmount?t(e.rotationAmount):void 0);case"TurbulenceField":return new x(new c(e.scale[0],e.scale[1],e.scale[2]),e.octaves,new c(e.velocityMultiplier[0],e.velocityMultiplier[1],e.velocityMultiplier[2]),new c(e.timeScale[0],e.timeScale[1],e.timeScale[2]));case"FrameOverLife":return new E(t(e.frame));case"LimitSpeedOverLife":return new k(t(e.speed),e.dampen);case"ChangeEmitDirection":return new R(t(e.angle));case"GravityForce":return new P(new c(e.center[0],e.center[1],e.center[2]),e.magnitude);case"WidthOverLength":return new D(t(e.width))}}function pe(e){const i={};e.map&&(i.map=le(e.map,e.mapSampler));const n=e.blending==="normal"?q:K,r=e.transparent!==!1,a=e.depthWrite??!1,o=e.side==="back"?Q:e.side==="double"?U:X;return e.type==="standard"?new Y({color:e.color??"#ffffff",...i,blending:n,transparent:r,depthWrite:a,side:o}):new Z({color:e.color??"#ffffff",...i,blending:n,transparent:r,depthWrite:a,side:o})}let p=null;function ue(){if(p)return p;const e=document.createElement("canvas");e.width=16,e.height=16;const i=e.getContext("2d"),n=i.createRadialGradient(8,8,0,8,8,8);return n.addColorStop(0,"rgba(255,255,255,1)"),n.addColorStop(1,"rgba(255,255,255,0)"),i.fillStyle=n,i.fillRect(0,0,16,16),p=new j(e),p}function Fe(e,i){const n=pe(e.material);(i?.defaultSprite??!0)&&!e.material.map&&"map"in n&&(n.map=ue());const r={material:n};e.autoDestroy!=null&&(r.autoDestroy=e.autoDestroy),e.looping!=null&&(r.looping=e.looping),e.prewarm!=null&&(r.prewarm=e.prewarm),e.duration!=null&&(r.duration=e.duration),i?.shape?r.shape=i.shape:e.shape&&(r.shape=v(e.shape)),i?.instancingGeometry&&(r.instancingGeometry=i.instancingGeometry),e.startLife&&(r.startLife=t(e.startLife)),e.startSpeed&&(r.startSpeed=t(e.startSpeed)),e.startSize&&(r.startSize=t(e.startSize)),e.startRotation&&(r.startRotation=t(e.startRotation)),i?.startColor?r.startColor=i.startColor:e.startColor&&(r.startColor=u(e.startColor)),e.startTileIndex&&(r.startTileIndex=t(e.startTileIndex)),e.renderMode==="trail"&&e.startLength&&(r.rendererEmitterSettings={startLength:t(e.startLength)}),e.emissionOverTime&&(r.emissionOverTime=t(e.emissionOverTime)),e.emissionOverDistance&&(r.emissionOverDistance=t(e.emissionOverDistance)),e.emissionBursts&&(r.emissionBursts=e.emissionBursts.map(o=>({time:o.time,count:t(o.count),cycle:o.cycle??1,interval:o.interval??0,probability:o.probability??1}))),e.behaviors&&(r.behaviors=e.behaviors.map(S)),e.renderMode!=null&&(r.renderMode=oe[e.renderMode]),e.worldSpace!=null&&(r.worldSpace=e.worldSpace),e.renderOrder!=null&&(r.renderOrder=e.renderOrder),e.uTileCount!=null&&(r.uTileCount=e.uTileCount),e.vTileCount!=null&&(r.vTileCount=e.vTileCount),e.blendTiles!=null&&(r.blendTiles=e.blendTiles),e.softParticles!=null&&(r.softParticles=e.softParticles),e.softFarFade!=null&&(r.softFarFade=e.softFarFade),e.softNearFade!=null&&(r.softNearFade=e.softNearFade);const a=new w(r);return{emitter:a.emitter,system:a}}function be(e,i){i.duration!=null&&(e.duration=i.duration),i.looping!=null&&(e.looping=i.looping),i.prewarm!=null&&(e.prewarm=i.prewarm),i.shape&&(e.emitterShape=v(i.shape)),i.startLife&&(e.startLife=t(i.startLife)),i.startSpeed&&(e.startSpeed=t(i.startSpeed)),i.startSize&&(e.startSize=t(i.startSize)),i.startRotation&&(e.startRotation=t(i.startRotation)),i.startColor&&(e.startColor=u(i.startColor)),i.startTileIndex&&(e.startTileIndex=t(i.startTileIndex)),i.emissionOverTime&&(e.emissionOverTime=t(i.emissionOverTime)),i.emissionOverDistance&&(e.emissionOverDistance=t(i.emissionOverDistance)),e.emissionBursts=(i.emissionBursts??[]).map(n=>({time:n.time,count:t(n.count),cycle:n.cycle??1,interval:n.interval??0,probability:n.probability??1})),e.behaviors=(i.behaviors??[]).map(S)}function Me(e,i,n=1/60){e.restart();const r=Math.max(0,i);let a=0;for(;a<r;){const o=Math.min(n,r-a);e.update(o),a+=o}e.pause()}function Be(e,i){e.addSystem(i),i.softParticles&&$(e)}function De(e,i){e.deleteSystem(i),i.softParticles&&H(e)}function Pe(){return{looping:!0,duration:2,shape:{type:"cone",radius:.1,angle:.3},startLife:{type:"IntervalValue",a:.5,b:1.5},startSpeed:{type:"IntervalValue",a:1,b:3},startSize:{type:"IntervalValue",a:.05,b:.15},startColor:{type:"ConstantColor",color:{r:1,g:.8,b:.2,a:1}},emissionOverTime:{type:"ConstantValue",value:30},behaviors:[{type:"SizeOverLife",size:{type:"PiecewiseBezier",functions:[{function:{p0:1,p1:.67,p2:.33,p3:0},start:0}]}}],material:{type:"basic",blending:"additive",transparent:!0,depthWrite:!1}}}export{be as applyParticlesDataLive,Fe as createParticleSystemFromData,Pe as defaultParticlesData,Be as registerParticleSystem,Me as scrubParticleSystemTo,De as unregisterParticleSystem};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import{B as P,dk as A,bG as M,cG as S,dl as j}from"./index-GIL7oGEO.js";import{c as v}from"./react-story-board-BDDwiE2H.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"./three.module-D396a9Mn.js";const u="src/lib/pasteboard/pasteboard.tsx",p="src/design/pasteboard.tsx";function T(r){return r.replace(/\.stories(?=\.[^.]+$)/,"")}function k(r){return`../${r.replace(/\.[cm]?[jt]sx?$/,"").replace(/^src\//,"")}`}function O(r,i){const t=r.filter(o=>o.path===i&&(o.exported||o.defaultExport));return t.find(o=>o.defaultExport)??(t.length===1?t[0]:null)}async function G(){if(!(await fetch("/__ui-source/read",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:u})})).ok)throw new Error(`Materialize pasteboard needs the pasteboard helpers at ${u} — run ${P("add pasteboard")} first.`);const i=document.querySelector('[data-vgai-react-story-board="true"]'),t=v(i);if(!t||t.length===0)throw new Error("Materialize pasteboard reads the live UI board and it has no frames — open the UI document (a project with dom stories) first.");const o=A(M()),m=await S(),b=m.ok?m.entries:[],a=[],s=[],l=new Map;for(const e of t){const d=o.find(E=>E.id===e.storyId);if(!d)continue;const g=T(d.modulePath),n=O(b,g);if(!n){s.push(d.label??d.id);continue}const c=k(n.path),f=n.defaultExport?`import ${n.name} from '${c}';`:`import { ${n.name} } from '${c}';`;l.set(c,f),a.push({importLine:f,name:n.name,x:e.x,y:e.y})}if(a.length===0)throw new Error(`Materialize pasteboard resolved no importable owner component for any board frame (skipped: ${s.join(", ")||"none"}). A story's owner module must export the component its frames render.`);const w=Math.max(...a.map(e=>e.x))+960,y=Math.max(...a.map(e=>e.y))+720,x=a.map(e=>` <At x={${e.x}} y={${e.y}}>
|
|
2
|
-
<${e.name} />
|
|
3
|
-
</At>`).join(`
|
|
4
|
-
`),$=`${[...l.values()].sort().join(`
|
|
5
|
-
`)}
|
|
6
|
-
import { At, Pasteboard } from '../lib/pasteboard/pasteboard';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Materialized from the UI board's derived auto-grid — this file is now the
|
|
10
|
-
* AUTHORED canvas: edit freely, and a drag in the editor writes each At's
|
|
11
|
-
* x/y literals right here.
|
|
12
|
-
*/
|
|
13
|
-
export default function DesignPasteboard() {
|
|
14
|
-
return (
|
|
15
|
-
<Pasteboard width={${w}} height={${y}}>
|
|
16
|
-
${x}
|
|
17
|
-
</Pasteboard>
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
`,h=await j(p,$);if(!h.created)throw new Error(h.error??`${p} already exists — the pasteboard is already authored; edit it directly (there is deliberately no regeneration).`);return window.dispatchEvent(new CustomEvent("editor:open-project-asset",{detail:{path:p,kind:"source"}})),`Materialized ${a.length} frame(s) into ${p}`+(s.length>0?` (skipped, no importable owner component: ${s.join(", ")})`:"")}export{p as MATERIALIZED_PASTEBOARD_PATH,u as PASTEBOARD_HELPERS_PATH,G as materializePasteboard};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pasteboard-materialize-BqSS4QzV.js","assets/index-GIL7oGEO.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/three.module-D396a9Mn.js","assets/index-D2fNXpHa.css","assets/react-story-board-BDDwiE2H.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as o,V as t}from"./index-GIL7oGEO.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"./three.module-D396a9Mn.js";const b="workspace.action",u=[{id:"pasteboard.materialize",label:"Materialize Pasteboard from UI Board",execute:async()=>{const{materializePasteboard:a}=await o(async()=>{const{materializePasteboard:r}=await import("./pasteboard-materialize-BqSS4QzV.js");return{materializePasteboard:r}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]));try{t.log(`[pasteboard] ${await a()}`,"authoring")}catch(r){t.error(`[pasteboard] materialize refused: ${r instanceof Error?r.message:String(r)}`,"authoring")}}}];export{u as actions,b as point};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{AuthoringAdapter2D as O}from"./authoring-CgcOFhGS.js";import{V as g,c9 as j,fE as T,bT as m,bU as v}from"./index-GIL7oGEO.js";import{c as A}from"./source-persistence-backend-C-aR-B_Y.js";import{J as N}from"./json-history-resource-BbxllWfV.js";import{f as F,a as L}from"./pixi-transform-channels-VjdohT11.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"./three.module-D396a9Mn.js";import"./ingest-source-persistence-C_6Hiyra.js";const H={count:0,sprites:0};class _{constructor(t,e,r,i=n=>queueMicrotask(n)){this.root=t,this.index=e,this.mapping=r,this.scheduleWindowClose=i,this.refresh()}current={nodes:new Map,rootIds:[],stats:H};projectionFresh=!1;refresh(){const t=this.index.refresh();return this.current=this.readProjection(t),this.openProjectionWindow(),t}project(){return this.projectionFresh?this.current:this.reproject()}reproject(){const t=this.index.reindex();return this.current=this.readProjection(t),this.openProjectionWindow(),this.current}invalidate(){this.projectionFresh=!1}openProjectionWindow(){this.projectionFresh||(this.projectionFresh=!0,this.scheduleWindowClose(()=>{this.projectionFresh=!1}))}projection(){return this.current}object(t){const e=this.current.nodes.get(t)?.object??null;return e===null||e.destroyed?null:e}node(t){const e=this.current.nodes.get(t);if(!e)return null;const r=this.index.node(t);return r?{...r,parentId:e.parentId,childIds:[...e.childIds]}:null}roots(){return this.current.rootIds.map(t=>this.node(t)).filter(t=>t!==null)}pick(t,e,r){return this.candidates(t,e,r)[0]??null}candidates(t,e,r){const i=this.pointFromClient(t,e);return i?(this.project(),this.hitIds(i,r)):[]}pointFromClient(t,e){const r=this.mapping?.surface()??null;if(!r)return null;const i=r.getBoundingClientRect();if(i.width<=0||i.height<=0)return null;const n=this.mapping?.pointFromClient?.(t,e,i)??null;if(this.mapping?.pointFromClient)return n;const c=Number(r.dataset?.vgaiStageWidth??i.width),a=Number(r.dataset?.vgaiStageHeight??i.height);return!(c>0)||!(a>0)?null:{x:(t-i.left)*(c/i.width),y:(e-i.top)*(a/i.height)}}hitIds(t,e){const r=[],i=[];this.collectHits(this.root,t,"visual",r),this.collectHits(this.root,t,"hitArea",i);const n=[],c=new Set;for(const a of[...r,...i]){const s=a.__authId;s&&!e(s)&&!c.has(s)&&(c.add(s),n.push(s))}return n}rect(t){const e=this.object(t);if(!e||typeof e.getBounds!="function")return null;const r=e.getBounds();return!(r.width>0)||!(r.height>0)?null:{x:r.x,y:r.y,width:r.width,height:r.height}}contextRects(t){const e=this.node(t);if(!e)return{siblings:[]};const r=e.parentId?this.node(e.parentId)?.childIds??[]:this.current.rootIds,i=e.parentId?this.rect(e.parentId):null;return{...i?{parent:i}:{},siblings:r.filter(n=>n!==t).map(n=>this.rect(n)).filter(n=>n!==null)}}readProjection(t){const e=new Map,r=[],i=n=>{const c=this.index.displayObject(n.id);if(!c)return;const a={object:c,id:n.id,parentId:n.parentId,childIds:[...n.childIds]};e.set(n.id,a);for(const s of n.childIds){const u=this.index.node(s);u&&i(u)}};for(const n of this.index.roots())r.push(n.id),i(n);return{nodes:e,rootIds:r,stats:t}}collectHits(t,e,r,i){const n=t.children??[];for(let c=n.length-1;c>=0;c--){const a=n[c];if(!a.visible||!a.renderable)continue;a.updateLocalTransform();const s={x:0,y:0};a.localTransform.applyInverse(e,s),this.collectHits(a,s,r,i),this.contains(a,s,r)&&i.push(a)}}contains(t,e,r){if(!t.__authId)return!1;const i=t;return r==="hitArea"?i.hitArea?i.hitArea.contains(e.x,e.y):!1:typeof i.containsPoint=="function"?i.containsPoint(e):!1}}const $="data-authoring-instance",M="data-authoring-label",R="data-authoring-component";function y(o,t){if(!o||typeof o!="object")return;const e=o[t];return typeof e=="string"&&e.length>0?e:void 0}function x(o){return y(o,$)}function P(o){return y(o,M)}function D(o){return y(o,R)}function U(o){const t=x(o);return t?x(o.parent)!==t:!1}const w="#root";function Y(o){if(!(!o.position||!o.scale||!o.pivot||!o.skew))return{x:o.position.x,y:o.position.y,rotation:o.rotation,scaleX:o.scale.x,scaleY:o.scale.y,pivotX:o.pivot.x,pivotY:o.pivot.y,skewX:o.skew.x,skewY:o.skew.y}}function B(o,t){!o.position||!o.scale||!o.pivot||!o.skew||(o.position.set(t.x,t.y),o.scale.set(t.scaleX,t.scaleY),o.pivot.set(t.pivotX,t.pivotY),o.skew.set(t.skewX,t.skewY),o.rotation=t.rotation)}class W{constructor(t,e,r,i){this.root=t,this.onRestored=i;const n=e.projectHistory;this.resource=n?new N({history:n,kind:"session-state",scope:"session",subject:{...r,id:`${r.id}/world-2d-structure`},displayName:"World 2D structure",capture:()=>this.capture(),conflictIdentity:c=>Object.fromEntries(Object.entries(c.placements).map(([a,s])=>[a,s.parent])),restore:async c=>{this.restore(c)}}):null}byUid=new Map;resource;track(t){return this.uidOf(t)}run(t,e){this.resource?.assertCanMutate();const r=this.capture(),i=e();return this.resource&&this.resource.record(t,r,this.capture()).catch(n=>{g.error(`[canvas] failed to journal "${t}" into project history — the structural edit is applied but has no history entry (it cannot be undone): ${n instanceof Error?n.message:String(n)}`,"authoring")}),i}dispose(){this.resource?.dispose(),this.byUid.clear()}uidOf(t){if(t===this.root)return w;const e=t,r=e.__vgaiStructUid;if(r&&this.byUid.get(r)===t)return r;const i=r??`s${crypto.randomUUID()}`;return e.__vgaiStructUid=i,this.byUid.set(i,t),i}capture(){const t={};for(const[e,r]of this.byUid){const i=r.parent??null,n=Y(r);t[e]={parent:i?this.uidOf(i):null,index:i?i.children?.indexOf(r)??-1:-1,...n?{pose:n}:{}}}return{placements:t}}restore(t){const e=Object.entries(t.placements);for(const[r,i]of e){if(i.parent!==null)continue;const n=this.byUid.get(r);n?.parent?.removeChild(n)}for(const[r,i]of e.filter(([,n])=>n.parent!==null).sort((n,c)=>n[1].index-c[1].index)){const n=this.byUid.get(r);if(!n)continue;const c=i.parent===w?this.root:this.byUid.get(i.parent);if(!c||typeof c.addChildAt!="function")continue;const a=c.children.length-(n.parent===c?1:0);c.addChildAt(n,Math.max(0,Math.min(i.index,a))),i.pose&&B(n,i.pose)}this.onRestored()}}const k=[{kind:"container",label:"Container"},{kind:"sprite",label:"Sprite"},{kind:"text",label:"Text"},{kind:"graphics",label:"Graphics"}],b=/\.(png|jpe?g|webp|gif|svg)(\?.*)?$/i,X="a canvas structural edit would have to add, delete or move a construction statement in the world's own source, and this lane plans property writes only — an editor-created node has no construction site there at all",S="origin",z="#ff2d92",G="this world's write target has no origin write, so the pivot/anchor can be seen here but not dragged";function I(o){const t=o,e=t.anchor,r=t.texture;return e&&r?.orig?{anchor:e,texture:r}:null}function Q(o){const t=I(o);if(!t)return null;const e=o.bounds;return typeof e?.width=="number"&&typeof e.height=="number"?{x:e.width,y:e.height}:{x:t.texture.orig.width,y:t.texture.orig.height}}function V(o){return k.find(e=>e.kind===o)?.label??o}function q(o,t){switch(t){case"container":return new o.Container;case"sprite":{const e=new o.Sprite(o.Texture.WHITE);return e.setSize(64,64),e}case"text":return new o.Text({text:"Text",style:{fill:16777215,fontSize:24}});case"graphics":return new o.Graphics().rect(0,0,100,100).fill(16777215);default:return null}}function C(o,t){const e=K(o,t);Z(t,e);for(const r of t.children??[])e.addChild(C(o,r));return e}function K(o,t){if(t.constructor===o.Container)return new o.Container;if(t.constructor===o.Sprite){const e=t,r=new o.Sprite(e.texture);return r.anchor.set(e.anchor.x,e.anchor.y),r}if(t.constructor===o.Text){const e=t,r=new o.Text({text:e.text,style:e.style.clone()});return r.anchor.set(e.anchor.x,e.anchor.y),r}if(t.constructor===o.Graphics)return t.clone(!0);throw new Error(`"${t.label??t.constructor?.name??"this node"}" cannot be duplicated: a ${t.constructor?.name??"custom"} is constructed by the game's own code, and copying only its display half would put a lookalike with no behaviour into the world.`)}function Z(o,t){t.label=o.label,t.position.set(o.position.x,o.position.y),t.scale.set(o.scale.x,o.scale.y),t.pivot.set(o.pivot.x,o.pivot.y),t.skew.set(o.skew.x,o.skew.y),t.rotation=o.rotation,t.alpha=o.alpha,t.visible=o.visible,"tint"in o&&"tint"in t&&(t.tint=o.tint)}function J(o){const t=new Set;return(o.x!==void 0||o.y!==void 0||o.originX!==void 0||o.originY!==void 0)&&t.add("position"),(o.width!==void 0||o.height!==void 0||o.scaleXFactor!==void 0||o.scaleYFactor!==void 0)&&(t.add("scale"),(o.width!==void 0||o.height!==void 0)&&t.add("position")),o.rotate!==void 0&&t.add("rotation"),[...t]}function tt(o,t){const e=t*Math.PI/180/2,r=Math.sin(e),i=Math.cos(e),[n,c,a,s]=o.rotation;return[n*i+c*r,c*i-n*r,a*i+s*r,s*i-a*r]}function et(o,t){const e={position:[...o.transform.position],rotation:[...o.transform.rotation],scale:[...o.transform.scale]},r=t.rotate;r!==void 0&&(e.rotation=tt(o.transform,r));const i=t.width;i!==void 0&&o.rect.width>0&&(e.scale[0]=o.transform.scale[0]*Math.max(1e-4,i/o.rect.width));const n=t.height;n!==void 0&&o.rect.height>0&&(e.scale[1]=o.transform.scale[1]*Math.max(1e-4,n/o.rect.height));const c=t.scaleStep,a=h=>c!==void 0&&c>0?Math.round(h/c)*c:h,s=h=>Math.abs(h)>=1e-4?h:h<0?-1e-4:1e-4,u=t.scaleXFactor;u!==void 0&&(e.scale[0]=s(a(o.transform.scale[0]*u)));const l=t.scaleYFactor;return l!==void 0&&(e.scale[1]=s(a(o.transform.scale[1]*l))),e}function rt(o,t,e,r){return r.originX!==void 0||r.originY!==void 0?{dx:r.originX!==void 0&&o?r.originX-o.x:0,dy:r.originY!==void 0&&o?r.originY-o.y:0}:{dx:t?(r.x??e.x)-t.x:0,dy:t?(r.y??e.y)-t.y:0}}class vt{constructor(t,e,r){this.root=t,this.store=e,this.target=r.target,this.pixi=r.pixi??j,this.transforms={dimensions:()=>"2d",get:s=>{const u=this.a2d.getTransform(s);return u?L(u):{position:[0,0,0],rotation:[0,0,0,1],scale:[1,1,1]}},editability:(s,u)=>this.target.transformEditability(s,u),beginEdit:s=>this.target.beginTransformEdit(s),apply:(s,u)=>{this.target.writeTransform(s,F(u)),this.notify()},endEdit:s=>this.target.endTransformEdit(s),...this.target.removeTransform?{remove:(s,u)=>this.target.removeTransform?.(s,u)}:{}},this.loadTexture=r.loadTexture??(s=>this.pixi.Assets.load(s)),this.capturePreview=r.capturePreview,this.structureHistory=new W(t,e,r.journal,()=>this.afterStructuralChange()),this.a2d=new O(t,{...r.identity?{identity:r.identity}:{}}),this.projector=new _(t,this.a2d,{surface:r.surface??(()=>null),...r.pointFromClient?{pointFromClient:r.pointFromClient}:{}}),this.provenance=this.target.provenance,r.surface&&(this.pickable={pick:(s,u)=>this.projector.pick(s,u,l=>this.isPickLocked(l)),candidates:(s,u)=>this.projector.candidates(s,u,l=>this.isPickLocked(l))},this.rects={rect:s=>this.projector.rect(s),contextRects:s=>this.projector.contextRects(s)}),r.stories&&(this.stories=r.stories),this.watchStructure(t),this.capabilities={transform:!0,inspectorFields:!0,persist:this.target.provenance.source==="source-code"&&this.target.persistence!==void 0},this.target.bind({a2d:this.a2d,store:e,journal:r.journal,notify:()=>this.notify()}),this.structure=this.target.structure??this.liveStructure,this.assetDrop=this.target.assetDrop??{accepts:(s,u)=>b.test(u)&&this.containerFor(s||null)!==null,drop:(s,u,l)=>this.dropAsset(s,u,l)};const n=this.target.persistence;n&&(this.persistence=n);const c=this.target.truth?.bind(this.target);c&&(this.truth={resolve:(s,u)=>c(s,u)},this.related=A(s=>c(s,"position").site)),!r.stories&&this.target.componentIdentity&&(this.stories=T("canvas",e,s=>this.target.componentIdentity?.(s)??null));const a=this.target.instances?.();a&&(this.instances={describe:s=>a.describe(s),...a.openComponent?{openComponent:s=>a.openComponent?.(s)}:{},revert:(s,u)=>a.revert(s,u),applyToComponent:(s,u)=>a.applyToComponent(s,u)})}capabilities;provenance;pickable;rects;persistence;truth;related;structure;stories;instances;transforms;a2d;projector;target;pixi;structureHistory;loadTexture;capturePreview;listeners=new Set;boxEditSessions=new Map;lockedIds=new Set;refresh(){return this.projector.refresh()}previewImage(t,e,r){const i=this.projector.object(t);return i&&this.capturePreview?this.capturePreview(i,{width:e,height:r}):Promise.resolve(null)}notify(){for(const t of this.listeners)t()}watchedForStructure=[];structureNotifyQueued=!1;onStructureChanged=()=>{this.projector.invalidate(),!this.structureNotifyQueued&&(this.structureNotifyQueued=!0,queueMicrotask(()=>{this.structureNotifyQueued=!1,this.projector.reproject(),this.watchStructure(this.root),this.target.onReindex(),this.notify(),this.store.notifyIngestEdit()}))};watchStructure(t){for(const r of this.watchedForStructure)r.off("childAdded",this.onStructureChanged),r.off("childRemoved",this.onStructureChanged);this.watchedForStructure=[];const e=r=>{typeof r.on=="function"&&typeof r.off=="function"&&(r.on("childAdded",this.onStructureChanged),r.on("childRemoved",this.onStructureChanged),this.watchedForStructure.push(r));for(const i of r.children??[])e(i)};e(t)}hierarchy={roots:()=>(this.projector.project(),this.projector.roots().map(t=>this.toEditorNode(t.id)).filter(t=>t!==null)),node:t=>this.toEditorNode(t)};toEditorNode(t){const e=this.projector.node(t);if(!e)return null;const r=this.projector.object(t),i=r?U(r):!1,n=i?D(r):void 0;return{id:e.id,label:(i&&r?P(r):void 0)??e.label,role:i?"component":"entity",kind:e.kind,...n?{typeLabel:n}:{},parentId:e.parentId,childIds:e.childIds}}selection={get:()=>[...this.store.selectedEntityIds],set:t=>{this.store.selectMultiple(t),this.notify()}};liveStructure={create:(t,e)=>this.createStructuralNode(t,e??null),remove:t=>this.removeStructuralNodes([t]),removeMany:t=>this.removeStructuralNodes(t),duplicate:t=>this.duplicateStructuralNode(t),reparent:(t,e)=>this.reparentStructuralNode(t,e),reorder:(t,e)=>this.reorderStructuralNode(t,e),creatableKinds:()=>k.map(t=>({...t}))};containerFor(t){if(!t)return this.root;const e=this.projector.object(t);return!e||typeof e.addChild!="function"?null:e}refuseStructure(t){return m({resolve:()=>v(t),record:()=>{},report:e=>g.warn(`[canvas] structural edit refused — ${e}`,"authoring")})}reportStructureLiveOnly(t){return m({resolve:()=>v(X),record:()=>{},report:e=>{if(this.target.reportStructureLiveOnly){this.target.reportStructureLiveOnly(t,e);return}g.log(`[canvas] ${t} is live-only — ${e}.`,"authoring")}})}afterStructuralChange(){this.projector.reproject(),this.watchStructure(this.root),this.target.onReindex(),this.notify(),this.store.notifyIngestEdit()}idOf(t){return t.__authId??""}createStructuralNode(t,e){const r=this.containerFor(e);if(!r)return{id:"",ack:this.refuseStructure(`no node with id "${e}" can hold children.`)};const i=q(this.pixi,t);if(!i)return{id:"",ack:this.refuseStructure(`"${t}" is not a kind this canvas surface can construct.`)};i.label=V(t);const n=`Create ${i.label}`;return this.structureHistory.track(r),this.structureHistory.track(i),this.structureHistory.run(n,()=>{r.addChild(i)}),this.afterStructuralChange(),{id:this.idOf(i),ack:this.reportStructureLiveOnly(n)}}removeStructuralNodes(t){const e=[];let r=null;for(const n of t){const c=this.projector.object(n);if(!c?.parent){r=this.refuseStructure(`"${n}" is not a removable node in this tree.`);continue}e.push(c)}if(e.length===0)return r??this.refuseStructure("the selection held no removable node.");const i=e.length===1?`Delete ${e[0].label??"node"}`:`Delete ${e.length} nodes`;for(const n of e)this.structureHistory.track(n),n.parent&&this.structureHistory.track(n.parent);return this.structureHistory.run(i,()=>{for(const n of e)n.parent?.removeChild(n)}),this.afterStructuralChange(),this.reportStructureLiveOnly(i)}duplicateStructuralNode(t){const e=this.projector.object(t),r=e?.parent??null;if(!e||!r)throw new Error(`"${t}" is not a duplicable node in this tree.`);const i=C(this.pixi,e);i.label=`${e.label||"node"} copy`;const n=`Duplicate ${e.label??"node"}`,c=r.children.indexOf(e);return this.structureHistory.track(r),this.structureHistory.track(i),this.structureHistory.run(n,()=>{r.addChildAt(i,c+1)}),this.afterStructuralChange(),{id:this.idOf(i),ack:this.reportStructureLiveOnly(n)}}reparentStructuralNode(t,e){const r=this.projector.object(t);if(!r)return this.refuseStructure(`"${t}" is not a node in this tree.`);const i=this.containerFor(e);if(!i)return this.refuseStructure(`no node with id "${e}" can hold children.`);if(i===r||this.isAncestorOf(r,i))return this.refuseStructure("a node cannot be reparented into itself or its own descendant.");const n=this.localToRootMatrix(r),c=this.localToRootMatrix(i),a=`Move ${r.label??"node"}`;return this.structureHistory.track(r),r.parent&&this.structureHistory.track(r.parent),this.structureHistory.track(i),this.structureHistory.run(a,()=>{i.addChild(r),r.setFromMatrix(c.clone().invert().append(n))}),this.afterStructuralChange(),this.reportStructureLiveOnly(a)}reorderStructuralNode(t,e){const r=this.projector.object(t),i=r?.parent??null;if(!r||!i)return this.refuseStructure(`"${t}" is not a reorderable node in this tree.`);const n=e?this.projector.object(e):null;if(e&&(!n||n.parent!==i))return this.refuseStructure(`"${e}" is not a sibling of "${t}".`);const c=`Reorder ${r.label??"node"}`;return this.structureHistory.track(i),this.structureHistory.track(r),this.structureHistory.run(c,()=>{const a=i.children.indexOf(r),s=n?i.children.indexOf(n):i.children.length;i.addChildAt(r,Math.max(0,a<s?s-1:s))}),this.afterStructuralChange(),this.reportStructureLiveOnly(c)}isAncestorOf(t,e){let r=e.parent;for(;r;){if(r===t)return!0;r=r.parent}return!1}localToRootMatrix(t){const e=[];let r=t;for(;r&&r!==this.root;)e.push(r),r=r.parent;const i=new this.pixi.Matrix;for(let n=e.length-1;n>=0;n--){const c=e[n];c.updateLocalTransform(),i.append(c.localTransform)}return i}assetDrop;async dropAsset(t,e,r){if(!b.test(e))return this.refuseStructure(`${e} is not an image. A canvas world mounts an image as a Sprite; a model or an audio file has no display object to become here.`);const i=this.containerFor(t||null);if(!i)return this.refuseStructure(`no node with id "${t}" can hold a dropped asset.`);let n;try{n=await this.loadTexture(e)}catch(u){return this.refuseStructure(`${e} could not be loaded as a texture: ${u instanceof Error?u.message:String(u)}`)}const c=new this.pixi.Sprite(n);c.anchor.set(.5,.5),c.label=e.split("/").pop()??"Sprite";const a=r?.position;if(a){const u=this.localToRootMatrix(i).clone().invert().apply({x:a[0],y:a[1]});c.position.set(u.x,u.y)}const s=`Add ${c.label}`;return this.structureHistory.track(i),this.structureHistory.track(c),this.structureHistory.run(s,()=>{i.addChild(c)}),this.afterStructuralChange(),this.reportStructureLiveOnly(s)}boxEdit={begin:t=>{const e=this.projector.rect(t);if(!e){this.boxEditSessions.delete(t);return}this.boxEditSessions.set(t,{id:t,rect:e,transform:this.transforms.get(t)}),this.transforms.beginEdit?.(t)},apply:(t,e)=>this.applyBoxEdit(t,e),end:t=>{const e=this.boxEditSessions.get(t);this.boxEditSessions.delete(t),e&&this.transforms.endEdit?.(t)},gizmoOrigin:t=>this.gizmoOriginOf(t)};gizmoOriginOf(t){const e=this.projector.object(t);if(!e||typeof e.getGlobalPosition!="function")return null;const r=e.getGlobalPosition();return{x:r.x,y:r.y}}applyBoxEdit(t,e){const r=this.boxEditSessions.get(t);if(!r||J(e).some(n=>this.transforms.editability?.(t,n).writable===!1))return;const i=et(r,e);this.transforms.apply(t,i),!(e.x===void 0&&e.y===void 0&&e.originX===void 0&&e.originY===void 0&&e.width===void 0&&e.height===void 0)&&this.repositionBoxEditBounds(t,r,e,i)}repositionBoxEditBounds(t,e,r,i){const n=this.projector.object(t);if(!n)return;const c=this.gizmoOriginOf(t),a=this.projector.rect(t),{dx:s,dy:u}=rt(c,a,e.rect,r),l=n.parent;if(l&&typeof l.toLocal=="function"){const h=l.toLocal({x:0,y:0}),d=l.toLocal({x:s,y:u});i.position[0]+=d.x-h.x,i.position[1]+=d.y-h.y}else i.position[0]+=s,i.position[1]+=u;this.transforms.apply(t,i)}spatialHandles={layers:t=>{const e=this.originOf(t);if(!e)return[];const r=this.target.transformEditability(t,"position"),i=!!this.target.writeOrigin&&r.writable;return[{id:`origin:${t}`,category:"origin",guides:[],handles:[{id:S,label:e.kind==="anchor"?"Sprite anchor":"Pivot",position:[e.world.x,e.world.y,0],color:z,writable:i,...i?{}:{reason:this.target.writeOrigin&&r.reason?r.reason:G}}]}]},preview:(t,e,r)=>{this.moveOrigin(t,e,r,"preview")},commit:(t,e,r)=>this.moveOrigin(t,e,r,"commit")};originEditId=null;originOf(t){const e=this.projector.object(t);if(!e||typeof e.updateLocalTransform!="function")return null;const r=I(e),i=r?"anchor":"pivot",n=r?{x:r.anchor.x,y:r.anchor.y}:{x:e.pivot.x,y:e.pivot.y},c=r?{x:0,y:0}:n,a=this.localToRootMatrix(e).apply({x:c.x,y:c.y});return{kind:i,value:n,world:{x:a.x,y:a.y}}}moveOrigin(t,e,r,i){if(e!==S)return;const n=this.originOf(t),c=this.projector.object(t),a=this.target.writeOrigin;if(!n||!c||!a||!this.target.transformEditability(t,"position").writable)return;this.originEditId!==t&&(this.target.beginTransformEdit(t),this.originEditId=t),c.updateLocalTransform();const s=this.localToRootMatrix(c).clone().invert().apply({x:r[0],y:r[1]}),u=n.kind==="anchor"?{x:0,y:0}:n.value,l={x:s.x-u.x,y:s.y-u.y},h=n.kind==="anchor"?Q(c):null;if(n.kind==="anchor"&&(!h||h.x===0||h.y===0))return;const d=h?[n.value.x+l.x/h.x,n.value.y+l.y/h.y]:[s.x,s.y],f=c.localTransform,p=this.a2d.getTransform(t);if(a(t,n.kind,d),p&&this.target.writeTransform(t,{...p,position:[p.position[0]+f.a*l.x+f.c*l.y,p.position[1]+f.b*l.x+f.d*l.y]}),this.notify(),i==="commit"){const E=this.target.endTransformEdit(t);return this.originEditId=null,E}}inspector={properties:t=>[...this.target.properties(t),{path:"locked",label:"Locked",type:"boolean",group:"Visibility"}],get:(t,e)=>e==="locked"?this.lockedIds.has(t):this.target.get(t,e),set:(t,e,r)=>{if(e==="locked"){r===!0?this.lockedIds.add(t):this.lockedIds.delete(t),this.notify();return}return this.target.set(t,e,r)},remove:(t,e)=>this.target.remove?.(t,e)};isPickLocked(t){let e=t;for(;e;){if(this.lockedIds.has(e))return!0;e=this.projector.node(e)?.parentId??null}return!1}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}dispose(){this.boxEditSessions.clear(),this.lockedIds.clear();for(const t of this.watchedForStructure)t.off("childAdded",this.onStructureChanged),t.off("childRemoved",this.onStructureChanged);this.watchedForStructure=[],this.structureHistory.dispose(),this.target.dispose(),this.listeners.clear()}}export{vt as PixiAuthoringAdapter};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as m}from"./extend-B-eOccUm.js";import"./jsx-runtime-DPjLkJKQ.js";import{c8 as p}from"./index-GIL7oGEO.js";import{r as a}from"./index-nmcBqr7Y.js";import"./index-bQE2NA0D.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./three.module-D396a9Mn.js";const s="object";class u{constructor(e){const t=e[s];if(!(t instanceof p))throw new Error(`PixiPrimitive: \`object\` must be a PIXI.Container (got ${t===null?"null":typeof t}). This element adopts an object the game already owns; it does not create one.`);return Object.defineProperty(t,s,{configurable:!0,enumerable:!1,get:()=>t,set:()=>{}}),t}}m({VgaiAdopted:u});const f="pixiVgaiAdopted";function T(r){const{object:e,children:t,...o}=r;if(a.useRef(e).current!==e)throw new Error("PixiPrimitive: `object` changed on a mounted element. The adopted container IS this element's instance, so it cannot be swapped; give the element a `key` derived from the object instead, so React remounts it.");a.useLayoutEffect(()=>()=>l(e),[e]);const n={[s]:e};for(const[d,c]of Object.entries(o))c!==void 0&&(n[d]=c);return a.createElement(f,n,t)}function l(r){const e=r,t=Object.getOwnPropertyDescriptor(r,"destroy");let o=!0;const i=()=>{o&&(o=!1,t===void 0?delete e.destroy:Object.defineProperty(r,"destroy",t))};Object.defineProperty(r,"destroy",{configurable:!0,enumerable:!1,writable:!0,value:function(){i(),this.removeFromParent()}}),queueMicrotask(i)}function A(r,e){e.parent!==r&&r.addChild(e)}export{T as PixiPrimitive,A as adoptNow};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as L,c as O}from"./extend-B-eOccUm.js";import{c9 as W}from"./index-GIL7oGEO.js";import{r as a}from"./index-nmcBqr7Y.js";import{WorldProvider as z}from"./world-state-BWG-IcOd.js";import{g as N}from"./debug-registry-Dgvitx8M.js";import{wireGameInputSeams as B,DEFAULT_INPUT_MAP_PATH as H}from"./game-input-seams-CIQdetRw.js";import"./jsx-runtime-DPjLkJKQ.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-bQE2NA0D.js";import"./index-D_NuPfjr.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./three.module-D396a9Mn.js";import"./frame-selector-cache-cCeUbcjG.js";import"./seeded-random-i3mtgBKZ.js";import"./render-seed-DF4JHy7P.js";const x=1e4,M=new WeakSet;function j(t){if(t===null||typeof t!="object")return!1;const o=t;return typeof o.id=="string"&&o.id.length>0&&typeof o.mount=="function"}function G(t,o){const n=a.createElement(o);return{id:t,async mount(r){const l=r.game?N(r.game):null;l&&await B(r,l,{id:t,inputMapPath:H,optionalInputMap:!0});const c=r.canvas;if(M.has(c))throw new Error(`canvas world "${t}": this lane has already mounted this canvas. @pixi/react keys its reconciler roots off the canvas element, so re-using one would resurrect a root whose Application is destroyed. Hand each mount a fresh canvas (every vgai host already does).`);M.add(c),L(W);let p;const b=new Promise(e=>{p=e});let f;const k=new Promise(e=>{f=e});let v;const $=new Promise(e=>{v=e});let w;const F=new Promise(e=>{w=e});function S(){return a.useLayoutEffect(()=>(p(),v),[]),a.useEffect(()=>(f(),w),[]),null}const y=r.game,h=a.createElement(a.Fragment,null,n,a.createElement(S)),U=y?a.createElement(z,{game:y},h):h,g=O(c),E={antialias:!0,width:r.width,height:r.height,resolution:r.dpr??globalThis.devicePixelRatio??1,autoDensity:!0,backgroundAlpha:r.transparent?0:1,preserveDrawingBuffer:r.preserveDrawingBuffer??!1,autoStart:!1,sharedTicker:!1};let P;const _=new Promise(e=>{P=e}),T=e=>{P(`the Pixi tree crashed before its first commit — ${e.message} (mount() fails loudly instead of hanging)`)};globalThis.addEventListener?.("error",T);let u,m;try{u=await g.render(U,E);const d=new Promise(I=>{m=setTimeout(()=>I(`no first commit within ${x/1e3}s (mount() fails loudly instead of hanging)`),x)}),R=await Promise.race([Promise.all([b,k]).then(()=>null),_,d]);if(R!==null)throw new Error(`canvas world "${t}": ${R}`)}catch(e){try{u?.destroy(!1,{children:!0})}catch{}throw e}finally{m!==void 0&&clearTimeout(m),globalThis.removeEventListener?.("error",T)}if(u===void 0)throw new Error(`canvas world "${t}": initialized without an Application`);const i=u;i.ticker.lastTime=0;let A=0,s=!1;const C=l?{debug:l.adapter}:{},D=Promise.all([$,F]).then(()=>{s=!0,i.destroy(!1,{children:!0})});return{kind:"canvas",canvas:c,substrate:{name:"pixi",root:i.stage},drivesOwnLoop:!1,systems:C,disposeComplete:D,update(e){s||(A+=e*1e3,i.ticker.update(A))},resize(e,d){s||i.renderer.resize(e,d)},dispose(){s||(s=!0,i.renderer.events.setTargetElement(null),g.render(null,E))}}}}}function V(t,o){const n=t;return j(n?.adapter)?n.adapter:typeof n?.default=="function"?G(o,n.default):null}const me=(t,o)=>{const n=V(o.entryModule,t.id);if(n)return{kind:"canvas",adapter:n};throw new Error(`pixiReactRootFactory: entry module "${t.entry??"(none)"}" for root "${t.id}" must default-export a React component (\`export default function World() { … }\`).`)};export{me as pixiReactRootFactory,V as resolveCanvasEntryAdapter};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/babylon-authoring-adapter-CL02gWDn.js","assets/index-GIL7oGEO.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/three.module-D396a9Mn.js","assets/index-D2fNXpHa.css","assets/json-history-resource-BbxllWfV.js","assets/source-persistence-backend-C-aR-B_Y.js","assets/ingest-source-persistence-C_6Hiyra.js","assets/pixi-authoring-adapter-CjibysC3.js","assets/authoring-CgcOFhGS.js","assets/pixi-transform-channels-VjdohT11.js","assets/pixi-live-write-target-DuWydlWb.js","assets/canvas-entry-runtime-SfBxaR9M.js","assets/mount-ingest-root-glv2SSWf.js","assets/active-ingest-CT6jSGhr.js","assets/game-contract-seams-a5YXejOu.js","assets/capability-coverage-Czas4C18.js","assets/playtest-BXIL1JEF.js","assets/module-mode-DVBLT9d-.js","assets/binding-resolver-Dsh-6Vor.js","assets/native-debug-module-CWicoSGD.js","assets/native-entry-surface-BE8LJNdu.js","assets/debug-registry-Dgvitx8M.js","assets/adapter-surface-Y37Nzcyw.js","assets/entry-adjudication-Cq8Yeb74.js","assets/r3f-root-factory-z9llD1OU.js","assets/register-render-vitals-BiZk29b2.js","assets/render-census-BrQX_CXv.js","assets/structural-signature-0w-i_ats.js","assets/render-vitals-BZ5HtvMi.js","assets/static-batch-advisor-B13QEH7d.js","assets/webgl-frame-capture-FlF9zQmW.js","assets/world-state-BWG-IcOd.js","assets/frame-selector-cache-cCeUbcjG.js","assets/dev-build-gDYrq68M.js","assets/game-input-seams-CIQdetRw.js","assets/seeded-random-i3mtgBKZ.js","assets/render-seed-DF4JHy7P.js","assets/frame-delta-D2nsw_Ht.js","assets/events-156d8d12.esm-ErOhDXXB.js","assets/index-bQE2NA0D.js","assets/realm-services-CobQsq_X.js","assets/three-ingest-runtime-QzDYk6tU.js","assets/EffectComposer-DQxfsXBZ.js","assets/CopyShader-BzTUYzf6.js","assets/ShaderPass-QYRpPuFJ.js","assets/CSS3DRenderer-CL7ABLVK.js","assets/relative-path-guard-GiM7Lsz8.js","assets/react-root-CEz5NTck.js","assets/mount-manifest-CGVxhmAw.js","assets/create-runtime-CVCc1BDx.js","assets/binding-Bmxqznjk.js","assets/assets-BuSoGjBX.js","assets/loader-CaF_I7Yt.js","assets/setup-renderer-DVXaSGin.js","assets/index-BcCBqgM_.js","assets/defaults-DKiBJCPN.js","assets/render-settings-Bw4W9SYF.js","assets/render-features-CPQ_e568.js","assets/game-loop-CZvXlY00.js","assets/frame-pacing-D5acoOzO.js","assets/game-DHOZVb-7.js","assets/loop-gate-report-N52EWFGD.js","assets/system-slot-E2mEdiih.js","assets/user-data-BB2Of6Ht.js","assets/object-marks-DwvIEBOK.js","assets/sim-clock-CLflx7kg.js","assets/system-runner-DkOjxEBt.js","assets/performance-profiler-D_Jey87L.js","assets/input-manager-DH_hGW6d.js","assets/asset-parse-error-BHMwBRU3.js","assets/binding-identity-DcTpbvyg.js","assets/prompt-labels-DSMdM2_B.js","assets/schema-kl9-2B_J.js","assets/gameplay-rng-trap-CTNhm-UW.js","assets/state-bridge-DLP1jLRW.js","assets/input-router-BNQvtIqw.js","assets/render-control-Df3yTiyr.js","assets/debug-bridge-CCohG-d-.js","assets/run-ticks-settled-C4ksViyA.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{Z as Ke,a3 as kt,a2 as hn,kL as gn,kM as yn,kN as wn,kO as vn,kP as bn,cg as En,ch as Sn,a1 as _t,kQ as Mt,ca as Pn,cb as An,cd as Dt,kR as Rn,a0 as In,kS as Tn,cc as kn,V as b,q as E,j4 as Ot,kT as _n,kU as Mn,kV as Dn,kW as q,as as On,kX as xt,aq as xn,bY as ae,kY as Ln,ju as Cn,x as Fn,kZ as jn,aC as Lt,k_ as Nn,aF as Ae,y as Ct,aj as le,jU as dt,k$ as Ft,_ as C,l0 as jt,l1 as Nt,kg as $t,jx as Ut,p as $n,j_ as Un,l2 as Vn,l3 as qn,l4 as Wn,l5 as Bn,l6 as Gn,g2 as zn,fv as Hn,eh as Kn,bX as Vt,l7 as Yn,l8 as qt,gx as Xn,bT as Jn,bU as Zn,dt as Qn,l9 as er,fZ as tr,la as nr,fD as rr,eU as or}from"./index-GIL7oGEO.js";import{installNativeDebugBindings as sr,installNativeSystemsBindings as ar}from"./native-debug-module-CWicoSGD.js";import{publishDevInstruments as ir}from"./instruments-CKR02Y8I.js";import{g as Ye,D as K}from"./debug-registry-Dgvitx8M.js";import{B as ut}from"./edit-mode-authoring-B47TfLqu.js";import{p as Wt,c as cr}from"./json-history-resource-BbxllWfV.js";import{a as Bt}from"./binding-resolver-Dsh-6Vor.js";import{i as lr,s as dr}from"./editor-presentation-activity-C7SNSmTd.js";import{E as Gt,U as ur,V as pr,G as zt,B as Ue,l as Xe,W as fr,g as mr}from"./active-ingest-CT6jSGhr.js";import{m as hr}from"./pixi-story-model-DNkfnWUV.js";import{t as gr,d as yr}from"./surface-content-Dg9Kkazf.js";import{l as wr}from"./viewport-root-presentation-CWsE56K6.js";import{getSeededRandom as vr}from"./seeded-random-i3mtgBKZ.js";import{_engineLogActive as br}from"./logger-Dqis-7W1.js";import{runTicksWhenSettled as Er}from"./run-ticks-settled-C4ksViyA.js";import{assertNever as Sr}from"./adapter-surface-Y37Nzcyw.js";import{r as Pr,o as Ar,s as Rr}from"./three-authoring-adapter-CmSQ3Vui.js";import{mountDeferredIngestForPlay as Ir,exitDeferredIngestPlay as Tr}from"./deferred-ingest-play-DCJi_Pgu.js";import{r as H}from"./rrweb-Cd2ifIRP.js";import{R as kr,w as _r}from"./react-world-authoring-adapter-DmrwM3py.js";async function Mr(e){try{const t=await fetch(`${Ke}/log-session`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"start",...e?{name:e}:{}})});return(await hn(t,"Could not start a play log session")).file}catch{return null}}async function Dr(){try{const e=await fetch(`${Ke}/log-session`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"end"})});kt(e,"Could not end the play log session")}catch{}}async function Ht(e){if(e.length===0)return!0;try{const t=await fetch(`${Ke}/log-entries`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entries:e})});return kt(t,"Could not flush play log entries"),!0}catch{return!1}}const Or="__adapter__",pt=new WeakSet;function ft(e,t){const n=[];for(const o of e.roots){const r=o.binding?.observation[t];r&&n.push(r)}return n}function xr(e,t,n){const o=t.forRoot(Or);for(const r of n){if(r.kind==="state"){o.registerStateProvider(r.id,()=>{if(!r.answer)throw new K("OBSERVATION_UNANSWERED",`Observation "${r.id}" (state) is declared by this game's adapter with no answer.`);return r.answer(e)},{tier:"assisted"});continue}o.registerCommand(r.id,{...r.description?{description:r.description}:{},locus:r.locus??"client"},(...s)=>{if(!r.answer)throw new K("OBSERVATION_UNANSWERED",`Observation "${r.id}" (command) is declared by this game's adapter with no answer.`);return r.answer(e,...s)})}}function De(e,t){const n=e.actions(t);if(!Array.isArray(n))throw new Error("vgai.adapter.ts input.actions must return an array.");const o=new Map;for(const r of n){if(typeof r?.name!="string"||r.name.length===0||!yn.includes(r.valueType))throw new Error("vgai.adapter.ts input.actions returned an invalid action; each action needs a non-empty `name` and a supported `valueType`.");if(o.has(r.name))throw new Error(`vgai.adapter.ts input.actions returned duplicate action "${r.name}".`);o.set(r.name,r.valueType)}return o}function Lr(e,t){return e==="digital"?typeof t=="boolean":e==="scalar"?typeof t=="number"&&Number.isFinite(t):typeof t=="object"&&t!==null&&typeof t.x=="number"&&Number.isFinite(t.x)&&typeof t.y=="number"&&Number.isFinite(t.y)}function Cr(e,t,n){if(!e.world(n.root))throw new Error(`vgai.adapter.ts input.root names "${n.root}", which is not a mounted manifest root.`);const o=[],r=[];let s=!1;const i=(u,c)=>{const a=De(n,e).get(u);if(!a)throw new K("INPUT_ACTION_NOT_FOUND",`Adapter input has no action named "${u}".`,{registered:[...De(n,e).keys()]});if(!Lr(a,c))throw new K("INPUT_ACTION_VALUE_TYPE",`Adapter input action "${u}" expects ${a}, not ${typeof c}.`,{action:u,expected:a});return a},p=(u,c,a)=>{i(u,c),n.set(e,u,c),s&&r.push({tick:a,action:u,value:c})},f=()=>{const u=t.getGameTick(),c=o.filter(a=>a.tick===u);if(c.length!==0){for(let a=o.length-1;a>=0;a--)o[a].tick===u&&o.splice(a,1);for(const a of c)p(a.action,a.value,u)}};e.systems.add("input",f,{name:"adapter.input"});const h=u=>{throw new K("ADAPTER_INPUT_SOURCE_UNSUPPORTED",`${u} addresses an engine test source, but this game declares an app-owned action store. Drive it by action name instead.`)},d={setVirtualAction(u,c){return p(u,c,t.getGameTick()),{delivered:!0}},tapVirtualAction(u){const c=t.getGameTick();return p(u,!0,c),o.push({tick:c+1,action:u,value:!1}),{delivered:!0}},clearVirtualActions(){o.length=0,n.clear(e)},scheduleActionAtTick(u,c,a){const m=t.getGameTick();if(!Number.isInteger(u)||u<m)throw new K("TICK_ALREADY_PASSED",`Cannot schedule adapter input for tick ${u}; current tick is ${m}.`,{tick:u,currentTick:m});i(c,a),o.push({tick:u,action:c,value:a})},startInputRecording(){r.length=0,s=!0},stopInputRecording(){s=!1},isInputRecording(){return s},injectAxis(){h("injectAxis")},injectVector2(){h("injectVector2")},injectPointerDelta(){h("injectPointerDelta")},injectPointerPosition(){h("injectPointerPosition")}};t.setInputActionsSource(n.root,()=>[...De(n,e)].map(([u,c])=>({name:u,valueType:c}))),t.setInputTraceSource(n.root,()=>({version:1,seed:null,fixedDt:e.loop.fixedDt,ticks:[...r]})),t.setVirtualInputTarget(n.root,d)}function Kt(e){if(pt.has(e))return;sr(e,ft(e,"entryDebug")),ar(e,ft(e,"entrySystems")),ir(e);const t=Ye(e);if(!t)throw new Error("Cannot install adapter runtime bindings: mounted Game has no debug registry.");e.roots.some(r=>r.mounted.systems?.debug!==void 0&&r.mounted.systems.debug!==t.adapter)||xr(e,t,wn());const o=gn();o&&Cr(e,t,o),pt.add(e)}const Fr="fit",Yt=[{id:Fr,label:"Fit panel",kind:"fit",width:null,height:null,dpr:null,safeArea:null},{id:"iphone-portrait",label:"iPhone 14 — 390×844 @3x",kind:"phone",width:390,height:844,dpr:3,safeArea:{top:47,right:0,bottom:34,left:0}},{id:"iphone-landscape",label:"iPhone 14 landscape — 844×390 @3x",kind:"phone",width:844,height:390,dpr:3,safeArea:{top:0,right:47,bottom:21,left:47}},{id:"android-portrait",label:"Android — 412×915 @2.6x",kind:"phone",width:412,height:915,dpr:2.6,safeArea:{top:24,right:0,bottom:24,left:0}},{id:"ipad-portrait",label:"iPad — 820×1180 @2x",kind:"tablet",width:820,height:1180,dpr:2,safeArea:{top:24,right:0,bottom:20,left:0}},{id:"desktop-1080p",label:"Desktop — 1920×1080 @1x",kind:"desktop",width:1920,height:1080,dpr:1,safeArea:null}],Je=Yt[0];function Xt(e){return Yt.find(t=>t.id===e)??Je}let I=Je,B=null,Jt=0;const Ve=new Set;function Ze(){Jt++;for(const e of Ve)e()}function ys(e){return Ve.add(e),()=>{Ve.delete(e)}}const ws=()=>Jt;function vs(){return I}function Zt(){return B??(I.kind==="phone"||I.kind==="tablet")}function bs(e){const t=Xt(e);t!==I&&(I=t,B=null,Qt(),Ze())}function Es(e){e!==B&&(B=e,Qt(),Ze())}function jr(){return I.dpr}function Ss(){return Math.min(typeof window<"u"&&window.devicePixelRatio||1,2)}function Qt(){vn({devicePreview:{preset:I.id,touch:B}})}function Ps(){const e=bn().devicePreview;return e?.preset?(I=Xt(e.preset),B=typeof e.touch=="boolean"?e.touch:null):(I=Je,B=null),Ze(),I}const mt=["pointerdown","pointermove","pointerup","pointercancel"],ht=new WeakSet;let qe=null,Oe=null;function gt(e){if(!Zt()||ht.has(e)||!(e instanceof PointerEvent)||e.pointerType!=="mouse")return;const t=e.target;if(!t)return;e.stopImmediatePropagation();const n=new PointerEvent(e.type,{bubbles:!0,cancelable:e.cancelable,composed:!0,view:e.view,detail:e.detail,clientX:e.clientX,clientY:e.clientY,screenX:e.screenX,screenY:e.screenY,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey,pointerId:e.pointerId,pointerType:"touch",isPrimary:!0,pressure:e.type==="pointerup"||e.type==="pointercancel"?0:Math.max(e.pressure,.5),width:20,height:20});ht.add(n),t.dispatchEvent(n),n.defaultPrevented&&e.preventDefault()}function Nr(e){if(e!==qe&&(Oe?.(),Oe=null,qe=e,!!e)){for(const t of mt)e.addEventListener(t,gt,{capture:!0});Oe=()=>{for(const t of mt)e.removeEventListener(t,gt,{capture:!0})}}}function As(e){qe===e&&Nr(null)}function $r(){return{presetId:I.id,presetLabel:I.label,dpr:I.dpr,safeArea:I.safeArea,touchActive:Zt()}}typeof window<"u"&&(window.__vgaiDevicePreview=$r);const Ur=15e3;function Vr(e,t,n){const o=n?` (open ${n})`:"";return`Play start stalled at "${e}" for ${Math.round(t/1e3)}s and the editor tab is HIDDEN — a backgrounded tab has its network requests deprioritized by the browser, so this step is queued rather than broken. Bring the editor tab to the foreground${o} and run play again; the engine loop itself is hidden-safe, only the boot's fetches are starved.`}function qr(e,t,n){const o=n.stallMs??Ur,r=n.setTimer??((i,p)=>setTimeout(i,p)),s=n.clearTimer??(i=>clearTimeout(i));return new Promise((i,p)=>{let f=!1;const h=r(()=>{f||n.isHidden()&&(f=!0,p(new Error(Vr(e,o,n.editorUrl))))},o);t.then(d=>{f||(f=!0,s(h),i(d))},d=>{f||(f=!0,s(h),p(d instanceof Error?d:new Error(String(d))))})})}function Wr(e,t,n=Date.now()){const o=e.filter(r=>r.seq>t).sort((r,s)=>r.seq-s.seq);return{entries:o.map(r=>({t:n,level:"info",source:"game-event",msg:r.event,tick:r.tick,simT:r.simT,meta:{seq:r.seq,...r.detail!==void 0?{detail:r.detail}:{}}})),lastSeq:o.at(-1)?.seq??t}}const fe="data-vgai-replay-block",Q="data-vgai-replay-video",yt="https://replay-assets.invalid/",Br=1e3,Gr=256*1024,zr=/data:image\/(?:png|jpeg|webp|gif|svg\+xml);base64,[a-zA-Z0-9+/=]+/g;function xe(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top,width:t.width,height:t.height}}function Hr(e){switch(e.toLowerCase()){case"image/png":return"png";case"image/jpeg":return"jpg";case"image/webp":return"webp";case"image/gif":return"gif";case"image/svg+xml":return"svg";default:return null}}function Kr(e){const t=/^data:([^;,]+);base64,([\s\S]+)$/i.exec(e);if(!t)throw new Error("image data URL is not base64 encoded");const n=atob(t[2]),o=new Uint8Array(n.length);for(let r=0;r<n.length;r+=1)o[r]=n.charCodeAt(r);return new Blob([o],{type:t[1].toLowerCase()})}function Yr(e){const t=[];for(let n=e;n&&n!==document.body;n=n.parentElement){const o=n.parentElement;if(!o)break;for(const r of Array.from(o.children))r!==n&&!["STYLE","LINK","SCRIPT"].includes(r.tagName)&&!r.hasAttribute(fe)&&(r.setAttribute(fe,""),t.push(r))}return()=>{for(const n of t)n.removeAttribute(fe)}}function Xr(e,t,n){if(n.format!=="canvas-dom"||n.replayPath===null)throw new Error("gameplay DOM recording requires a canvas-dom sink");const o=Yr(e),r=t.getAttribute(Q);t.setAttribute(Q,"");const s=()=>{o(),r===null?t.removeAttribute(Q):t.setAttribute(Q,r)},i=[],p=new Map,f=[];let h=0,d=0,u=0,c=0,a=0,m=null,P=Date.now(),y=null,D=Promise.resolve(),v=!1;const T=(g,L)=>{D=D.then(async()=>{if(!y)try{await L()}catch(z){const $=z instanceof Error?z.message:String(z);y=new Error(`${g}: ${$}`)}})},j=g=>{const L=p.get(g);if(L)return`${yt}${L}`;const z=/^data:([^;,]+)/i.exec(g)?.[1]??"",$=Hr(z);if(!$)return g;const ce=`${String(a).padStart(6,"0")}.${$}`;return a+=1,p.set(g,ce),T(`replay asset ${ce}`,async()=>{const lt=Kr(g);u+=lt.size,await En(n,ce,lt)}),`${yt}${ce}`},O=g=>g.includes("data:image/")?g.replace(zr,j):g,N=()=>{if(i.length===0)return;const g=new Blob([`[${i.join(",")}]`],{type:"application/json"});i.length=0,h=0;const L=c;c+=1,T(`DOM event batch ${L}`,()=>Sn(n,L,g))};let x;try{x=H({emit(g){m??=g.timestamp;const L=JSON.stringify(g,(z,$)=>typeof $=="string"?O($):$);i.push(L),h+=L.length,d+=1,h>=Gr&&N()},blockSelector:`[${fe}], [${Q}]`,recordCanvas:!0,inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,sampling:{mousemove:!1,mouseInteraction:!1,scroll:100,canvas:15},errorHandler(g){return f.push(g instanceof Error?g.message:String(g)),!0}})}catch(g){throw s(),g}if(!x)throw s(),new Error("rrweb could not start the DOM recording");const k=e.ownerDocument.defaultView??window,w={width:k.innerWidth,height:k.innerHeight,dpr:k.devicePixelRatio},_=xe(e),Z=xe(t),Me=H.mirror.getId(e),fn=H.mirror.getId(t),it=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>{H.addCustomEvent("vgai-canvas-layout",{rect:xe(t),drawingWidth:t.width,drawingHeight:t.height,dpr:k.devicePixelRatio})});it?.observe(t),H.addCustomEvent("vgai-canvas-layout",{rect:Z,drawingWidth:t.width,drawingHeight:t.height,dpr:k.devicePixelRatio});const mn=k.setInterval(N,Br),ct=()=>{k.clearInterval(mn),it?.disconnect(),s()};return{markVideoStarted(g){P=g},async stop(g){if(v)throw new Error("gameplay DOM recording is already stopped");if(v=!0,H.addCustomEvent("vgai-recording-stop",{}),x(),ct(),N(),await D,y)throw y;return{version:1,recorder:"rrweb@2.1.6",events:"events.json",assets:"assets/",video:g,videoStartEpochMs:P,firstEventEpochMs:m,viewport:w,surface:_,surfaceNodeId:Me,canvas:{...Z,nodeId:fn,drawingWidth:t.width,drawingHeight:t.height},eventCount:d,assetCount:p.size,assetBytes:u,rrwebErrors:f}},async abort(){v||(v=!0,x(),ct(),i.length=0,await D)}}}function Jr(){let e=null,t=!1,n=null;const o=`
|
|
3
|
-
let canvas;
|
|
4
|
-
onmessage = async ({data}) => {
|
|
5
|
-
const {bitmap, width, height, type, quality} = data;
|
|
6
|
-
try {
|
|
7
|
-
if (!canvas) canvas = new OffscreenCanvas(width, height);
|
|
8
|
-
if (canvas.width !== width) canvas.width = width;
|
|
9
|
-
if (canvas.height !== height) canvas.height = height;
|
|
10
|
-
const context = canvas.getContext('2d');
|
|
11
|
-
if (!context) throw new Error('No worker canvas context');
|
|
12
|
-
context.globalCompositeOperation = 'copy';
|
|
13
|
-
context.drawImage(bitmap, 0, 0, width, height);
|
|
14
|
-
bitmap.close();
|
|
15
|
-
const blob = await canvas.convertToBlob({type, quality});
|
|
16
|
-
postMessage({blob});
|
|
17
|
-
} catch (error) {
|
|
18
|
-
bitmap.close();
|
|
19
|
-
postMessage({error: error instanceof Error ? error.message : String(error)});
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
`;function r(s){const i=n;n=null,e?.terminate(),e=null,i?.reject(s)}return{encode(s,i,p,f,h){return t?Promise.reject(new Error("Recording preview encoder stopped")):n?Promise.reject(new Error("Recording preview already in flight")):new Promise((d,u)=>{const c={resolve:d,reject:u};n=c;try{if(!e){const a=URL.createObjectURL(new Blob([o],{type:"text/javascript"}));try{e=new Worker(a)}finally{URL.revokeObjectURL(a)}e.onmessage=({data:m})=>{if(m.error||!m.blob){r(new Error(m.error??"No recording preview image"));return}const P=n;n=null,P?.resolve(m.blob)},e.onerror=m=>{m.preventDefault(),r(new Error(m.message||"Recording preview worker failed"))},e.onmessageerror=()=>r(new Error("Recording preview worker message failed"))}createImageBitmap(s).then(a=>{if(t||n!==c||!e){a.close();return}try{e.postMessage({bitmap:a,width:i,height:p,type:f,quality:h},[a])}catch(m){a.close(),r(m instanceof Error?m:new Error(String(m)))}},a=>{n===c&&r(a instanceof Error?a:new Error(String(a)))})}catch(a){r(a instanceof Error?a:new Error(String(a)))}})},dispose(){t=!0,r(new Error("Recording preview encoder stopped"))}}}let F=null;const wt=1,vt=60,Zr=30,Re=2,Qr=1e3/Re,Ie=12e4,eo=Ie/1e3*Re,to=256,no="image/webp",ro=.72;function oo(e,t){const n="'use strict';var t=null;onmessage=function(e){clearInterval(t);t=null;if(e.data&&e.data.ms>0){t=setInterval(function(){postMessage(0)},e.data.ms)}};";try{const o=URL.createObjectURL(new Blob([n],{type:"text/javascript"})),r=new Worker(o);URL.revokeObjectURL(o);let s=null;return r.addEventListener("error",i=>{i.preventDefault(),s===null&&(s=window.setInterval(t,e))}),r.addEventListener("message",()=>t()),r.postMessage({ms:e}),{stop(){r.postMessage({ms:0}),r.terminate(),s!==null&&window.clearInterval(s)}}}catch{const o=window.setInterval(t,e);return{stop(){window.clearInterval(o)}}}}function so(e){const t=e??Zr;if(!Number.isFinite(t)||!Number.isInteger(t)||t<wt||t>vt)throw new Error(`gameplay recording fps must be an integer from ${wt} to ${vt}`);return t}function ao(e){const n=(e?["video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus","video/webm"]:["video/webm;codecs=vp9","video/webm;codecs=vp8","video/webm"]).find(o=>MediaRecorder.isTypeSupported(o));if(!n)throw new Error("this browser exposes MediaRecorder but no WebM video codec");return n}function Qe(){Tn(F?.previewSnapshot??null)}function Le(e,t){e.previewSnapshot={startedAt:e.started.startedAt,width:e.started.width,height:e.started.height,liveEdgeMs:t,sampleFps:Re,retentionMs:Ie,frames:[...e.previewFrames],previewError:e.previewError},F===e&&Qe()}function io(e){for(const t of e.previewFrames)URL.revokeObjectURL(t.src);e.previewFrames.length=0}function en(e,t){if(e.stopping||e.previewEncoding||e.previewError||t<e.nextPreviewAt)return;e.nextPreviewAt=t+Qr;const n=Math.min(1,to/Math.max(1,e.output.width)),o=Math.max(1,Math.round(e.output.width*n)),r=Math.max(1,Math.round(e.output.height*n));e.previewEncoding=!0;const s=new Date().toISOString(),i=e.nextPreviewSequence;e.nextPreviewSequence+=1;const p=e.previewEncoder.encode(e.output,o,r,no,ro).then(f=>{if(e.stopping)return;if(!f){e.previewError="The browser could not encode recording previews.",Le(e,t);return}const h={sequence:i,mediaTimeMs:Math.max(0,Math.round(t)),capturedAt:s,src:URL.createObjectURL(f),width:o,height:r};for(e.previewFrames.push(h);e.previewFrames.length>eo||(e.previewFrames[0]?.mediaTimeMs??h.mediaTimeMs)<h.mediaTimeMs-Ie;){const d=e.previewFrames.shift();d&&URL.revokeObjectURL(d.src)}Le(e,h.mediaTimeMs)}).catch(f=>{e.stopping||(e.previewError=f instanceof Error?f.message:"The browser could not encode recording previews.",Le(e,t))}).finally(()=>{e.previewEncoding=!1});e.previewTask=p}function co(){if(F)throw new Error("a gameplay recording is already active; stop it before starting one");if(typeof MediaRecorder>"u")throw new Error("this browser does not support MediaRecorder gameplay capture")}function lo(e){e.stopping||e.drawing||performance.now()<e.nextFrameAt||(typeof document<"u"&&document.hidden&&(e.hidden=!0),e.drawing=!0,e.frameTask=(async()=>{const t=performance.now();try{if(e.options.refreshFrame?.(),e.started.format==="composite-webm"){const n=e.staging,o=e.overlayCache;if(!n||!o)throw new Error("gameplay recording: composite buffers unavailable");await _t(e.container,n,{canvasFrame:e.options.canvasFrame,snapshots:e.snapshots,overlayCache:o});const{output:r}=e,s=r.getContext("2d");if(!s)throw new Error("gameplay recording: output context unavailable");r.width!==n.width&&(r.width=n.width),r.height!==n.height&&(r.height=n.height),s.globalCompositeOperation="copy",s.drawImage(n,0,0),s.globalCompositeOperation="source-over",en(e,performance.now()-e.startedWallMs)}e.frames+=1}catch{e.frameErrors+=1}finally{e.drawing=!1;const n=performance.now()-t;e.nextFrameAt=t+Math.max(e.intervalMs/2,2*n)}})())}async function tn(e,t={}){co();const n=so(t.fps),o=t.format??"composite-webm",r=e.ownerDocument.createElement("canvas"),s=t.audio??null;let i=null,p=null,f=null;const h=In(),d=Rn();try{const u=await _t(e,r,{canvasFrame:t.canvasFrame,snapshots:h,overlayCache:d});if(u.canvases===0&&u.domOverlays===0)throw new Error("gameplay recording: no game layers are mounted");const c=Array.from(e.querySelectorAll("canvas")).filter(Mt);if(o==="canvas-dom"&&c.length!==1)throw new Error(`canvas-dom recording requires exactly one root canvas; this game has ${c.length}`);const a=o==="canvas-dom"?c[0]:r;if(typeof a.captureStream!="function")throw new Error("this browser cannot capture a canvas as a media stream");if(i=a.captureStream(n),s)for(const T of s.stream.getAudioTracks())i.addTrack(T);const m=ao(i.getAudioTracks().length>0),P=new MediaRecorder(i,{mimeType:m}),y=new Date().toISOString();p=await Pn({startedAt:y,mimeType:m,name:t.name??null,format:o}),o==="canvas-dom"&&(f=Xr(e,a,p),d.dispose());const D={format:o,startedAt:y,mimeType:m,width:a.width,height:a.height,fps:n,audio:i.getAudioTracks().length>0,layers:u,path:p.path,replayPath:p.replayPath,rotates:p.rotates,logFile:p.logFile},v={started:D,recorder:P,output:a,staging:o==="composite-webm"?e.ownerDocument.createElement("canvas"):null,stream:i,audio:s,sink:p,startedWallMs:performance.now(),intervalMs:1e3/n,container:e,options:{canvasFrame:t.canvasFrame,refreshFrame:t.refreshFrame},clock:null,frameTask:null,drawing:!1,nextFrameAt:0,snapshots:h,overlayCache:o==="composite-webm"?d:null,domRecording:f,previewEncoder:Jr(),previewFrames:[],previewSnapshot:{startedAt:y,width:a.width,height:a.height,liveEdgeMs:0,sampleFps:Re,retentionMs:Ie,frames:[],previewError:null},previewTask:null,previewEncoding:!1,previewError:null,nextPreviewAt:0,nextPreviewSequence:0,frames:1,frameErrors:0,hidden:typeof document<"u"&&document.hidden,recorderError:null,uploadError:null,uploads:Promise.resolve(),nextSequence:0,stopping:!1};return P.addEventListener("dataavailable",T=>{if(T.data.size===0||v.uploadError)return;const j=v.nextSequence;v.nextSequence+=1,v.uploads=v.uploads.then(async()=>{if(!v.uploadError)try{await An(v.sink,j,T.data)}catch(O){v.uploadError=O instanceof Error?O:new Error(String(O))}})}),P.addEventListener("error",T=>{v.recorderError=T.error??new Error("gameplay recording failed")}),P.addEventListener("start",()=>{v.domRecording?.markVideoStarted(Date.now())}),P.start(1e3),F=v,Qe(),o==="composite-webm"&&en(v,0),v.clock=oo(v.intervalMs,()=>lo(v)),D}catch(u){await f?.abort(),d.dispose(),p&&await Dt(p);for(const c of i?.getTracks()??[])c.stop();throw s?.dispose(),u}}async function nn(e){const t=F;if(!t)throw new Error("no gameplay recording is active");t.stopping=!0,t.clock?.stop(),t.clock=null,await t.frameTask,t.previewEncoder.dispose(),await t.previewTask;let n=!1;try{if(t.recorder.state!=="inactive"){const f=new Promise(h=>{t.recorder.addEventListener("stop",()=>h(),{once:!0})});t.recorder.stop(),await f}if(t.recorderError)throw t.recorderError;if(await t.uploads,t.uploadError)throw t.uploadError;const o=Math.max(0,Math.round(performance.now()-t.startedWallMs)),r=Math.round(o/1e3*t.started.fps),s={...t.started,durationMs:o,droppedFrames:Math.max(0,r-t.frames),frameErrors:t.frameErrors,effectiveFps:o>0?Math.round(t.frames/(o/1e3)*10)/10:0,hidden:t.hidden},i=t.sink.path.split(/[\\/]/).at(-1)??"video.webm",p=await t.domRecording?.stop(i);return await kn(t.sink,e??null,void 0,p?{...p,capture:{durationMs:s.durationMs,droppedFrames:s.droppedFrames,frameErrors:s.frameErrors,effectiveFps:s.effectiveFps,hidden:s.hidden,fps:s.fps,width:s.width,height:s.height,mimeType:s.mimeType,audio:s.audio}}:null),n=!0,s}finally{n||(await t.domRecording?.abort(),await Dt(t.sink)),F=null,Qe(),io(t),t.overlayCache?.dispose();for(const o of t.stream.getTracks())o.stop();t.audio?.dispose()}}function et(){return F!==null}function uo(){return F?.started??null}function rn(e,t){return Math.max(0,Math.floor(t-e))}function po(){const e=F;return e===null?null:{startedAt:e.started.startedAt,elapsedMs:rn(e.startedWallMs,performance.now())}}const Rs=Object.freeze(Object.defineProperty({__proto__:null,activeGameplayRecording:uo,activeGameplayRecordingTimeline:po,gameplayRecordingActive:et,recordingTimelineElapsedMs:rn,startGameplayRecording:tn,stopGameplayRecording:nn},Symbol.toStringTag,{value:"Module"})),tt=12e4,fo=5e3,bt=["keydown","keyup","pointerdown","pointermove","wheel","touchstart","touchmove"];let A=null,me=null,Et=0,mo=null,on=null;function ho(e){on=e}function go(){return!A||!et()?null:{path:A.started.path,format:A.started.format,replayPath:A.started.replayPath,startedAt:A.started.startedAt,rotates:A.started.rotates,logFile:A.started.logFile,idleAutoStopMs:tt}}function sn(){A&&(A.lastActivityMs=Date.now())}function yo(){if(typeof window>"u")return()=>{};const e=()=>sn();for(const t of bt)window.addEventListener(t,e,{capture:!0,passive:!0});return()=>{for(const t of bt)window.removeEventListener(t,e,{capture:!0})}}async function Is(e,t={}){if(A&&await nt("restart"),await me,!e)return b.warn("Play started, but gameplay recording did not: no game surface is mounted to record.","play-recording"),null;try{return A={started:await tn(e,{format:Array.from(e.querySelectorAll("canvas")).filter(Mt).length===1?"canvas-dom":"composite-webm",...t.name?{name:t.name}:{},...t.audio?{audio:t.audio}:{},...t.refreshFrame?{refreshFrame:t.refreshFrame}:{},...t.canvasFrame?{canvasFrame:t.canvasFrame}:{}}),lastActivityMs:Date.now(),poll:null,releaseInput:yo(),ending:!1},A.poll=window.setInterval(()=>{const o=A;!o||o.ending||Date.now()-o.lastActivityMs<tt||vo()},fo),go()}catch(n){return b.warn(`Play started, but gameplay recording did not: ${n instanceof Error?n.message:String(n)}`,"play-recording"),null}}async function nt(e){const t=A;if(!t||t.ending)return me;if(t.ending=!0,t.poll!==null&&window.clearInterval(t.poll),t.releaseInput?.(),A=null,!et())return null;const n=++Et,o=(async()=>{try{const r=await nn(e);return mo=r,r}catch(r){return b.warn(`Gameplay recording could not be finalized: ${r instanceof Error?r.message:String(r)}`,"play-recording"),null}finally{Et===n&&(me=null)}})();return me=o,o}function wo(e){const t=Math.round(e.durationMs/100)/10;return`${e.path} — ${t}s at ${e.effectiveFps} fps${e.hidden?" (tab hidden; that is the cadence actually captured, not the requested one)":""}`}async function vo(){const e=Math.round(tt/1e3),t=await nt("idle-autostop");b.log(t===null?`Play auto-stopped after ${e}s with no session command and no player input.`:`Play auto-stopped after ${e}s with no session command and no player input. Recording finalized: ${wo(t)}`,"play-recording"),on?.()}E().session.onCommandDispatched(()=>sn());const bo={source:"live",label:"live",detail:"Running DOM adopted from the playing game. Edits apply to this session only and are discarded when play stops."},St="structure is owned by the running React tree — play edits are live-DOM only and are discarded on stop; stop play to change structure in source";function Ce(e,t){const n=[];for(const o of _r(e).nodes.values())o.oid===t&&n.push(o.el);return n}function Pt(e){return e.style?e.style:null}function Eo(e){return{writeStyle:async(t,n,o)=>{const r=Ce(e,t);if(r.length===0)return{changed:!1,error:`no live element carries oid "${t}"`};for(const s of r){const i=Pt(s);i&&(i[n]=o)}return{changed:!0,route:"live-dom"}},removeStyle:async(t,n)=>{const o=Ce(e,t);if(o.length===0)return{changed:!1,error:`no live element carries oid "${t}"`};let r=!1;for(const s of o){const i=Pt(s),p=i?.[n];i&&p!==void 0&&p!==null&&p!==""&&(delete i[n],r=!0)}return{changed:r,route:"live-dom"}},writeText:async(t,n)=>{const o=Ce(e,t).filter(s=>s.children.length===0);if(o.length===0)return{changed:!1,error:`no live leaf element carries oid "${t}"`};const r=o[0]?.textContent??null;for(const s of o)s.textContent=n;return{changed:!0,prevText:r}},writeProp:async(t,n)=>({changed:!1,error:`prop "${n}" is owned by the running React element (its value lives at the parent call site, not in the DOM) — play edits are live-DOM only and are discarded on stop; stop play to change it in source`}),writeStruct:async()=>({changed:!1,error:St}),writeStructMany:async()=>({changed:!1,error:St})}}function So(e,t){return new kr(e,t,{writeBackend:Eo(e),provenance:bo})}function an(){return{id:"",journalSession:"",name:"",container:null,session:null,presentation:null,unregisterPerformanceSource:null,unsubscribeSystemAdapters:null,determinismDeclared:!1,resizeObserver:null,rootResources:[]}}const l=an(),M=[];let ee=[],U=null;const We=new Set;function cn(){return U&&(U===l.id||M.some(e=>e.id===U))?U:l.id}function Ts(){return l.id}function ks(e){return We.add(e),()=>We.delete(e)}function rt(){for(const e of We)e()}function _s(e){xt(e),cn()!==e&&(U=e,J(),rt())}function ve(e){if(!S)return!1;const{store:t}=S;return t.playState==="playing"&&t.activeViewportTab==="play"&&cn()===e&&er()}function At(e){try{return e.session?.game?.input}catch{return}}function J(){l.id&&At(l)?.setEnabled(ve(l.id));for(const e of M)At(e)?.setEnabled(ve(e.id))}Ln(J);let S=null;const he=new Set;function Po(){return S?Promise.resolve():new Promise((e,t)=>{const n=()=>{clearTimeout(o),he.delete(n),e()},o=setTimeout(()=>{he.delete(n),t(new Error("Play mode failed to start: the editor shell did not bind within 15 seconds."))},15e3);he.add(n)})}const Be=new Set,be=new Set;let Ee=null;function ln(){return Ee}function Ms(e){return be.add(e),()=>be.delete(e)}function Ao(e){Ee=e;for(const t of be)t();E().live.notifyChanged()}const Fe=new Set;function Ro(){if(Fe.size>0){const e=[...Fe].map(t=>({severity:"warn",message:t}));Fe.clear(),Gn("console-resolved",{conditions:e,by:"play-mode"})}if(Ee!==null){Ee=null;for(const e of be)e();E().live.notifyChanged()}}function Te(){un();for(const e of Be)e()}function Ds(e){return Be.add(e),()=>Be.delete(e)}let R=0,ot=null,Se=null;pr();let Ge=null,ge;function de(e){const t={...e.capabilities,persist:!1},n=cr(),o=()=>Jn({resolve:()=>Zn("play edits are session-local by architecture",Qn),record:()=>{}}),r=e.transforms,s=r&&{...r,get:f=>r.get(f),beginEdit:f=>r.beginEdit(f),apply:(f,h)=>r.apply(f,h),endEdit:f=>(r.endEdit(f),o()),...r.remove?{remove:()=>o()}:{}},i=e.inspector,p=i&&{...i,properties:f=>i.properties(f),get:(f,h)=>i.get(f,h),set:(f,h,d)=>(i.set(f,h,d),o()),...i.remove?{remove:()=>o()}:{}};return new Proxy(e,{get(f,h){if(h==="capabilities")return t;if(h==="persistence")return n;if(h==="transforms"&&s)return s;if(h==="inspector"&&p)return p;const d=Reflect.get(f,h,f);return typeof d=="function"?d.bind(f):d}})}function Io(){ge!==void 0&&(Vt(ge),ge=void 0)}async function To(e,t,n,o,r){ge=rr();const s=[],i=[],p=()=>{for(const d of i)"dispose"in d&&typeof d.dispose=="function"&&d.dispose()};for(const d of t){const u=n?zn(n,d.id):void 0,c=u?{zOrder:u.zOrder,pausable:u.pausable,...u.entry?{content:`Entry · ${u.entry}`}:{}}:{};if(u?.adapter.identity==="ingest-react"){s.push({worldId:d.id,kind:d.kind,adapter:new ut(e,{id:d.id,kind:d.kind,adapter:u.adapter.identity,entryOrScenePath:u.entry,zOrder:u.zOrder,pausable:u.pausable}),...c});continue}const a=d.mounted;if(a.kind==="three"){const m=d.id===o&&a.scene===e.scene,P=m?await Pr():void 0;if(!r()){p();return}const y=m?Ar(e,a.scene,wr(d.id),je(d.id),{explicitSourceCommit:!0,sourceAnchor:P}):Rr(e,a.scene,{frameControl:"host",journal:je(d.id)});i.push(y),s.push({worldId:d.id,kind:d.kind,adapter:de(y),...c})}else if(a.kind==="canvas"){if(a.substrate.name==="babylon"){const{BabylonAuthoringAdapter:_}=await C(async()=>{const{BabylonAuthoringAdapter:Me}=await import("./babylon-authoring-adapter-CL02gWDn.js");return{BabylonAuthoringAdapter:Me}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]));if(!r()){p();return}const Z=new _(a.substrate.root,e,{canvas:a.canvas,api:a.substrate.api,provenance:{source:"live",label:"live",detail:"Native Babylon.js play scene; ordinary Play edits are ephemeral."}});i.push(Z),s.push({worldId:d.id,kind:d.kind,adapter:de(Z),...c});continue}if(a.substrate.name!=="pixi"){const _=new ut(e,{id:d.id,kind:d.kind,adapter:a.substrate.name,entryOrScenePath:u?.entry,zOrder:u?.zOrder??0,pausable:u?.pausable??!0},`No authoring adapter is registered for canvas substrate "${a.substrate.name}".`);i.push(_),s.push({worldId:d.id,kind:d.kind,adapter:_,...c});continue}const m=a.substrate.root,[P,y,D,v,T]=await Promise.all([C(()=>import("./physics-registry-B2Jkp8e6.js"),[]),C(()=>import("./system-adapters-rIC8FSGP.js"),[]),C(()=>import("./pixi-authoring-adapter-CjibysC3.js"),__vite__mapDeps([15,16,1,2,3,4,5,6,7,8,9,10,11,13,14,12,17])),C(()=>import("./pixi-live-write-target-DuWydlWb.js"),__vite__mapDeps([18,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17])),C(()=>import("./canvas-entry-runtime-SfBxaR9M.js"),__vite__mapDeps([19,1,2,3,4,5,6,7,8,9,10,11]))]);if(!r()){p();return}const{createPhysics2DRegistry:j}=P,{createPhysicsAdapter2D:O}=y,{PixiAuthoringAdapter:N}=D,{createLiveCanvasWriteTarget:x}=v,k=O(d.physics2d??j()),w=new N(m,e,{pixi:await T.resolveCanvasPixiForEditor(),target:x({physics:k}),journal:je(d.id),surface:Mo});i.push(w),s.push({worldId:d.id,kind:d.kind,adapter:de(w),...c})}else if(a.kind==="dom"){const m=So(a.container,e);i.push(m),s.push({worldId:d.id,kind:d.kind,adapter:de(m),...c})}else Sr(a,"installPlayRootAuthoring")}if(!r()){p();return}l.rootResources=i;const f=Hn(Ae()?.config),h=new Kn(s,void 0,f);Vt(h),e.notifyIngestEdit()}function je(e){return Wt(l.id,e)}function ko(e){for(const t of l.rootResources)"dispose"in t&&typeof t.dispose=="function"&&t.dispose();l.rootResources=[],l.journalSession&&(e.projectHistory?.expireSession(l.journalSession),l.journalSession="")}function _o(e){return!(e.defaultPrevented||nr(e.target))}let te=null,ne=null,re=null,oe=null,se=null,V=Promise.resolve(),ye=null,W=[],we=0;function dn(){const e=l.session?.game;if(!e)return{};const t=e.roots,n=l.presentation?.worldId??(t.length===1?t[0]?.id:void 0),o=e.loop.timeScale;return{...n!==void 0?{world:n}:{},...typeof o=="number"?{simSpeed:o}:{}}}function ze(){const e=l.session?.game?.systemAdapters?.debug;if(e)try{const t=Wr(e.events(we),we);we=t.lastSeq;const n=dn();for(const o of t.entries)W.push({...o,...n})}catch{}}Cn(()=>{l.session&&Ao("Project assets changed — restart play to load the revised models or textures.")});function Mo(){return E().workspace.liveDocument.container()}function Do(){const e=()=>{const t=E().workspace.liveDocument.container();if(!t)return;const n=typeof document<"u"?document.activeElement:null;n instanceof HTMLElement&&n!==t&&n.tagName==="BUTTON"&&n.blur(),t.hasAttribute("tabindex")||(t.tabIndex=-1);try{t.focus({preventScroll:!0})}catch{}Xn("viewport")};e(),setTimeout(e,150),setTimeout(e,600)}Fn(e=>Oo(e));function Oo(e){S={store:e,gameContainer:null},ho(Y);for(const t of he)t()}function Ne(){return l.session!==null}function ue(){const e=l.session?.game;if(!e)return null;const t=Ye(e),n=t?.getRunTicksTarget()??null;return{getInputTarget:o=>t?.getVirtualInputTarget(o)??null,loop:e.loop,runTicks:n?n.runTicks.bind(n):null,runTicksSettled:t&&n?(o,r)=>Er(t,o,r):null,random:vr(e),determinismDeclared:l.determinismDeclared}}function Os(){const e=l.session?.game.defaultRoot.mounted;return e?.kind==="three"?e.scene:null}function xs(){const e=l.session?.game?.roots;return e?e.map(t=>{const n=t.mounted;let o=!1;if(n.kind==="three")o=gr(n.scene);else if(n.kind==="canvas")try{o=n.substrate.name==="pixi"?hr(n.substrate.root):n.substrate.name==="babylon"?(n.substrate.root.scenes??[]).some(r=>(r.rootNodes?.length??0)>0):!1}catch{o=!1}else o=yr(n.container);return{rootId:t.id,kind:n.kind,hasRenderableContent:o}}):[]}function xo(){return l.session?Ot(E().workspace.liveDocument.container()).canvas:null}function Lo(e){return!e||e===l.id?E().workspace.liveDocument.container():M.find(t=>t.id===e)?.container??null}function Ls(e){if(!e||e===l.id)return xo();const t=M.find(n=>n.id===e);return t?.session?Ot(t.container).canvas:null}function Co(){return ot}function Fo(){return Se}function G(){return[l,...M].filter(e=>e.session)}const pe=new Set;function un(){const e=new Set(G().map(t=>t.session.game.loop));for(const t of pe)e.has(t)||pe.delete(t);for(const t of e)lr()?pe.delete(t)&&t.start():t.liveness!=="stopped"&&(pe.add(t),t.stop())}dr(un);function Rt(){const e=G(),t=tr();return e.find(n=>n.id===t)??e[0]??null}let Pe=null;function jo(){Pe?.(),Pe=Yn(()=>({projectName:Ae()?.config.name??null,instanceName:G().length>1?Rt()?.name??null:null})),qt(()=>{const e=Rt();return e?.session?{game:e.session.game,instanceId:e.id,recording:or}:null})}function No(){Pe?.(),Pe=null,qt(null)}function Cs(e,t,n){for(const o of G())o.session?.resize(e,t,n)}let It=Promise.resolve(),ke=null,st=null;function Fs(){return ke}function $o(){const e=globalThis.crypto?.randomUUID?.()??`private-${Date.now()}`;return{mode:"private",id:e,roomKey:`private:${e}`,revision:null,participantId:On}}function Tt(e,t=$o(),n,o){const r=o??null,s=It.then(()=>(Mn(),Vo(e,t,n??null,r).finally(()=>{Dn()})));return It=s.then(()=>{},()=>{}),s}async function Uo(e){const{autoLaunchIngest:t}=await C(async()=>{const{autoLaunchIngest:r}=await import("./mount-ingest-root-glv2SSWf.js").then(s=>s.m);return{autoLaunchIngest:r}},__vite__mapDeps([20,1,2,3,4,5,6,7,8,9,10,11,21,22,23,14,24]));await t(e);const n=mr();if(n)return n.play(),!0;const{isModuleModeActive:o}=await C(async()=>{const{isModuleModeActive:r}=await import("./module-mode-DVBLT9d-.js");return{isModuleModeActive:r}},__vite__mapDeps([25,1,2,3,4,5,6,7,8,9,10,11,23,22,26,27,28,29,24,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,19,49,50,51,52,53,54,55]));return o()}function $e(e,t){return q(e),qr(e,t,{isHidden:()=>typeof document<"u"&&document.hidden,editorUrl:typeof window<"u"?window.location.href:void 0})}async function Vo(e,t,n,o){if(!S){const c=R;if(q("waiting for the editor to bind Play"),await Po(),R!==c)throw new Error("Play start cancelled while waiting for the editor to bind.")}if(!S)throw new Error("Play mode failed to start: the editor shell is not bound.");if(q("waiting for the project bootstrap to settle"),await jn(),l.session&&Y(),st=o,await Uo(S.store)||await Ir(S.store))return;const r=++R;ke=t,ot=Date.now(),Se=null;const{store:s}=S;Yo();const i=V.then(()=>Mr(n));if(V=i,await $e("starting the play log session",i),r!==R||(W=[],we=0,b.setSink(c=>{let a;try{const m=l.session?.game?.systemAdapters.debug?.state("time");typeof m?.tick=="number"&&typeof m.simSeconds=="number"&&(a={tick:m.tick,simT:m.simSeconds})}catch{}W.push({t:c.timestamp,level:c.level,msg:c.message,...c.source?{source:c.source}:{},...c.subsystem?{sub:c.subsystem}:{},...c.metadata?{meta:c.metadata}:{},...a??{},...dn()})}),ye=setInterval(()=>{if(ze(),W.length>0){const c=W.splice(0);V=V.then(()=>Ht(c))}},200),te=c=>{c.key==="Escape"&&_o(c)&&Y()},window.addEventListener("keydown",te),q("opening the Game document"),await E().workspace.liveDocument.acquire(),r!==R))return;const p=E().workspace.liveDocument.container();if(!p){const c="Play mode failed to start: the game container is not mounted in the workspace.";throw b.error(c,"play-mode"),Y(),new Error(c)}const f=p.clientWidth,h=p.clientHeight;p.style.contain||(p.style.cssText+=zt),Lt(p),Ue(p),E().viewport.transition.begin(),s.setPlayState("playing"),Do(),b.log("Play mode started","play-mode"),E().viewport.transition.onSettled(()=>{r===R&&s.playState==="playing"&&Nn()});let d=null,u=null;try{const c=Ae();if(!c)throw new Error("No project open — open or create a project first");const a=await $e("fetching the project manifest",Ct());ee=le(a).map(w=>w.id);for(const w of ee)dt({rootId:w,mechanism:"host-mount",source:"declared",state:"waiting"});let m;Ft();const{entries:P,mountId:y}=await $e("resolving the project's root entries",Bt(a,c.rootPath,{selectionOverride:o??void 0}));if(b.log(`Resolved manifest composition (${le(a).length} world${le(a).length===1?"":"s"}): `+le(a).map(w=>`${w.id} (${w.surface})`).join(", "),"play-mode"),r!==R)return;const D=p.clientWidth||f,v=p.clientHeight||h;Ue(p,y),d=y,q("mounting the runtime roots");const{mountManifestRoots:T}=await C(async()=>{const{mountManifestRoots:w}=await import("./mount-manifest-CGVxhmAw.js");return{mountManifestRoots:w}},__vite__mapDeps([56,30,1,2,3,4,5,6,7,8,9,10,11,57,58,59,60,61,62,63,64,65,66,67,29,68,69,70,71,72,43,44,73,74,75,76,77,78,79,80,81,82,83,84,85,86]));if(m=await T({manifest:a,container:p,entries:P,width:D,height:v,seed:e,playtest:t}),u=m,r!==R){m.stop(),ie(m,y,"Cancelled instance");return}for(const w of jt(c.rootPath))b.error(Nt(w),"play-mode");for(const w of ee)dt({rootId:w,mechanism:"host-mount",source:"declared",state:"ready"});if(Kt(m.game),l.session=m,l.id=y,l.journalSession=Wt(y,"").session,l.name=pn(0),l.unregisterPerformanceSource?.(),l.unregisterPerformanceSource=$t({id:"workspace:game",label:"Game runtime",kind:"game",instanceId:y,profiler:m.game.profiler}),Ro(),l.determinismDeclared=a.determinism?.seededRandom===!0,a.configurations.some(w=>w.kind==="process")&&Ye(m.game)?.setRoomDeclared(!0),Te(),s.setPlayEditRegime("ephemeral"),l.presentation=E().viewport.presentRoots(m.game.roots),q("installing play authoring for each root"),await To(s,m.game.roots,a,l.presentation?.worldId??null,()=>r===R),r!==R)return;q("binding the editor to the running game");const j=m.game.systemAdapters;ae(j,y),xt(y),jo(),l.unsubscribeSystemAdapters?.(),l.unsubscribeSystemAdapters=m.game.subscribeSystemAdapters?.(()=>{Ut(m.game.systemAdapters,y)})??null,Xe(()=>ve(y),y),J(),Ge=s.subscribe(J);const O=$n(j.physics);s.setEcsSyncTransform((w,_)=>{!O||O.ownerOf(w)==="unresolved"||O.commit(w,{position:_.position.toArray(),rotation:_.quaternion.toArray(),scale:_.scale.toArray()})});const N=jr(),x=p.clientWidth,k=p.clientHeight;x>0&&k>0&&(x!==f||k!==h||N!==null)&&m.resize(x,k,N??void 0),E().viewport.transition.ready(()=>{const w=l.session?.game;if(!w)return null;for(const _ of w.roots)if(_.mounted.kind==="three")return _.mounted.camera;return null})}catch(c){const a=`Play mode failed to start: ${c}`;if(b.error(a,"play-mode"),d!==null&&l.id!==d)if(u){try{u.stop()}catch(m){b.error(`Error stopping the failed play session: ${m}`,"play-mode")}ie(u,d,"Failed instance")}else _e(d,"Failed instance");throw r===R&&Y(),new Error(a)}}async function js(e,t){if(!S)throw new Error("Cannot mount an additional instance: play mode is not bound.");if(!l.session)throw new Error("Cannot mount an additional instance: no primary play session is running.");const n=R,o=Ae();if(!o)throw new Error("Cannot mount an additional instance: no project is open.");const r=await Ct();Ft();const{entries:s,mountId:i}=await Bt(r,o.rootPath,{selectionOverride:st??void 0});e.style.contain||(e.style.cssText+=zt),Lt(e),Ue(e,i);const{mountManifestRoots:p}=await C(async()=>{const{mountManifestRoots:c}=await import("./mount-manifest-CGVxhmAw.js");return{mountManifestRoots:c}},__vite__mapDeps([56,30,1,2,3,4,5,6,7,8,9,10,11,57,58,59,60,61,62,63,64,65,66,67,29,68,69,70,71,72,43,44,73,74,75,76,77,78,79,80,81,82,83,84,85,86])),f=await p({manifest:r,container:e,entries:s,width:e.clientWidth,height:e.clientHeight,playtest:ke});for(const c of jt(o.rootPath))b.error(Nt(c),"play-mode");if(n!==R||!l.session){try{f.stop()}catch{}return ie(f,i,t?.trim()||"Cancelled instance"),i}Kt(f.game);const h=an();h.id=i,h.name=t?.trim()||pn(M.length+1),h.container=e,h.session=f,h.unregisterPerformanceSource=$t({id:`workspace:game:${i}`,label:`Game runtime (instance ${i})`,kind:"game",instanceId:i,profiler:f.game.profiler});const d=f.game.systemAdapters;ae(d,i),h.unsubscribeSystemAdapters=f.game.subscribeSystemAdapters?.(()=>{Ut(f.game.systemAdapters,i)})??null,Xe(()=>ve(i),i),M.push(h),J();const u=l.session.game.systemAdapters;return ae(u,l.id),Te(),i}function qo(){return M.map(e=>e.id)}function Ns(){const e=[];l.id&&e.push({id:l.id,name:l.name});for(const t of M)t.id&&e.push({id:t.id,name:t.name});return e}function Wo(e){return l.id===e?l.name:M.find(t=>t.id===e)?.name}function _e(e,t){e&&(Gt(e),ur(e,t))}function ie(e,t,n){e.stopComplete.then(()=>_e(t,n))}function Bo(e){const t=M.findIndex(r=>r.id===e);if(t<0)return;const[n]=M.splice(t,1);if(!n)return;n.unsubscribeSystemAdapters?.(),n.unsubscribeSystemAdapters=null;const o=n.session;try{o?.stop()}catch(r){b.error(`Error stopping additional instance ${n.id}: ${r}`,"play-mode")}n.unregisterPerformanceSource?.(),ae(null,n.id),o?ie(o,n.id,n.name):_e(n.id,n.name),n.container=null,n.session=null,U===e&&(U=null,J(),rt()),Te()}function Go(){for(const e of qo())Bo(e)}let X=[];const He=new Set;function at(e){if(e===0){const t=xn()?.getPlayerIdentity?.()?.name?.trim();if(t)return t}return`Instance ${e+1}`}function $s(){return X.length===0?0:X.length-1}function pn(e){return X[e]??at(e)}function Us(e){return He.add(e),()=>He.delete(e)}function zo(){for(const e of He)e()}function Ho(e){const t=Math.max(0,Math.floor(e));Ko(t===0?[]:Array.from({length:t+1},(n,o)=>at(o)))}function Ko(e){const t=e.length<=1?[]:e.map((n,o)=>n?.trim()?n.trim():at(o));t.length===X.length&&t.every((n,o)=>n===X[o])||(X=t,zo())}function Y(){if(R++,_n(),!S||(nt("teardown"),No(),st=null,Tr(S.store)))return;ke=null,U=null,rt();const{store:e}=S;ze(),Ho(0),Go(),E().viewport.transition.end(),e.setEcsSyncTransform(null);const t=l.id,n=l.name||"Game instance";l.id="",l.unsubscribeSystemAdapters?.(),l.unsubscribeSystemAdapters=null,ae(null,t),l.presentation?.dispose(),l.presentation=null,ko(e),Io(),e.setPlayEditRegime(null);const o=l.session;if(o)try{o.stop()}catch(r){b.error(`Error stopping play session: ${r}`,"play-mode")}finally{l.unregisterPerformanceSource?.(),l.unregisterPerformanceSource=null,l.session=null,l.determinismDeclared=!1,Te()}o?ie(o,t,n):_e(t,n);for(const r of ee)Un(r);if(ee=[],Ge?.(),Ge=null,Xe(()=>!0),Gt(),l.resizeObserver?.disconnect(),l.resizeObserver=null,te&&(window.removeEventListener("keydown",te),te=null),b.log("Play mode stopped","play-mode"),Vn(),ye&&(clearInterval(ye),ye=null),ze(),b.setSink(null),W.length>0){const r=W.splice(0);V=V.then(()=>Ht(r))}V=V.then(()=>Dr()),Xo(),e.setPlayState("stopped"),E().workspace.liveDocument.release(),ot!==null&&Se===null&&(Se=Date.now())}function Vs(){if(!(!l.session||!S)){for(const e of G())e.session?.pause();S.store.setPlayState("paused"),b.log("Play mode paused","play-mode")}}function qs(){if(!(!l.session||!S)){for(const e of G())e.session?.resume();S.store.setPlayState("playing"),b.log("Play mode resumed","play-mode")}}function Ws(){if(l.session)for(const e of G())e.session?.step()}function Yo(){qn(),ne=console.log,re=console.info,oe=console.warn,se=console.error;const e=(t,n)=>{if(br)return;const o=fr();b.logStructured(t,Bn(n),"game",void 0,o?{instanceId:o,instanceName:Wo(o)??`Instance ${o}`}:void 0)};console.log=(...t)=>{ne?.apply(console,t),e("info",t)},console.info=(...t)=>{re?.apply(console,t),e("info",t)},console.warn=(...t)=>{oe?.apply(console,t),e("warn",t)},console.error=(...t)=>{se?.apply(console,t),e("error",t)}}function Xo(){Wn(),ne&&(console.log=ne),re&&(console.info=re),oe&&(console.warn=oe),se&&(console.error=se),ne=null,re=null,oe=null,se=null}E().live.register({id:"play",priority:0,mounted:Ne,playing:Ne,stop:Y,instanceContainer:e=>Lo(e),startedAt:Co,endedAt:Fo,restartRequired:ln,restart:()=>void Tt(),remount:async e=>{try{return await Tt(void 0,void 0,void 0,e),Ne()?{ok:!0}:{ok:!1,error:"Play did not start: the remount was superseded before it finished booting."}}catch(t){return{ok:!1,error:t instanceof Error?t.message:String(t)}}}});E().session.reportFacet(()=>({timeScale:ue()?.loop.timeScale??null,loopLiveness:ue()?.loop.liveness??null,restartRequired:ln(),seed:ue()?.random?.seed??null,deterministic:ue()?.determinismDeclared??!1}));export{go as A,tn as B,po as C,Os as D,Yt as E,Zt as F,Es as G,vs as H,bs as I,ys as J,ws as K,ks as L,Ps as M,Nr as N,As as O,Cs as P,_s as Q,Ts as R,pn as S,xs as T,Ds as U,js as V,Bo as W,Ss as X,Fr as Y,Rs as Z,Ns as a,Ho as b,nn as c,Ws as d,Tt as e,nt as f,ue as g,Y as h,Ne as i,Is as j,Fs as k,Dr as l,Ht as m,sn as n,Mr as o,Vs as p,Mo as q,qs as r,Ko as s,cn as t,Us as u,$s as v,Ms as w,ln as x,Lo as y,Ls as z};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-GIL7oGEO.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/three.module-D396a9Mn.js","assets/index-D2fNXpHa.css","assets/gameplay-export-BoKXm51x.js","assets/wav-encode-D31zWF6O.js","assets/output-DK8waum9.js","assets/play-mode-BFU2PCkG.js","assets/native-debug-module-CWicoSGD.js","assets/native-entry-surface-BE8LJNdu.js","assets/debug-registry-Dgvitx8M.js","assets/playtest-BXIL1JEF.js","assets/game-contract-seams-a5YXejOu.js","assets/instruments-CKR02Y8I.js","assets/frame-pacing-D5acoOzO.js","assets/edit-mode-authoring-B47TfLqu.js","assets/json-history-resource-BbxllWfV.js","assets/binding-resolver-Dsh-6Vor.js","assets/adapter-surface-Y37Nzcyw.js","assets/entry-adjudication-Cq8Yeb74.js","assets/r3f-root-factory-z9llD1OU.js","assets/register-render-vitals-BiZk29b2.js","assets/render-census-BrQX_CXv.js","assets/structural-signature-0w-i_ats.js","assets/render-vitals-BZ5HtvMi.js","assets/static-batch-advisor-B13QEH7d.js","assets/webgl-frame-capture-FlF9zQmW.js","assets/world-state-BWG-IcOd.js","assets/frame-selector-cache-cCeUbcjG.js","assets/dev-build-gDYrq68M.js","assets/game-input-seams-CIQdetRw.js","assets/seeded-random-i3mtgBKZ.js","assets/render-seed-DF4JHy7P.js","assets/frame-delta-D2nsw_Ht.js","assets/events-156d8d12.esm-ErOhDXXB.js","assets/index-bQE2NA0D.js","assets/realm-services-CobQsq_X.js","assets/canvas-entry-runtime-SfBxaR9M.js","assets/three-ingest-runtime-QzDYk6tU.js","assets/EffectComposer-DQxfsXBZ.js","assets/CopyShader-BzTUYzf6.js","assets/ShaderPass-QYRpPuFJ.js","assets/CSS3DRenderer-CL7ABLVK.js","assets/relative-path-guard-GiM7Lsz8.js","assets/capability-coverage-Czas4C18.js","assets/react-root-CEz5NTck.js","assets/editor-presentation-activity-C7SNSmTd.js","assets/active-ingest-CT6jSGhr.js","assets/ingest-source-persistence-C_6Hiyra.js","assets/pixi-story-model-DNkfnWUV.js","assets/surface-content-Dg9Kkazf.js","assets/viewport-root-presentation-CWsE56K6.js","assets/mounted-authoring-Dmg5xmhP.js","assets/three-CDSueJyJ.js","assets/viewport-pick-context-DkawXbEi.js","assets/logger-Dqis-7W1.js","assets/run-ticks-settled-C4ksViyA.js","assets/three-authoring-adapter-CmSQ3Vui.js","assets/source-persistence-backend-C-aR-B_Y.js","assets/three-projection-core-BmKMZ-nf.js","assets/body-marks-h_xDxiDE.js","assets/user-data-BB2Of6Ht.js","assets/object-marks-DwvIEBOK.js","assets/structural-ids-Dc-7rEwi.js","assets/object3d-authoring-subject-CH5sI2oP.js","assets/rapier-physics-adapter-CaZqWLu0.js","assets/r3f-physics-binding-BBo8oma9.js","assets/deferred-ingest-play-DCJi_Pgu.js","assets/rrweb-Cd2ifIRP.js","assets/react-world-authoring-adapter-DmrwM3py.js","assets/board-guides-DziKSTss.js","assets/writer-B-KovzkA.js","assets/story-arg-descriptors-Ek86ExX7.js","assets/inspect-BZfi3mmo.js","assets/inference-diagnostics-Dhmtfbq_.js","assets/editor-api-BoJIcyZG.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{q as y,al as f,_ as c,am as b,ad as g}from"./index-GIL7oGEO.js";import{c as F,n as M,d as A,f as O,h as T,e as C,j as L,g as N,r as $,p as q}from"./play-mode-BFU2PCkG.js";import{r as W}from"./index-CtzuWnCS.js";import{n as z,s as R}from"./command-results-CUQD49AB.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-CinJrH5C.js";import"./three.module-D396a9Mn.js";import"./native-debug-module-CWicoSGD.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-Dgvitx8M.js";import"./playtest-BXIL1JEF.js";import"./game-contract-seams-a5YXejOu.js";import"./instruments-CKR02Y8I.js";import"./frame-pacing-D5acoOzO.js";import"./edit-mode-authoring-B47TfLqu.js";import"./json-history-resource-BbxllWfV.js";import"./binding-resolver-Dsh-6Vor.js";import"./adapter-surface-Y37Nzcyw.js";import"./entry-adjudication-Cq8Yeb74.js";import"./r3f-root-factory-z9llD1OU.js";import"./register-render-vitals-BiZk29b2.js";import"./render-census-BrQX_CXv.js";import"./structural-signature-0w-i_ats.js";import"./render-vitals-BZ5HtvMi.js";import"./static-batch-advisor-B13QEH7d.js";import"./webgl-frame-capture-FlF9zQmW.js";import"./world-state-BWG-IcOd.js";import"./frame-selector-cache-cCeUbcjG.js";import"./dev-build-gDYrq68M.js";import"./game-input-seams-CIQdetRw.js";import"./seeded-random-i3mtgBKZ.js";import"./render-seed-DF4JHy7P.js";import"./frame-delta-D2nsw_Ht.js";import"./events-156d8d12.esm-ErOhDXXB.js";import"./index-bQE2NA0D.js";import"./realm-services-CobQsq_X.js";import"./canvas-entry-runtime-SfBxaR9M.js";import"./three-ingest-runtime-QzDYk6tU.js";import"./EffectComposer-DQxfsXBZ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-QYRpPuFJ.js";import"./CSS3DRenderer-CL7ABLVK.js";import"./relative-path-guard-GiM7Lsz8.js";import"./capability-coverage-Czas4C18.js";import"./react-root-CEz5NTck.js";import"./editor-presentation-activity-C7SNSmTd.js";import"./active-ingest-CT6jSGhr.js";import"./ingest-source-persistence-C_6Hiyra.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-CWsE56K6.js";import"./mounted-authoring-Dmg5xmhP.js";import"./three-CDSueJyJ.js";import"./viewport-pick-context-DkawXbEi.js";import"./logger-Dqis-7W1.js";import"./run-ticks-settled-C4ksViyA.js";import"./three-authoring-adapter-CmSQ3Vui.js";import"./source-persistence-backend-C-aR-B_Y.js";import"./three-projection-core-BmKMZ-nf.js";import"./body-marks-h_xDxiDE.js";import"./user-data-BB2Of6Ht.js";import"./object-marks-DwvIEBOK.js";import"./structural-ids-Dc-7rEwi.js";import"./object3d-authoring-subject-CH5sI2oP.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./r3f-physics-binding-BBo8oma9.js";import"./deferred-ingest-play-DCJi_Pgu.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-DmrwM3py.js";import"./board-guides-DziKSTss.js";import"./writer-B-KovzkA.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-BZfi3mmo.js";import"./inference-diagnostics-Dhmtfbq_.js";const hr="workspace.command";async function x(e){const{liveCanvasFrame:r}=await c(async()=>{const{liveCanvasFrame:t}=await import("./index-GIL7oGEO.js").then(o=>o.tY);return{liveCanvasFrame:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]));return r(e)}function H(){const e=N();e?.loop.liveness==="loop-starved"&&e.runTicks?.(1,{render:"last"})}function j(){const e=g().audio,r=e?.renderOffline;if(!e||!r)return;let t=null;try{const o=g().debug?.state("time");typeof o?.simSeconds=="number"&&Number.isFinite(o.simSeconds)&&(t=o.simSeconds)}catch{t=null}if(t!==null)return{startSeconds:t,render:r.bind(e)}}let m=null;const vr={play:{timeoutMs:12e4,derivedRefresh:"always",handle:async e=>{try{const o=e.seed,d=e.name;await C(typeof o=="number"?o:void 0,void 0,typeof d=="string"?d:null)}catch(o){return{ok:!1,error:o instanceof Error?o.message:String(o)}}if(!y().live.playing())return{ok:!1,error:"Play did not start: the run was superseded before it finished booting (a stop, or a newer play, landed during startup). Nothing is running."};const r=e.record,t=await L(f()??y().workspace.liveDocument.container(),{name:typeof r=="string"?r:null,audio:g().audio?.acquireRecordingStream?.()??null,canvasFrame:x,refreshFrame:H});return{ok:!0,...t?{data:{recording:t}}:{}}}},stop:{timeoutMs:3e4,derivedRefresh:"always",handle:async()=>{m?.abort(new Error("Video export cancelled by Stop."));const e=await O("stop");return T(),{ok:!0,...e?{data:{recording:e}}:{}}}},pause:{derivedRefresh:"always",handle:()=>(q(),{ok:!0})},resume:{derivedRefresh:"always",handle:()=>($(),{ok:!0})},step:{derivedRefresh:"always",handle:()=>(A(),{ok:!0})},"bridge-recording-export":{timeoutMs:6e5,derivedRefresh:"none",handle:async e=>{const r=y();if(r.session.playState()!=="paused")return{ok:!1,error:"Pause the game before exporting video."};const t=f();if(!t)return z();if(m)return{ok:!1,error:"A video export is already active."};const{exportGameplayVideo:o,validateGameplayExport:d,assertGameplayVideoSupport:S}=await c(async()=>{const{exportGameplayVideo:n,validateGameplayExport:l,assertGameplayVideoSupport:s}=await import("./gameplay-export-BoKXm51x.js");return{exportGameplayVideo:n,validateGameplayExport:l,assertGameplayVideoSupport:s}},__vite__mapDeps([11,12,0,1,2,3,4,5,6,7,8,9,10,13])),h={frames:Number(e.frames),fps:e.fps===void 0?30:Number(e.fps)};try{d(h)}catch(n){return R(n)}if(m)return{ok:!1,error:"A video export is already active."};const i=new AbortController;m=i,b(!0);const k=setTimeout(()=>i.abort(new Error("Video export exceeded its ten-minute deadline.")),59e4),v=r.live.runWindow()?.startedAt??null,_=r.session.subscribe(()=>{(r.session.playState()!=="paused"||(r.live.runWindow()?.startedAt??null)!==v)&&i.abort(new Error("Video export cancelled: the Play session changed."))}),w=j();try{await S(t),i.signal.throwIfAborted();const{gameplayRecordingActive:n}=await c(async()=>{const{gameplayRecordingActive:a}=await import("./play-mode-BFU2PCkG.js").then(p=>p.Z);return{gameplayRecordingActive:a}},__vite__mapDeps([14,0,1,2,3,4,5,6,7,8,9,10,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81]));n()&&await F();const{blob:l,...s}=await o(t,h,{step:()=>W.flushSync(()=>A()),assertActive:()=>{if(M(),r.session.playState()!=="paused"||f()!==t||(r.live.runWindow()?.startedAt??null)!==v)throw new Error("Video export interrupted: its game must remain paused and mounted.")},canvasFrame:x,signal:i.signal,...w?{audio:w}:{}}),{beginGameplayRecordingSink:E,appendGameplayRecordingChunk:P,finishGameplayRecordingSink:G,abortGameplayRecordingSink:V}=await c(async()=>{const{beginGameplayRecordingSink:a,appendGameplayRecordingChunk:p,finishGameplayRecordingSink:I,abortGameplayRecordingSink:D}=await import("./editor-api-BoJIcyZG.js");return{beginGameplayRecordingSink:a,appendGameplayRecordingChunk:p,finishGameplayRecordingSink:I,abortGameplayRecordingSink:D}},__vite__mapDeps([82,0,1,2,3,4,5,6,7,8,9,10,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81]));i.signal.throwIfAborted();const u=await E({startedAt:new Date().toISOString(),mimeType:"video/webm",purpose:"export",name:typeof e.name=="string"?e.name:`export-${Date.now()}`},i.signal);try{for(let a=0,p=0;a<l.size;a+=4*1024*1024,p++)i.signal.throwIfAborted(),await P(u,p,l.slice(a,a+4*1024*1024),i.signal);i.signal.throwIfAborted(),await G(u,s.audio?`fixed-step export with audio (${s.audio.codec}, ${s.audio.channels}ch @ ${s.audio.sampleRate} Hz)`:"fixed-step export, video only: this world has no AudioAdapter.renderOffline",i.signal),i.signal.throwIfAborted()}catch(a){throw await V(u),a}return{ok:!0,data:{...s,path:u.path}}}catch(n){return R(n)}finally{_(),clearTimeout(k),m=null,b(!1)}}}};export{vr as commands,hr as point};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/world-documents-147tiFZe.js","assets/jsx-runtime-DPjLkJKQ.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-GIL7oGEO.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/three.module-D396a9Mn.js","assets/index-D2fNXpHa.css","assets/design-time-layers-wYgOTgni.js","assets/edit-mode-authoring-B47TfLqu.js","assets/design-time-mount-registry-DUpXCg1U.js","assets/react-story-board-BDDwiE2H.js","assets/CanvasSceneViewport-Bpi6gVTC.js","assets/RootSelectionOverlay-BZPlxmXU.js","assets/eyedropper-session-bjPXnfeX.js","assets/viewport-pick-context-DkawXbEi.js","assets/inspect-BZfi3mmo.js","assets/inference-diagnostics-Dhmtfbq_.js","assets/TransientHint-BB1fwrvK.js","assets/component-board-registry-DrIa2csL.js","assets/surface-state-DaxyruCj.js","assets/board-guides-DziKSTss.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{aQ as u,aR as p,aS as l,_ as m,aT as f,aU as b}from"./index-GIL7oGEO.js";import{b as D,e as o,i as v}from"./edit-mode-authoring-B47TfLqu.js";class g{constructor(s){this.store=s,this.unbind=D(()=>this.rebuild()),this.ready=this.rebuild()}references=0;disposed=!1;composite;disposeDocuments;stages=new Set;tail=Promise.resolve();unbind;ready;retain(){return this.references++,()=>{--this.references>0||(this.disposed=!0,this.unbind(),this.disposeDocuments?.(),o(this.composite),n.delete(this.store))}}attach(s){const r=this.retain();return this.stages.add(s),{ready:this.composite?s(this.composite):this.tail,dispose:()=>{this.stages.delete(s),r()}}}rebuild(){const s=this.tail.then(async()=>{if(this.disposed)return;const r=b(),a=new Set(p().map(t=>t.descriptor.id)),d=this.composite?l().map(t=>t.descriptor.id).filter(t=>a.has(t)):[];this.disposeDocuments?.(),this.disposeDocuments=void 0,o(this.composite),this.composite=void 0;const i=await v(this.store);if(this.disposed){o(i);return}const{installRootDocuments:h}=await m(async()=>{const{installRootDocuments:t}=await import("./world-documents-147tiFZe.js");return{installRootDocuments:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]));if(this.disposed){o(i);return}this.composite=i,this.disposeDocuments=h(this.store,i);for(const t of d)f(t,t===r);await Promise.all([...this.stages].map(t=>t(i)))});return this.tail=s.catch(()=>{}),s}}const n=new Map;function c(e){let s=n.get(e);return s||(s=new g(e),n.set(e,s)),s}function P(e){const s=c(e);return{ready:s.ready.then(()=>u()),dispose:s.retain()}}function _(e,s){return c(e).attach(s)}export{_ as a,P as r};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/r3f-source-authoring-adapter-w6Bc60K-.js","assets/index-GIL7oGEO.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/three.module-D396a9Mn.js","assets/index-D2fNXpHa.css","assets/live-gesture-lock-DJbrjOqf.js","assets/writer-B-KovzkA.js","assets/three-projection-core-BmKMZ-nf.js","assets/three-CDSueJyJ.js","assets/viewport-pick-context-DkawXbEi.js","assets/inference-diagnostics-Dhmtfbq_.js","assets/instance-fork-actions-D3sRzS3K.js","assets/r3f-physics-binding-BBo8oma9.js","assets/object3d-authoring-subject-CH5sI2oP.js","assets/user-data-BB2Of6Ht.js","assets/object-marks-DwvIEBOK.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{ft as Me,aj as Ae,g2 as Ce,_ as Ee,fl as Pe,V as $,p as le,bu as de,ju as xe,df as ue,jv as Fe,jw as Ie,bv as je,bw as De,aF as Be,bY as pe,db as He,jx as Le}from"./index-GIL7oGEO.js";import{p as Ve,B as fe,q as ye}from"./edit-mode-authoring-B47TfLqu.js";import{a as Ge}from"./entry-adjudication-Cq8Yeb74.js";import{a as Oe}from"./realm-services-CobQsq_X.js";import{p as _e}from"./scene-framing-Cat0GtyJ.js";import{installNativeDebugBindings as ze,installNativeSystemsBindings as We,nativeDebugBindingFromEntryModule as qe,nativeSystemsBindingFromEntryModule as Ue}from"./native-debug-module-CWicoSGD.js";import{createAssetCache as Ne}from"./assets-BuSoGjBX.js";import{createGameLoop as Qe}from"./game-loop-CZvXlY00.js";import{registerThreeRoot as Je}from"./create-runtime-CVCc1BDx.js";import{createGame as Ke}from"./game-DHOZVb-7.js";import{C as me,a0 as ee,w as Xe,T as Ye}from"./three.module-D396a9Mn.js";import{w as Ze,l as ke}from"./live-gesture-lock-DJbrjOqf.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./r3f-root-factory-z9llD1OU.js";import"./register-render-vitals-BiZk29b2.js";import"./render-census-BrQX_CXv.js";import"./structural-signature-0w-i_ats.js";import"./render-vitals-BZ5HtvMi.js";import"./static-batch-advisor-B13QEH7d.js";import"./webgl-frame-capture-FlF9zQmW.js";import"./world-state-BWG-IcOd.js";import"./debug-registry-Dgvitx8M.js";import"./frame-selector-cache-cCeUbcjG.js";import"./dev-build-gDYrq68M.js";import"./game-input-seams-CIQdetRw.js";import"./seeded-random-i3mtgBKZ.js";import"./render-seed-DF4JHy7P.js";import"./frame-delta-D2nsw_Ht.js";import"./events-156d8d12.esm-ErOhDXXB.js";import"./index-bQE2NA0D.js";import"./canvas-entry-runtime-SfBxaR9M.js";import"./three-ingest-runtime-QzDYk6tU.js";import"./EffectComposer-DQxfsXBZ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-QYRpPuFJ.js";import"./CSS3DRenderer-CL7ABLVK.js";import"./native-entry-surface-BE8LJNdu.js";import"./playtest-BXIL1JEF.js";import"./game-contract-seams-a5YXejOu.js";import"./loader-CaF_I7Yt.js";import"./frame-pacing-D5acoOzO.js";import"./adapter-surface-Y37Nzcyw.js";import"./binding-Bmxqznjk.js";import"./setup-renderer-DVXaSGin.js";import"./index-BcCBqgM_.js";import"./defaults-DKiBJCPN.js";import"./render-settings-Bw4W9SYF.js";import"./render-features-CPQ_e568.js";import"./input-router-BNQvtIqw.js";import"./render-control-Df3yTiyr.js";import"./loop-gate-report-N52EWFGD.js";import"./system-slot-E2mEdiih.js";import"./user-data-BB2Of6Ht.js";import"./object-marks-DwvIEBOK.js";import"./sim-clock-CLflx7kg.js";import"./system-runner-DkOjxEBt.js";import"./performance-profiler-D_Jey87L.js";import"./input-manager-DH_hGW6d.js";import"./asset-parse-error-BHMwBRU3.js";import"./binding-identity-DcTpbvyg.js";import"./prompt-labels-DSMdM2_B.js";import"./schema-kl9-2B_J.js";import"./gameplay-rng-trap-CTNhm-UW.js";import"./state-bridge-DLP1jLRW.js";function et(t,e){const i=()=>{},a=new Set(["dispose","forceContextLoss","forceContextRestore","setAnimationLoop","setSize","setPixelRatio","setDrawingBufferSize"]),p=new Map,S={...e.shadowMap};let v=e.xr.enabled;const b=e.getClearColor(new me);let C=e.getClearAlpha(),M=null,V=0,G=0;const u=e.getViewport(new ee),h=e.getScissor(new ee);let P=e.getScissorTest(),y=!1,x=!1,F=!1;const O=(l,o,s,r,w)=>{typeof o=="number"?l.set(o,s,r,w):l.copy(o)},B=new Proxy(e.xr,{get(l,o){if(o==="enabled")return v;if(o==="setAnimationLoop"||o==="addEventListener"||o==="removeEventListener")return i;const s=Reflect.get(l,o,l);return typeof s=="function"?s.bind(l):s},set(l,o,s){return o==="enabled"?(v=s,!0):Reflect.set(l,o,s,l)}}),q=new Proxy(e.renderLists,{get(l,o){if(o==="dispose")return i;const s=Reflect.get(l,o,l);return typeof s=="function"?s.bind(l):s}});function _(l,o){const s=new Map,r={...e.shadowMap},w=e.xr.enabled,R=e.getClearColor(new me),I=e.getClearAlpha(),J=e.getRenderTarget(),K=e.getActiveCubeFace(),W=e.getActiveMipmapLevel(),U=e.getViewport(new ee),te=e.getScissor(new ee),X=e.getScissorTest();try{for(const[j,N]of p)s.set(j,Reflect.get(e,j)),Reflect.set(e,j,N);return Object.assign(e.shadowMap,S),e.xr.enabled=v,e.setClearColor(b,C),e.setViewport(u),e.setScissor(h),e.setScissorTest(P),e.setRenderTarget(M,V,G),y&&e.setViewport(u),x&&e.setScissor(h),F&&e.setScissorTest(P),l.apply(e,o)}finally{for(const[j,N]of s)Reflect.set(e,j,N);Object.assign(e.shadowMap,r),e.xr.enabled=w,e.setClearColor(R,I),e.setViewport(U),e.setScissor(te),e.setScissorTest(X),e.setRenderTarget(J,K,W)}}const z=new Map;return new Proxy(e,{get(l,o){if(o==="domElement")return t;if(o==="shadowMap")return S;if(o==="xr")return B;if(o==="renderLists")return q;if(a.has(o))return i;if(o==="getRenderTarget")return()=>M;if(o==="getActiveCubeFace")return()=>V;if(o==="getActiveMipmapLevel")return()=>G;if(o==="setRenderTarget")return(r,w=0,R=0)=>{M=r,V=w,G=R,y=x=F=!1};if(o==="getViewport")return r=>r.copy(u);if(o==="getCurrentViewport")return r=>M&&!y?r.copy(M.viewport):(r.copy(u).multiplyScalar(e.getPixelRatio()),y?r.round():r.floor());if(o==="getScissor")return r=>r.copy(h);if(o==="getScissorTest")return()=>P;if(o==="setViewport")return(r,w,R,I)=>{O(u,r,w,R,I),y=!0};if(o==="setScissor")return(r,w,R,I)=>{O(h,r,w,R,I),x=!0};if(o==="setScissorTest")return r=>{P=r,F=!0};if(o==="getClearColor")return r=>r.copy(b);if(o==="getClearAlpha")return()=>C;if(o==="setClearColor")return(r,w=C)=>{b.set(r),C=w};if(o==="setClearAlpha")return r=>{C=r};if(p.has(o))return p.get(o);const s=Reflect.get(l,o,l);if(typeof s!="function")return s;if(!z.has(o)){const r=/^(render|compile|clear|copy|init|readRenderTarget)/.test(String(o));z.set(o,r?(...w)=>{if(!((o==="render"||String(o).startsWith("clear"))&&!M))return _(s,w)}:s.bind(l))}return z.get(o)},set(l,o,s){return o!=="domElement"&&p.set(o,s),!0}})}class tt{pending=new WeakMap;remember(e,i){const a=[...i];a.length===0?this.pending.delete(e):this.pending.set(e,a)}take(e,i){const a=[...i],p=this.pending.get(e)??[];return this.pending.delete(e),a.length>0?a:p}}function he(t){return decodeURIComponent(t.split("?")[0]).replace(/^\/@fs\/(?=[A-Za-z]:\/)/,"").replace(/^\/@fs/,"")}class ot{sources=new Map;applied=new Map;expected=new Map;missingRevision=!1;source(e){this.sources.set(e.file,e)}complete(e){for(const[i,a]of this.sources){const p=e.filter(v=>a.timestamp===v.timestamp);(a.boundaries?a.boundaries.every(v=>p.some(b=>b.acceptedPath===v)):p.some(v=>he(v.acceptedPath)===i))&&(this.applied.set(a.path,a.sha),this.sources.delete(i))}}matches(e){const i=he(e.acceptedPath);return[...this.sources.values()].some(a=>a.timestamp===e.timestamp&&(a.boundaries?a.boundaries.includes(e.acceptedPath):a.file===i))}revision(e){for(const i of e)this.expected.set(i.path,i.sha),i.sha===null&&this.applied.delete(i.path)}needsRemount(){if(this.missingRevision)return!0;for(const[e,i]of this.expected)if(i===null||this.applied.get(e)!==i)return!0;return!1}missing(){this.missingRevision=!0}mounted(){this.expected.clear(),this.applied.clear(),this.sources.clear(),this.missingRevision=!1}}function st(t){return t instanceof Xe||t!==null&&typeof t=="object"&&t.isScene===!0}function nt(t){return t.find(e=>e.surface==="three")?.id??null}const ge=new tt;function rt(t,e,i){return new Error(`three root "${t}" failed to mount: ${e} did not export a RootAdapter or a default React component (exports: ${i.join(", ")||"(nothing)"}).`)}function it(t,e){const i=je(e);return $.error(`[r3f-design] world "${t}" failed to mount: ${i}`,"authoring"),De({worldId:t,kind:"three",identity:"default-three",message:i}),i}async function at(t,e,i,a){const p=await t.loadEntryModule(i,e,"three"),S=a===i?p:await t.loadEntryModule(a,e,"three");return{designModule:p,rootModule:S}}function ct(t,e,i,a,p,S){Je(t,e,i,{id:a}),ze(t,p?[p]:[]),We(t,S?[S]:[])}function lt(t){const e=document.createElement("canvas"),i=et(e,t),a=Ne(),p=Ke({loop:Qe({update:()=>{}}),assets:a});return p.input.setEnabled(!1),{game:p,host:{three:Ye,surface:{canvas:e,width:1280,height:720},renderer:i,assets:a,headless:!1,game:p},dispose:()=>p.dispose()}}function we(t){return{id:t.id,kind:t.surface,adapter:t.adapter,entryOrScenePath:t.entry??t.scene,zOrder:t.zOrder??0,pausable:t.pausable??!0}}function re(t){let e=!1,i=!1;const a=()=>{e||i||t.playState!=="stopped"||(i=!0,ye())},p=t.subscribe(a);return a(),()=>{e=!0,p()}}async function Po(t,e,i){const a=Be();if(!a)return()=>{};const p=await Me();if(t.playState!=="stopped")return re(t);const S=Ve(p);if(!S)return()=>{};const v=nt(Ae(S)),b=v?Ce(S,v):void 0;if(!b)return()=>{};const C=b.world?.entry??b.entry,M=b.world?.export;if(!C||!/\.(tsx|jsx)$/.test(C))return()=>{};const V=Ee(()=>import("./r3f-source-authoring-adapter-w6Bc60K-.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22])),G=Pe();let u=!1,h=!1,P=null,y=null,x=!1,F=null,O=!1,B=!1,q,_,z,l=null,o=null;const s=b.id,r=C,w=()=>{o||!l||u||h||t.playState!=="stopped"||(o=l.systemAdapters,pe(o))},R=()=>{o&&(o=null,pe(null))},I=async()=>{const n=await Oe(a.rootPath,He()),{designModule:d,rootModule:f}=await at(n,s,r,b.entry??r),c=qe(s,f),m=Ue(s,f,"three"),g=await Ge(d,s,{...M===void 0?{}:{namedExport:M},entryPath:r});if(!g)throw rt(s,r,Object.keys(d));return M!==void 0?{adapter:g,entryDebug:c,entrySystems:m}:{adapter:g,entryDebug:c,entrySystems:m,components:d.components??d.behaviors}},J=async(n,d,f)=>{const{host:c,game:m,dispose:g}=lt(i);let T;try{T=await n.mount(c)}catch(Z){throw g(),Z}if(T.kind!=="three"||!st(T.scene))throw T.dispose(),g(),new Error(`entry adapter for world "${s}" did not mount a three scene`);return ct(m,n,T,s,d,f),{root:T,game:m,disposeHost:g}},K=n=>{P=n.root,l=n.game,_?.();const d=n.game;_=d.subscribeSystemAdapters?.(()=>{if(l!==d)return;const f=d.systemAdapters;o&&(o=f,Le(f)),t.notifyIngestEdit()}),q=n.disposeHost},W=()=>{R(),_?.(),_=void 0,l=null;try{P?.dispose()}catch(n){$.error(`[r3f-design] dispose failed: ${n}`,"authoring")}P=null;try{q?.()}catch(n){$.error(`[r3f-design] design host dispose failed: ${n}`,"authoring")}q=void 0},U=()=>{if(!x)return;x=!1;const n=F;F=null,n?t.releaseAdoptedScene(n):t.exitPlayScene()},te=()=>{h=!0,U(),W(),e.replaceChild(s,new fe(t,we(b),"R3F design session suspended by play mode — Stop restores it.")),t.notifyIngestEdit()},X=n=>{const d=it(s,n);e.replaceChild(s,new fe(t,we(b),d)),t.notifyIngestEdit()},j=setTimeout(()=>{$.warn(`[r3f-design] world "${s}" is still importing after 20s (${r}). The in-browser compiler or a module download may be stalled on a slow connection — it keeps trying; reload the tab if nothing appears.`,"authoring")},2e4);try{const[n,{R3fSourceAuthoringAdapter:d},f]=await Promise.all([I(),V,G]);if(clearTimeout(j),!n)return $.warn(`[r3f-design] world "${s}" produced no design entry (${r}) — the scene stays empty. This is a bug worth reporting; reload the tab to retry.`,"authoring"),()=>{};if(u)return()=>{};if(t.playState!=="stopped")return re(t);const c=await J(n.adapter,n.entryDebug,n.entrySystems);if(K(c),u||t.playState!=="stopped")return W(),u?()=>{}:re(t);y=new d(t,c.root.scene,{worldId:s,entryPath:r,writeBackend:f,physics:()=>le(l?.systemAdapters.physics)}),e.replaceChild(s,y);const m=ge.take(t,t.selectedEntityIds);t.enterPlayScene(c.root.scene,c.root.rendererConfig),x=!0,F=c.root.scene,t.focusOnScene(()=>_e(null,c.root.scene));const g=m.filter(T=>e.hierarchy.node(T)!==null);g.length>0&&t.selectMultiple(g),de(s),w(),t.notifyIngestEdit(),$.log(`[r3f-design] world "${s}" mounted for design-time authoring (${r})`,"authoring")}catch(n){clearTimeout(j),X(n)}const N=(n,d,f,c,m)=>{const g=performance.now()-d;g<400||console.info(`[r3f-design] world "${n}" remounted in ${g.toFixed(0)}ms (import ${(f-d).toFixed(0)}ms, mount ${(c-f).toFixed(0)}ms, settle ${(m-c).toFixed(0)}ms, adopt ${(performance.now()-m).toFixed(0)}ms)`)},be=async()=>{if(u||h)return;const n=[...t.selectedEntityIds],d=H,f=t.projectHistory?.getSnapshot().busy===!0;let c="importing";const m=setTimeout(()=>{$.warn(`[r3f-design] world "${s}" remount is still ${c} after 20s (${r}) — it keeps trying; reload the tab if nothing appears.`,"authoring")},2e4),g=performance.now();let T=g,Z=g,ae=g;try{const D=await I();if(T=performance.now(),!D||u||h){console.info(`[r3f-design] world "${s}" remount abandoned after import (${D?u?"torn down":"suspended":"no entry"})`);return}c="mounting";const A=await J(D.adapter,D.entryDebug,D.entrySystems);Z=performance.now();for(let E=0;E<50&&(await Ze(),await Se(),!(!ke()&&t.projectHistory?.getSnapshot().busy!==!0));E+=1);if(ae=performance.now(),!u&&!h&&H!==d){A.root.dispose(),A.disposeHost(),L();return}if(u||h){console.info(`[r3f-design] world "${s}" remount abandoned after mount (${u?"torn down":"suspended"})`),A.root.dispose(),A.disposeHost();return}const k=new Set(t.selectedEntityIds);if(U(),W(),K(A),y)y.adoptScene(A.root.scene),e.childAdapters().find(ne=>ne.worldId===s)?.adapter!==y&&(e.replaceChild(s,y),$.log(`[r3f-design] world "${s}" recovered and remounted for design-time authoring (${r})`,"authoring"));else{const[{R3fSourceAuthoringAdapter:E},ne]=await Promise.all([V,G]);y=new E(t,A.root.scene,{worldId:s,entryPath:r,writeBackend:ne,physics:()=>le(l?.systemAdapters.physics)}),e.replaceChild(s,y),$.log(`[r3f-design] world "${s}" recovered and mounted for design-time authoring (${r})`,"authoring")}const $e=k.size>0&&(k.size!==n.length||n.some(E=>!k.has(E)));t.enterPlayScene(A.root.scene,A.root.rendererConfig),x=!0,F=A.root.scene;const ce=($e?[...k]:n).filter(E=>y?.hierarchy.node(E)!==null);ce.length>0&&t.selectMultiple(ce),de(s),w(),t.notifyIngestEdit(),N(s,g,T,Z,ae),Q.mounted(),clearTimeout(Y),B=!1}catch(D){X(D),!B&&!u&&!h?(B=!0,setTimeout(()=>{!u&&!h&&L()},400)):!u&&!h&&(H===d&&!f?ve(D):(B=!1,L()))}finally{clearTimeout(m),!u&&!h&&H!==d&&L()}},Se=async()=>{const n=t.projectHistory;if(!n)return;const d=Date.now()+1e4;for(;n.getSnapshot().busy&&Date.now()<d;)await new Promise(f=>{const c=setTimeout(f,250),m=n.subscribe(()=>{clearTimeout(c),m(),f()})})},ve=async n=>{const d=n instanceof Error?n.message:String(n);if(!d.includes("fiber crashed"))return;if(/Could not load |Failed to fetch|Unexpected token '<'|not valid JSON/.test(d)){$.error(`World "${s}" failed to load a project asset (${d}). The edit is kept; the world remounts once the asset can be served.`,"authoring");return}const f=t.projectHistory;if(!f)return;const c=f.getSnapshot(),m=c.canUndo?c.transactions[c.cursor-1]:void 0;if(!m||Date.now()-m.timestamp>15e3){console.info(`[r3f-design] world "${s}" crash auto-undo skipped (${m?"last edit too old":c.canUndo?"no entry":`cannot undo: busy=${c.busy} blocked=${c.blocked}`})`);return}if(!await f.undo().catch(()=>!1)){console.info(`[r3f-design] world "${s}" crash auto-undo refused by history`);return}B=!1,$.error(`Undid “${m.label}”: that edit crashed world "${s}" (${n instanceof Error?n.message:String(n)}). The previous source is restored.`,"authoring"),L()};let H=0;const Q=new ot;let Y;const L=()=>{if(u||h){console.info(`[r3f-design] world "${s}" remount skipped: ${u?"session torn down":"suspended for play"}`);return}O||(O=!0,setTimeout(()=>{O=!1,be()},80))},Re=xe(()=>{H+=1,L()});let oe=ue()?.revision??0;const Te=Fe(n=>{H+=1;const f=ue()?.revisions.filter(m=>m.revision>oe)??[];f.length!==n-oe&&Q.missing(),oe=n;const c=f.flatMap(m=>m.resources);Q.revision(c),!(c.length&&!Q.needsRemount())&&(clearTimeout(Y),Y=setTimeout(()=>{c.length&&!Q.needsRemount()||(H+=1,L())},2e3))});let ie=!1,se=!1;return z=t.subscribe(()=>{if(!u){if(t.playState==="stopped"?w():R(),!h&&!se&&t.playState!=="stopped"){se=!0,Ie(()=>{se=!1,!(u||h||t.playState==="stopped")&&te()});return}h&&!ie&&t.playState==="stopped"&&(ie=!0,ye())}}),()=>{u=!0,console.info(`[r3f-design] world "${s}" design session torn down`),R(),Re(),Te(),clearTimeout(Y),z?.(),!h&&t.playState==="stopped"&&t.selectedEntityIds.size>0&&ge.remember(t,t.selectedEntityIds),U(),W()}}export{at as loadR3FDesignEntryModules,Po as mountR3FDesignSession,ct as registerR3FDesignRoot,it as reportDesignMountFailure,rt as unresolvedDesignEntryError};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./index-GIL7oGEO.js";function n(t,i){return i!=="position"&&i!=="rotation"&&i!=="scale"?!1:t?.physicsBinding?!0:t?.r3fAuthoring?.bodyForwarded?.includes(i)===!0}function u(t,i){const o=t?.physicsBinding;if(!o||i!=="position"&&i!=="rotation"&&i!=="scale")return null;const s=`${t.file.split("/").pop()??t.file}:${o.line}`,r=`${i} is owned by ${o.hook} at ${s}`;return o.forwarded.includes(i)?`${r}, which reads this component's own ${i} prop — write it where the instance is placed, not on this element`:o.literal.includes(i)?`${r} — the body spawns from that hook's own argument, and a hook argument has no write anchor`:`${r} — this node is placed by the simulation, so a ${i} written here is overwritten on the next frame`}export{n as b,u as p};
|