@volter/game-editor 0.5.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BUNDLED_NOTICES +11228 -0
- package/LICENSE +686 -0
- package/LICENSE-BLENDER +1409 -0
- package/LICENSE-MCP +21 -0
- package/NOTICE +21 -0
- package/catalog/entries/audio.json +14 -0
- package/catalog/entries/bake.json +36 -0
- package/catalog/entries/blender.json +17 -0
- package/catalog/entries/react-root.json +24 -0
- package/catalog/entries/reflections.json +29 -0
- package/catalog/entries/static-batch.json +25 -0
- package/catalog/project-source/LICENSE +37 -0
- package/catalog/project-source/src/contributions/bake.kind.ts +40 -0
- package/catalog/project-source/src/contributions/builder-document.tsx +65 -0
- package/catalog/project-source/src/contributions/builder-state.ts +27 -0
- package/catalog/project-source/src/contributions/builder-ui.tsx +61 -0
- package/catalog/project-source/src/contributions/module-source.ts +502 -0
- package/catalog/project-source/src/contributions/pages.finder.ts +61 -0
- package/catalog/project-source/src/lib/audio/sfx.ts +255 -0
- package/catalog/project-source/src/lib/bake/asset-seed.ts +128 -0
- package/catalog/project-source/src/lib/bake/bake-schema.ts +65 -0
- package/catalog/project-source/src/lib/bake/clip-layering.ts +203 -0
- package/catalog/project-source/src/lib/bake/gltf-bake.ts +657 -0
- package/catalog/project-source/src/lib/bake/mesh-slice.ts +157 -0
- package/catalog/project-source/src/lib/bake/node-image.ts +463 -0
- package/catalog/project-source/src/lib/bake/object3d-bake.ts +121 -0
- package/catalog/project-source/src/lib/bake/object3d-lifecycle.ts +15 -0
- package/catalog/project-source/src/lib/bake/object3d-source.ts +8 -0
- package/catalog/project-source/src/lib/bake/params.ts +75 -0
- package/catalog/project-source/src/lib/bake/rest-relative-animation.ts +217 -0
- package/catalog/project-source/src/lib/bake/use-model.ts +95 -0
- package/catalog/project-source/src/lib/react-root/index.ts +20 -0
- package/catalog/project-source/src/lib/react-root/react-root-adapter.tsx +57 -0
- package/catalog/project-source/src/lib/reflections/ReflectionProbe.tsx +201 -0
- package/catalog/project-source/src/lib/reflections/index.ts +19 -0
- package/catalog/project-source/src/lib/reflections/probe-controller.ts +75 -0
- package/catalog/project-source/src/lib/reflections/reflection-probe-registry.ts +402 -0
- package/catalog/project-source/src/lib/reflections/volume-reflection-material.ts +416 -0
- package/catalog/project-source/src/lib/static-batch/Frozen.tsx +91 -0
- package/catalog/project-source/src/lib/static-batch/freeze.ts +579 -0
- package/catalog/project-source/src/lib/static-batch/index.ts +44 -0
- package/catalog/project-source/src/lib/static-batch/mutation-watch.ts +149 -0
- package/catalog/project-source/src/lib/static-batch/shadow-cache.ts +171 -0
- package/catalog/project-source/src/tools/bake-module.tool.ts +139 -0
- package/catalog/project-source/src/tools/bake-preview.tool.ts +475 -0
- package/dist/.vite/manifest.json +8304 -0
- package/dist/assets/AssetBudgetPanel-J9--TZPU.js +23 -0
- package/dist/assets/AudioViewer-CR7333fe.js +1 -0
- package/dist/assets/BVHLoader-6bQIXhMX.js +1 -0
- package/dist/assets/BufferGeometryUtils-Nz37EVXf.js +1 -0
- package/dist/assets/CCDIKSolver-CD7vLpsK.js +1 -0
- package/dist/assets/CSS3DRenderer-CL7ABLVK.js +1 -0
- package/dist/assets/CanvasSceneViewport-Bpi6gVTC.js +1 -0
- package/dist/assets/ColladaLoader-aVOPIsCh.js +3 -0
- package/dist/assets/ColorInput-DQBNrW-K.js +1 -0
- package/dist/assets/ConvexGeometry-CAzXlPVG.js +1 -0
- package/dist/assets/ConvexHull-BINCESFp.js +1 -0
- package/dist/assets/CopyShader-BzTUYzf6.js +24 -0
- package/dist/assets/DecalGeometry-160KRdfg.js +1 -0
- package/dist/assets/EXRLoader-Cdans_oJ.js +1 -0
- package/dist/assets/EffectComposer-DQxfsXBZ.js +1 -0
- package/dist/assets/EntityModelDocument-Ccvw66N9.js +1 -0
- package/dist/assets/EnvironmentAssetDocument-Dg-Qq6O6.js +1 -0
- package/dist/assets/FBXLoader-B4MoUtAn.js +1 -0
- package/dist/assets/Fbo-Dz-Soul3.js +1 -0
- package/dist/assets/FontLoader-CvGoVI5a.js +2 -0
- package/dist/assets/GLTFExporter-HgrCle4L.js +1 -0
- package/dist/assets/GameplaySessionTimeline-B52W3FVZ.js +1 -0
- package/dist/assets/Gltf-UHVWKz65.js +2 -0
- package/dist/assets/HDRLoader-THU88oVD.js +5 -0
- package/dist/assets/ImageViewer-Tn7s_MnW.js +1 -0
- package/dist/assets/InspectorCanvasPreview-CEr_Kxna.js +1 -0
- package/dist/assets/InspectorObjectPreview-CVejvLRg.js +1 -0
- package/dist/assets/JsonAssetDocument-C7VGcLhu.js +3 -0
- package/dist/assets/LineSegments2-CsOpKSiM.js +370 -0
- package/dist/assets/MTLLoader-_Xzd4_0p.js +2 -0
- package/dist/assets/MarchingCubes-Bsp4wrzd.js +1 -0
- package/dist/assets/MeshBVH-BiDHDcu-.js +1 -0
- package/dist/assets/ModelAssetDocument-F5GACirk.js +1 -0
- package/dist/assets/NonThreeAuthoringBootstrap-C3woOMxX.js +1 -0
- package/dist/assets/OBJLoader-BhIC6Hwo.js +5 -0
- package/dist/assets/Object3DDocumentViewport-DB7T0NTl.js +2 -0
- package/dist/assets/Object3DPreview-DL8oi7Xs.js +2 -0
- package/dist/assets/OnlineAssetDetail-C6z9RvYK.js +2 -0
- package/dist/assets/OrbitControls-CM3bPray.js +1 -0
- package/dist/assets/OrbitControls-DLpayAaK.js +1 -0
- package/dist/assets/OrthographicCamera-bQozawrh.js +1 -0
- package/dist/assets/PLYLoader-DYQqs5Ik.js +2 -0
- package/dist/assets/PerspectiveCamera-CQ2lh01o.js +1 -0
- package/dist/assets/PlayBar-BR-Vg3Jb.js +2 -0
- package/dist/assets/RGBELoader-BgBcQv8j.js +1 -0
- package/dist/assets/RectAreaLightUniformsLib-CMMoWfll.js +1 -0
- package/dist/assets/RenderPass-DPrn-Uky.js +1 -0
- package/dist/assets/ResolutionPicker-C67vs1F3.js +1 -0
- package/dist/assets/RootSelectionOverlay-BZPlxmXU.js +1 -0
- package/dist/assets/RoundedBox-BDGBg6QZ.js +1 -0
- package/dist/assets/RoundedBoxGeometry-CyUuYPfW.js +1 -0
- package/dist/assets/STLLoader-Dyv3lsxY.js +1 -0
- package/dist/assets/SelectionBox-D_75KrNW.js +1 -0
- package/dist/assets/ShaderPass-QYRpPuFJ.js +1 -0
- package/dist/assets/ShadowEditor-DkImwu1Y.js +1 -0
- package/dist/assets/SimplifyModifier-C8ayvRzd.js +1 -0
- package/dist/assets/SkeletonUtils-Cps8GOC6.js +1 -0
- package/dist/assets/Sky-CQKCgYDs.js +154 -0
- package/dist/assets/SourceAssetViewer-2SWQoUut.js +12 -0
- package/dist/assets/StageHost-BN-IoTef.js +2 -0
- package/dist/assets/StoryPreviewMount-DjyxRCXu.js +1 -0
- package/dist/assets/TDSLoader-D_T8XJ81.js +1 -0
- package/dist/assets/TextGeometry-DOWAEUV0.js +1 -0
- package/dist/assets/ThreeBoardDocument-CVncZyIq.js +2 -0
- package/dist/assets/ThreeIsolationSceneContent-C8C8whSF.js +1 -0
- package/dist/assets/ToolObject3DPreview-BRoDWe4Q.js +1 -0
- package/dist/assets/TrackballControls-DfznuQTh.js +1 -0
- package/dist/assets/TransientHint-BB1fwrvK.js +1 -0
- package/dist/assets/UnrealBloomPass-CR-cS_K5.js +83 -0
- package/dist/assets/VideoViewer-C6kocgIU.js +1 -0
- package/dist/assets/_commonjsHelpers-D6-XlEtG.js +1 -0
- package/dist/assets/active-ingest-CT6jSGhr.js +3 -0
- package/dist/assets/adapter-surface-Y37Nzcyw.js +1 -0
- package/dist/assets/after-paint-CB4bz1-e.js +1 -0
- package/dist/assets/agx-base-srgb-BjWZJgrZ.lut +0 -0
- package/dist/assets/agx-look-medium-high-contrast-D5F_ob1L.lut +0 -0
- package/dist/assets/agx-look-punchy-dxsnycNs.lut +0 -0
- package/dist/assets/animation-clock-CnjZqfJp.js +1 -0
- package/dist/assets/asset-budget-asset.menu-Di3KiQCd.js +1 -0
- package/dist/assets/asset-budget.action-DCzzcuTh.js +1 -0
- package/dist/assets/asset-budget.document-BWU8wnVW.js +1 -0
- package/dist/assets/asset-budget.menu-BGZpT_31.js +1 -0
- package/dist/assets/asset-editor-persistence-BBaONOJt.js +1 -0
- package/dist/assets/asset-loaders-BOy5Ss8k.js +2 -0
- package/dist/assets/asset-parse-error-BHMwBRU3.js +3 -0
- package/dist/assets/assets-BuSoGjBX.js +1 -0
- package/dist/assets/audio-meter-CyiToeUW.js +1 -0
- package/dist/assets/audio-unlock.service-CfUgUQVy.js +1 -0
- package/dist/assets/audio.utility-C6K6jem8.js +1 -0
- package/dist/assets/authoring-CgcOFhGS.js +1 -0
- package/dist/assets/autoplay.service-BZBGNSvt.js +1 -0
- package/dist/assets/axe-LkjAB6Lv.js +30 -0
- package/dist/assets/babylon-authoring-adapter-CL02gWDn.js +1 -0
- package/dist/assets/binding-Bmxqznjk.js +1 -0
- package/dist/assets/binding-identity-DcTpbvyg.js +1 -0
- package/dist/assets/binding-resolver-Dsh-6Vor.js +2 -0
- package/dist/assets/blender-emscripten-engine-9ZIRYNhe.js +2 -0
- package/dist/assets/blender-node-editor.document-iIDkB9sI.js +1 -0
- package/dist/assets/blender-properties-tab-C5CyPydi.js +3 -0
- package/dist/assets/blender-runtime-host-BpBwGv7r.js +4 -0
- package/dist/assets/blender-runtime-skin-DyQ9B6CR.js +7140 -0
- package/dist/assets/blender-runtime.document-lIYhhPtv.js +8 -0
- package/dist/assets/blender-timeline.document-77fx96N7.js +1 -0
- package/dist/assets/blender-uv-editor.document-fsT7B4gV.js +1 -0
- package/dist/assets/blender-version.status-o6dBm3n6.js +1 -0
- package/dist/assets/blender-wali-engine-wTOcrOMC.js +2 -0
- package/dist/assets/blender.command-BtJeWk-A.js +1 -0
- package/dist/assets/blender.keymap-GAQgeklK.js +1 -0
- package/dist/assets/blender.status-ujwGU6dU.js +1 -0
- package/dist/assets/blender.style-Dcem5f_T.js +1 -0
- package/dist/assets/board-guides-DziKSTss.js +1 -0
- package/dist/assets/body-marks-h_xDxiDE.js +1 -0
- package/dist/assets/bridge.command-o5gDNEwa.js +3 -0
- package/dist/assets/browserAll-DeWblVez.js +1 -0
- package/dist/assets/build-profiles.document-kW8iw8Xj.js +2 -0
- package/dist/assets/build-progress.status-BNRLytg2.js +1 -0
- package/dist/assets/build-session-C_sg3CEn.js +9 -0
- package/dist/assets/build.action-lYjTLb7K.js +1 -0
- package/dist/assets/build.command-DIGgUPU_.js +1 -0
- package/dist/assets/build.header-CKajx5U3.js +1 -0
- package/dist/assets/build.menu-BdU0QXny.js +1 -0
- package/dist/assets/build.service-CbBAyeu3.js +1 -0
- package/dist/assets/bus-mixer-CGfWDP3C.js +1 -0
- package/dist/assets/camera-KEsKvOL7.js +1 -0
- package/dist/assets/camera-runtime.inspector-B7unX4g1.js +1 -0
- package/dist/assets/canvas-entry-runtime-SfBxaR9M.js +2 -0
- package/dist/assets/capability-coverage-Czas4C18.js +7 -0
- package/dist/assets/chrome-trace-YZHMz60-.js +1 -0
- package/dist/assets/client-DNXj_opT.js +25 -0
- package/dist/assets/clip-planes-CnAI6DZn.js +1 -0
- package/dist/assets/collaboration-presence-DLoZ7EA3.js +1 -0
- package/dist/assets/collider-Bw0mXlsW.js +1 -0
- package/dist/assets/collider-dimensions-9xoFADXN.js +1 -0
- package/dist/assets/collision-system-DpNUJRJ3.js +1 -0
- package/dist/assets/command-results-CUQD49AB.js +1 -0
- package/dist/assets/component-board-registry-DrIa2csL.js +1 -0
- package/dist/assets/component-board.service-DCwcUssB.js +2 -0
- package/dist/assets/component-board.service-DidCyM4O.js +2 -0
- package/dist/assets/component-verbs.command-7xzfjGMZ.js +1 -0
- package/dist/assets/component-verbs.service-Bv9jId3q.js +1 -0
- package/dist/assets/config-CEZk921y.js +6 -0
- package/dist/assets/configurations-DTBMdaTL.js +1 -0
- package/dist/assets/connection.status-BifnQdOs.js +1 -0
- package/dist/assets/console-bridge-CHcb-xk5.js +1 -0
- package/dist/assets/constraint-De8f1Uiq.js +1 -0
- package/dist/assets/constraints.inspector-B9U9Yj-u.js +1 -0
- package/dist/assets/countdown-timer-CUm74dom.js +1 -0
- package/dist/assets/coverage.service-VTX5Mcsx.js +3 -0
- package/dist/assets/crash-null-boundary-v3a0uEgw.js +1 -0
- package/dist/assets/create-runtime-CVCc1BDx.js +1 -0
- package/dist/assets/curve-7Q79VgU4.js +1 -0
- package/dist/assets/data-asset-4hjS642k.js +5 -0
- package/dist/assets/data-check-core-CQEjuFyt.js +1 -0
- package/dist/assets/data-ref-CQI28C0D.js +1 -0
- package/dist/assets/debug-bridge-CCohG-d-.js +1 -0
- package/dist/assets/debug-registry-Dgvitx8M.js +1 -0
- package/dist/assets/defaults-DKiBJCPN.js +1 -0
- package/dist/assets/deferred-commands-CEMmvL47.js +1 -0
- package/dist/assets/deferred-ingest-play-DCJi_Pgu.js +2 -0
- package/dist/assets/design-time-layers-wYgOTgni.js +1 -0
- package/dist/assets/design-time-mount-registry-DUpXCg1U.js +1 -0
- package/dist/assets/design-time-mount.service-BzY21e1F.js +2 -0
- package/dist/assets/design-time-react-mount-DM9WLrF2.js +1 -0
- package/dist/assets/dev-build-gDYrq68M.js +1 -0
- package/dist/assets/directional-shadow-fit-BVkOKAv2.js +1 -0
- package/dist/assets/document-preview-three-Kbg2GCLm.js +1 -0
- package/dist/assets/dom-authoring-adapter-CY8C7f4T.js +1 -0
- package/dist/assets/draco3d-BBUTcNkz.js +1 -0
- package/dist/assets/draco_decoder-DsQ12WqX.wasm +0 -0
- package/dist/assets/draco_encoder-2Tcju8Ns.wasm +0 -0
- package/dist/assets/edit-mode-audio.service-Bzetwd5B.js +1 -0
- package/dist/assets/edit-mode-authoring-B47TfLqu.js +1 -0
- package/dist/assets/edit-mode-networking.service-YCX6RRb_.js +1 -0
- package/dist/assets/editor-api-BoJIcyZG.js +1 -0
- package/dist/assets/editor-port-C_FeBdeV.js +1 -0
- package/dist/assets/editor-presentation-activity-C7SNSmTd.js +1 -0
- package/dist/assets/entry-adjudication-Cq8Yeb74.js +1 -0
- package/dist/assets/environment-capture-7himRh2L.js +1 -0
- package/dist/assets/esbuild-BHljloGq.wasm +0 -0
- package/dist/assets/events-156d8d12.esm-ErOhDXXB.js +36 -0
- package/dist/assets/extend-B-eOccUm.js +36 -0
- package/dist/assets/extends-CF3RwP-h.js +1 -0
- package/dist/assets/eyedropper-session-bjPXnfeX.js +1 -0
- package/dist/assets/fflate.module-DPuTF8aG.js +6 -0
- package/dist/assets/filmic-srgb-Ct35FIH6.lut +0 -0
- package/dist/assets/first-party-audio-system-DxnGJOER.js +1 -0
- package/dist/assets/first-party-navigation-system-CL5Bquub.js +1 -0
- package/dist/assets/fork-menu-BoVyw2Wu.js +1 -0
- package/dist/assets/frame-debugger-store-D1Mf_5up.js +1 -0
- package/dist/assets/frame-delta-D2nsw_Ht.js +1 -0
- package/dist/assets/frame-pacing-D5acoOzO.js +1 -0
- package/dist/assets/frame-selector-cache-cCeUbcjG.js +1 -0
- package/dist/assets/game-DHOZVb-7.js +1 -0
- package/dist/assets/game-contract-seams-a5YXejOu.js +1 -0
- package/dist/assets/game-css-scope-transform-Eng4wS8E.js +33 -0
- package/dist/assets/game-document.service-DbRfx2V0.js +1 -0
- package/dist/assets/game-eval.command-D-7Dxbj_.js +2 -0
- package/dist/assets/game-input-seams-CIQdetRw.js +1 -0
- package/dist/assets/game-loop-CZvXlY00.js +1 -0
- package/dist/assets/game-module-access-B2mFxv-i.js +1 -0
- package/dist/assets/game.layout-CBASrvQu.js +1 -0
- package/dist/assets/gameplay-export-BoKXm51x.js +1 -0
- package/dist/assets/gameplay-replay-e5umMlXv.js +1 -0
- package/dist/assets/gameplay-rng-trap-CTNhm-UW.js +3 -0
- package/dist/assets/gameplay.command-DxcVYX6F.js +1 -0
- package/dist/assets/generation-DhwCUHPf.css +1 -0
- package/dist/assets/generation-jobs-BQrXbGp_.js +1 -0
- package/dist/assets/generation.service-CDIgObuw.js +1 -0
- package/dist/assets/generations-DzUogZsM.js +1 -0
- package/dist/assets/generations.status-CgOUBCum.js +1 -0
- package/dist/assets/hierarchy-marks-BLPfSIym.js +1 -0
- package/dist/assets/host-pointer-DbGSCjE9.js +1 -0
- package/dist/assets/hosted-asset-materialization-CiIvWkGU.js +2 -0
- package/dist/assets/ibl-override-material-BlmCxFKq.js +6 -0
- package/dist/assets/index-96FBF1Oj.js +1 -0
- package/dist/assets/index-BAWkB0dv.js +1 -0
- package/dist/assets/index-BDnS2b6S.js +1 -0
- package/dist/assets/index-BHp07vN0.js +2 -0
- package/dist/assets/index-BMxv2MNV.js +1 -0
- package/dist/assets/index-BP6wv2A0.js +5 -0
- package/dist/assets/index-BcCBqgM_.js +952 -0
- package/dist/assets/index-Bge9JUr6.js +1 -0
- package/dist/assets/index-BjTCPEQ7.js +134 -0
- package/dist/assets/index-BncK9THk.js +1 -0
- package/dist/assets/index-CJbYy-CF.js +3 -0
- package/dist/assets/index-CVCb_ImQ.js +1 -0
- package/dist/assets/index-CZd9o7Lu.js +1 -0
- package/dist/assets/index-CanA16PU.js +2 -0
- package/dist/assets/index-CinJrH5C.js +9 -0
- package/dist/assets/index-CtzuWnCS.js +1 -0
- package/dist/assets/index-D2fNXpHa.css +1 -0
- package/dist/assets/index-DUpHH6JR.js +3120 -0
- package/dist/assets/index-DUqP1RMl.js +1 -0
- package/dist/assets/index-D_NuPfjr.js +9 -0
- package/dist/assets/index-Da9JhEvW.js +25 -0
- package/dist/assets/index-DgapqSPi.js +7 -0
- package/dist/assets/index-FUuS4qwW.js +562 -0
- package/dist/assets/index-GIL7oGEO.js +4894 -0
- package/dist/assets/index-IEjydI9d.js +1 -0
- package/dist/assets/index-OrYXPk3Z.js +487 -0
- package/dist/assets/index-V1R-e5Bd.js +1 -0
- package/dist/assets/index-bQE2NA0D.js +1 -0
- package/dist/assets/index-gHZae-lw.js +13 -0
- package/dist/assets/index-mjWQmGhM.js +1 -0
- package/dist/assets/index-nmcBqr7Y.js +1 -0
- package/dist/assets/inference-diagnostics-Dhmtfbq_.js +1 -0
- package/dist/assets/ingest-BbYMC2vQ.js +1 -0
- package/dist/assets/ingest-boot-viewport-D5rI_Kk_.js +1 -0
- package/dist/assets/ingest-siblings-Bop2kqVl.js +1 -0
- package/dist/assets/ingest-source-persistence-C_6Hiyra.js +1 -0
- package/dist/assets/ingest.service-BTDnQfM1.js +1 -0
- package/dist/assets/input-manager-DH_hGW6d.js +1 -0
- package/dist/assets/input-router-BNQvtIqw.js +1 -0
- package/dist/assets/inspect-BZfi3mmo.js +1 -0
- package/dist/assets/inspection-CObLhnrs.js +1 -0
- package/dist/assets/instance-fork-actions-D3sRzS3K.js +1 -0
- package/dist/assets/instances.command-D6UkZNO8.js +1 -0
- package/dist/assets/instruments-CKR02Y8I.js +1 -0
- package/dist/assets/json-history-resource-BbxllWfV.js +1 -0
- package/dist/assets/jsx-runtime-DPjLkJKQ.js +9 -0
- package/dist/assets/light-D-_wsKTq.js +1 -0
- package/dist/assets/light-camera-factory-CWbbe9gI.js +1 -0
- package/dist/assets/lil-gui.module.min-BF55BEwA.js +10 -0
- package/dist/assets/live-behaviors-Bxq49Maz.js +1 -0
- package/dist/assets/live-gesture-lock-DJbrjOqf.js +1 -0
- package/dist/assets/loader-CaF_I7Yt.js +1 -0
- package/dist/assets/logger-Dqis-7W1.js +1 -0
- package/dist/assets/loop-gate-report-N52EWFGD.js +1 -0
- package/dist/assets/matcap-texture-CVfalpWT.js +1 -0
- package/dist/assets/material-CpAdjDxn.js +1 -0
- package/dist/assets/material-factory-Bz6h__6g.js +1 -0
- package/dist/assets/mesh-B3WPtNKO.js +1 -0
- package/dist/assets/mesh-shadow-CZnXrw_l.js +1 -0
- package/dist/assets/mikktspace.module-DO88SLib.js +1 -0
- package/dist/assets/model-asset-sections-CFvvihfx.css +1 -0
- package/dist/assets/model-asset-sections.service-CHhFS3ZX.js +1 -0
- package/dist/assets/model.layout-BJUEQYUI.js +1 -0
- package/dist/assets/models.finder-G2jQgIRu.js +1 -0
- package/dist/assets/module-mode-DVBLT9d-.js +2 -0
- package/dist/assets/mount-canvas-ingest-root-DDuAWf_C.js +2 -0
- package/dist/assets/mount-dom-ingest-root-D_EiBgpn.js +2 -0
- package/dist/assets/mount-game-6t9cKNo4.js +1 -0
- package/dist/assets/mount-ingest-root-glv2SSWf.js +2 -0
- package/dist/assets/mount-manifest-CGVxhmAw.js +1 -0
- package/dist/assets/mount-readiness-Ds0HvvLH.js +4 -0
- package/dist/assets/mount-three-ingest-root-hrUt9VVU.js +1 -0
- package/dist/assets/mounted-authoring-Dmg5xmhP.js +1 -0
- package/dist/assets/mounted-story-viewport-source-DjP6RA9U.js +1 -0
- package/dist/assets/native-debug-module-CWicoSGD.js +1 -0
- package/dist/assets/native-entry-surface-BE8LJNdu.js +1 -0
- package/dist/assets/navigation-CIiCx-SM.js +1 -0
- package/dist/assets/navmesh-workflow-store-Cmnm57TB.js +1 -0
- package/dist/assets/navmesh.menu-CAKiH8PW.js +1 -0
- package/dist/assets/navmesh.service-jgDWlgj1.js +1 -0
- package/dist/assets/network.utility-CEu5nHf7.js +1 -0
- package/dist/assets/object-marks-DwvIEBOK.js +1 -0
- package/dist/assets/object3d-authoring-subject-CH5sI2oP.js +1 -0
- package/dist/assets/output-DK8waum9.js +195 -0
- package/dist/assets/particles-Y626p22p.js +1 -0
- package/dist/assets/particles-factory-DnLOHXT8.js +1 -0
- package/dist/assets/pasteboard-materialize-BqSS4QzV.js +20 -0
- package/dist/assets/pasteboard.action-DU3UHtJG.js +2 -0
- package/dist/assets/performance-profiler-D_Jey87L.js +1 -0
- package/dist/assets/physics-registry-B2Jkp8e6.js +1 -0
- package/dist/assets/physics-registry-CUB9cT9p.js +1 -0
- package/dist/assets/pixi-authoring-adapter-CjibysC3.js +1 -0
- package/dist/assets/pixi-live-write-target-DuWydlWb.js +1 -0
- package/dist/assets/pixi-primitive-DlWbUPN9.js +1 -0
- package/dist/assets/pixi-react-root-factory-DYsznYRQ.js +1 -0
- package/dist/assets/pixi-story-model-DNkfnWUV.js +1 -0
- package/dist/assets/pixi-transform-channels-VjdohT11.js +1 -0
- package/dist/assets/play-mode-BFU2PCkG.js +22 -0
- package/dist/assets/play.command-BpqqLqkq.js +2 -0
- package/dist/assets/playtest-BXIL1JEF.js +1 -0
- package/dist/assets/pose-guard-6Osb2cFu.js +1 -0
- package/dist/assets/presentation-BPP5pXeQ.js +1 -0
- package/dist/assets/product-DFhyARJj.js +1 -0
- package/dist/assets/profiler.action-CaXJDp3t.js +1 -0
- package/dist/assets/profiler.menu-BIMF6Bi4.js +1 -0
- package/dist/assets/profiler.utility-BExw9wBO.js +1 -0
- package/dist/assets/project-authoring-session-Bnt6icLr.js +2 -0
- package/dist/assets/project-provenance-BoP3nrle.js +1 -0
- package/dist/assets/prompt-labels-DSMdM2_B.js +1 -0
- package/dist/assets/properties-bone-constraints.inspector-ByT6p7S-.js +1 -0
- package/dist/assets/properties-bone.inspector-z4qJwKO5.js +1 -0
- package/dist/assets/properties-collection.inspector-D0_3ijWU.js +1 -0
- package/dist/assets/properties-constraints.inspector-CESzjuls.js +1 -0
- package/dist/assets/properties-data.inspector-hG8Wgyzb.js +1 -0
- package/dist/assets/properties-material.inspector-CzY0JCQ6.js +1 -0
- package/dist/assets/properties-modifiers.inspector-3dDhwf7g.js +1 -0
- package/dist/assets/properties-object.inspector-CiarfxkT.js +1 -0
- package/dist/assets/properties-output.inspector-DKJxmKSD.js +1 -0
- package/dist/assets/properties-particles.inspector-CCEdYWGm.js +1 -0
- package/dist/assets/properties-physics.inspector-B2c0KUyA.js +1 -0
- package/dist/assets/properties-render.inspector-Bcm0HLRW.js +1 -0
- package/dist/assets/properties-scene.inspector-PIM_eTb_.js +1 -0
- package/dist/assets/properties-texture.inspector-CgFlnyr8.js +1 -0
- package/dist/assets/properties-view-layer.inspector-DGjF_Aqo.js +1 -0
- package/dist/assets/properties-world.inspector-CrMvaRvB.js +1 -0
- package/dist/assets/r3f-design-session-D-4yyDO9.js +2 -0
- package/dist/assets/r3f-physics-binding-BBo8oma9.js +1 -0
- package/dist/assets/r3f-root-factory-z9llD1OU.js +1 -0
- package/dist/assets/r3f-source-authoring-adapter-w6Bc60K-.js +13 -0
- package/dist/assets/rapier-physics-adapter-CaZqWLu0.js +1 -0
- package/dist/assets/rapier-physics-bridge-CMoeVo3Y.js +1 -0
- package/dist/assets/react-18-By2b4xR9.js +1 -0
- package/dist/assets/react-inspector.service-B_neRnSK.js +1 -0
- package/dist/assets/react-root-CEz5NTck.js +1 -0
- package/dist/assets/react-story-board-BDDwiE2H.js +1 -0
- package/dist/assets/react-three-fiber.esm-CycrbDlA.js +1 -0
- package/dist/assets/react-three-rapier.esm-CEfKpvxT.js +1 -0
- package/dist/assets/react-world-authoring-adapter-DmrwM3py.js +1 -0
- package/dist/assets/realm-services-CobQsq_X.js +1 -0
- package/dist/assets/rebind-controller-Dtq19Vb3.js +1 -0
- package/dist/assets/recast-navigation.wasm-compat-Dsoa_MD-.js +1 -0
- package/dist/assets/reflection-probe-Don-M3Fj.js +1 -0
- package/dist/assets/reflection-probe-capture.inspector-CmFUoJCx.js +1 -0
- package/dist/assets/register-render-vitals-BiZk29b2.js +1 -0
- package/dist/assets/registry-02YZjMNp.js +1 -0
- package/dist/assets/relative-path-guard-GiM7Lsz8.js +1 -0
- package/dist/assets/render-audio-control-vMRlePWb.js +1 -0
- package/dist/assets/render-batch-system-0vq7p0VC.js +1 -0
- package/dist/assets/render-census-BrQX_CXv.js +1 -0
- package/dist/assets/render-control-Df3yTiyr.js +1 -0
- package/dist/assets/render-env-D2IV2x5k.js +1 -0
- package/dist/assets/render-features-CPQ_e568.js +1 -0
- package/dist/assets/render-seed-DF4JHy7P.js +1 -0
- package/dist/assets/render-settings-Bw4W9SYF.js +1 -0
- package/dist/assets/render-vitals-BZ5HtvMi.js +1 -0
- package/dist/assets/renderer-config-BqG4O8i9.js +1 -0
- package/dist/assets/resolve-three-SZE_WWUM.js +702 -0
- package/dist/assets/root-seam-contract-Z0VWX3Bk.js +1 -0
- package/dist/assets/rrweb-Cd2ifIRP.js +142 -0
- package/dist/assets/run-ticks-settled-C4ksViyA.js +1 -0
- package/dist/assets/runtime-inspection-l2iFQSsg.js +1 -0
- package/dist/assets/scene-capture-BQKzU0NT.js +1 -0
- package/dist/assets/scene-capture-CGYF-Viw.js +1 -0
- package/dist/assets/scene-document.service-qkDjUrlP.js +2 -0
- package/dist/assets/scene-framing-Cat0GtyJ.js +1 -0
- package/dist/assets/scene-index-B6BZOHMk.js +1 -0
- package/dist/assets/scene-query-C7_N-TpI.js +1 -0
- package/dist/assets/schema-kl9-2B_J.js +1 -0
- package/dist/assets/sculpt.layout-zJF55yCR.js +1 -0
- package/dist/assets/seeded-random-i3mtgBKZ.js +1 -0
- package/dist/assets/session-CZ5JPg-z.js +4877 -0
- package/dist/assets/setup-audio-S8GQF91f.js +1 -0
- package/dist/assets/setup-particles-GCXlnkj_.js +1 -0
- package/dist/assets/setup-physics-BeZ7-LKD.js +1 -0
- package/dist/assets/setup-renderer-DVXaSGin.js +1587 -0
- package/dist/assets/shading.layout-DULYZV6M.js +1 -0
- package/dist/assets/sim-clock-CLflx7kg.js +1 -0
- package/dist/assets/sky-precompute-worker-ChN7J87v.js +1 -0
- package/dist/assets/soft-particle-depth-DGvfQDi1.js +1 -0
- package/dist/assets/source-object3d-authoring-adapter-B-L6Ha6f.js +1 -0
- package/dist/assets/source-persistence-backend-C-aR-B_Y.js +1 -0
- package/dist/assets/spark-renderer-lifecycle-ynWESJcv.js +1 -0
- package/dist/assets/spark.module-4pXQoz5d.js +12120 -0
- package/dist/assets/stage-invalidation-DBg3C3Ta.js +1 -0
- package/dist/assets/stage-keyboard-n-5kKH-m.js +1 -0
- package/dist/assets/stage-overlay-set-B9zp2sLB.js +1 -0
- package/dist/assets/stage-presence-markers-DiGI6A45.js +1 -0
- package/dist/assets/standard-viewport-dressing-CzjAe_0A.js +7 -0
- package/dist/assets/state-bridge-DLP1jLRW.js +1 -0
- package/dist/assets/state-watch.action-BOvQR2qt.js +1 -0
- package/dist/assets/state-watch.menu-CNLvDeeY.js +1 -0
- package/dist/assets/state-watch.utility-Bg1tTTQU.js +1 -0
- package/dist/assets/static-batch-advisor-B13QEH7d.js +1 -0
- package/dist/assets/stats.module-BL02l9NC.js +1 -0
- package/dist/assets/story-arg-descriptors-Ek86ExX7.js +1 -0
- package/dist/assets/story-capture-_gC8dXV-.js +1 -0
- package/dist/assets/story-documents--TDLaPeL.js +3 -0
- package/dist/assets/story-documents.service-BiS_YbNQ.js +1 -0
- package/dist/assets/story-documents.service-CxOPYJ2j.js +1 -0
- package/dist/assets/story-media-presence-BHzk2IV5.js +1 -0
- package/dist/assets/story-mount-turn-DFRTj5hi.js +1 -0
- package/dist/assets/story-pixi-preview-BUrOJZXS.js +1 -0
- package/dist/assets/story-presentation-j2AVN-mK.js +1 -0
- package/dist/assets/story-three-preview-BHEDZzcl.js +2 -0
- package/dist/assets/structural-ids-Dc-7rEwi.js +1 -0
- package/dist/assets/structural-signature-0w-i_ats.js +1 -0
- package/dist/assets/surface-content-Dg9Kkazf.js +1 -0
- package/dist/assets/surface-state-DaxyruCj.js +3 -0
- package/dist/assets/system-adapters-rIC8FSGP.js +1 -0
- package/dist/assets/system-runner-DkOjxEBt.js +1 -0
- package/dist/assets/system-slot-E2mEdiih.js +1 -0
- package/dist/assets/team-playtest.service-DqOinFVA.js +1 -0
- package/dist/assets/texture.layout-DASpHVht.js +1 -0
- package/dist/assets/three-CDSueJyJ.js +1 -0
- package/dist/assets/three-authoring-adapter-CmSQ3Vui.js +1 -0
- package/dist/assets/three-authoring.service-iuHLwtf1.js +2 -0
- package/dist/assets/three-ingest-runtime-QzDYk6tU.js +1 -0
- package/dist/assets/three-projection-core-BmKMZ-nf.js +1 -0
- package/dist/assets/three-viewport-presentation-QBQpSdMh.js +1 -0
- package/dist/assets/three.module-D396a9Mn.js +3840 -0
- package/dist/assets/three.quarks.esm-B1C61jGo.js +1039 -0
- package/dist/assets/tools-B_NJsk05.js +1 -0
- package/dist/assets/transform-writer-BhBBTx33.js +1 -0
- package/dist/assets/transport.header-B-6HQlU2.js +1 -0
- package/dist/assets/trigger-volume-BNK2XzPL.js +1 -0
- package/dist/assets/tuples-CIQ4Bn1U.js +1 -0
- package/dist/assets/tween.module-DciWpAG6.js +1 -0
- package/dist/assets/ui-board-document-Bwtt--xp.js +2 -0
- package/dist/assets/unexported-game-trap-Dm1JYKHy.js +2 -0
- package/dist/assets/unmanaged-root-detector-B8CpbkSN.js +2 -0
- package/dist/assets/upstream-pin-BdgRH6ID.js +1 -0
- package/dist/assets/use-data-Dzq-MytE.js +1 -0
- package/dist/assets/use-live-actor-state-DErbWQWF.js +1 -0
- package/dist/assets/use-selection-DbR73-xd.js +1 -0
- package/dist/assets/user-data-BB2Of6Ht.js +1 -0
- package/dist/assets/utility-view-state-BHypxA33.js +1 -0
- package/dist/assets/uv-editing.layout-BEKHxmHw.js +1 -0
- package/dist/assets/vgai-shared-fontawesome-CU65D4Ij.js +1 -0
- package/dist/assets/vgai-shared-jsx-dev-runtime-DFDKL7fx.js +1 -0
- package/dist/assets/vgai-shared-jsx-runtime-DIqBpTut.js +1 -0
- package/dist/assets/vgai-shared-react-BT7rMc2H.js +1 -0
- package/dist/assets/vgai-shared-react-dom-DFajMqMT.js +1 -0
- package/dist/assets/vgai-shared-react-dom-client-S0ozfl6_.js +1 -0
- package/dist/assets/vgai-shared-three-Bc5PvpLM.js +1 -0
- package/dist/assets/viewport-pick-context-DkawXbEi.js +1 -0
- package/dist/assets/viewport-root-presentation-CWsE56K6.js +1 -0
- package/dist/assets/viewport-shading-BuA88e_A.js +1 -0
- package/dist/assets/viewport-shading-boundary-B_-_gABg.js +82 -0
- package/dist/assets/viewport-surface-status-B3om4Kcf.js +1 -0
- package/dist/assets/vision_bundle-DX0dWqEa.js +15 -0
- package/dist/assets/voxel-surface-DtcsSWRL.js +1 -0
- package/dist/assets/wav-encode-D31zWF6O.js +1 -0
- package/dist/assets/webgl-frame-capture-FlF9zQmW.js +1 -0
- package/dist/assets/webgl-gpu-timer-D3YX7RaD.js +1 -0
- package/dist/assets/webworkerAll-CM2o_dnz.js +1 -0
- package/dist/assets/worker-UrMcrc5_.js +2 -0
- package/dist/assets/world-documents-147tiFZe.js +1 -0
- package/dist/assets/world-root-stage-binding-vwTrtBz6.js +1 -0
- package/dist/assets/world-state-BWG-IcOd.js +1 -0
- package/dist/assets/writer-B-KovzkA.js +5 -0
- package/dist/assets/xstate-animation-binding-Brd0NST6.js +1 -0
- package/dist/assets/xstate-animation-meta-Q3u9zh_m.js +1 -0
- package/dist/assets/xstate-behavior.action-B8UluFBK.js +1 -0
- package/dist/assets/xstate-behavior.document-CKAsE45I.js +1 -0
- package/dist/assets/xstate-behavior.inspector-vJJyuifc.js +1 -0
- package/dist/assets/xstate-behavior.menu-BXbPICIh.js +1 -0
- package/dist/assets/xstate-inspection-BsZv8LS9.js +1 -0
- package/dist/vgai-shared-react.json +10 -0
- package/dist/vgai-shared-three.json +3 -0
- package/dist-node/cli.js +9320 -0
- package/dist-node/create.js +3239 -0
- package/package.json +91 -0
- package/presets.mjs +2 -0
- package/src/contributions.d.ts +4 -0
- package/src/index.ts +38 -0
- package/starter/cube.blend +0 -0
- package/starter/cube.py +81 -0
- package/template/.agents/references/project-manual.md +341 -0
- package/template/.agents/skills/editor/SKILL.md +53 -0
- package/template/.agents/skills/editor/agents/openai.yaml +4 -0
- package/template/.agents/skills/editor/references/editor-control.md +363 -0
- package/template/.agents/skills/vgai-3d-models/SKILL.md +64 -0
- package/template/.agents/skills/vgai-ingest-existing-game/SKILL.md +112 -0
- package/template/.agents/skills/vgai-threejs-authoring/SKILL.md +347 -0
- package/template/.agents/skills/vgai-threejs-authoring/agents/openai.yaml +4 -0
- package/template/.agents/skills/vgai-threejs-authoring/references/helper-catalog.md +65 -0
- package/template/.claude/skills/editor/SKILL.md +53 -0
- package/template/.claude/skills/editor/agents/openai.yaml +4 -0
- package/template/.claude/skills/editor/references/editor-control.md +363 -0
- package/template/.claude/skills/vgai-3d-models/SKILL.md +64 -0
- package/template/.claude/skills/vgai-ingest-existing-game/SKILL.md +112 -0
- package/template/.claude/skills/vgai-threejs-authoring/SKILL.md +347 -0
- package/template/.claude/skills/vgai-threejs-authoring/agents/openai.yaml +4 -0
- package/template/.claude/skills/vgai-threejs-authoring/references/helper-catalog.md +65 -0
- package/template/.github/copilot-instructions.md +6 -0
- package/template/.github/skills/editor/SKILL.md +53 -0
- package/template/.github/skills/editor/agents/openai.yaml +4 -0
- package/template/.github/skills/editor/references/editor-control.md +363 -0
- package/template/.github/skills/vgai-3d-models/SKILL.md +64 -0
- package/template/.github/skills/vgai-ingest-existing-game/SKILL.md +112 -0
- package/template/.github/skills/vgai-threejs-authoring/SKILL.md +347 -0
- package/template/.github/skills/vgai-threejs-authoring/agents/openai.yaml +4 -0
- package/template/.github/skills/vgai-threejs-authoring/references/helper-catalog.md +65 -0
- package/template/.mcp.json +12 -0
- package/template/.vgai/assets.json +1 -0
- package/template/.vgai/provenance.json +4 -0
- package/template/.volter/tracker/validation/.preset.base.mts +178 -0
- package/template/.volter/tracker/validation/preset.mts +186 -0
- package/template/.volter/tracker/visualizer/.extension.base.tsx +14 -0
- package/template/.volter/tracker/visualizer/extension.tsx +14 -0
- package/template/.volter/tracker-config.json +17 -0
- package/template/AGENTS.md +176 -0
- package/template/CLAUDE.md +1 -0
- package/template/DEVLOG.md +20 -0
- package/template/IDIOMS.md +118 -0
- package/template/LICENSE +30 -0
- package/template/README.md +83 -0
- package/template/ROADMAP.md +20 -0
- package/template/asset-manifest.json +3 -0
- package/template/check-idioms.ts +1533 -0
- package/template/index.html +18 -0
- package/template/manifest-entry-modules-plugin.ts +53 -0
- package/template/package.json +62 -0
- package/template/public/jsm/libs/basis/basis_transcoder.js +19 -0
- package/template/public/jsm/libs/basis/basis_transcoder.wasm +0 -0
- package/template/public/jsm/libs/draco/gltf/draco_decoder.js +33 -0
- package/template/public/jsm/libs/draco/gltf/draco_decoder.wasm +0 -0
- package/template/public/jsm/libs/draco/gltf/draco_encoder.js +33 -0
- package/template/public/jsm/libs/draco/gltf/draco_wasm_wrapper.js +116 -0
- package/template/public/shaders/daylight-sky.frag.glsl +15 -0
- package/template/public/shaders/daylight-sky.vert.glsl +7 -0
- package/template/scripts/patch-drei-stats-gl.mjs +35 -0
- package/template/server/colyseus-setup.ts +111 -0
- package/template/server/loopback.ts +76 -0
- package/template/server/main.ts +78 -0
- package/template/server/rooms/arena-room.ts +488 -0
- package/template/server/rooms/game-room.ts +274 -0
- package/template/server/rooms.ts +15 -0
- package/template/server/tsconfig.json +19 -0
- package/template/src/bot/QaTester.tsx +35 -0
- package/template/src/bot/behaviors.ts +203 -0
- package/template/src/bot/bot-station.ts +192 -0
- package/template/src/bot/tester-run.ts +238 -0
- package/template/src/bot/tester-station.ts +193 -0
- package/template/src/components/environment/DaylightSky.tsx +54 -0
- package/template/src/components/environment/Ground.tsx +129 -0
- package/template/src/components/environment/SceneAtmosphere.tsx +14 -0
- package/template/src/components/environment/SoftGroundShadow.tsx +62 -0
- package/template/src/components/environment/SunShadowFit.tsx +141 -0
- package/template/src/contributions/README.md +98 -0
- package/template/src/contributions/analytics.analytics.tsx +26 -0
- package/template/src/contributions/data.document.tsx +35 -0
- package/template/src/contributions/pages.finder.ts +61 -0
- package/template/src/contributions/tester.inspector.tsx +64 -0
- package/template/src/contributions/use-game-modules.ts +80 -0
- package/template/src/data/README.md +17 -0
- package/template/src/input.ts +97 -0
- package/template/src/lib/audio/capability.json +4 -0
- package/template/src/lib/audio/sfx.ts +255 -0
- package/template/src/lib/react-root/capability.json +4 -0
- package/template/src/lib/react-root/index.ts +20 -0
- package/template/src/lib/react-root/react-root-adapter.tsx +57 -0
- package/template/src/lib/reflections/ReflectionProbe.tsx +201 -0
- package/template/src/lib/reflections/capability.json +4 -0
- package/template/src/lib/reflections/index.ts +19 -0
- package/template/src/lib/reflections/probe-controller.ts +75 -0
- package/template/src/lib/reflections/reflection-probe-registry.ts +402 -0
- package/template/src/lib/reflections/volume-reflection-material.ts +416 -0
- package/template/src/lib/static-batch/Frozen.tsx +91 -0
- package/template/src/lib/static-batch/capability.json +4 -0
- package/template/src/lib/static-batch/freeze.ts +579 -0
- package/template/src/lib/static-batch/index.ts +44 -0
- package/template/src/lib/static-batch/mutation-watch.ts +149 -0
- package/template/src/lib/static-batch/shadow-cache.ts +171 -0
- package/template/src/main.ts +63 -0
- package/template/src/manifest-entry-modules.d.ts +3 -0
- package/template/src/prefabs/HeroBox.stories.tsx +23 -0
- package/template/src/prefabs/HeroBox.tsx +35 -0
- package/template/src/scenes/MainScene.tsx +77 -0
- package/template/src/world.tsx +87 -0
- package/template/tsconfig.json +35 -0
- package/template/tsconfig.node.json +32 -0
- package/template/tsconfig.tools.json +22 -0
- package/template/validate-asset-content.ts +27 -0
- package/template/validate-assets.ts +60 -0
- package/template/validate-manifest.ts +55 -0
- package/template/vgai.adapter.ts +76 -0
- package/template/vgai.project.json +24 -0
- package/template/vite.config.ts +247 -0
- package/template-dotfiles/gitignore +63 -0
- package/workbench/src/media/game-cover.css +83 -0
- package/workbench/src/product.contribution.ts +188 -0
- package/workbench/src/vgaiGameSkew.ts +276 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a={OPERATION_NOT_FOUND:"OPERATION_NOT_FOUND",INVALID_INPUT:"INVALID_INPUT",INVALID_OUTPUT:"INVALID_OUTPUT",INTERNAL_ERROR:"INTERNAL_ERROR"},m=Symbol.for("@vgai/sdk.ToolError");class g extends Error{[m]=!0;code;data;constructor(e,o,r){super(o),this.name="ToolError",this.code=e,this.data=r}}function O(t){if(t instanceof g)return!0;if(t===null||typeof t!="object")return!1;const e=t;return e[m]===!0&&typeof e.code=="string"&&typeof e.message=="string"}function d(t){return t.map(e=>({path:[...e.path],message:e.message,code:e.code}))}const f=["project","editor","play","cinematic"],T=/^[a-z][a-zA-Z0-9]*(\.[a-z][a-zA-Z0-9]*)+$/;function N(t){const e=t.indexOf(".");return e===-1?t:t.slice(0,e)}function I(t){if(!T.test(t.name))throw new Error(`defineTool: "${t.name}" is not a valid dotted operation name (expected e.g. "project.scene.read" — lowercase-leading segments joined by dots).`);const e=N(t.name);if(!f.includes(e))throw new Error(`defineTool: "${t.name}" has unknown namespace "${e}" — expected one of ${f.join(", ")} (§5.7).`);const o=new Set;for(const r of t.errors){if(o.has(r.code))throw new Error(`defineTool: "${t.name}" declares duplicate error code "${r.code}".`);o.add(r.code)}return t}function R(t,e){if(O(e)){const r=t.errors.find(s=>s.code===e.code);if(!r)return{code:a.INTERNAL_ERROR,message:`"${t.name}" threw undeclared error code "${e.code}".`,data:{undeclaredCode:e.code,message:e.message}};if(r.data){const s=r.data.safeParse(e.data);return s.success?{code:e.code,message:e.message,data:s.data}:{code:a.INVALID_OUTPUT,message:`"${t.name}" threw declared code "${e.code}" but its data failed that code's own schema.`,issues:d(s.error.issues)}}return{code:e.code,message:e.message,...e.data!==void 0?{data:e.data}:{}}}const o=e instanceof Error?e.message:String(e);return{code:a.INTERNAL_ERROR,message:`"${t.name}" failed: ${o}`,data:{message:o}}}function h(t){const{impl:e,...o}=t;return o}function u(t,e,o=[]){if(Array.isArray(t)&&Array.isArray(e)){for(let s=0;s<t.length;s++){const n=u(t[s],e[s],[...o,s]);if(n)return n}return null}if(t===null||e===null||typeof t!="object"||typeof e!="object"||Array.isArray(t)||Array.isArray(e))return null;const r=e;for(const[s,n]of Object.entries(t)){if(!Object.hasOwn(r,s))return[...o,s];const i=u(n,r[s],[...o,s]);if(i)return i}return null}class A{definitions=new Map;register(e){if(this.definitions.has(e.name))throw new Error(`ToolRegistry.register: "${e.name}" is already registered — operation names must be unique and stable.`);this.definitions.set(e.name,e)}listOperations(){return[...this.definitions.values()].map(h)}getOperation(e){return this.definitions.get(e)}has(e){return this.definitions.has(e)}async dispatch(e,o,r={}){const s=this.definitions.get(e);if(!s)return{ok:!1,error:{code:a.OPERATION_NOT_FOUND,message:`No operation is registered as "${e}".`,data:{name:e}}};const n=s.input.safeParse(o);if(!n.success)return{ok:!1,error:{code:a.INVALID_INPUT,message:`Input for "${e}" failed schema validation.`,issues:d(n.error.issues)}};const i=u(o,n.data);if(i)return{ok:!1,error:{code:a.INVALID_INPUT,message:`Input for "${e}" contains an unknown field.`,issues:[{path:i,message:"Unknown input field. Check spelling; unknown fields are never ignored.",code:"unrecognized_key"}]}};let l;try{l=await s.impl(n.data,r)}catch(p){return{ok:!1,error:R(s,p)}}const c=s.result.safeParse(l);return c.success?{ok:!0,data:c.data}:{ok:!1,error:{code:a.INVALID_OUTPUT,message:`Result of "${e}" failed schema validation (implementation bug).`,issues:d(c.error.issues)}}}}export{g as ToolError,A as ToolRegistry,I as defineTool};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as u,Q as s}from"./three.module-D396a9Mn.js";const f=new s,a=new u,i=new s;function y(p,c){return function(){for(const[r,{body:e}]of p.entries()){const n=e.translation(),t=e.rotation(),o=r.parent;o&&o!==c?(o.updateWorldMatrix(!0,!1),a.copy(o.matrixWorld).invert(),r.position.set(n.x,n.y,n.z).applyMatrix4(a),o.getWorldQuaternion(i).invert(),r.quaternion.copy(i.multiply(f.set(t.x,t.y,t.z,t.w)))):(r.position.set(n.x,n.y,n.z),r.quaternion.set(t.x,t.y,t.z,t.w))}}}export{y as createTransformWriter};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r}from"./jsx-runtime-DPjLkJKQ.js";import{q as t}from"./index-GIL7oGEO.js";import{r as m}from"./index-nmcBqr7Y.js";import{P as p}from"./PlayBar-BR-Vg3Jb.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-D_NuPfjr.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./three.module-D396a9Mn.js";import"./configurations-DTBMdaTL.js";import"./active-ingest-CT6jSGhr.js";import"./game-contract-seams-a5YXejOu.js";import"./capability-coverage-Czas4C18.js";import"./ingest-source-persistence-C_6Hiyra.js";import"./playtest-BXIL1JEF.js";import"./play-mode-BFU2PCkG.js";import"./native-debug-module-CWicoSGD.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-Dgvitx8M.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"./react-root-CEz5NTck.js";import"./editor-presentation-activity-C7SNSmTd.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 Ao="workspace.header",Co=0;function Do(){const{project:o}=t();return m.useSyncExternalStore(o.subscribe,o.mounts,o.mounts)?r.jsx(p,{}):null}export{Do as default,Co as order,Ao as point};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getUserData as o}from"./user-data-BB2Of6Ht.js";import"./object-marks-DwvIEBOK.js";function u(r){const e=o(r,"triggerVolume");if(!e||typeof e!="object")return null;const{radius:t}=e;return typeof t=="number"&&Number.isFinite(t)&&t>0?{radius:t}:null}export{u as triggerVolumeOf};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{J as r,L as o,r as e}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 t=r([o(),o(),o()]).describe("3D vector as [x, y, z]"),i=r([o(),o(),o(),o()]).describe("Quaternion as [x, y, z, w]"),u=e({position:t.optional().describe("World-space position [x, y, z]"),rotation:i.optional().describe("Rotation quaternion [x, y, z, w]"),scale:t.optional().describe("Scale factor per axis [x, y, z]. Defaults to [1, 1, 1]")}).describe("Local transform relative to parent entity");export{i as QuatSchema,u as TransformSchema,t as Vec3Schema};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var y=Object.freeze({Linear:Object.freeze({None:function(t){return t},In:function(t){return this.None(t)},Out:function(t){return this.None(t)},InOut:function(t){return this.None(t)}}),Quadratic:Object.freeze({In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}}),Cubic:Object.freeze({In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}}),Quartic:Object.freeze({In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}}),Quintic:Object.freeze({In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}}),Sinusoidal:Object.freeze({In:function(t){return 1-Math.sin((1-t)*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return .5*(1-Math.sin(Math.PI*(.5-t)))}}),Exponential:Object.freeze({In:function(t){return t===0?0:Math.pow(1024,t-1)},Out:function(t){return t===1?1:1-Math.pow(2,-10*t)},InOut:function(t){return t===0?0:t===1?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(-Math.pow(2,-10*(t-1))+2)}}),Circular:Object.freeze({In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}}),Elastic:Object.freeze({In:function(t){return t===0?0:t===1?1:-Math.pow(2,10*(t-1))*Math.sin((t-1.1)*5*Math.PI)},Out:function(t){return t===0?0:t===1?1:Math.pow(2,-10*t)*Math.sin((t-.1)*5*Math.PI)+1},InOut:function(t){return t===0?0:t===1?1:(t*=2,t<1?-.5*Math.pow(2,10*(t-1))*Math.sin((t-1.1)*5*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin((t-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(t){var e=1.70158;return t===1?1:t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return t===0?0:--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?.5*(t*t*((e+1)*t-e)):.5*((t-=2)*t*((e+1)*t+e)+2)}}),Bounce:Object.freeze({In:function(t){return 1-y.Bounce.Out(1-t)},Out:function(t){return t<.36363636363636365?7.5625*t*t:t<.7272727272727273?7.5625*(t-=.5454545454545454)*t+.75:t<.9090909090909091?7.5625*(t-=.8181818181818182)*t+.9375:7.5625*(t-=.9545454545454546)*t+.984375},InOut:function(t){return t<.5?y.Bounce.In(t*2)*.5:y.Bounce.Out(t*2-1)*.5+.5}}),generatePow:function(t){return t===void 0&&(t=4),t=t<Number.EPSILON?Number.EPSILON:t,t=t>1e4?1e4:t,{In:function(e){return Math.pow(e,t)},Out:function(e){return 1-Math.pow(1-e,t)},InOut:function(e){return e<.5?Math.pow(e*2,t)/2:(1-Math.pow(2-e*2,t))/2+.5}}}}),v=function(){return performance.now()},P=(function(){function t(){this._tweens={},this._tweensAddedDuringUpdate={}}return t.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map(function(i){return e._tweens[i]})},t.prototype.removeAll=function(){this._tweens={}},t.prototype.add=function(e){this._tweens[e.getId()]=e,this._tweensAddedDuringUpdate[e.getId()]=e},t.prototype.remove=function(e){delete this._tweens[e.getId()],delete this._tweensAddedDuringUpdate[e.getId()]},t.prototype.update=function(e,i){e===void 0&&(e=v()),i===void 0&&(i=!1);var r=Object.keys(this._tweens);if(r.length===0)return!1;for(;r.length>0;){this._tweensAddedDuringUpdate={};for(var n=0;n<r.length;n++){var s=this._tweens[r[n]],a=!i;s&&s.update(e,a)===!1&&!i&&delete this._tweens[r[n]]}r=Object.keys(this._tweensAddedDuringUpdate)}return!0},t})(),d={Linear:function(t,e){var i=t.length-1,r=i*e,n=Math.floor(r),s=d.Utils.Linear;return e<0?s(t[0],t[1],r):e>1?s(t[i],t[i-1],i-r):s(t[n],t[n+1>i?i:n+1],r-n)},Bezier:function(t,e){for(var i=0,r=t.length-1,n=Math.pow,s=d.Utils.Bernstein,a=0;a<=r;a++)i+=n(1-e,r-a)*n(e,a)*t[a]*s(r,a);return i},CatmullRom:function(t,e){var i=t.length-1,r=i*e,n=Math.floor(r),s=d.Utils.CatmullRom;return t[0]===t[i]?(e<0&&(n=Math.floor(r=i*(1+e))),s(t[(n-1+i)%i],t[n],t[(n+1)%i],t[(n+2)%i],r-n)):e<0?t[0]-(s(t[0],t[0],t[1],t[1],-r)-t[0]):e>1?t[i]-(s(t[i],t[i],t[i-1],t[i-1],r-i)-t[i]):s(t[n?n-1:0],t[n],t[i<n+1?i:n+1],t[i<n+2?i:n+2],r-n)},Utils:{Linear:function(t,e,i){return(e-t)*i+t},Bernstein:function(t,e){var i=d.Utils.Factorial;return i(t)/i(e)/i(t-e)},Factorial:(function(){var t=[1];return function(e){var i=1;if(t[e])return t[e];for(var r=e;r>1;r--)i*=r;return t[e]=i,i}})(),CatmullRom:function(t,e,i,r,n){var s=(i-t)*.5,a=(r-e)*.5,h=n*n,f=n*h;return(2*e-2*i+s+a)*f+(-3*e+3*i-2*s-a)*h+s*n+e}}},w=(function(){function t(){}return t.nextId=function(){return t._nextId++},t._nextId=0,t})(),O=new P,M=(function(){function t(e,i){i===void 0&&(i=O),this._object=e,this._group=i,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=y.Linear.None,this._interpolationFunction=d.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=w.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return t.prototype.getId=function(){return this._id},t.prototype.isPlaying=function(){return this._isPlaying},t.prototype.isPaused=function(){return this._isPaused},t.prototype.getDuration=function(){return this._duration},t.prototype.to=function(e,i){if(i===void 0&&(i=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=e,this._propertiesAreSetUp=!1,this._duration=i<0?0:i,this},t.prototype.duration=function(e){return e===void 0&&(e=1e3),this._duration=e<0?0:e,this},t.prototype.dynamic=function(e){return e===void 0&&(e=!1),this._isDynamic=e,this},t.prototype.start=function(e,i){if(e===void 0&&(e=v()),i===void 0&&(i=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var r in this._valuesStartRepeat)this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=e,this._startTime+=this._delayTime,!this._propertiesAreSetUp||i){if(this._propertiesAreSetUp=!0,!this._isDynamic){var n={};for(var s in this._valuesEnd)n[s]=this._valuesEnd[s];this._valuesEnd=n}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,i)}return this},t.prototype.startFromCurrentValues=function(e){return this.start(e,!0)},t.prototype._setupProperties=function(e,i,r,n,s){for(var a in r){var h=e[a],f=Array.isArray(h),_=f?"array":typeof h,l=!f&&Array.isArray(r[a]);if(!(_==="undefined"||_==="function")){if(l){var u=r[a];if(u.length===0)continue;for(var C=[h],p=0,b=u.length;p<b;p+=1){var I=this._handleRelativeValue(h,u[p]);if(isNaN(I)){l=!1,console.warn("Found invalid interpolation list. Skipping.");break}C.push(I)}l&&(r[a]=C)}if((_==="object"||f)&&h&&!l){i[a]=f?[]:{};var g=h;for(var c in g)i[a][c]=g[c];n[a]=f?[]:{};var u=r[a];if(!this._isDynamic){var S={};for(var c in u)S[c]=u[c];r[a]=u=S}this._setupProperties(g,i[a],u,n[a],s)}else(typeof i[a]>"u"||s)&&(i[a]=h),f||(i[a]*=1),l?n[a]=r[a].slice().reverse():n[a]=i[a]||0}}},t.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},t.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},t.prototype.pause=function(e){return e===void 0&&(e=v()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=e,this._group&&this._group.remove(this),this)},t.prototype.resume=function(e){return e===void 0&&(e=v()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},t.prototype.stopChainedTweens=function(){for(var e=0,i=this._chainedTweens.length;e<i;e++)this._chainedTweens[e].stop();return this},t.prototype.group=function(e){return e===void 0&&(e=O),this._group=e,this},t.prototype.delay=function(e){return e===void 0&&(e=0),this._delayTime=e,this},t.prototype.repeat=function(e){return e===void 0&&(e=0),this._initialRepeat=e,this._repeat=e,this},t.prototype.repeatDelay=function(e){return this._repeatDelayTime=e,this},t.prototype.yoyo=function(e){return e===void 0&&(e=!1),this._yoyo=e,this},t.prototype.easing=function(e){return e===void 0&&(e=y.Linear.None),this._easingFunction=e,this},t.prototype.interpolation=function(e){return e===void 0&&(e=d.Linear),this._interpolationFunction=e,this},t.prototype.chain=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return this._chainedTweens=e,this},t.prototype.onStart=function(e){return this._onStartCallback=e,this},t.prototype.onEveryStart=function(e){return this._onEveryStartCallback=e,this},t.prototype.onUpdate=function(e){return this._onUpdateCallback=e,this},t.prototype.onRepeat=function(e){return this._onRepeatCallback=e,this},t.prototype.onComplete=function(e){return this._onCompleteCallback=e,this},t.prototype.onStop=function(e){return this._onStopCallback=e,this},t.prototype.update=function(e,i){var r=this,n;if(e===void 0&&(e=v()),i===void 0&&(i=!0),this._isPaused)return!0;var s,a=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(e>a)return!1;i&&this.start(e,!0)}if(this._goToEnd=!1,e<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var h=e-this._startTime,f=this._duration+((n=this._repeatDelayTime)!==null&&n!==void 0?n:this._delayTime),_=this._duration+this._repeat*f,l=function(){if(r._duration===0||h>_)return 1;var g=Math.trunc(h/f),c=h-g*f,S=Math.min(c/r._duration,1);return S===0&&h===r._duration?1:S},u=l(),C=this._easingFunction(u);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,C),this._onUpdateCallback&&this._onUpdateCallback(this._object,u),this._duration===0||h>=this._duration)if(this._repeat>0){var p=Math.min(Math.trunc((h-this._duration)/f)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=p);for(s in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[s]=="string"&&(this._valuesStartRepeat[s]=this._valuesStartRepeat[s]+parseFloat(this._valuesEnd[s])),this._yoyo&&this._swapEndStartRepeatValues(s),this._valuesStart[s]=this._valuesStartRepeat[s];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=f*p,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var b=0,I=this._chainedTweens.length;b<I;b++)this._chainedTweens[b].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},t.prototype._updateProperties=function(e,i,r,n){for(var s in r)if(i[s]!==void 0){var a=i[s]||0,h=r[s],f=Array.isArray(e[s]),_=Array.isArray(h),l=!f&&_;l?e[s]=this._interpolationFunction(h,n):typeof h=="object"&&h?this._updateProperties(e[s],a,h,n):(h=this._handleRelativeValue(a,h),typeof h=="number"&&(e[s]=a+(h-a)*n))}},t.prototype._handleRelativeValue=function(e,i){return typeof i!="string"?i:i.charAt(0)==="+"||i.charAt(0)==="-"?e+parseFloat(i):parseFloat(i)},t.prototype._swapEndStartRepeatValues=function(e){var i=this._valuesStartRepeat[e],r=this._valuesEnd[e];typeof r=="string"?this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(r):this._valuesStartRepeat[e]=this._valuesEnd[e],this._valuesEnd[e]=i},t})(),T="23.1.1",E=w.nextId,o=O,R=o.getAll.bind(o),k=o.removeAll.bind(o),A=o.add.bind(o),j=o.remove.bind(o),F=o.update.bind(o),U={Easing:y,Group:P,Interpolation:d,now:v,Sequence:w,nextId:E,Tween:M,VERSION:T,getAll:R,removeAll:k,add:A,remove:j,update:F};export{y as Easing,P as Group,d as Interpolation,w as Sequence,M as Tween,T as VERSION,A as add,U as default,R as getAll,E as nextId,v as now,j as remove,k as removeAll,F as update};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/story-capture-_gC8dXV-.js","assets/react-story-board-BDDwiE2H.js","assets/jsx-runtime-DPjLkJKQ.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-nmcBqr7Y.js","assets/index-D_NuPfjr.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-GIL7oGEO.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/three.module-D396a9Mn.js","assets/index-D2fNXpHa.css","assets/StoryPreviewMount-DjyxRCXu.js","assets/story-pixi-preview-BUrOJZXS.js","assets/crash-null-boundary-v3a0uEgw.js","assets/pixi-story-model-DNkfnWUV.js","assets/story-mount-turn-DFRTj5hi.js","assets/story-presentation-j2AVN-mK.js","assets/story-three-preview-BHEDZzcl.js","assets/events-156d8d12.esm-ErOhDXXB.js","assets/index-bQE2NA0D.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{di as s,av as m,dj as p,aF as n,_ as c,bG as d}from"./index-GIL7oGEO.js";import{a as u}from"./jsx-runtime-DPjLkJKQ.js";import{d as v,p as l,r as P}from"./design-time-layers-wYgOTgni.js";import{RootDocumentContent as w}from"./world-documents-147tiFZe.js";import{U as _}from"./component-board.service-DidCyM4O.js";import"./index-nmcBqr7Y.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";import"./edit-mode-authoring-B47TfLqu.js";import"./design-time-mount-registry-DUpXCg1U.js";import"./react-story-board-BDDwiE2H.js";import"./CanvasSceneViewport-Bpi6gVTC.js";import"./RootSelectionOverlay-BZPlxmXU.js";import"./eyedropper-session-bjPXnfeX.js";import"./viewport-pick-context-DkawXbEi.js";import"./inspect-BZfi3mmo.js";import"./inference-diagnostics-Dhmtfbq_.js";import"./TransientHint-BB1fwrvK.js";import"./component-board-registry-DrIa2csL.js";import"./surface-state-DaxyruCj.js";import"./board-guides-DziKSTss.js";import"./story-media-presence-BHzk2IV5.js";const b={revision:()=>JSON.stringify(d().map(({id:e,modulePath:t})=>[e,t])),subscribe:m,capture:async({width:e,height:t})=>{const{captureDomStoryBoardPreview:o}=await c(async()=>{const{captureDomStoryBoardPreview:i}=await import("./story-capture-_gC8dXV-.js");return{captureDomStoryBoardPreview:i}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]));return o(e,t)}};function z({store:e,composite:t}){const o=v(t).find(r=>r.kind==="dom")??l(),i=r=>u.jsx(w,{...r,composite:t,descriptor:o,store:e});s({id:p,title:_,kind:"world",workspaceRole:"authored-subject",provenance:{rootId:o.worldId,...o.path?{sourcePath:o.path}:{}},Content:i,preview:b,presentation:()=>{const r=n()?.rootPath,a=r?P(r,o.worldId):void 0;return{kind:"workspace",id:p,...a?{story:a}:{}}},onActivate:()=>e.setActiveViewportTab("edit")},{category:"canvas",default:!t.childAdapters().some(r=>r.kind==="three"||r.kind==="canvas")})}export{z as installUiBoard};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const o=["UNEXPORTED GAME, OUTSIDE THE EDITOR — refusing to mount.","","This game has not been exported. Until it is, the ONLY way to run, see,","or drive it is the editor:",""," vgai edit . open (or reuse) the editor for this project"," vgai play enter play mode from the terminal"," vgai eval '<js>' drive and read the running game","","The standalone page serves EXPORTED builds only (`vgai deploy`, or the","production build it runs). Do not script around this page — no headless","browsers, bots, or screenshots against the dev server. Every agent","workflow goes through the editor session."].join(`
|
|
2
|
+
`);function t(){return typeof window>"u"||typeof document>"u"||document.defaultView!==window,!1}function n(){if(!t())return;const e=document.createElement("pre");throw e.textContent=o,e.style.cssText=["position:fixed","inset:0","z-index:2147483647","margin:0","padding:48px","background:#1A0E0E","color:#FF9B8A","font:600 15px/1.7 ui-monospace,SFMono-Regular,Menlo,monospace","white-space:pre-wrap"].join(";"),document.body.appendChild(e),document.title="UNEXPORTED — use the editor",new Error(`mountGameFromManifest: ${o}`)}export{n as assertExportedOrInEditor};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function i(n,s){return n.slice(0,s).split(`
|
|
2
|
+
`).length}const f=/(^|[/\\])src[/\\]lib[/\\]react-root[/\\]/;function m(n,s){if(f.test(s))return[];const a=[],l=new Map;for(const e of n.matchAll(/import\s*\{([^}]*)\}\s*from\s*['"]react-dom\/client['"]/g))for(const o of(e[1]??"").split(",")){const t=o.trim().match(/^(createRoot|hydrateRoot)(?:\s+as\s+([\w$]+))?$/);t&&l.set(t[2]??t[1],t[1])}for(const[e,o]of l){const t=new RegExp(`\\b${e.replace(/[$]/g,"\\$&")}\\s*\\(`,"g");for(const r of n.matchAll(t))a.push({file:s,line:i(n,r.index??0),api:o})}const c=new Set;for(const e of n.matchAll(/import\s+(?:\*\s+as\s+|)([\w$]+)\s+from\s*['"]react-dom(?:\/client)?['"]/g))c.add(e[1]);c.add("ReactDOM");for(const e of c)for(const o of["createRoot","hydrateRoot","render"]){const t=new RegExp(`\\b${e}\\.${o}\\s*\\(`,"g");for(const r of n.matchAll(t))a.push({file:s,line:i(n,r.index??0),api:o==="render"?"ReactDOM.render":o})}return a.filter((e,o)=>a.findIndex(t=>t.file===e.file&&t.line===e.line&&t.api===e.api)===o)}export{m as detectUnmanagedReactRoots};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=/-\s*Commit:\s*\*\*`([0-9a-fA-F]{7,40})`\*\*/;function n(t){return e.exec(t)?.[1]??null}export{n as extractUpstreamPin};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as n}from"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";function u(t){return n.useSyncExternalStore(r=>t.subscribe(()=>r()),()=>t.get())}async function w(t,r){if(!t.startsWith("src/data/")||!t.endsWith(".data.json"))throw new Error(`writeData: invalid path ${JSON.stringify(t)} — data assets live at src/data/**/*.data.json, addressed project-relative, e.g. writeData('src/data/tuning.data.json', next).`);const{$schema:s,...i}=r,o={$schema:s??`./${t.split("/").pop()?.replace(/\.data\.json$/,"")}.schema.json`,...i};let e;try{e=await fetch("/__editor/data-file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t,values:o})})}catch(a){throw new Error(`writeData: could not reach the editor dev server (/__editor/data-file) — this helper is editor-tool plumbing and only works inside the running editor. Game code must not write data assets: they are immutable at runtime — keep runtime state in your game's own store. (${String(a)})`)}if(!e.ok){const a=await e.text().catch(()=>"");throw new Error(`writeData: the editor rejected the write to "${t}" (HTTP ${e.status}${a?`: ${a}`:""}).`)}}export{u as useData,w as writeData};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as f}from"./index-nmcBqr7Y.js";const b="#";console.log.bind(console);const h=t=>t[0]===b;function u(t,e){if(h(e))return t.machine.getStateNodeById(e);if(!t.states)throw new Error(`Unable to retrieve child state '${e}' from '${t.id}'; no child states exist.`);const n=t.states[e];if(!n)throw new Error(`Child state '${e}' does not exist on '${t.id}'`);return n}function d(t,e){if(typeof e=="string"){const o=t.states[e];if(!o)throw new Error(`State '${e}' does not exist on '${t.id}'`);return[t,o]}const n=Object.keys(e),r=n.map(o=>u(t,o)).filter(Boolean);return[t.machine.root,t].concat(r,n.reduce((o,s)=>{const i=u(t,s);if(!i)return o;const c=d(i,e[s]);return o.concat(c)},[]))}function y(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function l(t){if(t!=null){if(typeof t=="string")return t;if(typeof t=="function"){const e=t.name;if(e&&e!=="guard"&&e!=="anonymous")return e;const n=t.toString().replace(/\s+/g," ").trim();return n.length>60?`${n.slice(0,57)}...`:n}return y(t)&&typeof t.type=="string"?t.type:"(guard)"}}function*p(t,e,n){yield{node:t,parentId:e,depth:n};for(const r of Object.values(t.states))yield*p(r,t.id,n+1)}function S(t){const e=t.parent;return e?e.type!=="compound"?!1:e.initial?.target?.some(n=>n.id===t.id)??!1:!0}function $(t,e){const n=[];for(const[r,o]of Object.entries(t.on))for(const s of o)for(const i of s.target??[])n.push({id:`${t.id}--${r}--${i.id}--${e()}`,source:t.id,target:i.id,eventLabel:r,isEventless:!1,guardLabel:l(s.guard)});for(const r of t.always??[])for(const o of r.target??[])n.push({id:`${t.id}--always--${o.id}--${e()}`,source:t.id,target:o.id,eventLabel:"always",isEventless:!0,guardLabel:l(r.guard)});return n}function v(t){const e=t.root,n=[],r=[];let o=0;const s=()=>o++;for(const{node:i,parentId:c,depth:g}of p(e,null,0))n.push({id:i.id,key:i.key,parentId:c,depth:g,type:i.type,isInitial:S(i)}),r.push(...$(i,s));return{machineId:e.id,nodes:n,edges:r}}function a(t,e){return d(t.root,e).map(n=>n.id)}function I(t,e){const[n,r]=f.useState(null);return f.useEffect(()=>{if(!e){r(null);return}r(a(t,e.getSnapshot().value));const o=e.subscribe(s=>{r(a(t,s.value))});return()=>o.unsubscribe()},[t,e]),n}export{v as b,I as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as u}from"./jsx-runtime-DPjLkJKQ.js";import{r as t}from"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";const c=t.createContext(null);function x({adapter:n,nodeId:e,children:o}){const r=t.useMemo(()=>({adapter:n,nodeId:e}),[n,e]);return u.jsx(c.Provider,{value:r,children:o})}function p(){const n=t.useContext(c);if(!n)throw new Error("useSelection: no editor selection in context — this hook only works inside an editor-hosted INSPECTOR tool (placement: 'inspector'). Dock tools and game code have no selection to read.");const{adapter:e,nodeId:o}=n,r=t.useRef(0),i=t.useSyncExternalStore(s=>e.subscribe?.(()=>{r.current++,s()})??(()=>{}),()=>r.current);return t.useMemo(()=>{const s=o?e.hierarchy.node(o):null;return{nodeId:o,node:s}},[e,o,i])}export{x as EditorSelectionProvider,p as useSelection};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ObjectMarkKeys as i}from"./object-marks-DwvIEBOK.js";const a={...i,entityId:"entityId",forward:"forward",tags:"tags",attributes:"attributes",navRole:"navRole",pivot:"pivot",splineCurve:"splineCurve",splineControlPoint:"splineControlPoint",_camera:"_camera",_particleSystem:"_particleSystem",gaussianSplat:"gaussianSplat",_animMixer:"_animMixer",_animClips:"_animClips",_availableClips:"_availableClips",_animationRuntime:"_animationRuntime",_xstateBehavior:"_xstateBehavior",_xstateAnimation:"_xstateAnimation",__sharedGeometry:"__sharedGeometry",__shadeOrig:"__shadeOrig",__shadeUnlit:"__shadeUnlit",__ingest:"__ingest",__ingestNextId:"__ingestNextId",authoringRoot:"authoringRoot",authoringInstance:"authoringInstance",authoringLabel:"authoringLabel",vgaiBodyOwner:"vgaiBodyOwner",authoringComponent:"authoringComponent",authoringDocument:"authoringDocument",authoringHierarchyId:"authoringHierarchyId",authoringHierarchyParentId:"authoringHierarchyParentId",authoringHierarchyOrder:"authoringHierarchyOrder",editorIcon:"editorIcon",envObject:"envObject",constraints:"constraints",authoringSubject:"authoringSubject",reflectionProbe:"reflectionProbe",triggerVolume:"triggerVolume",vcDirIdx:"vcDirIdx"};function o(t,e){return t?t.userData[a[e]]:void 0}function s(t,e,r){t.userData[a[e]]=r}function u(t,e){return t?t.userData[a[e]]!==void 0:!1}function _(t,e){delete t.userData[a[e]]}export{a as UserDataKeys,_ as deleteUserData,o as getUserData,u as hasUserData,s as setUserData};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ac as l}from"./index-GIL7oGEO.js";function f(c,i){let t=i,s=0;const r=new Set,o=()=>{s++;for(const e of r)e()},n=e=>{t!==e&&(t=e,o())};return{subscribe(e){return r.add(e),()=>{r.delete(e)}},version:()=>s,active:()=>t,select:n,open(e){n(e),l(c)},notify:o,reset(){t=i,o()}}}const p=f("tool:profiler.utility","profiler");export{p};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e="workspace.layout",t={id:"uv-editing",title:"UV Editing",description:"Blender-shaped UV editing: the viewport beside the mesh's UV layout, read-only.",requires:{documentKind:"model"},regions:{header:"shown",shelf:"shown",inspector:"properties",drawer:"hidden"},areas:[{id:"uv",document:"blender-uv-editor.document",place:"left",ratio:.5003}]};export{t as layout,e as point};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e}from"./index-FUuS4qwW.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";const o=e,a=o.FontAwesomeIcon,c=o.FontAwesomeLayers,p=o.LayersCounter,y=o.LayersText;export{a as FontAwesomeIcon,c as FontAwesomeLayers,p as LayersCounter,y as LayersText,o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as t}from"./jsx-runtime-DPjLkJKQ.js";import"./_commonjsHelpers-D6-XlEtG.js";function a(e,n,o,s){return s?t.jsxs(e,n,o):t.jsx(e,n,o)}const m=Object.freeze(Object.defineProperty({__proto__:null,Fragment:t.Fragment,jsxDEV:a},Symbol.toStringTag,{value:"Module"})),r=m,_=r.Fragment,c=r.jsxDEV;export{_ as Fragment,r as default,c as jsxDEV};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t,_ as n}from"./jsx-runtime-DPjLkJKQ.js";import"./_commonjsHelpers-D6-XlEtG.js";const s=t??n,a=s.Fragment,j=s.jsx,r=s.jsxs;export{a as Fragment,s as default,j as jsx,r as jsxs};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as t,R as s}from"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";const e=t??s,a=e.Activity,u=e.Children,r=e.Component,i=e.Fragment,E=e.Profiler,_=e.PureComponent,l=e.StrictMode,f=e.Suspense,m=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R=e.__COMPILER_RUNTIME,S=e.cache,C=e.cacheSignal,d=e.cloneElement,N=e.createContext,T=e.createElement,p=e.createRef,I=e.forwardRef,A=e.isValidElement,O=e.lazy,h=e.memo,v=e.startTransition,y=e.unstable_useCacheRefresh,D=e.use,L=e.useActionState,M=e.useCallback,P=e.useContext,U=e.useDebugValue,x=e.useDeferredValue,b=e.useEffect,g=e.useEffectEvent,V=e.useId,H=e.useImperativeHandle,k=e.useInsertionEffect,w=e.useLayoutEffect,z=e.useMemo,F=e.useOptimistic,G=e.useReducer,W=e.useRef,Y=e.useState,$=e.useSyncExternalStore,j=e.useTransition,q=e.version;export{a as Activity,u as Children,r as Component,i as Fragment,E as Profiler,_ as PureComponent,l as StrictMode,f as Suspense,m as __CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R as __COMPILER_RUNTIME,S as cache,C as cacheSignal,d as cloneElement,N as createContext,T as createElement,p as createRef,e as default,I as forwardRef,A as isValidElement,O as lazy,h as memo,v as startTransition,y as unstable_useCacheRefresh,D as use,L as useActionState,M as useCallback,P as useContext,U as useDebugValue,x as useDeferredValue,b as useEffect,g as useEffectEvent,V as useId,H as useImperativeHandle,k as useInsertionEffect,w as useLayoutEffect,z as useMemo,F as useOptimistic,G as useReducer,W as useRef,Y as useState,$ as useSyncExternalStore,j as useTransition,q as version};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,_ as o}from"./index-CtzuWnCS.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-CinJrH5C.js";import"./index-D_NuPfjr.js";const t=e??o,c=t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,a=t.createPortal,p=t.flushSync,u=t.preconnect,i=t.prefetchDNS,S=t.preinit,l=t.preinitModule,d=t.preload,N=t.preloadModule,m=t.requestFormReset,R=t.unstable_batchedUpdates,E=t.useFormState,O=t.useFormStatus,A=t.version;export{c as __DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,a as createPortal,t as default,p as flushSync,u as preconnect,i as prefetchDNS,S as preinit,l as preinitModule,d as preload,N as preloadModule,m as requestFormReset,R as unstable_batchedUpdates,E as useFormState,O as useFormStatus,A as version};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as t,_ as r}from"./client-DNXj_opT.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";const o=t??r,n=o.createRoot,i=o.hydrateRoot,m=o.version;export{n as createRoot,o as default,i as hydrateRoot,m as version};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{T as t}from"./three.module-D396a9Mn.js";const e=t,n=e.ACESFilmicToneMapping,r=e.AddEquation,a=e.AddOperation,c=e.AdditiveAnimationBlendMode,s=e.AdditiveBlending,i=e.AgXToneMapping,l=e.AlphaFormat,p=e.AlwaysCompare,m=e.AlwaysDepth,u=e.AlwaysStencilFunc,d=e.AmbientLight,C=e.AnimationAction,S=e.AnimationClip,T=e.AnimationLoader,g=e.AnimationMixer,M=e.AnimationObjectGroup,F=e.AnimationUtils,A=e.ArcCurve,G=e.ArrayCamera,h=e.ArrowHelper,B=e.AttachedBindMode,_=e.Audio,R=e.AudioAnalyser,L=e.AudioContext,y=e.AudioListener,D=e.AudioLoader,f=e.AxesHelper,E=e.BackSide,x=e.BasicDepthPacking,b=e.BasicShadowMap,P=e.BatchedMesh,I=e.Bone,U=e.BooleanKeyframeTrack,N=e.Box2,O=e.Box3,v=e.Box3Helper,k=e.BoxGeometry,q=e.BoxHelper,H=e.BufferAttribute,V=e.BufferGeometry,w=e.BufferGeometryLoader,W=e.ByteType,K=e.Cache,Q=e.Camera,X=e.CameraHelper,j=e.CanvasTexture,z=e.CapsuleGeometry,Z=e.CatmullRomCurve3,J=e.CineonToneMapping,Y=e.CircleGeometry,$=e.ClampToEdgeWrapping,ee=e.Clock,te=e.Color,oe=e.ColorKeyframeTrack,ne=e.ColorManagement,re=e.CompressedArrayTexture,ae=e.CompressedCubeTexture,ce=e.CompressedTexture,se=e.CompressedTextureLoader,ie=e.ConeGeometry,le=e.ConstantAlphaFactor,pe=e.ConstantColorFactor,me=e.Controls,ue=e.CubeCamera,de=e.CubeReflectionMapping,Ce=e.CubeRefractionMapping,Se=e.CubeTexture,Te=e.CubeTextureLoader,ge=e.CubeUVReflectionMapping,Me=e.CubicBezierCurve,Fe=e.CubicBezierCurve3,Ae=e.CubicInterpolant,Ge=e.CullFaceBack,he=e.CullFaceFront,Be=e.CullFaceFrontBack,_e=e.CullFaceNone,Re=e.Curve,Le=e.CurvePath,ye=e.CustomBlending,De=e.CustomToneMapping,fe=e.CylinderGeometry,Ee=e.Cylindrical,xe=e.Data3DTexture,be=e.DataArrayTexture,Pe=e.DataTexture,Ie=e.DataTextureLoader,Ue=e.DataUtils,Ne=e.DecrementStencilOp,Oe=e.DecrementWrapStencilOp,ve=e.DefaultLoadingManager,ke=e.DepthFormat,qe=e.DepthStencilFormat,He=e.DepthTexture,Ve=e.DetachedBindMode,we=e.DirectionalLight,We=e.DirectionalLightHelper,Ke=e.DiscreteInterpolant,Qe=e.DodecahedronGeometry,Xe=e.DoubleSide,je=e.DstAlphaFactor,ze=e.DstColorFactor,Ze=e.DynamicCopyUsage,Je=e.DynamicDrawUsage,Ye=e.DynamicReadUsage,$e=e.EdgesGeometry,et=e.EllipseCurve,tt=e.EqualCompare,ot=e.EqualDepth,nt=e.EqualStencilFunc,rt=e.EquirectangularReflectionMapping,at=e.EquirectangularRefractionMapping,ct=e.Euler,st=e.EventDispatcher,it=e.ExternalTexture,lt=e.ExtrudeGeometry,pt=e.FileLoader,mt=e.Float16BufferAttribute,ut=e.Float32BufferAttribute,dt=e.FloatType,Ct=e.Fog,St=e.FogExp2,Tt=e.FramebufferTexture,gt=e.FrontSide,Mt=e.Frustum,Ft=e.FrustumArray,At=e.GLBufferAttribute,Gt=e.GLSL1,ht=e.GLSL3,Bt=e.GreaterCompare,_t=e.GreaterDepth,Rt=e.GreaterEqualCompare,Lt=e.GreaterEqualDepth,yt=e.GreaterEqualStencilFunc,Dt=e.GreaterStencilFunc,ft=e.GridHelper,Et=e.Group,xt=e.HalfFloatType,bt=e.HemisphereLight,Pt=e.HemisphereLightHelper,It=e.IcosahedronGeometry,Ut=e.ImageBitmapLoader,Nt=e.ImageLoader,Ot=e.ImageUtils,vt=e.IncrementStencilOp,kt=e.IncrementWrapStencilOp,qt=e.InstancedBufferAttribute,Ht=e.InstancedBufferGeometry,Vt=e.InstancedInterleavedBuffer,wt=e.InstancedMesh,Wt=e.Int16BufferAttribute,Kt=e.Int32BufferAttribute,Qt=e.Int8BufferAttribute,Xt=e.IntType,jt=e.InterleavedBuffer,zt=e.InterleavedBufferAttribute,Zt=e.Interpolant,Jt=e.InterpolateDiscrete,Yt=e.InterpolateLinear,$t=e.InterpolateSmooth,eo=e.InterpolationSamplingMode,to=e.InterpolationSamplingType,oo=e.InvertStencilOp,no=e.KeepStencilOp,ro=e.KeyframeTrack,ao=e.LOD,co=e.LatheGeometry,so=e.Layers,io=e.LessCompare,lo=e.LessDepth,po=e.LessEqualCompare,mo=e.LessEqualDepth,uo=e.LessEqualStencilFunc,Co=e.LessStencilFunc,So=e.Light,To=e.LightProbe,go=e.Line,Mo=e.Line3,Fo=e.LineBasicMaterial,Ao=e.LineCurve,Go=e.LineCurve3,ho=e.LineDashedMaterial,Bo=e.LineLoop,_o=e.LineSegments,Ro=e.LinearFilter,Lo=e.LinearInterpolant,yo=e.LinearMipMapLinearFilter,Do=e.LinearMipMapNearestFilter,fo=e.LinearMipmapLinearFilter,Eo=e.LinearMipmapNearestFilter,xo=e.LinearSRGBColorSpace,bo=e.LinearToneMapping,Po=e.LinearTransfer,Io=e.Loader,Uo=e.LoaderUtils,No=e.LoadingManager,Oo=e.LoopOnce,vo=e.LoopPingPong,ko=e.LoopRepeat,qo=e.MOUSE,Ho=e.Material,Vo=e.MaterialLoader,wo=e.MathUtils,Wo=e.Matrix2,Ko=e.Matrix3,Qo=e.Matrix4,Xo=e.MaxEquation,jo=e.Mesh,zo=e.MeshBasicMaterial,Zo=e.MeshDepthMaterial,Jo=e.MeshDistanceMaterial,Yo=e.MeshLambertMaterial,$o=e.MeshMatcapMaterial,en=e.MeshNormalMaterial,tn=e.MeshPhongMaterial,on=e.MeshPhysicalMaterial,nn=e.MeshStandardMaterial,rn=e.MeshToonMaterial,an=e.MinEquation,cn=e.MirroredRepeatWrapping,sn=e.MixOperation,ln=e.MultiplyBlending,pn=e.MultiplyOperation,mn=e.NearestFilter,un=e.NearestMipMapLinearFilter,dn=e.NearestMipMapNearestFilter,Cn=e.NearestMipmapLinearFilter,Sn=e.NearestMipmapNearestFilter,Tn=e.NeutralToneMapping,gn=e.NeverCompare,Mn=e.NeverDepth,Fn=e.NeverStencilFunc,An=e.NoBlending,Gn=e.NoColorSpace,hn=e.NoToneMapping,Bn=e.NormalAnimationBlendMode,_n=e.NormalBlending,Rn=e.NotEqualCompare,Ln=e.NotEqualDepth,yn=e.NotEqualStencilFunc,Dn=e.NumberKeyframeTrack,fn=e.Object3D,En=e.ObjectLoader,xn=e.ObjectSpaceNormalMap,bn=e.OctahedronGeometry,Pn=e.OneFactor,In=e.OneMinusConstantAlphaFactor,Un=e.OneMinusConstantColorFactor,Nn=e.OneMinusDstAlphaFactor,On=e.OneMinusDstColorFactor,vn=e.OneMinusSrcAlphaFactor,kn=e.OneMinusSrcColorFactor,qn=e.OrthographicCamera,Hn=e.PCFShadowMap,Vn=e.PCFSoftShadowMap,wn=e.PMREMGenerator,Wn=e.Path,Kn=e.PerspectiveCamera,Qn=e.Plane,Xn=e.PlaneGeometry,jn=e.PlaneHelper,zn=e.PointLight,Zn=e.PointLightHelper,Jn=e.Points,Yn=e.PointsMaterial,$n=e.PolarGridHelper,er=e.PolyhedronGeometry,tr=e.PositionalAudio,or=e.PropertyBinding,nr=e.PropertyMixer,rr=e.QuadraticBezierCurve,ar=e.QuadraticBezierCurve3,cr=e.Quaternion,sr=e.QuaternionKeyframeTrack,ir=e.QuaternionLinearInterpolant,lr=e.RED_GREEN_RGTC2_Format,pr=e.RED_RGTC1_Format,mr=e.REVISION,ur=e.RGBADepthPacking,dr=e.RGBAFormat,Cr=e.RGBAIntegerFormat,Sr=e.RGBA_ASTC_10x10_Format,Tr=e.RGBA_ASTC_10x5_Format,gr=e.RGBA_ASTC_10x6_Format,Mr=e.RGBA_ASTC_10x8_Format,Fr=e.RGBA_ASTC_12x10_Format,Ar=e.RGBA_ASTC_12x12_Format,Gr=e.RGBA_ASTC_4x4_Format,hr=e.RGBA_ASTC_5x4_Format,Br=e.RGBA_ASTC_5x5_Format,_r=e.RGBA_ASTC_6x5_Format,Rr=e.RGBA_ASTC_6x6_Format,Lr=e.RGBA_ASTC_8x5_Format,yr=e.RGBA_ASTC_8x6_Format,Dr=e.RGBA_ASTC_8x8_Format,fr=e.RGBA_BPTC_Format,Er=e.RGBA_ETC2_EAC_Format,xr=e.RGBA_PVRTC_2BPPV1_Format,br=e.RGBA_PVRTC_4BPPV1_Format,Pr=e.RGBA_S3TC_DXT1_Format,Ir=e.RGBA_S3TC_DXT3_Format,Ur=e.RGBA_S3TC_DXT5_Format,Nr=e.RGBDepthPacking,Or=e.RGBFormat,vr=e.RGBIntegerFormat,kr=e.RGB_BPTC_SIGNED_Format,qr=e.RGB_BPTC_UNSIGNED_Format,Hr=e.RGB_ETC1_Format,Vr=e.RGB_ETC2_Format,wr=e.RGB_PVRTC_2BPPV1_Format,Wr=e.RGB_PVRTC_4BPPV1_Format,Kr=e.RGB_S3TC_DXT1_Format,Qr=e.RGDepthPacking,Xr=e.RGFormat,jr=e.RGIntegerFormat,zr=e.RawShaderMaterial,Zr=e.Ray,Jr=e.Raycaster,Yr=e.RectAreaLight,$r=e.RedFormat,ea=e.RedIntegerFormat,ta=e.ReinhardToneMapping,oa=e.RenderTarget,na=e.RenderTarget3D,ra=e.RepeatWrapping,aa=e.ReplaceStencilOp,ca=e.ReverseSubtractEquation,sa=e.RingGeometry,ia=e.SIGNED_RED_GREEN_RGTC2_Format,la=e.SIGNED_RED_RGTC1_Format,pa=e.SRGBColorSpace,ma=e.SRGBTransfer,ua=e.Scene,da=e.ShaderChunk,Ca=e.ShaderLib,Sa=e.ShaderMaterial,Ta=e.ShadowMaterial,ga=e.Shape,Ma=e.ShapeGeometry,Fa=e.ShapePath,Aa=e.ShapeUtils,Ga=e.ShortType,ha=e.Skeleton,Ba=e.SkeletonHelper,_a=e.SkinnedMesh,Ra=e.Source,La=e.Sphere,ya=e.SphereGeometry,Da=e.Spherical,fa=e.SphericalHarmonics3,Ea=e.SplineCurve,xa=e.SpotLight,ba=e.SpotLightHelper,Pa=e.Sprite,Ia=e.SpriteMaterial,Ua=e.SrcAlphaFactor,Na=e.SrcAlphaSaturateFactor,Oa=e.SrcColorFactor,va=e.StaticCopyUsage,ka=e.StaticDrawUsage,qa=e.StaticReadUsage,Ha=e.StereoCamera,Va=e.StreamCopyUsage,wa=e.StreamDrawUsage,Wa=e.StreamReadUsage,Ka=e.StringKeyframeTrack,Qa=e.SubtractEquation,Xa=e.SubtractiveBlending,ja=e.TOUCH,za=e.TangentSpaceNormalMap,Za=e.TetrahedronGeometry,Ja=e.Texture,Ya=e.TextureLoader,$a=e.TextureUtils,ec=e.Timer,tc=e.TimestampQuery,oc=e.TorusGeometry,nc=e.TorusKnotGeometry,rc=e.Triangle,ac=e.TriangleFanDrawMode,cc=e.TriangleStripDrawMode,sc=e.TrianglesDrawMode,ic=e.TubeGeometry,lc=e.UVMapping,pc=e.Uint16BufferAttribute,mc=e.Uint32BufferAttribute,uc=e.Uint8BufferAttribute,dc=e.Uint8ClampedBufferAttribute,Cc=e.Uniform,Sc=e.UniformsGroup,Tc=e.UniformsLib,gc=e.UniformsUtils,Mc=e.UnsignedByteType,Fc=e.UnsignedInt101111Type,Ac=e.UnsignedInt248Type,Gc=e.UnsignedInt5999Type,hc=e.UnsignedIntType,Bc=e.UnsignedShort4444Type,_c=e.UnsignedShort5551Type,Rc=e.UnsignedShortType,Lc=e.VSMShadowMap,yc=e.Vector2,Dc=e.Vector3,fc=e.Vector4,Ec=e.VectorKeyframeTrack,xc=e.VideoFrameTexture,bc=e.VideoTexture,Pc=e.WebGL3DRenderTarget,Ic=e.WebGLArrayRenderTarget,Uc=e.WebGLCoordinateSystem,Nc=e.WebGLCubeRenderTarget,Oc=e.WebGLRenderTarget,vc=e.WebGLRenderer,kc=e.WebGLUtils,qc=e.WebGPUCoordinateSystem,Hc=e.WebXRController,Vc=e.WireframeGeometry,wc=e.WrapAroundEnding,Wc=e.ZeroCurvatureEnding,Kc=e.ZeroFactor,Qc=e.ZeroSlopeEnding,Xc=e.ZeroStencilOp,jc=e.createCanvasElement;export{n as ACESFilmicToneMapping,r as AddEquation,a as AddOperation,c as AdditiveAnimationBlendMode,s as AdditiveBlending,i as AgXToneMapping,l as AlphaFormat,p as AlwaysCompare,m as AlwaysDepth,u as AlwaysStencilFunc,d as AmbientLight,C as AnimationAction,S as AnimationClip,T as AnimationLoader,g as AnimationMixer,M as AnimationObjectGroup,F as AnimationUtils,A as ArcCurve,G as ArrayCamera,h as ArrowHelper,B as AttachedBindMode,_ as Audio,R as AudioAnalyser,L as AudioContext,y as AudioListener,D as AudioLoader,f as AxesHelper,E as BackSide,x as BasicDepthPacking,b as BasicShadowMap,P as BatchedMesh,I as Bone,U as BooleanKeyframeTrack,N as Box2,O as Box3,v as Box3Helper,k as BoxGeometry,q as BoxHelper,H as BufferAttribute,V as BufferGeometry,w as BufferGeometryLoader,W as ByteType,K as Cache,Q as Camera,X as CameraHelper,j as CanvasTexture,z as CapsuleGeometry,Z as CatmullRomCurve3,J as CineonToneMapping,Y as CircleGeometry,$ as ClampToEdgeWrapping,ee as Clock,te as Color,oe as ColorKeyframeTrack,ne as ColorManagement,re as CompressedArrayTexture,ae as CompressedCubeTexture,ce as CompressedTexture,se as CompressedTextureLoader,ie as ConeGeometry,le as ConstantAlphaFactor,pe as ConstantColorFactor,me as Controls,ue as CubeCamera,de as CubeReflectionMapping,Ce as CubeRefractionMapping,Se as CubeTexture,Te as CubeTextureLoader,ge as CubeUVReflectionMapping,Me as CubicBezierCurve,Fe as CubicBezierCurve3,Ae as CubicInterpolant,Ge as CullFaceBack,he as CullFaceFront,Be as CullFaceFrontBack,_e as CullFaceNone,Re as Curve,Le as CurvePath,ye as CustomBlending,De as CustomToneMapping,fe as CylinderGeometry,Ee as Cylindrical,xe as Data3DTexture,be as DataArrayTexture,Pe as DataTexture,Ie as DataTextureLoader,Ue as DataUtils,Ne as DecrementStencilOp,Oe as DecrementWrapStencilOp,ve as DefaultLoadingManager,ke as DepthFormat,qe as DepthStencilFormat,He as DepthTexture,Ve as DetachedBindMode,we as DirectionalLight,We as DirectionalLightHelper,Ke as DiscreteInterpolant,Qe as DodecahedronGeometry,Xe as DoubleSide,je as DstAlphaFactor,ze as DstColorFactor,Ze as DynamicCopyUsage,Je as DynamicDrawUsage,Ye as DynamicReadUsage,$e as EdgesGeometry,et as EllipseCurve,tt as EqualCompare,ot as EqualDepth,nt as EqualStencilFunc,rt as EquirectangularReflectionMapping,at as EquirectangularRefractionMapping,ct as Euler,st as EventDispatcher,it as ExternalTexture,lt as ExtrudeGeometry,pt as FileLoader,mt as Float16BufferAttribute,ut as Float32BufferAttribute,dt as FloatType,Ct as Fog,St as FogExp2,Tt as FramebufferTexture,gt as FrontSide,Mt as Frustum,Ft as FrustumArray,At as GLBufferAttribute,Gt as GLSL1,ht as GLSL3,Bt as GreaterCompare,_t as GreaterDepth,Rt as GreaterEqualCompare,Lt as GreaterEqualDepth,yt as GreaterEqualStencilFunc,Dt as GreaterStencilFunc,ft as GridHelper,Et as Group,xt as HalfFloatType,bt as HemisphereLight,Pt as HemisphereLightHelper,It as IcosahedronGeometry,Ut as ImageBitmapLoader,Nt as ImageLoader,Ot as ImageUtils,vt as IncrementStencilOp,kt as IncrementWrapStencilOp,qt as InstancedBufferAttribute,Ht as InstancedBufferGeometry,Vt as InstancedInterleavedBuffer,wt as InstancedMesh,Wt as Int16BufferAttribute,Kt as Int32BufferAttribute,Qt as Int8BufferAttribute,Xt as IntType,jt as InterleavedBuffer,zt as InterleavedBufferAttribute,Zt as Interpolant,Jt as InterpolateDiscrete,Yt as InterpolateLinear,$t as InterpolateSmooth,eo as InterpolationSamplingMode,to as InterpolationSamplingType,oo as InvertStencilOp,no as KeepStencilOp,ro as KeyframeTrack,ao as LOD,co as LatheGeometry,so as Layers,io as LessCompare,lo as LessDepth,po as LessEqualCompare,mo as LessEqualDepth,uo as LessEqualStencilFunc,Co as LessStencilFunc,So as Light,To as LightProbe,go as Line,Mo as Line3,Fo as LineBasicMaterial,Ao as LineCurve,Go as LineCurve3,ho as LineDashedMaterial,Bo as LineLoop,_o as LineSegments,Ro as LinearFilter,Lo as LinearInterpolant,yo as LinearMipMapLinearFilter,Do as LinearMipMapNearestFilter,fo as LinearMipmapLinearFilter,Eo as LinearMipmapNearestFilter,xo as LinearSRGBColorSpace,bo as LinearToneMapping,Po as LinearTransfer,Io as Loader,Uo as LoaderUtils,No as LoadingManager,Oo as LoopOnce,vo as LoopPingPong,ko as LoopRepeat,qo as MOUSE,Ho as Material,Vo as MaterialLoader,wo as MathUtils,Wo as Matrix2,Ko as Matrix3,Qo as Matrix4,Xo as MaxEquation,jo as Mesh,zo as MeshBasicMaterial,Zo as MeshDepthMaterial,Jo as MeshDistanceMaterial,Yo as MeshLambertMaterial,$o as MeshMatcapMaterial,en as MeshNormalMaterial,tn as MeshPhongMaterial,on as MeshPhysicalMaterial,nn as MeshStandardMaterial,rn as MeshToonMaterial,an as MinEquation,cn as MirroredRepeatWrapping,sn as MixOperation,ln as MultiplyBlending,pn as MultiplyOperation,mn as NearestFilter,un as NearestMipMapLinearFilter,dn as NearestMipMapNearestFilter,Cn as NearestMipmapLinearFilter,Sn as NearestMipmapNearestFilter,Tn as NeutralToneMapping,gn as NeverCompare,Mn as NeverDepth,Fn as NeverStencilFunc,An as NoBlending,Gn as NoColorSpace,hn as NoToneMapping,Bn as NormalAnimationBlendMode,_n as NormalBlending,Rn as NotEqualCompare,Ln as NotEqualDepth,yn as NotEqualStencilFunc,Dn as NumberKeyframeTrack,fn as Object3D,En as ObjectLoader,xn as ObjectSpaceNormalMap,bn as OctahedronGeometry,Pn as OneFactor,In as OneMinusConstantAlphaFactor,Un as OneMinusConstantColorFactor,Nn as OneMinusDstAlphaFactor,On as OneMinusDstColorFactor,vn as OneMinusSrcAlphaFactor,kn as OneMinusSrcColorFactor,qn as OrthographicCamera,Hn as PCFShadowMap,Vn as PCFSoftShadowMap,wn as PMREMGenerator,Wn as Path,Kn as PerspectiveCamera,Qn as Plane,Xn as PlaneGeometry,jn as PlaneHelper,zn as PointLight,Zn as PointLightHelper,Jn as Points,Yn as PointsMaterial,$n as PolarGridHelper,er as PolyhedronGeometry,tr as PositionalAudio,or as PropertyBinding,nr as PropertyMixer,rr as QuadraticBezierCurve,ar as QuadraticBezierCurve3,cr as Quaternion,sr as QuaternionKeyframeTrack,ir as QuaternionLinearInterpolant,lr as RED_GREEN_RGTC2_Format,pr as RED_RGTC1_Format,mr as REVISION,ur as RGBADepthPacking,dr as RGBAFormat,Cr as RGBAIntegerFormat,Sr as RGBA_ASTC_10x10_Format,Tr as RGBA_ASTC_10x5_Format,gr as RGBA_ASTC_10x6_Format,Mr as RGBA_ASTC_10x8_Format,Fr as RGBA_ASTC_12x10_Format,Ar as RGBA_ASTC_12x12_Format,Gr as RGBA_ASTC_4x4_Format,hr as RGBA_ASTC_5x4_Format,Br as RGBA_ASTC_5x5_Format,_r as RGBA_ASTC_6x5_Format,Rr as RGBA_ASTC_6x6_Format,Lr as RGBA_ASTC_8x5_Format,yr as RGBA_ASTC_8x6_Format,Dr as RGBA_ASTC_8x8_Format,fr as RGBA_BPTC_Format,Er as RGBA_ETC2_EAC_Format,xr as RGBA_PVRTC_2BPPV1_Format,br as RGBA_PVRTC_4BPPV1_Format,Pr as RGBA_S3TC_DXT1_Format,Ir as RGBA_S3TC_DXT3_Format,Ur as RGBA_S3TC_DXT5_Format,Nr as RGBDepthPacking,Or as RGBFormat,vr as RGBIntegerFormat,kr as RGB_BPTC_SIGNED_Format,qr as RGB_BPTC_UNSIGNED_Format,Hr as RGB_ETC1_Format,Vr as RGB_ETC2_Format,wr as RGB_PVRTC_2BPPV1_Format,Wr as RGB_PVRTC_4BPPV1_Format,Kr as RGB_S3TC_DXT1_Format,Qr as RGDepthPacking,Xr as RGFormat,jr as RGIntegerFormat,zr as RawShaderMaterial,Zr as Ray,Jr as Raycaster,Yr as RectAreaLight,$r as RedFormat,ea as RedIntegerFormat,ta as ReinhardToneMapping,oa as RenderTarget,na as RenderTarget3D,ra as RepeatWrapping,aa as ReplaceStencilOp,ca as ReverseSubtractEquation,sa as RingGeometry,ia as SIGNED_RED_GREEN_RGTC2_Format,la as SIGNED_RED_RGTC1_Format,pa as SRGBColorSpace,ma as SRGBTransfer,ua as Scene,da as ShaderChunk,Ca as ShaderLib,Sa as ShaderMaterial,Ta as ShadowMaterial,ga as Shape,Ma as ShapeGeometry,Fa as ShapePath,Aa as ShapeUtils,Ga as ShortType,ha as Skeleton,Ba as SkeletonHelper,_a as SkinnedMesh,Ra as Source,La as Sphere,ya as SphereGeometry,Da as Spherical,fa as SphericalHarmonics3,Ea as SplineCurve,xa as SpotLight,ba as SpotLightHelper,Pa as Sprite,Ia as SpriteMaterial,Ua as SrcAlphaFactor,Na as SrcAlphaSaturateFactor,Oa as SrcColorFactor,va as StaticCopyUsage,ka as StaticDrawUsage,qa as StaticReadUsage,Ha as StereoCamera,Va as StreamCopyUsage,wa as StreamDrawUsage,Wa as StreamReadUsage,Ka as StringKeyframeTrack,Qa as SubtractEquation,Xa as SubtractiveBlending,ja as TOUCH,za as TangentSpaceNormalMap,Za as TetrahedronGeometry,Ja as Texture,Ya as TextureLoader,$a as TextureUtils,ec as Timer,tc as TimestampQuery,oc as TorusGeometry,nc as TorusKnotGeometry,rc as Triangle,ac as TriangleFanDrawMode,cc as TriangleStripDrawMode,sc as TrianglesDrawMode,ic as TubeGeometry,lc as UVMapping,pc as Uint16BufferAttribute,mc as Uint32BufferAttribute,uc as Uint8BufferAttribute,dc as Uint8ClampedBufferAttribute,Cc as Uniform,Sc as UniformsGroup,Tc as UniformsLib,gc as UniformsUtils,Mc as UnsignedByteType,Fc as UnsignedInt101111Type,Ac as UnsignedInt248Type,Gc as UnsignedInt5999Type,hc as UnsignedIntType,Bc as UnsignedShort4444Type,_c as UnsignedShort5551Type,Rc as UnsignedShortType,Lc as VSMShadowMap,yc as Vector2,Dc as Vector3,fc as Vector4,Ec as VectorKeyframeTrack,xc as VideoFrameTexture,bc as VideoTexture,Pc as WebGL3DRenderTarget,Ic as WebGLArrayRenderTarget,Uc as WebGLCoordinateSystem,Nc as WebGLCubeRenderTarget,Oc as WebGLRenderTarget,vc as WebGLRenderer,kc as WebGLUtils,qc as WebGPUCoordinateSystem,Hc as WebXRController,Vc as WireframeGeometry,wc as WrapAroundEnding,Wc as ZeroCurvatureEnding,Kc as ZeroFactor,Qc as ZeroSlopeEnding,Xc as ZeroStencilOp,jc as createCanvasElement,e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let t=null;function n(e){t=e}function o(){return t}export{o as g,n as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s}from"./mounted-authoring-Dmg5xmhP.js";import{s as u}from"./three-CDSueJyJ.js";function f(n,d){const e=d.find(i=>i.mounted.kind==="three");if(!e||e.mounted.kind!=="three")return null;const t=e.mounted.scene,r=e.mounted.authoring;r&&s(t,r),u(t,m(e.id)),n.enterPlayScene(t,e.mounted.rendererConfig);let o=!1;return{worldId:e.id,dispose(){o||(o=!0,n.releaseAdoptedScene(t))}}}function m(n){return n??"main"}export{m as l,f as p};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createNeutralMatcapTexture as d}from"./matcap-texture-CVfalpWT.js";import{an as c,z as p,ap as u,b7 as f,bc as _,F as m,C as M}from"./three.module-D396a9Mn.js";function w(s){return s.color?.clone()??new M(12502993)}function n(s,e){return s[e]??null}class y{_derived=new Map;_normals=new c;_matcap=null;_matcapTexture=null;_overdraw=new p({color:16777215,transparent:!0,opacity:.08,depthTest:!1,depthWrite:!1,blending:f,side:u,toneMapped:!1});render(e,a,r,i=()=>!0){if(a==="solid"){r();return}const l=[];e.traverse(o=>{const t=o;!t.isMesh||!t.material||!i(t)||(l.push({mesh:t,material:t.material}),t.material=Array.isArray(t.material)?t.material.map(h=>this._materialFor(h,a)):this._materialFor(t.material,a))});try{r()}finally{for(const{mesh:o,material:t}of l)o.material=t}}dispose(){for(const e of this._derived.values())e.clay.dispose(),e.unlit.dispose(),e.wireframe.dispose();this._derived.clear(),this._normals.dispose(),this._overdraw.dispose(),this._matcap?.dispose(),this._matcapTexture?.dispose(),this._matcap=null,this._matcapTexture=null}_materialFor(e,a){if(a==="normals")return this._normals;if(a==="overdraw")return this._overdraw;if(a==="matcap")return this._matcap||(this._matcapTexture=d(),this._matcap=new _({matcap:this._matcapTexture,toneMapped:!1})),this._matcap;let r=this._derived.get(e);if(!r){const i={color:w(e),map:n(e,"map"),alphaMap:n(e,"alphaMap"),alphaTest:e.alphaTest,opacity:e.opacity,transparent:e.transparent,side:e.side,depthTest:e.depthTest,depthWrite:e.depthWrite,vertexColors:!!e.vertexColors,fog:e.fog??!0};r={clay:new m({color:11450048,roughness:.82,metalness:0,flatShading:!0,alphaMap:n(e,"alphaMap"),alphaTest:e.alphaTest,opacity:e.opacity,transparent:e.transparent,side:e.side,depthTest:e.depthTest,depthWrite:e.depthWrite}),unlit:new p(i),wireframe:new p({...i,wireframe:!0})},this._derived.set(e,r)}return r[a]}}export{y as ViewportShadingRenderer};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/spark.module-4pXQoz5d.js","assets/three.module-D396a9Mn.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/index-D2fNXpHa.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{aI as U,aM as W,aN as M,aO as Rt,jO as tt,ly as ye,lz as Mt,ki as bs,ks as Ht,kh as xs,lA as we,lB as ve,lC as be,kk as Ss,jQ as Cs,lD as xe,ek as Pt,dG as F,V as At,lE as Wt,lF as Ms,lG as Hs,lH as Ps,lI as As,lJ as Es,e$ as Is,lK as Ts,lL as zs,kn as Se,ko as Ce,kp as Me,bD as He,ao as Et,lM as Os,lN as Ds,lO as Pe,gQ as Ae,bx as Ls,_ as Rs,aH as ks}from"./index-GIL7oGEO.js";import{i as Yt}from"./stage-invalidation-DBg3C3Ta.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{E as Ee,a as Ie,f as js}from"./clip-planes-CnAI6DZn.js";import{e as ce,r as kt}from"./three-CDSueJyJ.js";import{OrbitControls as Fs}from"./OrbitControls-CM3bPray.js";import{l as Gs,V as h,Q as T,t as et,O as Gt,z as X,aZ as ht,bJ as O,B as E,aB as lt,aY as yt,M as m,cs as it,bh as V,ct as pt,H as Q,aQ as $e,a as fe,y as Je,ap as Bt,aX as q,cu as Bs,C as x,r as Y,cv as ts,b0 as _e,cm as es,u as ft,ch as Vs,cl as Xs,b_ as Ws,v as Ys,X as ss,bP as Ns,q as Te,g as K,w as Qs,x as qs,ar as Nt,bU as Zs,D as Us,m as Qt,cw as Ks,cx as $s,cy as Js,cz as ti,cA as ei,bd as si,s as ii,be as oi,bf as ni,h as ri,a1 as ai,j as li,k as ci}from"./three.module-D396a9Mn.js";import{L as is,a as os,b as ns}from"./LineSegments2-CsOpKSiM.js";import{B as hi}from"./three.quarks.esm-B1C61jGo.js";import{b as pi,e as di}from"./live-gesture-lock-DJbrjOqf.js";import{s as ze}from"./viewport-pick-context-DkawXbEi.js";import{f as Oe,v as ui,s as fi}from"./scene-framing-Cat0GtyJ.js";function he(a){const t=U(a,"triggerVolume");if(!t||typeof t!="object")return null;const{radius:e}=t;return typeof e=="number"&&Number.isFinite(e)&&e>0?{radius:e}:null}const $=new et,z=new h,Z=new h,P=new T,De={X:new h(1,0,0),Y:new h(0,1,0),Z:new h(0,0,1)},qt={type:"change"},Le={type:"mouseDown",mode:null},Re={type:"mouseUp",mode:null},ke={type:"objectChange"};class Zt extends Gs{constructor(t,e=null){super(void 0,e);const s=new vi(this);this._root=s;const i=new bi;this._gizmo=i,s.add(i);const o=new xi;this._plane=o,s.add(o);const n=this;function r(b,L){let R=L;Object.defineProperty(n,b,{get:function(){return R!==void 0?R:L},set:function(S){R!==S&&(R=S,o[b]=S,i[b]=S,n.dispatchEvent({type:b+"-changed",value:S}),n.dispatchEvent(qt))}}),n[b]=L,o[b]=L,i[b]=L}r("camera",t),r("object",void 0),r("enabled",!0),r("axis",null),r("mode","translate"),r("translationSnap",null),r("rotationSnap",null),r("scaleSnap",null),r("space","world"),r("size",1),r("dragging",!1),r("showX",!0),r("showY",!0),r("showZ",!0),r("minX",-1/0),r("maxX",1/0),r("minY",-1/0),r("maxY",1/0),r("minZ",-1/0),r("maxZ",1/0);const l=new h,c=new h,d=new T,p=new T,f=new h,u=new T,_=new h,g=new h,y=new h,v=0,w=new h;r("worldPosition",l),r("worldPositionStart",c),r("worldQuaternion",d),r("worldQuaternionStart",p),r("cameraPosition",f),r("cameraQuaternion",u),r("pointStart",_),r("pointEnd",g),r("rotationAxis",y),r("rotationAngle",v),r("eye",w),this._offset=new h,this._startNorm=new h,this._endNorm=new h,this._cameraScale=new h,this._parentPosition=new h,this._parentQuaternion=new T,this._parentQuaternionInv=new T,this._parentScale=new h,this._worldScaleStart=new h,this._worldQuaternionInv=new T,this._worldScale=new h,this._positionStart=new h,this._quaternionStart=new T,this._scaleStart=new h,this._getPointer=_i.bind(this),this._onPointerDown=gi.bind(this),this._onPointerHover=mi.bind(this),this._onPointerMove=yi.bind(this),this._onPointerUp=wi.bind(this),e!==null&&this.connect(e)}connect(t){super.connect(t),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.style.touchAction="auto"}getHelper(){return this._root}pointerHover(t){if(this.object===void 0||this.dragging===!0)return;t!==null&&$.setFromCamera(t,this.camera);const e=Ut(this._gizmo.picker[this.mode],$);e?this.axis=e.object.name:this.axis=null}pointerDown(t){if(!(this.object===void 0||this.dragging===!0||t!=null&&t.button!==0)&&this.axis!==null){t!==null&&$.setFromCamera(t,this.camera);const e=Ut(this._plane,$,!0);e&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(e.point).sub(this.worldPositionStart)),this.dragging=!0,Le.mode=this.mode,this.dispatchEvent(Le)}}pointerMove(t){const e=this.axis,s=this.mode,i=this.object;let o=this.space;if(s==="scale"?o="local":(e==="E"||e==="XYZE"||e==="XYZ")&&(o="world"),i===void 0||e===null||this.dragging===!1||t!==null&&t.button!==-1)return;t!==null&&$.setFromCamera(t,this.camera);const n=Ut(this._plane,$,!0);if(n){if(this.pointEnd.copy(n.point).sub(this.worldPositionStart),s==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),o==="local"&&e!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),e.indexOf("X")===-1&&(this._offset.x=0),e.indexOf("Y")===-1&&(this._offset.y=0),e.indexOf("Z")===-1&&(this._offset.z=0),o==="local"&&e!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),i.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(o==="local"&&(i.position.applyQuaternion(P.copy(this._quaternionStart).invert()),e.search("X")!==-1&&(i.position.x=Math.round(i.position.x/this.translationSnap)*this.translationSnap),e.search("Y")!==-1&&(i.position.y=Math.round(i.position.y/this.translationSnap)*this.translationSnap),e.search("Z")!==-1&&(i.position.z=Math.round(i.position.z/this.translationSnap)*this.translationSnap),i.position.applyQuaternion(this._quaternionStart)),o==="world"&&(i.parent&&i.position.add(z.setFromMatrixPosition(i.parent.matrixWorld)),e.search("X")!==-1&&(i.position.x=Math.round(i.position.x/this.translationSnap)*this.translationSnap),e.search("Y")!==-1&&(i.position.y=Math.round(i.position.y/this.translationSnap)*this.translationSnap),e.search("Z")!==-1&&(i.position.z=Math.round(i.position.z/this.translationSnap)*this.translationSnap),i.parent&&i.position.sub(z.setFromMatrixPosition(i.parent.matrixWorld)))),i.position.x=Math.max(this.minX,Math.min(this.maxX,i.position.x)),i.position.y=Math.max(this.minY,Math.min(this.maxY,i.position.y)),i.position.z=Math.max(this.minZ,Math.min(this.maxZ,i.position.z));else if(s==="scale"){if(e.search("XYZ")!==-1){let r=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(r*=-1),Z.set(r,r,r)}else z.copy(this.pointStart),Z.copy(this.pointEnd),z.applyQuaternion(this._worldQuaternionInv),Z.applyQuaternion(this._worldQuaternionInv),Z.divide(z),e.search("X")===-1&&(Z.x=1),e.search("Y")===-1&&(Z.y=1),e.search("Z")===-1&&(Z.z=1);i.scale.copy(this._scaleStart).multiply(Z),this.scaleSnap&&(e.search("X")!==-1&&(i.scale.x=Math.round(i.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),e.search("Y")!==-1&&(i.scale.y=Math.round(i.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),e.search("Z")!==-1&&(i.scale.z=Math.round(i.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(s==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const r=20/this.worldPosition.distanceTo(z.setFromMatrixPosition(this.camera.matrixWorld));let l=!1;e==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(z.copy(this.rotationAxis).cross(this.eye))*r):(e==="X"||e==="Y"||e==="Z")&&(this.rotationAxis.copy(De[e]),z.copy(De[e]),o==="local"&&z.applyQuaternion(this.worldQuaternion),z.cross(this.eye),z.length()===0?l=!0:this.rotationAngle=this._offset.dot(z.normalize())*r),(e==="E"||l)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),o==="local"&&e!=="E"&&e!=="XYZE"?(i.quaternion.copy(this._quaternionStart),i.quaternion.multiply(P.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),i.quaternion.copy(P.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),i.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(qt),this.dispatchEvent(ke)}}pointerUp(t){t!==null&&t.button!==0||(this.dragging&&this.axis!==null&&(Re.mode=this.mode,this.dispatchEvent(Re)),this.dragging=!1,this.axis=null)}dispose(){this.disconnect(),this._root.dispose()}attach(t){return this.object=t,this._root.visible=!0,this}detach(){return this.object=void 0,this.axis=null,this._root.visible=!1,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(qt),this.dispatchEvent(ke),this.pointStart.copy(this.pointEnd))}getRaycaster(){return $}getMode(){return this.mode}setMode(t){this.mode=t}setTranslationSnap(t){this.translationSnap=t}setRotationSnap(t){this.rotationSnap=t}setScaleSnap(t){this.scaleSnap=t}setSize(t){this.size=t}setSpace(t){this.space=t}setColors(t,e,s,i){const o=this._gizmo.materialLib;o.xAxis.color.set(t),o.yAxis.color.set(e),o.zAxis.color.set(s),o.active.color.set(i),o.xAxisTransparent.color.set(t),o.yAxisTransparent.color.set(e),o.zAxisTransparent.color.set(s),o.activeTransparent.color.set(i),o.xAxis._color&&o.xAxis._color.set(t),o.yAxis._color&&o.yAxis._color.set(e),o.zAxis._color&&o.zAxis._color.set(s),o.active._color&&o.active._color.set(i),o.xAxisTransparent._color&&o.xAxisTransparent._color.set(t),o.yAxisTransparent._color&&o.yAxisTransparent._color.set(e),o.zAxisTransparent._color&&o.zAxisTransparent._color.set(s),o.activeTransparent._color&&o.activeTransparent._color.set(i)}}function _i(a){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:a.button};{const t=this.domElement.getBoundingClientRect();return{x:(a.clientX-t.left)/t.width*2-1,y:-(a.clientY-t.top)/t.height*2+1,button:a.button}}}function mi(a){if(this.enabled)switch(a.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(a));break}}function gi(a){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(a.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(a)),this.pointerDown(this._getPointer(a)))}function yi(a){this.enabled&&this.pointerMove(this._getPointer(a))}function wi(a){this.enabled&&(this.domElement.releasePointerCapture(a.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(a)))}function Ut(a,t,e){const s=t.intersectObject(a,!0);for(let i=0;i<s.length;i++)if(s[i].object.visible||e)return s[i];return!1}const It=new $e,H=new h(0,1,0),je=new h(0,0,0),Fe=new fe,Tt=new T,jt=new T,B=new h,Ge=new fe,_t=new h(1,0,0),st=new h(0,1,0),mt=new h(0,0,1),zt=new h,dt=new h,ut=new h;class vi extends Gt{constructor(t){super(),this.isTransformControlsRoot=!0,this.controls=t,this.visible=!1}updateMatrixWorld(t){const e=this.controls;e.object!==void 0&&(e.object.updateMatrixWorld(),e.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):e.object.parent.matrixWorld.decompose(e._parentPosition,e._parentQuaternion,e._parentScale),e.object.matrixWorld.decompose(e.worldPosition,e.worldQuaternion,e._worldScale),e._parentQuaternionInv.copy(e._parentQuaternion).invert(),e._worldQuaternionInv.copy(e.worldQuaternion).invert()),e.camera.updateMatrixWorld(),e.camera.matrixWorld.decompose(e.cameraPosition,e.cameraQuaternion,e._cameraScale),e.camera.isOrthographicCamera?e.camera.getWorldDirection(e.eye).negate():e.eye.copy(e.cameraPosition).sub(e.worldPosition).normalize(),super.updateMatrixWorld(t)}dispose(){this.traverse(function(t){t.geometry&&t.geometry.dispose(),t.material&&t.material.dispose()})}}class bi extends Gt{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const t=new X({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),e=new ht({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),s=t.clone();s.opacity=.15;const i=e.clone();i.opacity=.5;const o=t.clone();o.color.setHex(16711680);const n=t.clone();n.color.setHex(65280);const r=t.clone();r.color.setHex(255);const l=t.clone();l.color.setHex(16711680),l.opacity=.5;const c=t.clone();c.color.setHex(65280),c.opacity=.5;const d=t.clone();d.color.setHex(255),d.opacity=.5;const p=t.clone();p.opacity=.25;const f=t.clone();f.color.setHex(16776960),f.opacity=.25;const u=t.clone();u.color.setHex(16776960);const _=t.clone();_.color.setHex(7895160),this.materialLib={xAxis:o,yAxis:n,zAxis:r,active:u,xAxisTransparent:l,yAxisTransparent:c,zAxisTransparent:d,activeTransparent:f};const g=new O(0,.04,.1,12);g.translate(0,.05,0);const y=new E(.08,.08,.08);y.translate(0,.04,0);const v=new lt;v.setAttribute("position",new yt([0,0,0,1,0,0],3));const w=new O(.0075,.0075,.5,3);w.translate(0,.25,0);function b(k,bt){const j=new pt(k,.0075,3,64,bt*Math.PI*2);return j.rotateY(Math.PI/2),j.rotateX(Math.PI/2),j}function L(){const k=new lt;return k.setAttribute("position",new yt([0,0,0,1,1,1],3)),k}const R={X:[[new m(g,o),[.5,0,0],[0,0,-Math.PI/2]],[new m(g,o),[-.5,0,0],[0,0,Math.PI/2]],[new m(w,o),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new m(g,n),[0,.5,0]],[new m(g,n),[0,-.5,0],[Math.PI,0,0]],[new m(w,n)]],Z:[[new m(g,r),[0,0,.5],[Math.PI/2,0,0]],[new m(g,r),[0,0,-.5],[-Math.PI/2,0,0]],[new m(w,r),null,[Math.PI/2,0,0]]],XYZ:[[new m(new it(.1,0),p),[0,0,0]]],XY:[[new m(new E(.15,.15,.01),d),[.15,.15,0]]],YZ:[[new m(new E(.15,.15,.01),l),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new m(new E(.15,.15,.01),c),[.15,0,.15],[-Math.PI/2,0,0]]]},S={X:[[new m(new O(.2,0,.6,4),s),[.3,0,0],[0,0,-Math.PI/2]],[new m(new O(.2,0,.6,4),s),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new m(new O(.2,0,.6,4),s),[0,.3,0]],[new m(new O(.2,0,.6,4),s),[0,-.3,0],[0,0,Math.PI]]],Z:[[new m(new O(.2,0,.6,4),s),[0,0,.3],[Math.PI/2,0,0]],[new m(new O(.2,0,.6,4),s),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new m(new it(.2,0),s)]],XY:[[new m(new E(.2,.2,.01),s),[.15,.15,0]]],YZ:[[new m(new E(.2,.2,.01),s),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new m(new E(.2,.2,.01),s),[.15,0,.15],[-Math.PI/2,0,0]]]},C={START:[[new m(new it(.01,2),i),null,null,null,"helper"]],END:[[new m(new it(.01,2),i),null,null,null,"helper"]],DELTA:[[new V(L(),i),null,null,null,"helper"]],X:[[new V(v,i),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new V(v,i),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new V(v,i),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},A={XYZE:[[new m(b(.5,1),_),null,[0,Math.PI/2,0]]],X:[[new m(b(.5,.5),o)]],Y:[[new m(b(.5,.5),n),null,[0,0,-Math.PI/2]]],Z:[[new m(b(.5,.5),r),null,[0,Math.PI/2,0]]],E:[[new m(b(.75,1),f),null,[0,Math.PI/2,0]]]},I={AXIS:[[new V(v,i),[-1e3,0,0],null,[1e6,1,1],"helper"]]},vt={XYZE:[[new m(new Q(.25,10,8),s)]],X:[[new m(new pt(.5,.1,4,24),s),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new m(new pt(.5,.1,4,24),s),[0,0,0],[Math.PI/2,0,0]]],Z:[[new m(new pt(.5,.1,4,24),s),[0,0,0],[0,0,-Math.PI/2]]],E:[[new m(new pt(.75,.1,2,24),s)]]},gs={X:[[new m(y,o),[.5,0,0],[0,0,-Math.PI/2]],[new m(w,o),[0,0,0],[0,0,-Math.PI/2]],[new m(y,o),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new m(y,n),[0,.5,0]],[new m(w,n)],[new m(y,n),[0,-.5,0],[0,0,Math.PI]]],Z:[[new m(y,r),[0,0,.5],[Math.PI/2,0,0]],[new m(w,r),[0,0,0],[Math.PI/2,0,0]],[new m(y,r),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new m(new E(.15,.15,.01),d),[.15,.15,0]]],YZ:[[new m(new E(.15,.15,.01),l),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new m(new E(.15,.15,.01),c),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new m(new E(.1,.1,.1),p)]]},ys={X:[[new m(new O(.2,0,.6,4),s),[.3,0,0],[0,0,-Math.PI/2]],[new m(new O(.2,0,.6,4),s),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new m(new O(.2,0,.6,4),s),[0,.3,0]],[new m(new O(.2,0,.6,4),s),[0,-.3,0],[0,0,Math.PI]]],Z:[[new m(new O(.2,0,.6,4),s),[0,0,.3],[Math.PI/2,0,0]],[new m(new O(.2,0,.6,4),s),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new m(new E(.2,.2,.01),s),[.15,.15,0]]],YZ:[[new m(new E(.2,.2,.01),s),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new m(new E(.2,.2,.01),s),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new m(new E(.2,.2,.2),s),[0,0,0]]]},ws={X:[[new V(v,i),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new V(v,i),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new V(v,i),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function N(k){const bt=new Gt;for(const j in k)for(let ot=k[j].length;ot--;){const D=k[j][ot][0].clone(),xt=k[j][ot][1],St=k[j][ot][2],Ct=k[j][ot][3],vs=k[j][ot][4];D.name=j,D.tag=vs,xt&&D.position.set(xt[0],xt[1],xt[2]),St&&D.rotation.set(St[0],St[1],St[2]),Ct&&D.scale.set(Ct[0],Ct[1],Ct[2]),D.updateMatrix();const ge=D.geometry.clone();ge.applyMatrix4(D.matrix),D.geometry=ge,D.renderOrder=1/0,D.position.set(0,0,0),D.rotation.set(0,0,0),D.scale.set(1,1,1),bt.add(D)}return bt}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=N(R)),this.add(this.gizmo.rotate=N(A)),this.add(this.gizmo.scale=N(gs)),this.add(this.picker.translate=N(S)),this.add(this.picker.rotate=N(vt)),this.add(this.picker.scale=N(ys)),this.add(this.helper.translate=N(C)),this.add(this.helper.rotate=N(I)),this.add(this.helper.scale=N(ws)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(t){const s=(this.mode==="scale"?"local":this.space)==="local"?this.worldQuaternion:jt;this.gizmo.translate.visible=this.mode==="translate",this.gizmo.rotate.visible=this.mode==="rotate",this.gizmo.scale.visible=this.mode==="scale",this.helper.translate.visible=this.mode==="translate",this.helper.rotate.visible=this.mode==="rotate",this.helper.scale.visible=this.mode==="scale";let i=[];i=i.concat(this.picker[this.mode].children),i=i.concat(this.gizmo[this.mode].children),i=i.concat(this.helper[this.mode].children);for(let o=0;o<i.length;o++){const n=i[o];n.visible=!0,n.rotation.set(0,0,0),n.position.copy(this.worldPosition);let r;if(this.camera.isOrthographicCamera?r=(this.camera.top-this.camera.bottom)/this.camera.zoom:r=this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),n.scale.set(1,1,1).multiplyScalar(r*this.size/4),n.tag==="helper"){n.visible=!1,n.name==="AXIS"?(n.visible=!!this.axis,this.axis==="X"&&(P.setFromEuler(It.set(0,0,0)),n.quaternion.copy(s).multiply(P),Math.abs(H.copy(_t).applyQuaternion(s).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="Y"&&(P.setFromEuler(It.set(0,0,Math.PI/2)),n.quaternion.copy(s).multiply(P),Math.abs(H.copy(st).applyQuaternion(s).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="Z"&&(P.setFromEuler(It.set(0,Math.PI/2,0)),n.quaternion.copy(s).multiply(P),Math.abs(H.copy(mt).applyQuaternion(s).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="XYZE"&&(P.setFromEuler(It.set(0,Math.PI/2,0)),H.copy(this.rotationAxis),n.quaternion.setFromRotationMatrix(Fe.lookAt(je,H,st)),n.quaternion.multiply(P),n.visible=this.dragging),this.axis==="E"&&(n.visible=!1)):n.name==="START"?(n.position.copy(this.worldPositionStart),n.visible=this.dragging):n.name==="END"?(n.position.copy(this.worldPosition),n.visible=this.dragging):n.name==="DELTA"?(n.position.copy(this.worldPositionStart),n.quaternion.copy(this.worldQuaternionStart),z.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),z.applyQuaternion(this.worldQuaternionStart.clone().invert()),n.scale.copy(z),n.visible=this.dragging):(n.quaternion.copy(s),this.dragging?n.position.copy(this.worldPositionStart):n.position.copy(this.worldPosition),this.axis&&(n.visible=this.axis.search(n.name)!==-1));continue}n.quaternion.copy(s),this.mode==="translate"||this.mode==="scale"?(n.name==="X"&&Math.abs(H.copy(_t).applyQuaternion(s).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="Y"&&Math.abs(H.copy(st).applyQuaternion(s).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="Z"&&Math.abs(H.copy(mt).applyQuaternion(s).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="XY"&&Math.abs(H.copy(mt).applyQuaternion(s).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="YZ"&&Math.abs(H.copy(_t).applyQuaternion(s).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="XZ"&&Math.abs(H.copy(st).applyQuaternion(s).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1)):this.mode==="rotate"&&(Tt.copy(s),H.copy(this.eye).applyQuaternion(P.copy(s).invert()),n.name.search("E")!==-1&&n.quaternion.setFromRotationMatrix(Fe.lookAt(this.eye,je,st)),n.name==="X"&&(P.setFromAxisAngle(_t,Math.atan2(-H.y,H.z)),P.multiplyQuaternions(Tt,P),n.quaternion.copy(P)),n.name==="Y"&&(P.setFromAxisAngle(st,Math.atan2(H.x,H.z)),P.multiplyQuaternions(Tt,P),n.quaternion.copy(P)),n.name==="Z"&&(P.setFromAxisAngle(mt,Math.atan2(H.y,H.x)),P.multiplyQuaternions(Tt,P),n.quaternion.copy(P))),n.visible=n.visible&&(n.name.indexOf("X")===-1||this.showX),n.visible=n.visible&&(n.name.indexOf("Y")===-1||this.showY),n.visible=n.visible&&(n.name.indexOf("Z")===-1||this.showZ),n.visible=n.visible&&(n.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),n.material._color=n.material._color||n.material.color.clone(),n.material._opacity=n.material._opacity||n.material.opacity,n.material.color.copy(n.material._color),n.material.opacity=n.material._opacity,this.enabled&&this.axis&&(n.name===this.axis?(n.material.color.copy(this.materialLib.active.color),n.material.opacity=1):this.axis.split("").some(function(l){return n.name===l})&&(n.material.color.copy(this.materialLib.active.color),n.material.opacity=1))}super.updateMatrixWorld(t)}}class xi extends m{constructor(){super(new Je(1e5,1e5,2,2),new X({visible:!1,wireframe:!0,side:Bt,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(t){let e=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(e="local"),zt.copy(_t).applyQuaternion(e==="local"?this.worldQuaternion:jt),dt.copy(st).applyQuaternion(e==="local"?this.worldQuaternion:jt),ut.copy(mt).applyQuaternion(e==="local"?this.worldQuaternion:jt),H.copy(dt),this.mode){case"translate":case"scale":switch(this.axis){case"X":H.copy(this.eye).cross(zt),B.copy(zt).cross(H);break;case"Y":H.copy(this.eye).cross(dt),B.copy(dt).cross(H);break;case"Z":H.copy(this.eye).cross(ut),B.copy(ut).cross(H);break;case"XY":B.copy(ut);break;case"YZ":B.copy(zt);break;case"XZ":H.copy(ut),B.copy(dt);break;case"XYZ":case"E":B.set(0,0,0);break}break;case"rotate":default:B.set(0,0,0)}B.length()===0?this.quaternion.copy(this.cameraQuaternion):(Ge.lookAt(z.set(0,0,0),B,H),this.quaternion.setFromRotationMatrix(Ge)),super.updateMatrixWorld(t)}}const Kt=new x(4441855),Ot=new x(16758858),Dt=new x(14185983),Si=new x(16731496),Be=new x(16777215);function $t(a){return new V(new lt,new ht({color:a,depthTest:!1,depthWrite:!1,transparent:!0,toneMapped:!1}))}function Jt(a,t){return new m(a,new X({color:t,depthTest:!1,depthWrite:!1,transparent:!0,toneMapped:!1}))}function te(a,t){if(a.visible=t.length>1,!a.visible)return;let e=a.geometry.getAttribute("position");(!e||e.count!==t.length)&&(e=new yt(t.length*3,3),a.geometry.setAttribute("position",e));for(let s=0;s<t.length;s++)e.setXYZ(s,t[s].x,t[s].y,t[s].z);e.needsUpdate=!0,a.geometry.computeBoundingSphere()}class Ci extends q{constructor(t){super(),this.source=t,this.name="Constraint Helper",this.renderOrder=999,W(this,"editorHelper",!0),W(this,"editorHelperType","constraints"),this.layers.set(M),this.refreshStructure()}selected=!1;hoveredControl=null;selectedObjects=new Set;visuals=[];setSelected(t){this.selected=t}setSelectedObjects(t){this.selectedObjects=t}controlMeshes(){return this.visuals.flatMap(t=>[t.targetHit,t.poleHit].filter(e=>e.visible))}presents(t){return t===this.source?!0:this.visuals.some(e=>{const s=e.mark.getSnapshot();return t===s.target||t===s.pole})}controlFor(t){for(const e of this.visuals){const s=e.mark.getSnapshot();if((t===e.target||t===e.targetHit)&&s.target)return{kind:"target",label:s.target.name||`${e.mark.config.label} target`,object:s.target,mesh:e.target};if((t===e.pole||t===e.poleHit)&&s.pole)return{kind:"pole",label:s.pole.name||`${e.mark.config.label} pole`,object:s.pole,mesh:e.pole}}return null}setHoveredControl(t){this.hoveredControl=t}update(t){this.refreshStructure();for(const e of this.visuals)this.updateVisual(e,t)}dispose(){this.clearVisuals(),this.removeFromParent()}refreshStructure(){const t=ce(this.source);t.length===this.visuals.length&&t.every((s,i)=>{const o=s.getSnapshot(),n=o.chain.length>0?o.chain.length:o.constrained?1:0;return this.visuals[i]?.mark===s&&this.visuals[i]?.positions.length===n})||(this.clearVisuals(),this.visuals=t.map(s=>this.makeVisual(s)))}makeVisual(t){const e=t.getSnapshot(),s=e.chain.length>0?e.chain:e.constrained?[e.constrained]:[],i=$t(Kt),o=$t(Ot),n=$t(Dt),r=s.map(()=>Jt(new Q(.035,10,7),Kt)),l=Jt(new it(.085),Ot),c=Jt(new Bs(.075),Dt),d=new X({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1,colorWrite:!1}),p=new m(new Q(.16,10,7),d),f=new m(new Q(.15,10,7),d.clone());for(const u of[i,o,n,...r,l,c,p,f])u.renderOrder=this.renderOrder,u.layers.set(M),this.add(u);return{mark:t,chain:i,targetLine:o,poleLine:n,joints:r,target:l,pole:c,targetHit:p,poleHit:f,positions:s.map(()=>new h),targetPosition:new h,polePosition:new h}}updateVisual(t,e){const s=t.mark.getSnapshot(),i=s.chain.length>0?s.chain:s.constrained?[s.constrained]:[];for(let f=0;f<i.length;f++)i[f].getWorldPosition(t.positions[f]);te(t.chain,t.positions);for(let f=0;f<t.joints.length;f++){const u=t.joints[f],_=t.positions[f];u.visible=!!_,_&&(u.position.copy(_),u.scale.setScalar(this.handleScale(e,_)))}const o=t.positions.at(-1),n=s.target?.getWorldPosition(t.targetPosition)??null,r=s.pole?.getWorldPosition(t.polePosition)??null;te(t.targetLine,o&&n?[o,n]:[]),te(t.poleLine,t.positions[0]&&r?[t.positions[0],r]:[]),t.target.visible=n!==null,n&&(t.target.position.copy(n),t.target.scale.setScalar(this.handleScale(e,n)*(this.hoveredControl===t.target?1.22:1))),t.targetHit.visible=n!==null,n&&(t.targetHit.position.copy(n),t.targetHit.scale.copy(t.target.scale)),t.pole.visible=r!==null,r&&(t.pole.position.copy(r),t.pole.scale.setScalar(this.handleScale(e,r)*(this.hoveredControl===t.pole?1.22:1))),t.poleHit.visible=r!==null,r&&(t.poleHit.position.copy(r),t.poleHit.scale.copy(t.pole.scale));const l=s.status==="error"||s.status==="unresolved",c=this.selected?1:.52;for(const f of[t.chain,...t.joints]){const u=f.material;u.color.copy(l?Si:Kt),u.opacity=c}const d=this.hoveredControl===t.target||s.target!==null&&this.selectedObjects.has(s.target),p=this.hoveredControl===t.pole||s.pole!==null&&this.selectedObjects.has(s.pole);t.target.material.color.copy(d?Be:Ot),t.pole.material.color.copy(p?Be:Dt),t.targetLine.material.color.copy(Ot),t.poleLine.material.color.copy(Dt),t.targetLine.material.opacity=c,t.poleLine.material.opacity=c,t.target.material.opacity=d?1:c,t.pole.material.opacity=p?1:c}handleScale(t,e){return Y.clamp(t.position.distanceTo(e)/8,.65,4)}clearVisuals(){for(const t of[...this.children]){t.removeFromParent();const e=t;e.geometry.dispose();const s=Array.isArray(e.material)?e.material:[e.material];for(const i of s)i.dispose()}this.visuals=[],this.hoveredControl=null}}const Mi=new x(4892927),Hi=new x(7718143),Pi=new x(16758858),Ai=new x(16777215);class Ei extends q{constructor(t){super(),this.source=t,this.name="Reflection Probe Helper",this.matrixAutoUpdate=!1,this.renderOrder=998,W(this,"editorHelper",!0),W(this,"editorHelperType","reflection-probes"),this.layers.set(M),this.refresh(!0)}signature="";selected=!1;setSelected(t){this.selected!==t&&(this.selected=t,this.refresh(!0))}update(){this.refresh(!1),this.source.updateWorldMatrix(!0,!1),this.matrix.copy(this.source.matrixWorld),this.matrixWorldNeedsUpdate=!0}dispose(){this.clearVisuals(),this.removeFromParent()}refresh(t){const e=kt(this.source);if(!e)return;const s=e.config,i=JSON.stringify(s);if(!t&&i===this.signature)return;this.signature=i,this.clearVisuals();const o=this.selected?Hi:Mi,n=this.selected?1:.62,r=Math.max(0,s.blendDistance);if(s.shape==="sphere"){const c=Math.max(.01,s.radius);this.addWire(new Q(c,24,16),o,n),r>0&&c-r>.01&&this.addWire(new Q(c-r,20,12),o,this.selected?.55:.28)}else{const[c,d,p]=s.size.map(u=>Math.max(.01,u));this.addWire(new E(c,d,p),o,n);const f=[c-r*2,d-r*2,p-r*2];r>0&&f.every(u=>u>.01)&&this.addWire(new E(f[0],f[1],f[2]),o,this.selected?.55:.28)}if(s.parallaxProjection){const[c,d,p]=s.parallaxSize.map(u=>Math.max(.01,u));this.addWire(new E(c,d,p),Pi,this.selected?.9:.45).position.fromArray(s.parallaxOffset)}this.addWire(new it(this.selected?.16:.11),Ai,this.selected?1:.72).position.fromArray(s.captureOffset),this.traverse(c=>c.layers.set(M))}addWire(t,e,s){const i=new ts(t);t.dispose();const o=new ht({color:e,depthTest:!1,transparent:!0,opacity:s,toneMapped:!1}),n=new _e(i,o);return n.renderOrder=this.renderOrder,this.add(n),n}clearVisuals(){for(const t of[...this.children]){t.removeFromParent();const e=t;e.geometry?.dispose();const s=Array.isArray(e.material)?e.material:[e.material];for(const i of s)i?.dispose()}}}const me=new WeakMap,rs=new Q(1,12,8);function ct(a){return new h(a[0],a[1],a[2])}function wt(a){const t={color:a.color,transparent:!0,opacity:a.opacity??.68,depthTest:!1};return a.dashed?new es({...t,dashSize:.18,gapSize:.12}):new ht(t)}function G(a,t,e,s=!1){const i=s&&t.length>0?[...t,t[0]]:[...t],o=new V(new lt().setFromPoints(i),e);o.renderOrder=997,o.layers.set(M),e instanceof es&&o.computeLineDistances(),a.add(o)}function Ft(a,t,e,s,i=64){const o=[];for(let n=0;n<i;n++){const r=n/i*Math.PI*2;o.push(a.clone().addScaledVector(e,Math.cos(r)*t).addScaledVector(s,Math.sin(r)*t))}return o}function Ii(a){const t=new q,e=ct(a.center),s=wt(a);return G(t,Ft(e,a.radius,new h(1,0,0),new h(0,1,0)),s,!0),G(t,Ft(e,a.radius,new h(1,0,0),new h(0,0,1)),s,!0),G(t,Ft(e,a.radius,new h(0,1,0),new h(0,0,1)),s,!0),t}function Ti(a){const t=new q;return G(t,a.points.map(ct),wt(a)),t}function zi(a){const t=new q,e=ct(a.origin),s=ct(a.direction).normalize(),i=Math.abs(s.y)<.9?new h(0,1,0):new h(1,0,0),o=new h().crossVectors(i,s).normalize(),n=new h().crossVectors(s,o).normalize(),r=Y.degToRad(Math.max(0,Math.min(360,a.angle))/2),l=wt(a),c=[];for(let d=0;d<64;d++){const p=d/64*Math.PI*2,f=o.clone().multiplyScalar(Math.cos(p)).addScaledVector(n,Math.sin(p));c.push(e.clone().addScaledVector(s,Math.cos(r)*a.length).addScaledVector(f,Math.sin(r)*a.length))}G(t,c,l,!0);for(const d of[0,16,32,48])G(t,[e,c[d]],l);return t}function Oi(a,t,e){return a.applyQuaternion(new T(...e)).add(new h(...t))}function Di(a){const t=new q,e=wt(a),[s,i,o]=a.halfExtents,n=[[-s,-i,-o],[s,-i,-o],[s,i,-o],[-s,i,-o],[-s,-i,o],[s,-i,o],[s,i,o],[-s,i,o]].map(([r,l,c])=>Oi(new h(r,l,c),a.center,a.rotation));for(const[r,l]of[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[1,5],[2,6],[3,7]])G(t,[n[r],n[l]],e);return t}function Li(a){const t=new q,e=wt(a),s=new T(...a.rotation),i=ct(a.center),o=r=>r.applyQuaternion(s).add(i),n=(r,l,c)=>Ft(new h(0,r,0),a.radius,l,c).map(o);G(t,n(a.halfHeight,new h(1,0,0),new h(0,0,1)),e,!0),G(t,n(-a.halfHeight,new h(1,0,0),new h(0,0,1)),e,!0);for(const[r,l]of[[a.radius,0],[-a.radius,0],[0,a.radius],[0,-a.radius]])G(t,[o(new h(r,-a.halfHeight,l)),o(new h(r,a.halfHeight,l))],e);for(const r of["x","z"]){const l=[];for(let c=0;c<=32;c++){const d=c/32*Math.PI,p=new h(0,a.halfHeight+Math.sin(d)*a.radius,0);p[r]=Math.cos(d)*a.radius,l.push(o(p))}for(let c=0;c<=32;c++){const d=Math.PI+c/32*Math.PI,p=new h(0,-a.halfHeight+Math.sin(d)*a.radius,0);p[r]=Math.cos(d)*a.radius,l.push(o(p))}G(t,l,e)}return t}function Ri(a){const t=a.kind==="line"?Ti(a):a.kind==="sphere"?Ii(a):a.kind==="cone"?zi(a):a.kind==="box"?Di(a):Li(a);return t.layers.set(M),t.traverse(e=>e.layers.set(M)),t}function ki(a,t){const e=new X({color:t.color,depthTest:!1,transparent:!0,opacity:t.writable?.92:.35}),s=new m(rs,e);return Object.defineProperty(s,"isSpatialHandleMesh",{value:!0}),s.position.copy(ct(t.position)),s.renderOrder=998,s.layers.set(M),me.set(s,{nodeId:a,handle:t}),s}function ji(a,t){const e=[],s=[];for(const i of t){for(const o of i.guides)e.push(Ri(o));for(const o of i.handles){const n=ki(a,o);e.push(n),s.push(n)}}return{roots:e,handles:s}}function Ve(a){return me.get(a)??null}function ee(a,t){const e=me.get(a);a.material.color.set(t&&e?.handle.writable?"#ffffff":e?.handle.color??"#ffffff")}function Xe(a,t){const e=a.position.distanceTo(t.position);a.scale.setScalar(Math.max(.025,e*.012))}function Fi(a,t,e){const s=a,i=s.geometry;i&&i!==rs&&!t.has(i)&&(i.dispose(),t.add(i));const o=Array.isArray(s.material)?s.material:s.material?[s.material]:[];for(const n of o)e.has(n)||(n.dispose(),e.add(n))}function We(a){const t=new Set,e=new Set;for(const s of a)s.removeFromParent(),s.traverse(i=>Fi(i,t,e))}function se(a,t,e,s=1.15){if(a.isEmpty())return 3;const i=e.clone().normalize(),o=Math.abs(i.dot(t.up))>.999?new h(0,0,1):t.up,n=new h().crossVectors(o,i).normalize(),r=new h().crossVectors(i,n).normalize(),l=a.getCenter(new h);let c=0,d=0,p=0;for(const g of[a.min.x,a.max.x])for(const y of[a.min.y,a.max.y])for(const v of[a.min.z,a.max.z]){const w=new h(g,y,v).sub(l);p=Math.max(p,Math.abs(w.dot(n))),d=Math.max(d,Math.abs(w.dot(r))),c=Math.max(c,Math.abs(w.dot(i)))}const f=Y.degToRad(t.fov*.5),u=Math.atan(Math.tan(f)*Math.max(t.aspect,.01)),_=Math.max(d/Math.tan(f),p/Math.tan(u));return Math.max(_*s+c,t.near*4,.01)}const Gi=3,Bi=.05,Vi=.03,Xi=.6,Wi=.15,Yi=.08,Ni=3,Qi=.45,qi=.001,Zi=24,Ui=6,Ki=[[0,0,0],[0,0,1],[0,1,0],[0,1,1],[1,0,0],[1,0,1],[1,1,0],[1,1,1]];function ie(a){const t=Y.clamp(a*Wi,Yi,Ni);return Math.max(Math.min(t,a*Qi),qi)}function oe(a){return Y.clamp(a*Bi,Vi,Xi)}function $i(a,t){const{min:e,max:s}=a,i=ie(s.x-e.x),o=ie(s.y-e.y),n=ie(s.z-e.z);let r=0;for(const[l,c,d]of Ki){const p=l===0?e.x:s.x,f=c===0?e.y:s.y,u=d===0?e.z:s.z,_=l===0?i:-i,g=c===0?o:-o,y=d===0?n:-n;t[r++]=p,t[r++]=f,t[r++]=u,t[r++]=p+_,t[r++]=f,t[r++]=u,t[r++]=p,t[r++]=f,t[r++]=u,t[r++]=p,t[r++]=f+g,t[r++]=u,t[r++]=p,t[r++]=f,t[r++]=u,t[r++]=p,t[r++]=f,t[r++]=u+y}}class ne extends is{entityObject;_fixedSize;_positions=new Float32Array(Zi*Ui);_box=new ft;_worldPos=new h;_fixedExtent=new h;_standoff=new h;_lastRootMatrix=new Float32Array(16);_requiresContinuousBounds;constructor(t,e){const s=new os,i=new ns({color:e.color,linewidth:Gi,worldUnits:!1,alphaToCoverage:!0,toneMapped:!1,depthTest:!1,depthWrite:!1});super(s,i),this.entityObject=t,this._fixedSize=e.fixedSize;let o=!1;t.traverse(n=>{const r=n;(n.isSkinnedMesh||Array.isArray(r.morphTargetInfluences)&&r.morphTargetInfluences.length>0||n.userData._animMixer)&&(o=!0)}),this._requiresContinuousBounds=o,this.renderOrder=1,this.frustumCulled=!1,s.setPositions(this._positions),this.update()}setColor(t){this.material.color.setHex(t)}updateIfNeeded(){this.entityObject.updateWorldMatrix(!0,!1);const t=this.entityObject.matrixWorld.elements;let e=!1;for(let s=0;s<t.length;s++)if(t[s]!==this._lastRootMatrix[s]){e=!0;break}(e||this._requiresContinuousBounds)&&this.update()}update(){if(this.entityObject.updateWorldMatrix(!0,!1),this._fixedSize!==void 0)this.entityObject.getWorldPosition(this._worldPos),this._fixedExtent.setScalar(this._fixedSize),this._box.setFromCenterAndSize(this._worldPos,this._fixedExtent);else if(Rt(this.entityObject,this._box),this._box.isEmpty())return;this._box.getSize(this._standoff),this._standoff.set(oe(this._standoff.x),oe(this._standoff.y),oe(this._standoff.z)),this._box.expandByVector(this._standoff),$i(this._box,this._positions);const t=this.geometry.getAttribute("instanceStart");t&&(t.data.needsUpdate=!0),this._lastRootMatrix.set(this.entityObject.matrixWorld.elements)}dispose(){this.geometry.dispose(),this.material.dispose()}}function No({BlendFunction:a,KernelSize:t,OutlineEffect:e},s,i,o){const n=Ji(()=>new e(s,i,{blendFunction:a.ALPHA,visibleEdgeColor:o.visible,hiddenEdgeColor:o.hidden,edgeStrength:5,pulseSpeed:0,blur:!0,kernelSize:t.MEDIUM,resolutionScale:.5,xRay:!0}));return n.selectionLayer=ye,i.layers.disable(ye),n}function Ji(a){const t=console.warn;console.warn=(...e)=>{e[0]!=="Layer out of range, resetting to 2"&&t.apply(console,e)};try{return a()}finally{console.warn=t}}function Qo(a,t){a.visibleEdgeColor.setHex(t.visible),a.hiddenEdgeColor.setHex(t.hidden)}function to(a){return a.isBone?!1:a.isMesh||a.isLine||a.isPoints||a.isSprite}function as(a){const t=[],e=new Set;for(const s of a)s.isBone||s.traverse(i=>{e.has(i)||tt(i)||!to(i)||(e.add(i),t.push(i))});return t}function qo(a,t){const e=as(t);a.selection.size===e.length&&e.every(s=>a.selection.has(s))||a.selection.set(e)}function Ye(a,t){const e=new x(a);if(!t||t.toneMapping===Vs)return e;const s=t.toneMappingExposure||1;if(t.toneMapping===Xs)return e.multiplyScalar(1/s);if(t.toneMapping===Ws)return eo(e,s);if(t.toneMapping!==Ys)return e;const i=[[.59719,.35458,.04823],[.076,.90834,.01566],[.0284,.13383,.83777]],o=[[1.60475,-.53108,-.07367],[-.10208,1.10813,-.00605],[-.00327,-.07276,1.07602]],n=p=>(p*(p+.0245786)-90537e-9)/(p*(.983729*p+.432951)+.238081),r=p=>{let f=0,u=64;for(let _=0;_<60;_++){const g=(f+u)/2;n(g)<p?f=g:u=g}return(f+u)/2},c=nt(Vt(o),[e.r,e.g,e.b]).map(p=>p<=0?0:r(Math.min(p,.999))),d=nt(Vt(i),c).map(p=>Math.max(0,p)*(.6/s));return new x().setRGB(d[0],d[1],d[2],ss)}function eo(a,t){const e=[[.6274,.3293,.0433],[.0691,.9195,.0113],[.0164,.088,.8956]],s=[[1.6605,-.5876,-.0728],[-.1246,1.1329,-.0083],[-.0182,-.1006,1.1187]],i=[[.856627153315983,.0951212405381588,.0482516061458583],[.137318972929847,.761241990602591,.101439036467562],[.11189821299995,.0767994186031903,.811302368396859]],o=[[1.1271005818144368,-.11060664309660323,-.016493938717834573],[-.1413297634984383,1.157823702216272,-.016493938717834257],[-.14132976349843826,-.11060664309660294,1.2519364065950405]],n=-12.47393,r=4.026069,l=_=>{const g=_*_,y=g*g;return 15.5*y*g-40.14*y*_+31.96*y-6.868*g*_+.4298*g+.1191*_-.00232},c=_=>{let g=0,y=1;for(let v=0;v<60;v++){const w=(g+y)/2;l(w)<_?g=w:y=w}return(g+y)/2},d=nt(e,[a.r,a.g,a.b]),f=nt(Vt(o),d.map(_=>Math.max(0,_)**(1/2.2))).map(_=>2**(c(_)*(r-n)+n)),u=nt(s,nt(Vt(i),f)).map(_=>Math.max(0,_)/t);return new x().setRGB(u[0],u[1],u[2],ss)}function nt(a,t){return[a[0][0]*t[0]+a[0][1]*t[1]+a[0][2]*t[2],a[1][0]*t[0]+a[1][1]*t[1]+a[1][2]*t[2],a[2][0]*t[0]+a[2][1]*t[1]+a[2][2]*t[2]]}function Vt(a){const[[t,e,s],[i,o,n],[r,l,c]]=a,d=o*c-n*l,p=-(i*c-n*r),f=i*l-o*r,u=t*d+e*p+s*f;return[[d/u,-(e*c-s*l)/u,(e*n-s*o)/u],[p/u,(t*c-s*r)/u,-(t*n-s*i)/u],[f/u,-(t*l-e*r)/u,(t*o-e*i)/u]]}const so=new x(5231045),io=new x(10481896),Ne=64,oo=.6;class no extends q{constructor(t){super(),this.source=t,this.name="Trigger Volume Helper",this.matrixAutoUpdate=!1,this.renderOrder=998,W(this,"editorHelper",!0),W(this,"editorHelperType","trigger-volumes"),this.layers.set(M),this.refresh(!0)}signature="";selected=!1;setSelected(t){this.selected!==t&&(this.selected=t,this.refresh(!0))}update(){this.refresh(!1),this.source.updateWorldMatrix(!0,!1),this.matrix.copy(this.source.matrixWorld),this.matrixWorldNeedsUpdate=!0}dispose(){this.clearVisuals(),this.removeFromParent()}refresh(t){const e=he(this.source);if(!e)return;const s=e.radius,i=String(s);if(!t&&i===this.signature)return;this.signature=i,this.clearVisuals();const o=this.selected?io:so,n=this.selected?1:.62,r=[];for(let u=0;u<Ne;u+=1){const _=u/Ne*Math.PI*2;r.push(Math.cos(_)*s,0,Math.sin(_)*s)}const l=new lt;l.setAttribute("position",new yt(r,3));const c=new Ns(l,this.lineMaterial(o,n));c.renderOrder=this.renderOrder,this.add(c);const d=[];for(const[u,_]of[[s,0],[-s,0],[0,s],[0,-s]])d.push(u,0,_,u,oo,_);const p=new lt;p.setAttribute("position",new yt(d,3));const f=new _e(p,this.lineMaterial(o,n));f.renderOrder=this.renderOrder,this.add(f),this.traverse(u=>u.layers.set(M))}lineMaterial(t,e){return new ht({color:t,depthTest:!1,transparent:!0,opacity:e,toneMapped:!1})}clearVisuals(){for(const t of[...this.children]){t.removeFromParent();const e=t;e.geometry?.dispose();const s=Array.isArray(e.material)?e.material:[e.material];for(const i of s)i?.dispose()}}}const ls="vgai-viewport-orbit-gestures-v1",ro="vgai-viewport-orbit-learned-v1",cs=3,pe=new Set;let rt=null;function hs(){try{return typeof window>"u"?null:window.localStorage}catch{return null}}function ps(){if(rt===null){const a=hs();a?.getItem(ro)==="1"?rt=cs:rt=Number(a?.getItem(ls)??0)||0}return rt}function Qe(){return ps()>=cs}function ao(){if(!Qe()&&(rt=ps()+1,hs()?.setItem(ls,String(rt)),Qe()))for(const a of pe)a()}function Zo(a){return pe.add(a),()=>{pe.delete(a)}}function lo(a){const t=new Set(a.values()),e=[];for(const s of t){let i=s.parent,o=!1;for(;i!==null;){if(t.has(i)){o=!0;break}i=i.parent}o||e.push(s)}return e}function co(a,t){const e=new Set;for(const s of t){const i=a.get(s);i&&e.add(i)}return[...e].filter(s=>{for(let i=s.parent;i!==null;i=i.parent)if(e.has(i))return!1;return!0})}const Lt=.5,ho=1e3,po=new h(0,1,0),uo=new h(0,0,1),re=new ii,fo=new h,qe=new h,ae=new T,Ze=new h,_o=1e-8,mo=[new h(1,0,0),new h(-1,0,0),new h(0,1,0),new h(0,-1,0),new h(0,0,1),new h(0,0,-1)],J=[[.96,.2,.32],[.53,.84,.01],[.16,.55,.96]],le=[[0,1],[1,1],[2,1]],Ue=[[0,1],[2,1],[1,-1]],go=["X","Y","Z"],yo=62.6;function Ke(a){const t=Number.isFinite(a)&&a>.01?a:1,e=Y.degToRad(yo/2),s=t>=1?Math.atan(Math.tan(e)/t):e;return Y.radToDeg(s*2)}const wo=39/21,vo=[new x(16070225),new x(7316507),new x(3048419)],bo=.356,xo=7.5/17.5;function So(a,t){const s=document.createElement("canvas");s.width=32,s.height=32;const i=s.getContext("2d");if(i){const n=`#${a.getHexString()}`,r=32/2-1;if(t===null){const l=ds/de*32;i.beginPath(),i.arc(32/2,32/2,r,0,Math.PI*2),i.fillStyle=n,i.globalAlpha=.35,i.fill(),i.globalAlpha=1,i.beginPath(),i.arc(32/2,32/2,r-l/2,0,Math.PI*2),i.lineWidth=l,i.strokeStyle=n,i.stroke()}else{i.beginPath(),i.arc(32/2,32/2,r,0,Math.PI*2),i.fillStyle=n,i.fill();const l=a.clone().multiplyScalar(bo);i.fillStyle=`#${l.getHexString()}`;const c=xo*(2*r);i.font=`bold ${Math.round(c/.72)}px system-ui, -apple-system, sans-serif`,i.textAlign="center",i.textBaseline="middle",i.fillText(t,32/2,32/2+2)}}const o=new ai(s);return o.colorSpace=li,o.generateMipmaps=!1,o.minFilter=ci,o}const Co=new h(.8187,.4458,.3617),at=90,Mo=32,de=15,Ho=2.75,ds=2,Po=74.5,us=73.5,Ao=8.5+Po/2-at/2,fs=38+us/2-at/2,Uo=fs+at/2+us/2+16-14.5,_s=`
|
|
3
|
+
float vgaiGrazingFade(vec3 worldPosition, vec3 eye, vec3 planeNormal, float amount) {
|
|
4
|
+
vec3 toEye = eye - worldPosition;
|
|
5
|
+
float toEyeLength = max(length(toEye), 1e-6);
|
|
6
|
+
float graze = 1.0 - abs(dot(toEye / toEyeLength, planeNormal));
|
|
7
|
+
graze *= graze;
|
|
8
|
+
return mix(1.0, 1.0 - graze * graze, amount);
|
|
9
|
+
}
|
|
10
|
+
`,ue=200,gt=2,Xt=ue*2/gt;function Eo(){const a=[];for(let t=0;t<Xt;t++){const e=-ue+t*gt,s=e+gt;a.push(e,.001,0,s,.001,0)}for(let t=0;t<Xt;t++){const e=-ue+t*gt,s=e+gt;a.push(0,.001,e,0,.001,s)}return a}function Io(a,t){a.onBeforeCompile=e=>{e.uniforms.uGrazingFade=t,e.vertexShader=e.vertexShader.replace("void main() {",`varying vec3 vAxisWorld;
|
|
11
|
+
void main() {`).replace("vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );",`vAxisWorld = ( modelMatrix * vec4( position.y < 0.5 ? instanceStart : instanceEnd, 1.0 ) ).xyz;
|
|
12
|
+
vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );`),e.fragmentShader=e.fragmentShader.replace("void main() {",`varying vec3 vAxisWorld;
|
|
13
|
+
uniform float uGrazingFade;
|
|
14
|
+
${_s}
|
|
15
|
+
void main() {`).replace("gl_FragColor = vec4( diffuseColor.rgb, alpha );","gl_FragColor = vec4( diffuseColor.rgb, alpha * vgaiGrazingFade( vAxisWorld, cameraPosition, vec3( 0.0, 1.0, 0.0 ), uGrazingFade ) );")},a.customProgramCacheKey=()=>"vgai-axis-grazing-fade"}function To(a){const t=new Je(a,a);t.rotateX(-Math.PI/2);const e=new ri({uniforms:{uColor:{value:new x(10066329)},uMajorColor:{value:new x(10066329)},uOpacity:{value:1},uLineWidth:{value:1.5},uFadeStart:{value:a/2*.55},uFadeEnd:{value:a/2},uGrazingFade:{value:0}},vertexShader:`
|
|
16
|
+
varying vec3 vWorld;
|
|
17
|
+
void main() {
|
|
18
|
+
vWorld = (modelMatrix * vec4(position, 1.0)).xyz;
|
|
19
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
20
|
+
}
|
|
21
|
+
`,fragmentShader:`
|
|
22
|
+
uniform vec3 uColor;
|
|
23
|
+
uniform vec3 uMajorColor;
|
|
24
|
+
uniform float uOpacity;
|
|
25
|
+
uniform float uLineWidth;
|
|
26
|
+
uniform float uFadeStart;
|
|
27
|
+
uniform float uFadeEnd;
|
|
28
|
+
uniform float uGrazingFade;
|
|
29
|
+
varying vec3 vWorld;
|
|
30
|
+
${_s}
|
|
31
|
+
// Coverage of a line WIDTH device pixels across, with a one-pixel
|
|
32
|
+
// anti-aliased edge — so its core is FULL, the way Blender's is. The
|
|
33
|
+
// earlier form (1 - distance/width) was a triangle with no plateau:
|
|
34
|
+
// whether a line reached its own colour depended on where the nearest
|
|
35
|
+
// fragment centre happened to fall, and the measured peak wandered
|
|
36
|
+
// between 0.67 and 1 of it.
|
|
37
|
+
float gridLine(vec2 coord, float width) {
|
|
38
|
+
vec2 d = max(fwidth(coord), vec2(1e-6));
|
|
39
|
+
vec2 dist = abs(fract(coord - 0.5) - 0.5) / d;
|
|
40
|
+
vec2 cov = clamp(width * 0.5 - dist + 0.5, 0.0, 1.0);
|
|
41
|
+
return max(cov.x, cov.y);
|
|
42
|
+
}
|
|
43
|
+
void main() {
|
|
44
|
+
vec2 p = vWorld.xz;
|
|
45
|
+
vec2 pixelsPerMetre = 1.0 / max(fwidth(p), vec2(1e-6));
|
|
46
|
+
float minorVisible = smoothstep(4.0, 14.0, min(pixelsPerMetre.x, pixelsPerMetre.y));
|
|
47
|
+
// Both levels reach FULL strength in their own colour, as Blender's
|
|
48
|
+
// do: the 1 m line is measured at exactly the palette's grid colour
|
|
49
|
+
// and the 10 m line brighter than it (see uMajorColor). The minor
|
|
50
|
+
// level's only attenuation is its own drop-out as cells shrink.
|
|
51
|
+
float minor = gridLine(p, uLineWidth) * minorVisible;
|
|
52
|
+
// The 10 m level is WIDER as well as brighter, which is what lets it
|
|
53
|
+
// reach full coverage — and so its full colour. Measured across one
|
|
54
|
+
// scanline of modeling-object-none.png at device resolution: the 1 m
|
|
55
|
+
// line is 4 px at half rise and plateaus at 83, the 10 m line is 6 px
|
|
56
|
+
// and plateaus at 101. At one shared width ours drew a 10 m line that
|
|
57
|
+
// never exceeded 0.75 coverage and so measured 91, not 102.
|
|
58
|
+
float major = gridLine(p / 10.0, uLineWidth * 1.5);
|
|
59
|
+
float line = max(minor, major);
|
|
60
|
+
float fade = 1.0 - smoothstep(uFadeStart, uFadeEnd, length(p));
|
|
61
|
+
// The floor's DEPTH, beside the band that ends its finite extent:
|
|
62
|
+
// Blender's own grazing-angle profile, transcribed from its frames
|
|
63
|
+
// (see GRAZING_FADE_GLSL above). Without it this lattice reads the
|
|
64
|
+
// same ink at the front of the frame and at the horizon.
|
|
65
|
+
fade *= vgaiGrazingFade(vWorld, cameraPosition, vec3(0.0, 1.0, 0.0), uGrazingFade);
|
|
66
|
+
float alpha = line * fade * uOpacity;
|
|
67
|
+
if (alpha <= 0.002) discard;
|
|
68
|
+
// WHICH level a fragment belongs to is the major's SHARE of the
|
|
69
|
+
// coverage being drawn, never a comparison of the two and never the
|
|
70
|
+
// major's raw coverage. Every 10 m line is also a 1 m line, so there
|
|
71
|
+
// the two are equal: a step() between them compares values equal to
|
|
72
|
+
// within rounding and flips per fragment (photographed with the major
|
|
73
|
+
// forced white: the 10 m lines came out DOTTED), and mixing by the raw
|
|
74
|
+
// coverage dilutes the colour by the line's own anti-aliasing (the
|
|
75
|
+
// same lines then measured 91 where Blender's is 102). As a share it
|
|
76
|
+
// is exactly 1 wherever the major draws — core and skirt alike, and in
|
|
77
|
+
// the far field where the minor has dropped out — and 0 on a 1 m line.
|
|
78
|
+
float majorShare = clamp(major / max(line, 1e-6), 0.0, 1.0);
|
|
79
|
+
gl_FragColor = vec4(mix(uColor, uMajorColor, majorShare), alpha);
|
|
80
|
+
#include <colorspace_fragment>
|
|
81
|
+
}
|
|
82
|
+
`,transparent:!0,depthWrite:!1,side:Bt}),s=new m(t,e);return s.name="editor-floor-grid",s}class ms{setTransformMode(t){this._store.setTransformMode(t)}camera;orthographicCamera;orbitControls;transformControls;_auxRotateControls;_auxScaleControls;_activeGizmo;raycaster=(()=>{const t=new et;return t.layers.enableAll(),t})();grid;_boxHelpers=new Map;_unsubscribeSelectionTheme=()=>{};_constraintHelpers=new Map;_constraintControlRaycaster=(()=>{const t=new et;return t.layers.enableAll(),t})();_hoveredConstraintControl=null;_constraintControlPointerSession=!1;_reflectionProbeHelpers=new Map;_triggerVolumeHelpers=new Map;_cameraHelpers=new Map;_lightHelpers=new Map;_audioHelpers=new Map;_spatialHandleRoots=[];_spatialHandleMeshes=[];_spatialHandleRaycaster=(()=>{const t=new et;return t.layers.enableAll(),t})();_activeSpatialHandle=null;_hoveredSpatialHandle=null;_spatialHandleDragPlane=new Te;_spatialHandleDragOffset=new h;_spatialHandleDragPoint=new h;_orbitEnabledBeforeHandleDrag=!0;_transformEnabledBeforeHandleDrag=!0;_gizmoHelper;_editorAmbient;_editorDirLight;_lightRig;_scene;_contentBoundsBox=new ft;_contentBoundsAt=0;_renderer;_sparkRenderer=null;_sparkRendererLoading=!1;_sparkRendererFailed=!1;_lastSparkDiscoveryAt=Number.NEGATIVE_INFINITY;_disposed=!1;_editorObjects=[];_axisLines=null;_axesWanted=!1;_lookAxisHexes=null;_lookGridHex=null;_lookBackgroundHex=null;_lookToneMapping=null;_lookExposure=null;_lookGizmoSizePx=null;_lookAxisFrame=le;_appliedAxisSigns=[1,1,1];_lookBoxSelect=null;_store;_objectMap=new Map;_canvas;_interactionElement;_onInteractionPointerUp;_onInteractionDblClick;_authoring;_pick;_standaloneAuthoring;_publishPickContext;_onlineAssetResolver;_onProjectionChange;_pointerDownPos=new K;_skipNextSync=!1;_marqueeActive=!1;_pointerSessionActive=!1;_marqueeDiv=null;_pointerDownButton=-1;_altDragOrbit=!1;_vcScene=new Qs;_vcCamera;_vcClickTargets=[];_vcBalls=[];_vcStalks=[];_vcSize=at;_vcMarginRight=Ao;_vcMarginTop=fs;_chromeInsetPx=0;_vcDir=new h;_previewClearColor=new x;_cameraView=null;_projection="perspective";_pendingProjection=null;_viewportAspect=1;_orthographicHeight=10;_cameraViewMode=null;_orbitEnabledBeforeCameraView=!0;_orbitTargetBeforeCameraView=new h;_lastGizmoObjectMap=null;_lastGizmoSig="";_lastGizmoEpoch=-1;_threejsToolContextActive=!1;_threeSurfaceShowing=!1;_vcRaycaster=new et;_dropOverlay=null;_groundPlane=new Te(new h(0,1,0),0);_dragStartPos=new h;_dragStartQuat=new T;_dragStartScale=new h;_attachedAuthoringId=null;_otherDragObjects=[];_allDragObjects=[];_preservedChildObjects=[];_activeTransformEditIds=[];_pivotDummy=new Gt;_dummyIsPresentationAnchor=!1;_pivotPos=new h;_surfaceSnapRaycaster=new et;_surfaceSnapIndicator;_vertexSnapTargets=[];_vertexSnapIndicator;_vertexSnapThreshold=20;batchedRenderer;_helpers=new Map;_snapAnimating=!1;_snapStartTime=0;_snapDuration=400;_snapQ1=new T;_snapQ2=new T;_snapDist=0;_flyActive=!1;_orbitGesture=!1;_orbitGestureCounted=!1;_snapHold=!1;_flyKeys=new Set;_flySpeed=5;_flyEuler=new $e(0,0,0,"YXZ");_rightMouseDown=!1;constructor(t,e,s,i=t,o={}){this._canvas=t,this._interactionElement=i,this._scene=e,this._renderer=o.renderer,this._store=s,this._authoring=o.authoring??(()=>Mt().activeAuthoring(this._store)),this._pick=o.pick,this._standaloneAuthoring=o.authoring!==void 0,this._publishPickContext=o.publishPickContext??!0,this._chromeInsetPx=o.chromeInsetPx??0,this._onlineAssetResolver=o.onlineAssetResolver,this._onProjectionChange=o.onProjectionChange,this.camera=new qs(Ke(t.clientWidth/Math.max(1,t.clientHeight)),t.clientWidth/t.clientHeight,Ee,Ie),this.camera.position.copy(Co).multiplyScalar(17.32),this.camera.lookAt(0,0,0),this.camera.layers.enableAll(),this._viewportAspect=t.clientWidth/Math.max(1,t.clientHeight),this.orthographicCamera=new Nt(-5,5,5,-5,Ee,Ie),this.orthographicCamera.layers.enableAll(),this._syncOrthographicFromPerspective(),this.grid=To(400),this.grid.layers.set(M),e.add(this.grid);const n=new os;n.setPositions(Eo()),n.setColors(new Array(Xt*2*2*3).fill(1)),this._axisLines=new is(n,new ns({vertexColors:!0,linewidth:2,transparent:!0,opacity:1,depthWrite:!1,toneMapped:!1})),Io(this._axisLines.material,this.grid.material.uniforms.uGrazingFade),this._axisLines.visible=!1,this._axisLines.layers.set(M),e.add(this._axisLines),this._unsubscribeSelectionTheme=bs(t,()=>{Yt();const l=Ht(t).visible;for(const c of this._boxHelpers.values())c instanceof ne&&c.setColor(l);this._applyViewportLook(xs(t)),this._lookGizmoSizePx=we(t),this._applyGizmoSize(),this._readLookStage(t)}),this._lightRig=o?.lightRig!==!1,this._editorAmbient=new Zs(16777215,.5),this._editorAmbient.layers.set(M),e.add(this._editorAmbient),this._editorDirLight=new Us(16777215,1),this._editorDirLight.position.set(10,20,10),this._editorDirLight.layers.set(M),e.add(this._editorDirLight),this._editorAmbient.visible=this._lightRig,this._editorDirLight.visible=this._lightRig,this.batchedRenderer=new hi,this.batchedRenderer.layers.set(M),e.add(this.batchedRenderer),i.addEventListener("wheel",this._onTrackpadWheel,{passive:!1}),this.orbitControls=new Fs(this.camera,i),this.orbitControls.enableDamping=!0,this.orbitControls.dampingFactor=.1,this.orbitControls.mouseButtons={LEFT:-1,MIDDLE:Qt.PAN,RIGHT:Qt.ROTATE},this.transformControls=new Zt(this.camera,t),this._auxScaleControls=new Zt(this.camera,t),this._auxScaleControls.setMode("scale"),this._auxRotateControls=new Zt(this.camera,t),this._auxRotateControls.setMode("rotate"),this._activeGizmo=this.transformControls;const r=l=>{l.getRaycaster().layers.enableAll(),l.addEventListener("dragging-changed",c=>{const d=c.value;if(d?pi():di(),this.orbitControls.enabled=!d,d){this._activeGizmo=l;for(const g of this._allGizmos())g!==l&&(g.enabled=!1);const p=l.object,f=l.mode==="translate"?"position":l.mode==="rotate"?"rotation":"scale",u=g=>this._authoring().transforms?.editability?.(g,f).writable??!0,_=this._attachedAuthoringId??(p&&this._authoringIdForObject(p))??"";if(p){if(this._dragStartPos.copy(p.position),this._dragStartQuat.copy(p.quaternion),this._dragStartScale.copy(p.scale),this._otherDragObjects=[],this._allDragObjects=[],this._pivotPos.copy(p.position),p===this._pivotDummy?null:this._authoringIdForObject(p))for(const w of this._store.selectedEntityIds){if(w===_||!u(w))continue;const b=this._objectForAuthoringId(w);b&&this._otherDragObjects.push({id:w,obj:b,startPos:b.position.clone(),startQuat:b.quaternion.clone(),startScale:b.scale.clone()})}else for(const w of this._store.selectedEntityIds){if(!u(w))continue;const b=this._objectForAuthoringId(w);b&&this._allDragObjects.push({id:w,obj:b,startPos:b.position.clone(),startQuat:b.quaternion.clone(),startScale:b.scale.clone()})}const y=p===this._pivotDummy?this._allDragObjects.map(({id:w})=>w):[_,...this._otherDragObjects.map(({id:w})=>w)];this._preservedChildObjects=this._preparePreservedChildren(y.filter(Boolean)),this._activeTransformEditIds=[...new Set([...y.filter(Boolean),...this._preservedChildObjects.map(({id:w})=>w)])];const v=this._authoring();for(const w of this._activeTransformEditIds)Se(v,w)}}else this._surfaceSnapIndicator.visible=!1,this._vertexSnapIndicator.visible=!1,this.syncFromStore()}),l.addEventListener("objectChange",()=>{const c=l.object;if(!c)return;const d=l.mode,p=this._store.pivotMode==="individual-origins"||this._dummyIsPresentationAnchor,u=this._allDragObjects.length>0?this._allDragObjects:this._otherDragObjects;if(u.length>0){if(d==="translate"){const _=c.position.clone().sub(this._dragStartPos);for(const{obj:g,startPos:y}of u)g.position.copy(y).add(_)}else if(d==="rotate"){const _=c.quaternion.clone().multiply(this._dragStartQuat.clone().invert());if(p)for(const{obj:g,startQuat:y}of u)g.quaternion.copy(_).multiply(y);else for(const{obj:g,startPos:y,startQuat:v}of u){const w=y.clone().sub(this._pivotPos);w.applyQuaternion(_),g.position.copy(this._pivotPos).add(w),g.quaternion.copy(_).multiply(v)}}else if(d==="scale"){const _=new h(this._dragStartScale.x!==0?c.scale.x/this._dragStartScale.x:1,this._dragStartScale.y!==0?c.scale.y/this._dragStartScale.y:1,this._dragStartScale.z!==0?c.scale.z/this._dragStartScale.z:1);if(p)for(const{obj:g,startScale:y}of u)g.scale.copy(y).multiply(_);else for(const{obj:g,startPos:y,startScale:v}of u){const w=y.clone().sub(this._pivotPos);w.multiply(_),g.position.copy(this._pivotPos).add(w),g.scale.copy(v).multiply(_)}}}d==="translate"&&this._store.vertexSnapActive&&this._vertexSnapTargets.length>0?this._applyVertexSnap(c,u):d==="translate"&&this._store.snapToSurface&&this._applySurfaceSnap(c,u),this._restorePreservedChildren();for(const _ of this._boxHelpers.values())"update"in _&&_.update();this._flushGizmoToStoreLive()}),l.addEventListener("mouseUp",()=>{this._flushGizmoToStore()})};r(this.transformControls),r(this._auxRotateControls),r(this._auxScaleControls),this._gizmoHelper=this.transformControls.getHelper(),this._gizmoHelper.traverse(l=>l.layers.set(M)),e.add(this._gizmoHelper);for(const l of[this._auxRotateControls,this._auxScaleControls]){const c=l.getHelper();c.traverse(d=>d.layers.set(M)),c.visible=!1,e.add(c)}this._pivotDummy.layers.set(M),e.add(this._pivotDummy),this._surfaceSnapIndicator=new m(new Ks(.08,.12,16),new X({color:65416,side:Bt,depthTest:!1})),this._surfaceSnapIndicator.rotation.x=-Math.PI/2,this._surfaceSnapIndicator.visible=!1,this._surfaceSnapIndicator.renderOrder=999,this._surfaceSnapIndicator.layers.set(M),e.add(this._surfaceSnapIndicator),this._vertexSnapIndicator=new m(new Q(1,8,8),new X({color:65450,depthTest:!1})),this._vertexSnapIndicator.visible=!1,this._vertexSnapIndicator.renderOrder=999,this._vertexSnapIndicator.layers.set(M),e.add(this._vertexSnapIndicator),this._patchGizmo(this._gizmoHelper),this._patchGizmo(this._auxRotateControls.getHelper()),this._patchGizmo(this._auxScaleControls.getHelper()),this._dropNegativeAxisHandles(this._gizmoHelper,["translate","scale"]),this._dropNegativeAxisHandles(this._auxScaleControls.getHelper(),["scale"]),this._patchCombinedScaleGizmo(this._auxScaleControls.getHelper()),this._lookGizmoSizePx=we(t),this._applyGizmoSize(),this._lookAxisFrame=ve(t)==="z"?Ue:le,this._lookBoxSelect=be(t),this._applyGizmoAxisFrame(),this._vcCamera=new Nt(-1.5,1.5,1.5,-1.5,.1,10),this._initOrientationGizmo(),window.addEventListener("keydown",this._onFlyKeyDown),window.addEventListener("keyup",this._onFlyKeyUp),i.addEventListener("pointerdown",this._onFlyPointerDown),i.addEventListener("pointerup",this._onFlyPointerUp),i.addEventListener("pointermove",this._onFlyPointerMove),i.addEventListener("wheel",this._onFlyWheel,{passive:!1}),t.addEventListener("pointerdown",this._onAltOrbitStart,{capture:!0}),window.addEventListener("pointerup",this._onAltOrbitRelease,{capture:!0}),window.addEventListener("pointercancel",this._onAltOrbitRelease,{capture:!0}),this.orbitControls.addEventListener("change",()=>{this._orbitGesture&&!this._orbitGestureCounted&&(this._orbitGestureCounted=!0,ao())}),window.addEventListener("keydown",this._onSnapHoldKey),window.addEventListener("keyup",this._onSnapHoldKey),t.addEventListener("pointerdown",this._onPointerDown),i.addEventListener("pointermove",this._onPointerMove),this._onInteractionPointerUp=l=>{(l.target===t||l.target===i||this._pointerSessionActive)&&this._onPointerUp(l)},i.addEventListener("pointerup",this._onInteractionPointerUp),this._onInteractionDblClick=l=>{(l.target===t||l.target===i)&&this._onDoubleClick(l)},i.addEventListener("dblclick",this._onInteractionDblClick),t.addEventListener("dragover",this._onDragOver),t.addEventListener("dragleave",this._onDragLeave),t.addEventListener("drop",this._onDrop),this._editorObjects=[this.grid,...this._axisLines?[this._axisLines]:[],this._editorAmbient,this._editorDirLight,this.batchedRenderer,this._gizmoHelper,this._auxRotateControls.getHelper(),this._auxScaleControls.getHelper(),this._pivotDummy,this._surfaceSnapIndicator,this._vertexSnapIndicator],this._publishPickContext&&this._installPickContext(this.camera)}setScene(t){if(t===this._scene)return;for(const s of this._editorObjects)s.removeFromParent(),t.add(s);for(const s of this._boxHelpers.values())s.removeFromParent(),t.add(s);for(const s of this._constraintHelpers.values())s.removeFromParent(),t.add(s);for(const s of this._reflectionProbeHelpers.values())s.removeFromParent(),t.add(s);for(const s of this._triggerVolumeHelpers.values())s.removeFromParent(),t.add(s);for(const{helper:s}of this._cameraHelpers.values())s.removeFromParent(),t.add(s);for(const s of this._spatialHandleRoots)s.removeFromParent(),t.add(s);this._scene=t,this._contentBoundsAt=0;const e=this._lightRig&&!this._store.isAdoptedSceneActive;this._editorAmbient.visible=e,this._editorDirLight.visible=e}get currentScene(){return this._scene}get renderCamera(){return this._cameraView??this.freeCamera}get freeCamera(){return this._projection==="orthographic"?this.orthographicCamera:this.camera}get projection(){return this._projection}_installPickContext(t){this._publishPickContext&&ze({camera:t,canvas:this._canvas,editorControls:{activate:(e,s)=>this._selectConstraintControlAt({clientX:e,clientY:s},!1),hover:(e,s)=>this._hoverConstraintControlAt({clientX:e,clientY:s}),clearHover:()=>this._clearConstraintControlHover()}})}setProjection(t){if(this._cameraView){this._pendingProjection=t;return}if(this._projection===t)return;t==="orthographic"?this._syncOrthographicFromPerspective():this._syncPerspectiveFromOrthographic(),this._projection=t;const e=this.freeCamera;this.orbitControls.object=e;for(const s of this._allGizmos())s.camera=e;this._applyGizmoSize(),this.orbitControls.update(),this._installPickContext(e),this._onProjectionChange?.(t)}_syncOrthographicFromPerspective(t=!1){const e=Math.max(.01,this.camera.position.distanceTo(this.orbitControls?.target??new h));t||(this._orthographicHeight=2*e*Math.tan(Y.degToRad(this.camera.fov*.5))),this.orthographicCamera.position.copy(this.camera.position),this.orthographicCamera.quaternion.copy(this.camera.quaternion),this.orthographicCamera.up.copy(this.camera.up),this.orthographicCamera.zoom=1,this._applyOrthographicFrustum(),this.orthographicCamera.updateMatrixWorld(!0)}_syncPerspectiveFromOrthographic(){const e=this._orthographicHeight/Math.max(this.orthographicCamera.zoom,.01)/(2*Math.tan(Y.degToRad(this.camera.fov*.5))),s=this.orthographicCamera.position.clone().sub(this.orbitControls.target).normalize();this.camera.position.copy(this.orbitControls.target).add(s.multiplyScalar(e)),this.camera.quaternion.copy(this.orthographicCamera.quaternion),this.camera.up.copy(this.orthographicCamera.up),this.camera.updateMatrixWorld(!0)}_applyOrthographicFrustum(){const t=this._orthographicHeight*.5,e=t*this._viewportAspect;this.orthographicCamera.left=-e,this.orthographicCamera.right=e,this.orthographicCamera.top=t,this.orthographicCamera.bottom=-t,this.orthographicCamera.updateProjectionMatrix()}get cameraViewMode(){return this._cameraViewMode}setCameraView(t,e){if(this.clearCameraView(),this._cameraView=t,this._cameraViewMode=e,this._orbitEnabledBeforeCameraView=this.orbitControls.enabled,this._orbitTargetBeforeCameraView.copy(this.orbitControls.target),e==="pilot"){const s=t.getWorldPosition(new h),i=t.getWorldDirection(new h),o=Math.max(1,this.freeCamera.position.distanceTo(this.orbitControls.target));this.orbitControls.object=t,this.orbitControls.target.copy(s).add(i.multiplyScalar(o)),this.orbitControls.enabled=!0,this.orbitControls.update()}else this.orbitControls.enabled=!1;this._publishPickContext&&this._installPickContext(t)}clearCameraView(){if(!this._cameraView)return;this._flyActive&&this._exitFlyMode(),this.orbitControls.object=this.freeCamera,this.orbitControls.target.copy(this._orbitTargetBeforeCameraView),this.orbitControls.enabled=this._orbitEnabledBeforeCameraView,this.orbitControls.update(),this._cameraView=null,this._cameraViewMode=null;const t=this._pendingProjection;this._pendingProjection=null,t&&t!==this._projection&&this.setProjection(t),this._publishPickContext&&this._installPickContext(this.freeCamera)}get objectMap(){return this._objectMap}set objectMap(t){this._objectMap=t}attach(t){const e=this._objectForAuthoringId(t);e&&(this._attachedAuthoringId=t,this._attachGizmosTo(e))}detach(){this._attachedAuthoringId=null,this._detachGizmos()}_objectForAuthoringId(t){const e=this._authoring();return e.hierarchy.node(t)===null?null:Ss(e,this._objectMap,t)}_authoringIdForObject(t){return this._authoring().hierarchy.idForObject3D?.(t)??Cs(t)??null}_hasBoundableGeometry(t){return as([t]).length>0}_makeDiagnosticBounds(t){if(this._hasBoundableGeometry(t))return new xe(t,Ht(this._canvas).visible);const e=new E(Lt,Lt,Lt),s=new ts(e);e.dispose();const i=new ht({color:new x(Ht(this._canvas).visible),toneMapped:!1}),o=new _e(s,i);return t.getWorldPosition(o.position),o.isBoxHelper=!0,o._entityObj=t,o}_syncBoxHelpers(){for(const e of this._boxHelpers.values())this._scene.remove(e),e.geometry.dispose(),e.material.dispose();this._boxHelpers.clear();const t=(e,s)=>{s.layers.set(M),this._scene.add(s),this._boxHelpers.set(e,s)};if(this._store.showHelpers&&this._store.helperVisibility.bounds)for(const e of this._objectMap.keys()){const s=this._objectForAuthoringId(e);s&&t(`bounds:${e}`,this._makeDiagnosticBounds(s))}for(const e of this._store.selectedEntityIds){const s=this._objectForAuthoringId(e);!s||this._hasBoundableGeometry(s)||this._standaloneAuthoring&&s.isBone||[...this._constraintHelpers.values()].some(i=>i.presents(s))||t(`selection:${e}`,new ne(s,{fixedSize:Lt,color:Ht(this._canvas).visible}))}}_syncReflectionProbeHelpers(t=null){if(t===null){const e=new Map,s=new Set;for(const[i,o]of this._objectMap)!o||s.has(o)||!kt(o)||(s.add(o),e.set(i,o));for(const[i,o]of this._reflectionProbeHelpers)e.get(i)!==o.source&&(o.dispose(),this._reflectionProbeHelpers.delete(i));for(const[i,o]of e)this._ensureReflectionProbeHelper(i,o)}else{let e=!1;for(const s of t){const i=this._objectMap.get(s),o=i&&kt(i)?i:null,n=this._reflectionProbeHelpers.get(s);n&&n.source!==o&&(o===null&&(e=!0),n.dispose(),this._reflectionProbeHelpers.delete(s)),o&&![...this._reflectionProbeHelpers.values()].some(r=>r.source===o)&&this._ensureReflectionProbeHelper(s,o)}if(e){this._syncReflectionProbeHelpers();return}}for(const[e,s]of this._reflectionProbeHelpers)s.setSelected(this._store.selectedEntityIds.has(e)),s.visible=this._threejsToolContextActive&&this._store.showHelpers&&this._store.helperVisibility.reflectionProbes,s.update()}_ensureReflectionProbeHelper(t,e){if(this._reflectionProbeHelpers.has(t))return;const s=new Ei(e);this._reflectionProbeHelpers.set(t,s),this._scene.add(s)}_syncTriggerVolumeHelpers(t=null){if(t===null){const s=new Map,i=new Set;for(const[o,n]of this._objectMap)!n||i.has(n)||!he(n)||(i.add(n),s.set(o,n));for(const[o,n]of this._triggerVolumeHelpers)s.get(o)!==n.source&&this._disposeTriggerVolumeHelper(o,n);for(const[o,n]of s)this._ensureTriggerVolumeHelper(o,n)}else{let s=!1;for(const i of t){const o=this._objectMap.get(i),n=o&&he(o)?o:null,r=this._triggerVolumeHelpers.get(i);r&&r.source!==n&&(n===null&&(s=!0),this._disposeTriggerVolumeHelper(i,r)),n&&![...this._triggerVolumeHelpers.values()].some(l=>l.source===n)&&this._ensureTriggerVolumeHelper(i,n)}if(s){this._syncTriggerVolumeHelpers();return}}const e=this._threeSurfaceShowing&&this._store.showHelpers&&this._store.helperVisibility.triggerVolumes;for(const[s,i]of this._triggerVolumeHelpers)i.setSelected(this._store.selectedEntityIds.has(s)),i.visible=e,i.update()}_ensureTriggerVolumeHelper(t,e){if(this._triggerVolumeHelpers.has(t))return;const s=new no(e);this._triggerVolumeHelpers.set(t,s),this._scene.add(s)}_disposeTriggerVolumeHelper(t,e){e.dispose(),this._triggerVolumeHelpers.delete(t)}_syncConstraintHelpers(t=null){if(t===null){const s=new Map,i=new Set;for(const[o,n]of this._objectMap)!n||i.has(n)||ce(n).length===0||(i.add(n),s.set(o,n));for(const[o,n]of this._constraintHelpers)s.get(o)!==n.source&&(this._disposeConstraintHelper(n),this._constraintHelpers.delete(o));for(const[o,n]of s)this._ensureConstraintHelper(o,n)}else{let s=!1;for(const i of t){const o=this._objectMap.get(i),n=o&&ce(o).length>0?o:null,r=this._constraintHelpers.get(i);r&&r.source!==n&&(n===null&&(s=!0),this._disposeConstraintHelper(r),this._constraintHelpers.delete(i)),n&&![...this._constraintHelpers.values()].some(l=>l.source===n)&&this._ensureConstraintHelper(i,n)}if(s){this._syncConstraintHelpers();return}}const e=new Set;for(const s of this._store.selectedEntityIds){const i=this._objectForAuthoringId(s);i&&e.add(i)}for(const[s,i]of this._constraintHelpers)i.setSelected(this._store.selectedEntityIds.has(s)),i.setSelectedObjects(e),i.visible=this._threejsToolContextActive&&this._store.showHelpers&&this._store.helperVisibility.constraints,i.update(this.camera)}_ensureConstraintHelper(t,e){if(this._constraintHelpers.has(t))return;const s=new Ci(e);this._constraintHelpers.set(t,s),this._scene.add(s)}_disposeConstraintHelper(t){this._hoveredConstraintControl?.helper===t&&(this._hoveredConstraintControl=null),t.dispose()}_raycastConstraintControl(t){const e=[];for(const n of this._constraintHelpers.values())n.visible&&e.push(...n.controlMeshes());if(e.length===0)return null;const s=this._canvas.getBoundingClientRect(),i=new K((t.clientX-s.left)/s.width*2-1,-((t.clientY-s.top)/s.height)*2+1);this._constraintControlRaycaster.setFromCamera(i,this.renderCamera);const o=this._constraintControlRaycaster.intersectObjects(e,!1)[0]?.object;if(!o)return null;for(const n of this._constraintHelpers.values()){const r=n.controlFor(o);if(r)return{helper:n,control:r}}return null}_updateConstraintControlHover(t){if(t.buttons&1)return this._constraintControlPointerSession;const e=this._hoverConstraintControlAt(t);return e?(this._hoveredSpatialHandle&&(ee(this._hoveredSpatialHandle,!1),this._hoveredSpatialHandle=null),this._canvas.style.cursor=e,!0):(this._canvas.style.cursor="",!1)}_hoverConstraintControlAt(t){const e=this._raycastConstraintControl(t),s=this._hoveredConstraintControl;return e?(s?.mesh!==e.control.mesh&&(s&&s.helper.setHoveredControl(null),e.helper.setHoveredControl(e.control.mesh),this._hoveredConstraintControl={helper:e.helper,mesh:e.control.mesh}),this._authoringIdForObject(e.control.object)?"pointer":"not-allowed"):(this._clearConstraintControlHover(),null)}_clearConstraintControlHover(){this._hoveredConstraintControl?.helper.setHoveredControl(null),this._hoveredConstraintControl=null}_selectConstraintControlAt(t,e=!0){const s=this._raycastConstraintControl(t);if(!s)return!1;this._constraintControlPointerSession=e;const i=this._authoringIdForObject(s.control.object);if(i){const o=this._authoring();Pt(o,[i],{intent:"exact"})||this._store.select(i),F(`${s.control.label} selected — move it with the gizmo.`)}else F(`${s.control.label} is a runtime-only constraint control.`);return!0}_syncCameraHelpers(t=null){if(t===null){const s=new Map;for(const[i,o]of this._objectMap){const n=this._nativeCamera(o);n&&s.set(i,n)}for(const[i,o]of this._cameraHelpers)s.get(i)!==o.source&&this._disposeCameraHelper(i,o);for(const[i,o]of s)this._ensureCameraHelper(i,o)}else{let s=!1;for(const i of t){const o=this._objectMap.get(i),n=o?this._nativeCamera(o):null,r=this._cameraHelpers.get(i);r&&r.source!==n&&(n===null&&(s=!0),this._disposeCameraHelper(i,r)),n&&![...this._cameraHelpers.values()].some(l=>l.source===n)&&this._ensureCameraHelper(i,n)}if(s){this._syncCameraHelpers();return}}const e=this._threeSurfaceShowing&&this._store.showHelpers&&this._store.helperVisibility.cameras;for(const s of this._cameraHelpers.values())s.helper.visible=e,s.helper.update()}_syncLightHelpers(t=null){if(t===null){const s=new Map;for(const[i,o]of this._objectMap){const n=this._nativeLight(o);n&&s.set(i,n)}for(const[i,o]of this._lightHelpers)s.get(i)!==o.source&&this._disposeLightHelper(i,o);for(const[i,o]of s)this._ensureLightHelper(i,o)}else{let s=!1;for(const i of t){const o=this._objectMap.get(i),n=o?this._nativeLight(o):null,r=this._lightHelpers.get(i);r&&r.source!==n&&(n===null&&(s=!0),this._disposeLightHelper(i,r)),n&&![...this._lightHelpers.values()].some(l=>l.source===n)&&this._ensureLightHelper(i,n)}if(s){this._syncLightHelpers();return}}const e=this._threeSurfaceShowing&&this._store.showHelpers&&this._store.helperVisibility.lights;for(const s of this._lightHelpers.values())s.helper.visible=e,s.helper.update?.()}_nativeLight(t){return t.isLight?t:null}_disposeLightHelper(t,e){e.helper.removeFromParent(),e.helper.dispose?.(),this._lightHelpers.delete(t)}_ensureLightHelper(t,e){if(this._lightHelpers.has(t))return;const s=.5;let i=null;const o=e;try{o.isDirectionalLight?i=new $s(e,s):o.isPointLight?i=new Js(e,s):o.isSpotLight?i=new ti(e):o.isHemisphereLight&&(i=new ei(e,s))}catch{i=null}i&&(i.name=`Light helper: ${e.name||t}`,i.userData.editorOnly=!0,i.traverse(n=>n.layers.set(M)),i.layers.set(M),this._lightHelpers.set(t,{source:e,helper:i}),this._scene.add(i))}_syncAudioHelpers(t=null){if(t===null){const s=new Map;for(const[i,o]of this._objectMap){const n=this._nativeAudio(o);n&&s.set(i,n)}for(const[i,o]of this._audioHelpers)s.get(i)!==o.source&&this._disposeAudioHelper(i,o);for(const[i,o]of s)this._ensureAudioHelper(i,o)}else for(const s of t){const i=this._objectMap.get(s),o=i?this._nativeAudio(i):null,n=this._audioHelpers.get(s);n&&n.source!==o&&this._disposeAudioHelper(s,n),o&&![...this._audioHelpers.values()].some(r=>r.source===o)&&this._ensureAudioHelper(s,o)}const e=this._threeSurfaceShowing&&this._store.showHelpers&&this._store.helperVisibility.audio;for(const s of this._audioHelpers.values())s.helper.visible=e}_nativeAudio(t){const e=t.type;return e==="Audio"||e==="PositionalAudio"||e==="AudioListener"?t:null}_ensureAudioHelper(t,e){if(this._audioHelpers.has(t))return;const s=new q,i=e.type==="AudioListener"?8377599:16763274,o=new m(new it(.16),new X({color:i,wireframe:!0,depthTest:!1}));s.add(o),s.name=`Audio helper: ${e.name||t}`,s.userData.editorOnly=!0,s.traverse(n=>n.layers.set(M)),s.layers.set(M),e.add(s),this._audioHelpers.set(t,{source:e,helper:s})}_disposeAudioHelper(t,e){e.helper.traverse(s=>{const i=s;i.geometry?.dispose?.(),i.material?.dispose?.()}),e.helper.removeFromParent(),this._audioHelpers.delete(t)}_disposeCameraHelper(t,e){e.helper.removeFromParent(),e.helper.dispose(),this._cameraHelpers.delete(t)}_ensureCameraHelper(t,e){if(this._cameraHelpers.has(t))return;let s;try{s=new si(e)}catch(i){this._refuseCameraOverlay(t,e,i);return}s.name=`Camera frustum: ${e.name||t}`,s.userData.editorOnly=!0,s.layers.set(M),this._cameraHelpers.set(t,{source:e,helper:s}),this._scene.add(s)}_refusedCameraOverlays=new Set;_refuseCameraOverlay(t,e,s){this._refusedCameraOverlays.has(t)||(this._refusedCameraOverlays.add(t),At.warn(`Helpers → Cameras draws no frustum for "${e.name||e.type}": ${s instanceof Error?s.message:String(s)}. This world's camera was constructed by the GAME's own copy of three, and \`THREE.CameraHelper\` is the editor's class reading fields off it that that revision does not define. Every other camera capability (framing, selection, inspection) is unaffected. It closes when the game resolves \`three\` to the host's instance — a bare, un-rewritten \`import 'three'\` in its own source.`,"authoring"))}_nativeCamera(t){if(t.isCamera)return t;const e=U(t,"_camera");return e?.isCamera?e:null}_syncSpatialHandles(){We(this._spatialHandleRoots),this._spatialHandleRoots=[],this._spatialHandleMeshes=[],this._hoveredSpatialHandle=null;const t=Wt(this._authoring());if(!t||!this._threejsToolContextActive||!this._store.showHelpers)return;const e=this._store.helperVisibility;for(const s of this._store.selectedEntityIds){const i=t.layers(s).filter(n=>n.category in e?e[n.category]:!0),o=ji(s,i);for(const n of o.handles)Xe(n,this.renderCamera);for(const n of o.roots)this._scene.add(n);this._spatialHandleRoots.push(...o.roots),this._spatialHandleMeshes.push(...o.handles)}}_raycastSpatialHandle(t){if(this._spatialHandleMeshes.length===0)return null;const e=this._canvas.getBoundingClientRect(),s=new K((t.clientX-e.left)/e.width*2-1,-((t.clientY-e.top)/e.height)*2+1);return this._spatialHandleRaycaster.setFromCamera(s,this.renderCamera),this._spatialHandleRaycaster.intersectObjects(this._spatialHandleMeshes,!1)[0]?.object??null}_spatialHandleWorldPoint(t){const e=this._canvas.getBoundingClientRect(),s=new K((t.clientX-e.left)/e.width*2-1,-((t.clientY-e.top)/e.height)*2+1);this._spatialHandleRaycaster.setFromCamera(s,this.renderCamera);const i=new h;return this._spatialHandleRaycaster.ray.intersectPlane(this._spatialHandleDragPlane,i)?i.add(this._spatialHandleDragOffset):null}_finishSpatialHandleDrag(t){const e=this._activeSpatialHandle;this._activeSpatialHandle=null,this.orbitControls.enabled=this._orbitEnabledBeforeHandleDrag,this.transformControls.enabled=this._transformEnabledBeforeHandleDrag,this.syncFromStore(),this._canvas.style.cursor="",t&&e&&Wt(this._authoring())?.commit(e.nodeId,e.handle.id,[this._spatialHandleDragPoint.x,this._spatialHandleDragPoint.y,this._spatialHandleDragPoint.z])}_updateSpatialHandleDrag(t){const e=this._activeSpatialHandle;if(!e)return!1;const s=this._spatialHandleWorldPoint(t);return s&&(this._spatialHandleDragPoint.copy(s),Wt(this._authoring())?.preview(e.nodeId,e.handle.id,[s.x,s.y,s.z]),this._syncSpatialHandles(),this._canvas.style.cursor="grabbing"),!0}_updateSpatialHandleHover(t){if(t.buttons&1||this._spatialHandleMeshes.length===0)return;const e=this._raycastSpatialHandle(t);if(e===this._hoveredSpatialHandle)return;if(this._hoveredSpatialHandle&&ee(this._hoveredSpatialHandle,!1),this._hoveredSpatialHandle=e,!e){this._canvas.style.cursor="";return}ee(e,!0);const s=Ve(e);this._canvas.style.cursor=s?.handle.writable?"grab":"not-allowed"}_updateEditorHandleInteraction(t){return this._updateSpatialHandleDrag(t)||this._updateConstraintControlHover(t)}_previewInfrastructure(){return[this.grid,...this._axisLines?[this._axisLines]:[],this._gizmoHelper,this._auxRotateControls.getHelper(),this._auxScaleControls.getHelper(),...this._boxHelpers.values(),...this._constraintHelpers.values(),...this._reflectionProbeHelpers.values(),...this._triggerVolumeHelpers.values(),...[...this._cameraHelpers.values()].map(({helper:t})=>t),...this._spatialHandleRoots]}_suspendPreviewInfrastructure(){const t=this._previewInfrastructure().map(e=>[e,e.visible]);for(const[e]of t)e.visible=!1;return()=>{for(const[e,s]of t)e.visible=s}}_allGizmos(){return[this.transformControls,this._auxRotateControls,this._auxScaleControls]}_anyGizmoDragging(){return this._allGizmos().some(t=>t.dragging)}_attachGizmosTo(t){this.transformControls.attach(t),this._auxRotateControls.attach(t),this._auxScaleControls.attach(t)}_detachGizmos(){for(const t of this._allGizmos())t.detach()}syncFromStore(){this._gizmoHelper.traverse(S=>S.layers.set(M));const t=this._store.transformMode,s=t==="combined"||t==="select"?"translate":t;this.transformControls.mode!==s&&this.transformControls.setMode(s),this._applySnapToGizmos();for(const S of this._allGizmos())S.setSpace(this._store.transformSpace);const i=Mt(),o=this._authoring(),n=i.toolOwner(o,this._store.selectedEntityIds);this._threejsToolContextActive=(this._standaloneAuthoring||i.toolOwnerPainted(this._store,n))&&n?.kind==="three";const r=this._standaloneAuthoring||i.threeSurfaceShowing(this._store,o);this._threeSurfaceShowing=r,this.grid.visible=this._store.showGrid&&r,this._axisLines&&(this._axisLines.visible=this.grid.visible&&this._axesWanted);const l=this._store.helperVisibility,c=this._standaloneAuthoring?null:i.threeViewportRootId(this._store),d=c!==null&&Ls(c);d&&i.applyRootHiddenVisibility(this._objectMap,c),d&&i.suppressRootEnvironment(this._scene);const p=this._store.gizmoEpoch,f=`${this._store.showHelpers}|${JSON.stringify(l)}|${c??""}|${d}|${this._threejsToolContextActive}`,u=this._objectMap!==this._lastGizmoObjectMap,_=f!==this._lastGizmoSig,g=u?null:this._store.ingestObjectMapMembershipChangesSince(this._lastGizmoEpoch),y=u||_||g===null?null:g.changedIds,v=y===null||y.size>0;if(this._lastGizmoObjectMap=this._objectMap,this._lastGizmoSig=f,this._lastGizmoEpoch=p,v){i.applyRootHiddenVisibility(this._objectMap,c);const S=y===null?lo(this._objectMap):co(this._objectMap,y);for(const C of S)C.traverse(A=>{if(U(A,"editorIcon")){A.visible=this._store.showHelpers;return}if(!U(A,"editorHelper"))return;const I=U(A,"editorHelperType");if(I==="skeletons"){A.visible=this._store.showHelpers&&(l.skeletons||!!U(A,"skeletonEnabled"));return}I&&I in l?A.visible=this._store.showHelpers&&l[I]:A.visible=this._store.showHelpers});for(const[C,A]of this._helpers)A.visible=this._store.showHelpers&&(!(C in l)||l[C]);this._syncCameraHelpers(y),this._syncLightHelpers(y)}this._syncAudioHelpers(y),this._syncReflectionProbeHelpers(y),this._syncTriggerVolumeHelpers(y),this._syncConstraintHelpers(y);const w=this._threejsToolContextActive&&o.capabilities.transform&&t!=="select"?this._store.selectedEntityId:null,b=t==="translate"||t==="combined"?"position":t==="rotate"?"rotation":"scale",R=w?t==="combined"?(S=>["position","rotation","scale"].some(C=>o.transforms?.editability?.(S,C).writable??!0))(w):o.transforms?.editability?.(w,b).writable??!0:!1;if(w&&R){if(!this._anyGizmoDragging())if(this._store.pivotMode==="median-point"&&this._store.selectedEntityIds.size>1){const S=new h;let C=0;for(const A of this._store.selectedEntityIds){if(!(o.transforms?.editability?.(A,b).writable??!0))continue;const I=this._objectForAuthoringId(A);I&&(S.add(I.getWorldPosition(fo)),C++)}C>0&&S.divideScalar(C),this._pivotDummy.position.copy(S),this._pivotDummy.quaternion.identity(),this._pivotDummy.scale.set(1,1,1),this._attachedAuthoringId=null,this._dummyIsPresentationAnchor=!1,this._attachGizmosTo(this._pivotDummy)}else{const S=this._objectForAuthoringId(w),C=U(S,"pivot"),A=C&&(C[0]!==0||C[1]!==0||C[2]!==0),I=A?null:this._centreAnchorFor(S);if(I&&S)this._pivotDummy.position.copy(I),this._pivotDummy.quaternion.copy(S.getWorldQuaternion(ae)),this._pivotDummy.scale.copy(S.getWorldScale(Ze)),this._attachedAuthoringId=w,this._dummyIsPresentationAnchor=!0,this._attachGizmosTo(this._pivotDummy);else if(A&&S){const vt=new h(C[0],C[1],C[2]);vt.applyQuaternion(S.getWorldQuaternion(ae)),this._pivotDummy.position.copy(S.getWorldPosition(qe)).add(vt),this._pivotDummy.quaternion.copy(ae),this._pivotDummy.scale.copy(S.getWorldScale(Ze)),this._attachedAuthoringId=w,this._dummyIsPresentationAnchor=!1,this._attachGizmosTo(this._pivotDummy)}else this._dummyIsPresentationAnchor=!1,this.attach(w)}}else this.detach();this._syncBoxHelpers(),this._syncSpatialHandles(),this._syncCombinedGizmoHalves()}_applySnapToGizmos(){const t=this._store.snapEnabled||this._snapHold,e=this._store.snapValues;for(const s of this._allGizmos())s.setTranslationSnap(t?e.translate:null),s.setRotationSnap(t?Y.degToRad(e.rotate):null),s.setScaleSnap(t?e.scale:null)}_onAltOrbitStart=t=>{t.altKey&&t.button===0&&(this._altDragOrbit=!0,this.orbitControls.mouseButtons.LEFT=Qt.ROTATE),(t.button===2||t.altKey&&t.button===0)&&(this._orbitGesture=!0)};_onAltOrbitRelease=()=>{this._orbitGesture=!1,this._orbitGestureCounted=!1,this._altDragOrbit&&(this._altDragOrbit=!1,this.orbitControls.mouseButtons.LEFT=-1)};_onSnapHoldKey=t=>{const e=t.ctrlKey||t.metaKey;if(e!==this._snapHold&&(this._snapHold=e,this._applySnapToGizmos(),e&&this._anyGizmoDragging()&&!this._store.snapEnabled)){const{translate:s,rotate:i,scale:o}=this._store.snapValues;F(`Snapping while held: ${s} units · ${i}° · ×${o}`)}};_syncCombinedGizmoHalves(){if(this._anyGizmoDragging())return;const t=this._store.transformMode==="combined",e=this._attachedAuthoringId,s=this._authoring().transforms?.editability,i=c=>e===null||(s?.(e,c).writable??!0),o=t&&this._auxRotateControls.object!==void 0&&i("rotation"),n=t&&this._auxScaleControls.object!==void 0&&i("scale");this._auxRotateControls.enabled=o,this._auxScaleControls.enabled=n;const r=this._auxRotateControls.getHelper(),l=this._auxScaleControls.getHelper();r.visible=o,l.visible=n;for(const c of[r,l])c.traverse(d=>d.layers.set(M));this.transformControls.enabled=!0}moveGizmosTo(t){const e=this._gizmoObjects();for(const s of e)t.add(s)}restoreGizmos(){const t=this._gizmoObjects();for(const e of t)this._scene.add(e)}_gizmoObjects(){return[this.grid,...this._axisLines?[this._axisLines]:[],this._editorAmbient,this._editorDirLight,this.batchedRenderer,this._gizmoHelper,this._auxRotateControls.getHelper(),this._auxScaleControls.getHelper(),this._pivotDummy,this._surfaceSnapIndicator,...[...this._cameraHelpers.values()].map(({helper:t})=>t),...this._spatialHandleRoots]}_contentBounds(t=!1){const e=performance.now(),s=this._contentBoundsAt===0||e-this._contentBoundsAt>ho;if(t||s){this._contentBoundsBox.makeEmpty();for(const i of this._scene.children)tt(i)||Ms(this._contentBoundsBox,i);this._contentBoundsAt=e}return this._contentBoundsBox}_measureContentBounds(){const t=[];for(const e of this._scene.children)tt(e)||Hs(e,t);this._contentBoundsBox.makeEmpty();for(const e of t)this._contentBoundsBox.union(e);return this._contentBoundsAt=performance.now(),t}_updateClipPlanes(){const t=this._contentBounds();let e=0,s=0;t.isEmpty()||(t.getBoundingSphere(re),e=this.freeCamera.position.distanceTo(re.center),s=re.radius);const{near:i,far:o}=js(e,s);i===this.camera.near&&o===this.camera.far||(this.camera.near=i,this.camera.far=o,this.camera.updateProjectionMatrix(),this.orthographicCamera.near=i,this.orthographicCamera.far=o,this.orthographicCamera.updateProjectionMatrix())}seedFromGameCamera(t){const e=Oe(this._measureContentBounds()),s=ui(t,e);if(!s)return!1;const i=this.camera.position.clone(),o=this.orbitControls.target.clone();this.camera.position.copy(s.position),this.orbitControls.target.copy(s.target),this.camera.lookAt(this.orbitControls.target),this.camera.updateMatrixWorld(!0);const n=this._scene.children.filter(r=>!tt(r));return fi(this.camera,n,s.position.distanceTo(s.target))?(this._updateClipPlanes(),this.orbitControls.update(),!0):(this.camera.position.copy(i),this.orbitControls.target.copy(o),this.camera.lookAt(this.orbitControls.target),this.camera.updateMatrixWorld(!0),!1)}focusOnScene(){const t=Oe(this._measureContentBounds());if(t.isEmpty())return!1;const e=t.getCenter(new h),s=this.camera.position.clone().sub(this.orbitControls.target).normalize(),i=se(t,this.camera,s);return Number.isFinite(i)?(this.camera.position.copy(e).add(s.multiplyScalar(i)),this.orbitControls.target.copy(e),this._orthographicHeight=Math.max(t.getSize(new h).y,t.getSize(new h).x/this._viewportAspect)*1.15,this._syncOrthographicFromPerspective(!0),this._updateClipPlanes(),!0):!1}focusOn(t){const e=this._contentOrProbeBounds(t),s=e.getCenter(new h),i=this.camera.position.clone().sub(this.orbitControls.target).normalize(),o=se(e,this.camera,i);this.camera.position.copy(s).add(i.multiplyScalar(o)),this.orbitControls.target.copy(s);const n=e.getSize(new h);this._orthographicHeight=Math.max(n.y,n.x/this._viewportAspect,.01)*1.15,this._syncOrthographicFromPerspective(!0)}activateVertexSnap(){this._vertexSnapTargets=this._collectVertices(this._store.selectedEntityIds)}deactivateVertexSnap(){this._vertexSnapTargets=[],this._vertexSnapIndicator.visible=!1}focusOnMultiple(t){if(t.length===0)return;if(t.length===1){this.focusOn(t[0]);return}const e=new ft;for(const r of t)e.union(this._contentOrProbeBounds(r));const s=e.getCenter(new h),i=this.camera.position.clone().sub(this.orbitControls.target).normalize(),o=se(e,this.camera,i);this.camera.position.copy(s).add(i.multiplyScalar(o)),this.orbitControls.target.copy(s);const n=e.getSize(new h);this._orthographicHeight=Math.max(n.y,n.x/this._viewportAspect,.01)*1.15,this._syncOrthographicFromPerspective(!0)}_centreAnchorFor(t){const e=this._store.gizmoAnchor;if(!t||e==="pivot"||e==="auto"&&Ps(t)===0)return null;const s=Rt(t);if(s.isEmpty()||e==="auto"&&!As(t,s)?.worldAnchored)return null;const i=s.getCenter(new h);return t.updateWorldMatrix(!0,!1),i.distanceToSquared(t.getWorldPosition(qe))<_o?null:i}_contentOrProbeBounds(t){const e=kt(t);if(!e)return Rt(t);const s=e.config,[i,o,n]=s.size,r=s.shape==="sphere"?new h(1,1,1).multiplyScalar(Math.max(.01,s.radius)):new h(Math.max(.01,i),Math.max(.01,o),Math.max(.01,n)).multiplyScalar(.5);return t.updateWorldMatrix(!0,!1),new ft(r.clone().negate(),r).applyMatrix4(t.matrixWorld)}setHelper(t,e){Yt();const s=this._helpers.get(t);if(s&&(this._scene.remove(s),this._helpers.delete(t)),!e)return;W(e,"editorHelper",!0),W(e,"editorHelperType",t);const i=this._store.helperVisibility;e.visible=this._store.showHelpers&&(!(t in i)||i[t]),this._scene.add(e),this._helpers.set(t,e)}setViewPreset(t){this._projection==="orthographic"&&this.setProjection("perspective");const e=this.orbitControls.target.clone(),s=this.camera.position.distanceTo(e),i=new h;switch(t){case"top":i.set(0,1,0);break;case"front":i.set(0,0,1);break;case"right":i.set(1,0,0);break;case"perspective":i.set(1,1,1).normalize();break}this.camera.position.copy(e).add(i.multiplyScalar(s)),this.camera.lookAt(e),t!=="perspective"&&this.setProjection("orthographic"),this.orbitControls.update()}setPose(t,e,s){this.setProjection("perspective"),this.camera.position.set(t.x,t.y,t.z),this.orbitControls.target.set(e.x,e.y,e.z),this.camera.lookAt(this.orbitControls.target),s!==void 0&&(this.camera.fov=s,this.camera.updateProjectionMatrix()),this.orbitControls.update()}resize(t,e){this._viewportAspect=Math.max(1,t)/Math.max(1,e),this.camera.aspect=this._viewportAspect,this.camera.fov=Ke(this._viewportAspect),this.camera.updateProjectionMatrix(),this._applyOrthographicFrustum(),this._applyGizmoSize()}update(t=0){this._ensureSparkRenderer(),this._syncLookBackground();const e=this.transformControls.object;if(e&&e!==this._pivotDummy&&!e.parent&&(this._detachGizmos(),this.syncFromStore()),this._updateFlyCamera(t),this.orbitControls.update(),this._snapAnimating){const s=performance.now()-this._snapStartTime;let i=Math.min(s/this._snapDuration,1);i=i<.5?4*i*i*i:1-(-2*i+2)**3/2;const o=new T().slerpQuaternions(this._snapQ1,this._snapQ2,i),n=new h(0,0,1).applyQuaternion(o);this.freeCamera.position.copy(this.orbitControls.target).add(n.multiplyScalar(this._snapDist)),this.freeCamera.lookAt(this.orbitControls.target),i>=1&&(this._snapAnimating=!1)}for(const s of this._boxHelpers.values()){if(s instanceof ne){s.updateIfNeeded();continue}const i=s;i._entityObj?i._entityObj.getWorldPosition(s.position):s instanceof xe&&s.update()}for(const s of this._constraintHelpers.values())s.update(this.camera);for(const s of this._reflectionProbeHelpers.values())s.update();for(const s of this._triggerVolumeHelpers.values())s.update();for(const{helper:s}of this._cameraHelpers.values())s.update();for(const s of this._spatialHandleMeshes)Xe(s,this.renderCamera);this._enforceLodForcedLevels(),this._updateClipPlanes()}_enforceLodForcedLevels(){const t=new Set(this._objectMap.values());for(const[e,s]of this._store.lodForcedLevels){const i=this._objectMap.get(e),o=i?Es(i,r=>t.has(r)):null;if(!o||o.levels.length===0)continue;o.autoUpdate=!1;const n=Math.min(Math.max(s,0),o.levels.length-1);for(let r=0;r<o.levels.length;r++)o.levels[r].object.visible=r===n}}renderWithInfrastructure(t){const e=this._sparkRenderer,s=this._cameraView?this._suspendPreviewInfrastructure():null;e&&this._scene.add(e);try{t()}finally{e?.removeFromParent(),s?.()}}renderViewCube(t){if(!this._threeSurfaceShowing||this._cameraView)return;const e=t.domElement.clientWidth,s=t.domElement.clientHeight,i=this._vcSize,o=this._vcDir.subVectors(this.freeCamera.position,this.orbitControls.target).normalize();this._vcCamera.position.copy(o.multiplyScalar(4)),this._vcCamera.up.copy(this.freeCamera.up),this._vcCamera.lookAt(0,0,0),this._syncOrientationGizmoDepth();const n=e-i-this._vcMarginRight-this._chromeInsetPx,r=s-i-this._vcMarginTop-this._chromeInsetPx,l=t.autoClear;try{t.setScissorTest(!0),t.setViewport(n,r,i,i),t.setScissor(n,r,i,i),t.clear(!1,!0,!1),t.autoClear=!1,t.render(this._vcScene,this._vcCamera)}finally{t.autoClear=l,t.setScissorTest(!1),t.setViewport(0,0,e,s)}}renderCameraPreview(t,e,s){if(!e||!s||this._cameraView)return;const i=t.domElement.clientWidth,o=t.domElement.clientHeight,n=t.domElement.getBoundingClientRect(),r=s.getBoundingClientRect(),l=Math.round(r.left-n.left),c=Math.round(n.bottom-r.bottom),d=Math.max(1,Math.round(r.width)),p=Math.max(1,Math.round(r.height));if(l>=i||c>=o||l+d<=0||c+p<=0)return;const f=this._suspendPreviewInfrastructure(),u=t.getClearColor(this._previewClearColor),_=t.getClearAlpha();try{t.setScissorTest(!0),t.setViewport(l,c,d,p),t.setScissor(l,c,d,p),t.setClearColor(1118740,1),t.clear(),t.render(this._scene,e)}finally{t.setScissorTest(!1),t.setViewport(0,0,i,o),t.setClearColor(u,_),f()}}get isFlying(){return this._flyActive}_inputDisconnected=!1;disconnectInput(){if(!this._inputDisconnected){this._inputDisconnected=!0,this._publishPickContext&&ze(null),window.removeEventListener("keydown",this._onFlyKeyDown),window.removeEventListener("keyup",this._onFlyKeyUp),this._interactionElement.removeEventListener("pointerdown",this._onFlyPointerDown),this._canvas.removeEventListener("pointerdown",this._onAltOrbitStart,{capture:!0}),window.removeEventListener("pointerup",this._onAltOrbitRelease,{capture:!0}),window.removeEventListener("pointercancel",this._onAltOrbitRelease,{capture:!0}),window.removeEventListener("keydown",this._onSnapHoldKey),window.removeEventListener("keyup",this._onSnapHoldKey),this._interactionElement.removeEventListener("pointerup",this._onFlyPointerUp),this._interactionElement.removeEventListener("pointermove",this._onFlyPointerMove),this._interactionElement.removeEventListener("wheel",this._onFlyWheel),this._interactionElement.removeEventListener("wheel",this._onTrackpadWheel),this._canvas.removeEventListener("pointerdown",this._onPointerDown),this._interactionElement.removeEventListener("pointermove",this._onPointerMove),this._onInteractionPointerUp&&this._interactionElement.removeEventListener("pointerup",this._onInteractionPointerUp),this._onInteractionDblClick&&this._interactionElement.removeEventListener("dblclick",this._onInteractionDblClick),this._canvas.removeEventListener("dragover",this._onDragOver),this._canvas.removeEventListener("dragleave",this._onDragLeave),this._canvas.removeEventListener("drop",this._onDrop),this.orbitControls.dispose();for(const t of this._allGizmos())t.dispose()}}_applyViewportLook(t){this._lookGridHex=t.grid??10066329;const e=this.grid.material.uniforms.uGrazingFade;if(e&&(e.value=t.background!==null?1:0),this._paintLookGrid(),this._axesWanted=t.axisX!==null&&t.axisY!==null,this._lookAxisHexes=t.axisX!==null&&t.axisY!==null?{x:t.axisX,y:t.axisY}:null,this._paintLookAxes(),this._axisLines&&(this._axisLines.visible=this.grid.visible&&this._axesWanted),t.background!==null){const s=this._scene.background,i=s===null||s instanceof x&&[this._lookBackgroundHex,t.background].includes(s.getHex());this._lookBackgroundHex=t.background,i&&this._paintLookBackground()}else this._lookBackgroundHex=null}_paintLookGrid(){const t=this._lookGridHex;if(t===null)return;const e=this._lookBackgroundHex??4144959,s=r=>{const l=t>>r&255,c=e>>r&255;return Math.round(Math.min(255,Math.max(0,c+(l-c)*wo)))},i=s(16)<<16|s(8)<<8|s(0),o=Ye(t,this._renderer),n=Ye(i,this._renderer);this.grid.material.uniforms.uColor?.value?.copy(o),this.grid.material.uniforms.uMajorColor?.value?.copy(n)}_paintLookAxes(){const t=this._lookAxisHexes;if(!this._axisLines||t===null)return;const e=new x(t.x),s=new x(t.y),i=[];for(const o of[e,s])for(let n=0;n<Xt*2;n++)i.push(o.r,o.g,o.b);this._axisLines.geometry.setColors(i)}_paintLookBackground(){this._lookBackgroundHex!==null&&(this._scene.background=new x(this._lookBackgroundHex))}_syncLookBackground(){this._renderer&&(this._renderer.toneMapping===this._lookToneMapping&&this._renderer.toneMappingExposure===this._lookExposure||(this._paintLookGrid(),this._lookToneMapping=this._renderer.toneMapping,this._lookExposure=this._renderer.toneMappingExposure))}dispose(){this._disposed=!0,this._unsubscribeSelectionTheme(),this._axisLines&&(this._scene.remove(this._axisLines),this._axisLines.geometry.dispose(),this._axisLines.material.dispose(),this._axisLines=null),this.clearCameraView(),this._sparkRenderer&&(this._scene.remove(this._sparkRenderer),Is(this._sparkRenderer),this._sparkRenderer=null),this.disconnectInput(),this._hideDropOverlay();for(const t of this._helpers.values())this._scene.remove(t);this._helpers.clear();for(const t of this._boxHelpers.values())this._scene.remove(t),t.geometry.dispose(),t.material.dispose();this._boxHelpers.clear();for(const t of this._reflectionProbeHelpers.values())t.dispose();this._reflectionProbeHelpers.clear();for(const t of this._triggerVolumeHelpers.values())t.dispose();this._triggerVolumeHelpers.clear();for(const t of this._constraintHelpers.values())t.dispose();this._constraintHelpers.clear();for(const{helper:t}of this._cameraHelpers.values())t.dispose();this._cameraHelpers.clear(),We(this._spatialHandleRoots),this._spatialHandleRoots=[],this._spatialHandleMeshes=[]}_ensureSparkRenderer(){if(!this._renderer||this._sparkRenderer||this._sparkRendererLoading||this._sparkRendererFailed)return;const t=performance.now();Ts(this._lastSparkDiscoveryAt,t)&&(this._lastSparkDiscoveryAt=t,zs(this._scene)&&(this._sparkRendererLoading=!0,Rs(async()=>{const{SparkRenderer:e}=await import("./spark.module-4pXQoz5d.js");return{SparkRenderer:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])).then(({SparkRenderer:e})=>{if(this._disposed||!this._renderer)return;const s=new e({renderer:this._renderer,enableLod:!1});s.traverse(i=>W(i,"engineInternal",!0)),this._sparkRenderer=s,Yt()}).catch(e=>{this._sparkRendererFailed=!0,console.error("Failed to install SparkRenderer in the editor viewport.",e)}).finally(()=>{this._sparkRendererLoading=!1})))}_buildOrientationGizmo(){if(this._vcScene!==void 0){for(const t of[...this._vcScene.children])this._vcScene.remove(t);this._vcBalls.length=0,this._vcStalks.length=0,this._vcClickTargets.length=0,this._initOrientationGizmo()}}_initOrientationGizmo(){const t=at/3,e=de/t,s=Mo/t,i=ds/t/2,o=[new h(1,0,0),new h(0,1,0),new h(0,0,1)],n=new Q(e*.6,8,8),r=new X({visible:!1});for(let l=0;l<3;l++){const[c,d]=this._lookAxisFrame[l],p=vo[c],f=go[c],u=o[l].clone().multiplyScalar(d),_=new m(new O(i,i,s,8),new X({color:p,transparent:!0,depthTest:!1}));_.position.copy(u).multiplyScalar(s/2),_.quaternion.setFromUnitVectors(new h(0,1,0),u),this._vcScene.add(_),this._vcStalks.push({mesh:_,direction:u.clone()});for(const g of[1,-1]){const y=u.clone().multiplyScalar(g),v=new oi(new ni({map:So(p,g>0?f:null),transparent:!0,depthTest:!1}));v.position.copy(y).multiplyScalar(s),v.scale.setScalar(e),this._vcScene.add(v),this._vcBalls.push({sprite:v,direction:y.clone(),positive:g>0});const w=new m(n,r);w.position.copy(v.position),W(w,"vcDirIdx",l*2+(d*g>0?0:1)),this._vcScene.add(w),this._vcClickTargets.push(w)}}}_syncOrientationGizmoDepth(){const t=at/3,e=this._vcDir.copy(this._vcCamera.position).normalize();for(const{sprite:s,direction:i,positive:o}of this._vcBalls){const n=(i.dot(e)+1)/2,r=s.material;r.opacity=o?1:.56+n*.44,s.scale.setScalar((de+Ho*n)/t),s.renderOrder=10+Math.round(n*100)}for(const{mesh:s,direction:i}of this._vcStalks){const o=(i.dot(e)+1)/2;s.material.opacity=.35+o*.65,s.renderOrder=Math.round(o*100)}}_isOverViewCube(t,e){const s=this._canvas.getBoundingClientRect(),i=t-s.left,o=e-s.top,n=s.width-this._vcSize-this._vcMarginRight,r=this._vcMarginTop;return i>=n&&i<=n+this._vcSize&&o>=r&&o<=r+this._vcSize}_handleViewCubeClick(t){if(!this._isOverViewCube(t.clientX,t.clientY))return!1;const e=this._canvas.getBoundingClientRect(),s=t.clientX-e.left,i=t.clientY-e.top,o=e.width-this._vcSize-this._vcMarginRight,n=this._vcMarginTop,r=(s-o)/this._vcSize*2-1,l=-((i-n)/this._vcSize*2-1);this._vcRaycaster.setFromCamera(new K(r,l),this._vcCamera);const c=this._vcRaycaster.intersectObjects(this._vcClickTargets);if(c.length===0)return!0;const d=U(c[0].object,"vcDirIdx"),p=mo[d],f=new h().subVectors(this.freeCamera.position,this.orbitControls.target).normalize();return this._snapDist=this.freeCamera.position.distanceTo(this.orbitControls.target),this._snapQ1.setFromUnitVectors(new h(0,0,1),f),this._snapQ2.setFromUnitVectors(new h(0,0,1),p),this._snapStartTime=performance.now(),this._snapAnimating=!0,!0}_flushGizmoToStoreLive(){this._skipNextSync=!0;const t=this._authoring(),e=(i,o)=>{i&&Ce(t,i,{position:o.position.toArray(),rotation:o.quaternion.toArray(),scale:o.scale.toArray()})},s=this._activeGizmo.object;s&&s!==this._pivotDummy&&e(this._attachedAuthoringId??this._authoringIdForObject(s),s);for(const{id:i,obj:o}of this._otherDragObjects)e(i,o);for(const{id:i,obj:o}of this._allDragObjects)e(i,o);for(const{id:i,obj:o}of this._preservedChildObjects)e(i,o)}_preparePreservedChildren(t){if(!this._store.preserveChildrenTransform)return[];const e=this._authoring(),s=new Set(t),i=new Map;for(const o of s){const n=this._preservedChildrenForParent(e,o,s,i);if(typeof n=="string")return F(n),[];for(const r of n)i.set(r.id,r)}return[...i.values()]}_preservedChildrenForParent(t,e,s,i){const o=[];for(const n of t.hierarchy.node(e)?.childIds??[]){if(s.has(n)||i.has(n))continue;const r=this._objectForAuthoringId(n);if(!r?.parent)continue;const l=this._unwritableTransformChannel(t,n);if(l){const c=t.hierarchy.node(n)?.label??n;return`Preserve Children Transform needs writable ${l} on ${c}. The parent will transform normally.`}r.updateWorldMatrix(!0,!1),o.push({id:n,obj:r,worldMatrix:r.matrixWorld.clone()})}return o}_unwritableTransformChannel(t,e){return["position","rotation","scale"].find(s=>!(t.transforms?.editability?.(e,s).writable??!1))}_restorePreservedChildren(){const t=new fe;for(const e of this._preservedChildObjects){const s=e.obj.parent;s&&(s.updateWorldMatrix(!0,!1),t.copy(s.matrixWorld).invert().multiply(e.worldMatrix),t.decompose(e.obj.position,e.obj.quaternion,e.obj.scale),e.obj.updateMatrix(),e.obj.updateWorldMatrix(!1,!0))}}_belongsToRoots(t,e){let s=t;for(;s;){if(e.has(s))return!0;s=s.parent}return!1}_floorSnapPosition(t,e){t.updateWorldMatrix(!0,!0);const s=Rt(t);if(s.isEmpty())return null;const i=Math.min((s.max.x-s.min.x)*.1,.05),o=Math.min((s.max.z-s.min.z)*.1,.05),n=[[(s.min.x+s.max.x)/2,(s.min.z+s.max.z)/2],[s.min.x+i,s.min.z+o],[s.max.x-i,s.min.z+o],[s.min.x+i,s.max.z-o],[s.max.x-i,s.max.z-o]],r=new et;r.layers.enableAll();const l=s.min.y+Math.max((s.max.y-s.min.y)*.001,.001);let c=Number.NEGATIVE_INFINITY;for(const[f,u]of n){r.set(new h(f,l,u),new h(0,-1,0));const _=r.intersectObjects(this._scene.children,!0).find(g=>!this._belongsToRoots(g.object,e)&&!tt(g.object)&&g.point.y<=l);_&&(c=Math.max(c,_.point.y))}if(!Number.isFinite(c))return null;const d=c-s.min.y;if(Math.abs(d)<1e-6)return null;const p=t.getWorldPosition(new h);return p.y+=d,t.parent?(t.parent.updateWorldMatrix(!0,!1),t.parent.worldToLocal(p)):p}snapSelectionToFloor(){const t=this._authoring(),e=t.transforms;if(!e){F("This document does not expose writable transforms.");return}const s=[...this._store.selectedEntityIds].map(l=>({id:l,obj:this._objectForAuthoringId(l)})).filter(l=>!!l.obj&&(e.editability?.(l.id,"position").writable??!0)),i=new Set(s.map(({obj:l})=>l)),o=s.filter(({obj:l})=>{let c=l.parent;for(;c;){if(i.has(c))return!1;c=c.parent}return!0});if(o.length===0){F("Select an object with a writable position first.");return}const n=new Set(o.map(({obj:l})=>l)),r=[];for(const l of o){const c=this._floorSnapPosition(l.obj,n);c&&r.push({...l,position:c})}if(r.length===0){F("No solid scene surface was found beneath the selection.");return}for(const{id:l}of r)Se(t,l);for(const{obj:l,position:c}of r)l.position.copy(c);this._skipNextSync=!0;for(const{id:l,obj:c}of r)Ce(t,l,{position:c.position.toArray(),rotation:c.quaternion.toArray(),scale:c.scale.toArray()});for(const{id:l}of r)Me(t,l);this.syncFromStore()}_applySurfaceSnap(t,e){const s=new Set,i=this._attachedAuthoringId??this._authoringIdForObject(t);i&&s.add(i);for(const{id:c}of e)s.add(c);const o=[];for(const[c,d]of this._objectMap)s.has(c)||o.push(d);if(o.push(this.grid),o.length===0){this._surfaceSnapIndicator.visible=!1;return}const n=t.position.clone();n.y+=50,this._surfaceSnapRaycaster.set(n,new h(0,-1,0)),this._surfaceSnapRaycaster.far=200;const l=this._surfaceSnapRaycaster.intersectObjects(o,!0).find(c=>c.object===this.grid||!tt(c.object));if(l){const c=l.point,d=c.y,p=d-t.position.y;t.position.y=d;for(const{obj:u}of e)u.position.y+=p;this._surfaceSnapIndicator.position.copy(c),this._surfaceSnapIndicator.position.y+=.01;const f=l.face?.normal;if(f){const u=f.clone().transformDirection(l.object.matrixWorld);this._surfaceSnapIndicator.quaternion.setFromUnitVectors(new h(0,1,0),u)}this._surfaceSnapIndicator.visible=!0}else this._surfaceSnapIndicator.visible=!1}_collectVertices(t){const e=[];for(const[i,o]of this._objectMap)t.has(i)||o.traverse(n=>{if(tt(n))return;const r=n;if(!r.isMesh||!r.geometry)return;const l=r.geometry.getAttribute("position");if(!l)return;const c=Math.min(l.count,1e3),d=r.matrixWorld;for(let p=0;p<c;p++){const f=new h(l.getX(p),l.getY(p),l.getZ(p));f.applyMatrix4(d),e.push(f)}});return e}_applyVertexSnap(t,e){const s=t.position,i=s.clone().project(this.renderCamera),o=this._canvas.getBoundingClientRect(),n=(i.x+1)/2*o.width,r=(-i.y+1)/2*o.height;let l=this._vertexSnapThreshold,c=null;for(const d of this._vertexSnapTargets){const p=d.clone().project(this.renderCamera);if(p.z>1)continue;const f=(p.x+1)/2*o.width,u=(-p.y+1)/2*o.height,_=n-f,g=r-u,y=Math.sqrt(_*_+g*g);y<l&&(l=y,c=d)}if(c){const d=c.clone().sub(s);t.position.copy(c);for(const{obj:f}of e)f.position.add(d);this._vertexSnapIndicator.position.copy(c),this._vertexSnapIndicator.visible=!0;const p=c.distanceTo(this.renderCamera.position);this._vertexSnapIndicator.scale.setScalar(p*.008)}else this._vertexSnapIndicator.visible=!1}_flushGizmoToStore(){this._flushGizmoToStoreLive();const t=this._activeTransformEditIds;this._activeTransformEditIds=[],this._otherDragObjects=[],this._allDragObjects=[],this._preservedChildObjects=[];const e=this._authoring();for(const s of t)Me(e,s)}consumeSkipSync(){return this._skipNextSync?(this._skipNextSync=!1,!0):!1}_applyGizmoSize(){if(this.transformControls===void 0)return;const t=this._lookGizmoSizePx,e=Math.max(1,this._canvas.clientHeight),s=t===null?null:2*t,i=s===null?1:this.freeCamera instanceof Nt?4*s/e:s/(.2375*e);for(const o of this._allGizmos())o.size=i}_dropNegativeAxisHandles(t,e){const s=t.children.find(o=>o.isTransformControlsGizmo);if(!s)return;const i={X:new h(1,0,0),Y:new h(0,1,0),Z:new h(0,0,1)};for(const o of e)for(const n of[s.gizmo[o],s.picker[o]])if(n)for(const r of[...n.children]){const l=i[r.name];if(l===void 0)continue;const c=r;if(!c.geometry)continue;c.geometry.computeBoundingBox();const d=c.geometry.boundingBox;d&&d.getCenter(new h).dot(l)<0&&n.remove(r)}}_axisColorMap(){const t=o=>new x(...J[this._lookAxisFrame[o][0]]),e=t(0),s=t(1),i=t(2);return{X:e,Y:s,Z:i,XY:i,YZ:e,XZ:s}}_readLookStage(t){this._lookAxisFrame=ve(t)==="z"?Ue:le,this._lookBoxSelect=be(t),this._applyGizmoAxisFrame(),this._buildOrientationGizmo()}_applyGizmoAxisFrame(){if(this.transformControls===void 0)return;const t=this._lookAxisFrame.map(([,r])=>r),e=[0,1,2].map(r=>t[r]===this._appliedAxisSigns[r]?1:-1),s=e.some(r=>r===-1),i=this._axisColorMap(),o={X:new x(...J[0]),Y:new x(...J[1]),Z:new x(...J[2]),XY:new x(...J[2]),YZ:new x(...J[0]),XZ:new x(...J[1])},n=(r,l,c,d=!1)=>{r&&r.traverse(p=>{const f=p;c&&f.geometry&&f.geometry.scale(e[0],e[1],e[2]),d&&f.material&&!Array.isArray(f.material)&&!f.userData.vgaiOwnMaterial&&(f.material=f.material.clone(),f.userData.vgaiOwnMaterial=!0);const u=f.material;if(!u||Array.isArray(u))return;c&&(u.side=Bt);const _=l[p.name];_&&u.color&&(u.color.copy(_),u._color=void 0)})};for(const r of this._allGizmos()){const l=r.getHelper().children.find(c=>c.isTransformControlsGizmo);if(l)for(const c of["gizmo","picker","helper"])n(l[c]?.translate,i,s),n(l[c]?.rotate,i,!1),n(l[c]?.scale,o,!1,!0)}s&&(this._appliedAxisSigns=t)}_patchGizmo(t){const e=this._axisColorMap(),s={XY:[-.075,-.075,0],YZ:[0,-.075,-.075],XZ:[-.075,0,-.075]};t.traverse(i=>{const o=i,n=e[i.name];if(n&&o.material){const l=o.material;l.color&&l.color.copy(n)}const r=s[i.name];r&&o.geometry&&o.geometry.translate(r[0],r[1],r[2])})}_patchCombinedScaleGizmo(t){const s=t.children.find(r=>r.isTransformControlsGizmo);if(!s)return;const i={X:new h(1,0,0),Y:new h(0,1,0),Z:new h(0,0,1)},o=.54+.55,n=.3;for(const[r,l]of[[s.gizmo.scale,!1],[s.picker.scale,!0]])if(r)for(const c of[...r.children]){const d=c,p=i[c.name],f=p!==void 0&&d.geometry?.type==="CylinderGeometry"&&d.geometry.parameters.radiusTop<.05;if(p===void 0||f){r.remove(c);continue}d.geometry.computeBoundingBox();const u=d.geometry.boundingBox;if(!u)continue;const _=Math.sign(u.getCenter(new h).dot(p))||1;if(l){const y=p.clone().multiplyScalar(_*o);d.geometry.dispose(),d.geometry=new E(n,n,n).translate(y.x,y.y,y.z);continue}const g=p.clone().multiplyScalar(_*.55);d.geometry.translate(g.x,g.y,g.z)}}_projectToScreen(t){const e=new h;t.getWorldPosition(e),e.project(this.renderCamera);const s=this._canvas.getBoundingClientRect();return new K((e.x+1)/2*s.width+s.left,(-e.y+1)/2*s.height+s.top)}static _FLY_KEYS=new Set(["w","a","s","d","q","e"]);_enterFlyMode(){this._flyActive||this._cameraViewMode!=="view"&&(this._flyActive=!0,this._snapAnimating=!1,this.orbitControls.enabled=!1,this._flyEuler.setFromQuaternion(this.renderCamera.quaternion,"YXZ"),this.orbitControls.dispatchEvent({type:"start"}),this._canvas.requestPointerLock?.())}_exitFlyMode(){if(!this._flyActive)return;this._flyActive=!1,this._flyKeys.clear(),this.orbitControls.enabled=this._cameraViewMode!=="view",document.exitPointerLock();const t=this.renderCamera,e=new h(0,0,-1).applyQuaternion(t.quaternion),s=t.position.distanceTo(this.orbitControls.target);this.orbitControls.target.copy(t.position).add(e.multiplyScalar(Math.max(s,5))),this.orbitControls.dispatchEvent({type:"end"})}_updateFlyCamera(t){if(!this._flyActive||this._flyKeys.size===0)return;const e=this.renderCamera,s=this._flySpeed*(this._flyKeys.has("shift")?3:1),i=new h(0,0,-1).applyQuaternion(e.quaternion),o=new h(1,0,0).applyQuaternion(e.quaternion),n=new h;this._flyKeys.has("w")&&n.add(i),this._flyKeys.has("s")&&n.sub(i),this._flyKeys.has("d")&&n.add(o),this._flyKeys.has("a")&&n.sub(o),this._flyKeys.has("e")&&(n.y+=1),this._flyKeys.has("q")&&(n.y-=1),n.lengthSq()>0&&(n.normalize().multiplyScalar(s*t),e.position.add(n),this.orbitControls.dispatchEvent({type:"change"}))}_onFlyKeyDown=t=>{if(!this._rightMouseDown||t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement||t.target instanceof HTMLSelectElement)return;const e=t.key.toLowerCase();if(e==="shift"){this._flyKeys.add("shift");return}ms._FLY_KEYS.has(e)&&(t.preventDefault(),t.stopPropagation(),this._flyKeys.add(e),this._flyActive||this._enterFlyMode())};_onFlyKeyUp=t=>{const e=t.key.toLowerCase();if(e==="shift"){this._flyKeys.delete("shift");return}this._flyKeys.delete(e)};_onFlyPointerDown=t=>{t.button===2&&(this._rightMouseDown=!0)};_onFlyPointerUp=t=>{t.button===2&&(this._rightMouseDown=!1,this._flyActive&&this._exitFlyMode())};_onFlyPointerMove=t=>{if(!this._flyActive)return;const e=.002;this._flyEuler.y-=t.movementX*e,this._flyEuler.x-=t.movementY*e,this._flyEuler.x=Math.max(-Math.PI/2+.01,Math.min(Math.PI/2-.01,this._flyEuler.x)),this.renderCamera.quaternion.setFromEuler(this._flyEuler),this.orbitControls.dispatchEvent({type:"change"})};_onTrackpadWheel=t=>{if(this._flyActive||!this.orbitControls.enabled||t.ctrlKey||Math.abs(t.deltaX)<.5&&!t.shiftKey)return;t.preventDefault(),t.stopImmediatePropagation();const e=this._interactionElement.clientHeight||1,s=this.camera.position.distanceTo(this.orbitControls.target),i=2*Math.tan(this.camera.fov/2*Math.PI/180)*s/e,o=t.deltaMode===1?16:1,n=d=>Math.sign(d)*Math.min(Math.abs(d*o),30),r=new h().setFromMatrixColumn(this.camera.matrix,0),l=new h().setFromMatrixColumn(this.camera.matrix,1),c=r.multiplyScalar(n(t.deltaX)*i).add(l.multiplyScalar(-n(t.deltaY)*i));this.camera.position.add(c),this.orbitControls.target.add(c),this.orbitControls.update()};_onFlyWheel=t=>{if(!this._flyActive)return;t.preventDefault();const e=t.deltaY>0?.85:1.18;this._flySpeed=Math.max(.5,Math.min(100,this._flySpeed*e))};_onPointerDown=t=>{if(this._pointerDownPos.set(t.clientX,t.clientY),this._pointerDownButton=t.button,this._marqueeActive=!1,this._pointerSessionActive=!0,this._constraintControlPointerSession=!1,t.button===0&&!t.altKey){if(this._selectConstraintControlAt(t))return;const e=this._raycastSpatialHandle(t),s=e?Ve(e):null;if(e&&s?.handle.writable){t.stopPropagation(),this._activeSpatialHandle=s,this._spatialHandleDragPoint.copy(e.position),this._orbitEnabledBeforeHandleDrag=this.orbitControls.enabled,this._transformEnabledBeforeHandleDrag=this.transformControls.enabled,this.orbitControls.enabled=!1;for(const n of this._allGizmos())n.enabled=!1;const i=this.renderCamera.getWorldDirection(new h);this._spatialHandleDragPlane.setFromNormalAndCoplanarPoint(i,e.position),this._spatialHandleDragOffset.set(0,0,0);const o=this._spatialHandleWorldPoint(t);o&&this._spatialHandleDragOffset.subVectors(e.position,o),this._canvas.style.cursor="grabbing"}}};_onPointerMove=t=>{if(this._updateEditorHandleInteraction(t)||(this._updateSpatialHandleHover(t),!this._pointerSessionActive)||!(t.buttons&1)||this._pointerDownButton!==0||this._anyGizmoDragging()||this._altDragOrbit)return;const e=t.clientX-this._pointerDownPos.x,s=t.clientY-this._pointerDownPos.y;if(!this._marqueeActive&&Math.sqrt(e*e+s*s)>5){const i=this._canvas.getBoundingClientRect(),o=this._pointerDownPos.x-i.left,n=this._pointerDownPos.y-i.top,r=i.width-this._vcSize-this._vcMarginRight;if(o>=r&&o<=r+this._vcSize&&n>=this._vcMarginTop&&n<=this._vcMarginTop+this._vcSize)return;this._marqueeActive=!0,this.orbitControls.enabled=!1,this._marqueeDiv||(this._marqueeDiv=document.createElement("div"),Object.assign(this._marqueeDiv.style,{position:"fixed",border:`1px solid ${Et.accent.default}`,background:Et.accent.muted,pointerEvents:"none",zIndex:He.sticky}),(document.getElementById("editor-chrome-root")??document.body).appendChild(this._marqueeDiv))}if(this._marqueeActive&&this._marqueeDiv){const i=Math.min(this._pointerDownPos.x,t.clientX),o=Math.min(this._pointerDownPos.y,t.clientY),n=Math.abs(t.clientX-this._pointerDownPos.x),r=Math.abs(t.clientY-this._pointerDownPos.y);Object.assign(this._marqueeDiv.style,{left:`${i}px`,top:`${o}px`,width:`${n}px`,height:`${r}px`,display:"block"})}};_onPointerUp=t=>{if(!this._pointerSessionActive)return;if(this._pointerSessionActive=!1,this._activeSpatialHandle){this._finishSpatialHandleDrag(!0);return}if(this._constraintControlPointerSession){this._constraintControlPointerSession=!1;return}if(this._marqueeActive){this._marqueeActive=!1,this.orbitControls.enabled=!0,this._marqueeDiv&&(this._marqueeDiv.style.display="none");const n=Math.min(this._pointerDownPos.x,t.clientX),r=Math.max(this._pointerDownPos.x,t.clientX),l=Math.min(this._pointerDownPos.y,t.clientY),c=Math.max(this._pointerDownPos.y,t.clientY),d=[],p=new h,f=new ft;for(const[u,_]of this._objectMap){if(!_.visible||_.isCamera===!0)continue;if(f.setFromObject(_),f.isEmpty()){const C=this._projectToScreen(_);C.x>=n&&C.x<=r&&C.y>=l&&C.y<=c&&d.push(u);continue}const g=this._lookBoxSelect==="touch",y=this._canvas.getBoundingClientRect();let v=!0,w=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY,L=Number.POSITIVE_INFINITY,R=Number.NEGATIVE_INFINITY;for(let C=0;C<8;C++){if(p.set(C&1?f.max.x:f.min.x,C&2?f.max.y:f.min.y,C&4?f.max.z:f.min.z),p.project(this.camera),p.z<-1||p.z>1){if(v=!1,!g)break;continue}const A=y.left+(p.x+1)*y.width/2,I=y.top+(1-p.y)*y.height/2;(A<n||A>r||I<l||I>c)&&(v=!1),w=Math.min(w,A),b=Math.max(b,A),L=Math.min(L,I),R=Math.max(R,I)}const S=w<=b&&b>=n&&w<=r&&R>=l&&L<=c;(g?S:v)&&d.push(u)}if(t.shiftKey)for(const u of d)this._store.addToSelection(u);else Pt(this._authoring(),d);return}if(t.button!==0)return;const e=t.clientX-this._pointerDownPos.x,s=t.clientY-this._pointerDownPos.y;if(Math.sqrt(e*e+s*s)>5||this._anyGizmoDragging()||this._threejsToolContextActive&&this._handleViewCubeClick(t))return;const i=t.shiftKey&&(t.metaKey||t.ctrlKey),o=Os(this._scopeAuthoring(),()=>this._pickAt(t.clientX,t.clientY,i?"deep":"normal"));i?Pt(this._authoring(),o?[o]:[]):t.shiftKey&&o?this._store.toggleSelection(o):(t.metaKey||t.ctrlKey)&&o?this._store.toggleSelection(o):Pt(this._authoring(),o?[o]:[])};_scopeAuthoring(){return this._standaloneAuthoring?this._authoring():Mt().panelAuthoring(this._store)}_pickAt(t,e,s){return this._pick?this._pick(t,e):Mt().pick(this._store,t,e,s)}_onDoubleClick=t=>{if(t.button!==0||this._anyGizmoDragging()||this._marqueeActive||this._threejsToolContextActive&&this._isOverViewCube(t.clientX,t.clientY))return;const e=this._pickAt(t.clientX,t.clientY,"normal");e&&Ds(this._scopeAuthoring(),e,()=>this._pickAt(t.clientX,t.clientY,"normal"))};_raycastGroundPlane(t){const e=this._canvas.getBoundingClientRect(),s=new K((t.clientX-e.left)/e.width*2-1,-((t.clientY-e.top)/e.height)*2+1);this.raycaster.setFromCamera(s,this.renderCamera);const i=Pe("three");this._groundPlane.set(i.up==="z"?uo:po,-i.groundHeight);const o=new h;return this.raycaster.ray.intersectPlane(this._groundPlane,o)}_showDropOverlay(){if(this._dropOverlay)return;const t=document.createElement("div");Object.assign(t.style,{position:"fixed",inset:"0",pointerEvents:"none",border:`2px dashed ${Et.accent.default}`,background:Et.accent.muted,zIndex:He.base}),(document.getElementById("editor-chrome-root")??document.body).appendChild(t),this._dropOverlay=t}_hideDropOverlay(){this._dropOverlay&&(this._dropOverlay.remove(),this._dropOverlay=null)}_onDragOver=t=>{t.dataTransfer?.types.includes("application/x-editor-asset")&&(t.preventDefault(),t.dataTransfer.dropEffect="copy",this._showDropOverlay())};_onDragLeave=t=>{this._hideDropOverlay()};_onDrop=t=>{this._hideDropOverlay();const e=t.dataTransfer?.getData("application/x-editor-asset");if(!e)return;t.preventDefault();let s;try{s=JSON.parse(e)}catch{return}const i=Pe("three"),o=this._raycastGroundPlane(t),n=p=>Math.round(p*100)/100,r=i.up==="z"?[n(o?.x??0),n(o?.y??0),i.groundHeight]:[n(o?.x??0),i.groundHeight,n(o?.z??0)],l=this._authoring(),c=l.assetDrop,d=s.component??{kind:"file",name:s.name};if(!c){At.warn(`Dropped “${s.name}” was not placed: this document does not accept dropped assets.`,"editor");return}if(s.online){const p=s.online,f=this._onlineAssetResolver;if(!f){At.warn(`Dropped “${s.name}” was not placed: this viewport has no online-asset resolver installed.`,"editor");return}F(`Downloading ${p.name} from the library…`),f(p).then(u=>{u?(F(`${p.name} downloaded — placing it.`),Ae(l,"",u,{position:r})):F(`Could not download ${p.name} — see the Console.`)}).catch(()=>{F(`Could not download ${p.name} — see the Console.`),At.error(`Could not download ${p.name}.`,"asset")});return}Ae(l,"",s.path,{position:r,item:d})}}const Ko=a=>!ks(a);export{Uo as C,ms as E,qo as a,Qo as b,No as c,Ko as i,Qe as o,se as p,Zo as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r}from"./jsx-runtime-DPjLkJKQ.js";import"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{ao as i}from"./index-GIL7oGEO.js";const m="Preparing the viewport…",n="Preparing 3D component previews…";function c(e){return!Number.isFinite(e)||e<1?n:e===1?"Preparing 1 component preview…":`Preparing ${e} component previews…`}function u({testId:e,children:t}){return r.jsx("div",{"data-testid":e,style:{position:"absolute",inset:0,padding:16,fontSize:12,color:i.content.muted,pointerEvents:"none"},children:t})}export{m as O,u as V,c as t};
|